当前位置: 首页>>代码示例>>PHP>>正文


PHP make_http函数代码示例

本文整理汇总了PHP中make_http函数的典型用法代码示例。如果您正苦于以下问题:PHP make_http函数的具体用法?PHP make_http怎么用?PHP make_http使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了make_http函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_page

 public function display_page(Page $page)
 {
     global $config;
     $tl_enabled = $config->get_string("transload_engine", "none") != "none";
     $upload_list = "";
     for ($i = 0; $i < $config->get_int('upload_count'); $i++) {
         $n = $i + 1;
         $width = $tl_enabled ? "35%" : "80%";
         $upload_list .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td width='50'>File {$n}</td>\n\t\t\t\t\t<td width='250'><input accept='image/jpeg,image/png,image/gif' id='data{$i}' name='data{$i}' type='file'></td>\n\t\t\t";
         if ($tl_enabled) {
             $upload_list .= "\n\t\t\t\t\t<td width='50'>URL {$n}</td>\n\t\t\t\t\t<td width='250'><input id='url{$i}' name='url{$i}' type='text'></td>\n\t\t\t\t";
         }
         $upload_list .= "\n\t\t\t\t</tr>\n\t\t\t";
     }
     $max_size = $config->get_int('upload_size');
     $max_kb = to_shorthand_int($max_size);
     $html = "\n\t\t\t<script>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$('#tag_box').DefaultValue('tagme');\n\t\t\t\t\$('#tag_box').autocomplete('" . make_link("api/internal/tag_list/complete") . "', {\n\t\t\t\t\twidth: 320,\n\t\t\t\t\tmax: 15,\n\t\t\t\t\thighlight: false,\n\t\t\t\t\tmultiple: true,\n\t\t\t\t\tmultipleSeparator: ' ',\n\t\t\t\t\tscroll: true,\n\t\t\t\t\tscrollHeight: 300,\n\t\t\t\t\tselectFirst: false\n\t\t\t\t});\n\t\t\t});\n\t\t\t</script>\n\t\t\t<form enctype='multipart/form-data' action='" . make_link("upload") . "' method='POST'>\n\t\t\t\t<table id='large_upload_form'>\n\t\t\t\t\t{$upload_list}\n\t\t\t\t\t<tr><td>Tags</td><td colspan='3'><input id='tag_box' name='tags' type='text'></td></tr>\n\t\t\t\t\t<tr><td>Source</td><td colspan='3'><input name='source' type='text'></td></tr>\n\t\t\t\t\t<tr><td colspan='4'><input id='uploadbutton' type='submit' value='Post'></td></tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\t<small>(Max file size is {$max_kb})</small>\n\t\t";
     if ($tl_enabled) {
         $link = make_http(make_link("upload"));
         $title = "Upload to " . $config->get_string('title');
         $html .= '<p><a href="javascript:location.href=&quot;' . $link . '?url=&quot;+location.href+&quot;&amp;tags=&quot;+prompt(&quot;enter tags&quot;)">' . $title . '</a> (Drag & drop onto your bookmarks toolbar, then click when looking at an image)';
     }
     $page->set_title("Upload");
     $page->set_heading("Upload");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Upload", $html, "main", 20));
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:27,代码来源:theme.php

示例2: onInitExt

 public function onInitExt(InitExtEvent $event)
 {
     global $config;
     $config->set_default_string("mail_sub", $config->get_string("site_title") . " - ");
     $config->set_default_string("mail_img", make_http("ext/mail/banner.png"));
     $config->set_default_string("mail_style", make_http("ext/mail/mail.css"));
     $config->set_default_string("mail_fot", "<a href='" . make_http(make_link()) . "'>" . $config->get_string("site_title") . "</a>");
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:8,代码来源:main.php

示例3: data

 private function data(Image $image)
 {
     global $config;
     $text_link = $image->parse_link_template($config->get_string("ext_link-img_text-link_format"));
     $text_link = trim($text_link) == "" ? null : $text_link;
     // null blank setting so the url gets filled in on the text links.
     return array('thumb_src' => make_http($image->get_thumb_link()), 'image_src' => make_http($image->get_image_link()), 'post_link' => make_http($_SERVER["REQUEST_URI"]), 'text_link' => $text_link);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:8,代码来源:main.php

示例4: __construct

 function __construct($main)
 {
     $matches = array();
     $lines = file($main);
     $number_of_lines = count($lines);
     preg_match("#ext/(.*)/main.php#", $main, $matches);
     $this->ext_name = $matches[1];
     $this->name = $this->ext_name;
     $this->enabled = $this->is_enabled($this->ext_name);
     for ($i = 0; $i < $number_of_lines; $i++) {
         $line = $lines[$i];
         if (preg_match("/Name: (.*)/", $line, $matches)) {
             $this->name = $matches[1];
         }
         if (preg_match("/Visibility: (.*)/", $line, $matches)) {
             $this->visibility = $matches[1];
         }
         if (preg_match("/Link: (.*)/", $line, $matches)) {
             $this->link = $matches[1];
             if ($this->link[0] == "/") {
                 $this->link = make_link(substr($this->link, 1));
             }
         }
         if (preg_match("/Version: (.*)/", $line, $matches)) {
             $this->version = $matches[1];
         }
         if (preg_match("/Author: (.*) [<\\(](.*@.*)[>\\)]/", $line, $matches)) {
             $this->author = $matches[1];
             $this->email = $matches[2];
         } else {
             if (preg_match("/Author: (.*)/", $line, $matches)) {
                 $this->author = $matches[1];
             }
         }
         if (preg_match("/(.*)Description: ?(.*)/", $line, $matches)) {
             $this->description = $matches[2];
             $start = $matches[1] . " ";
             $start_len = strlen($start);
             while (substr($lines[$i + 1], 0, $start_len) == $start) {
                 $this->description .= " " . substr($lines[$i + 1], $start_len);
                 $i++;
             }
         }
         if (preg_match("/(.*)Documentation: ?(.*)/", $line, $matches)) {
             $this->documentation = $matches[2];
             $start = $matches[1] . " ";
             $start_len = strlen($start);
             while (substr($lines[$i + 1], 0, $start_len) == $start) {
                 $this->documentation .= " " . substr($lines[$i + 1], $start_len);
                 $i++;
             }
             $this->documentation = str_replace('$site', make_http(get_base_href()), $this->documentation);
         }
         if (preg_match("/\\*\\//", $line, $matches)) {
             break;
         }
     }
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:58,代码来源:main.php

示例5: onPageRequest

 /**
  * Adds functionality for post/list.
  *
  * @param PageRequestEvent $event
  */
 public function onPageRequest(PageRequestEvent $event)
 {
     if ($event->page_matches("post/list")) {
         $pageinfo = $this->get_list_pageinfo($event);
         $prev_url = make_http(make_link("post/list/" . $pageinfo["prev"]));
         $next_url = make_http(make_link("post/list/" . $pageinfo["next"]));
         $this->add_arrowkeys_code($prev_url, $next_url);
     }
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:14,代码来源:main.php

示例6: curl_purge

 private function curl_purge($path)
 {
     $url = make_http(make_link($path));
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PURGE");
     $result = curl_exec($ch);
     $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     curl_close($ch);
     return $result;
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:11,代码来源:main.php

示例7: display_page

 public function display_page(Image $image, $editor_parts)
 {
     global $page;
     $h_metatags = str_replace(" ", ", ", html_escape($image->get_tag_list()));
     $page->set_title("Image {$image->id}: " . html_escape($image->get_tag_list()));
     $page->add_html_header("<meta name=\"keywords\" content=\"{$h_metatags}\">");
     $page->add_html_header("<meta property=\"og:title\" content=\"{$h_metatags}\">");
     $page->add_html_header("<meta property=\"og:type\" content=\"article\">");
     $page->add_html_header("<meta property=\"og:image\" content=\"" . make_http($image->get_thumb_link()) . "\">");
     $page->add_html_header("<meta property=\"og:url\" content=\"" . make_http(make_link("post/view/{$image->id}")) . "\">");
     $page->set_heading(html_escape($image->get_tag_list()));
     $page->add_block(new Block(null, $this->build_pin($image), "subtoolbar", 0));
     $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "left", 20));
 }
开发者ID:CrandellWS,项目名称:shimmie2,代码行数:14,代码来源:view.theme.php

示例8: do_xml

 private function do_xml($images)
 {
     global $page;
     $page->set_mode("data");
     $page->set_type("application/xml");
     $data = "";
     foreach ($images as $image) {
         $link = make_http(make_link("post/view/{$image->id}"));
         $posted = date("Y-m-d", $image->posted_timestamp);
         $data .= "\n\t\t\t<url>\n\t\t\t<loc>{$link}</loc>\n\t\t\t<lastmod>{$posted}</lastmod>\n\t\t\t<changefreq>monthly</changefreq>\n\t\t\t<priority>0.8</priority>\n\t\t\t</url>\n\t\t\t";
     }
     $base_href = make_http(make_link("post/list"));
     $xml = "<" . "?xml version=\"1.0\" encoding=\"utf-8\"?" . ">\n\t\t\t\t<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\t\t\t\t<url>\n\t\t\t\t<loc>{$base_href}</loc>\n\t\t\t\t<lastmod>2009-01-01</lastmod>\n\t\t\t\t<changefreq>monthly</changefreq>\n\t\t\t\t<priority>1</priority>\n\t\t\t\t</url>\n\t\t\t\t{$data}\n\t\t\t\t</urlset>\n\t\t\t\t";
     $page->set_data($xml);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:15,代码来源:main.php

示例9: curl_purge

 private function curl_purge($path)
 {
     // waiting for curl timeout adds ~5 minutes to unit tests
     if (defined("UNITTEST")) {
         return;
     }
     $url = make_http(make_link($path));
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PURGE");
     curl_setopt($ch, CURLOPT_TIMEOUT, 5);
     $result = curl_exec($ch);
     $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     curl_close($ch);
     //return $result;
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:16,代码来源:main.php

示例10: display_page

 public function display_page($image, $editor_parts)
 {
     global $page;
     $metatags = str_replace(" ", ", ", html_escape($image->get_tag_list()));
     $page->set_title("Image {$image->id}: " . html_escape($image->get_tag_list()));
     $page->set_heading(html_escape($image->get_tag_list()));
     $page->add_html_header("<meta name=\"keywords\" content=\"{$metatags}\">");
     $page->add_html_header("<meta property=\"og:title\" content=\"{$metatags}\">");
     $page->add_html_header("<meta property=\"og:type\" content=\"article\">");
     $page->add_html_header("<meta property=\"og:image\" content=\"" . make_http($image->get_thumb_link()) . "\">");
     $page->add_html_header("<meta property=\"og:url\" content=\"" . make_http(make_link("post/view/{$image->id}")) . "\">");
     $page->add_block(new Block("Navigation", $this->build_navigation($image), "left", 0));
     $page->add_block(new Block("Statistics", $this->build_stats($image), "left", 15));
     $page->add_block(new Block(null, $this->build_image_editor($image, $editor_parts), "main", 10));
     $page->add_block(new Block(null, $this->build_pin($image), "main", 11));
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:16,代码来源:view.theme.php

示例11: thumb

 /**
  * @param Image $image
  * @return string
  */
 private function thumb(Image $image)
 {
     global $database;
     $cached = $database->cache->get("rss-thumb:{$image->id}");
     if ($cached) {
         return $cached;
     }
     $link = make_http(make_link("post/view/{$image->id}"));
     $tags = html_escape($image->get_tag_list());
     $owner = $image->get_owner();
     $thumb_url = $image->get_thumb_link();
     $image_url = $image->get_image_link();
     $posted = date(DATE_RSS, $image->posted_timestamp);
     $content = html_escape("<p>" . $this->theme->build_thumb_html($image) . "</p>" . "<p>Uploaded by " . html_escape($owner->name) . "</p>");
     $data = "\n\t\t<item>\n\t\t\t<title>{$image->id} - {$tags}</title>\n\t\t\t<link>{$link}</link>\n\t\t\t<guid isPermaLink=\"true\">{$link}</guid>\n\t\t\t<pubDate>{$posted}</pubDate>\n\t\t\t<description>{$content}</description>\n\t\t\t<media:thumbnail url=\"{$thumb_url}\"/>\n\t\t\t<media:content url=\"{$image_url}\"/>\n\t\t</item>\n\t\t";
     $database->cache->set("rss-thumb:{$image->id}", $data, 3600);
     return $data;
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:22,代码来源:main.php

示例12: display_page

 public function display_page()
 {
     global $config, $page;
     $base_href = get_base_href();
     $oekW = $config->get_int("oekaki_width", 400);
     $oekH = $config->get_int("oekaki_height", 400);
     if (isset($_POST['oekW']) && isset($_POST['oekH'])) {
         $oekW = int_escape($_POST['oekW']);
         $oekH = int_escape($_POST['oekH']);
     }
     $html = "\n    <applet archive='{$base_href}/ext/oekaki/chibipaint.jar' code='chibipaint.ChibiPaint.class' width='800' height='600'>\n      <param name='canvasWidth' value='" . $oekW . "' />\n      <param name='canvasHeight' value='" . $oekH . "' />\n      <param name='postUrl' value='" . make_http(make_link("oekaki/upload")) . "' />\n      <param name='exitUrl' value='" . make_http(make_link("oekaki/claim")) . "' />\n      <param name='exitUrlTarget' value='_self' />\n      JAVA NOT INSTALLED :(<!-- alternative content for users who don't have Java installed -->\n    </applet>\n\t\t";
     #      <param name='loadImage' value='http://yourserver/oekaki/pictures/168.png' />
     #      <param name='loadChibiFile' value='http://yourserver/oekaki/pictures/168.chi' />
     // FIXME: prevent oekaki block from collapsing on click in cerctain themes. This causes canvas reset
     $page->set_title("Oekaki");
     $page->set_heading("Oekaki");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Oekaki", $html, "main", 20));
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:19,代码来源:theme.php

示例13: onPageRequest

    public function onPageRequest($event)
    {
        global $config, $database, $page;
        if ($event->page_matches("rss/comments")) {
            $page->set_mode("data");
            $page->set_type("application/rss+xml");
            $comments = $database->get_all("\n\t\t\t\t\tSELECT\n\t\t\t\t\tusers.id as user_id, users.name as user_name,\n\t\t\t\t\tcomments.comment as comment, comments.id as comment_id,\n\t\t\t\t\tcomments.image_id as image_id, comments.owner_ip as poster_ip,\n\t\t\t\t\tUNIX_TIMESTAMP(posted) AS posted_timestamp\n\t\t\t\t\tFROM comments\n\t\t\t\t\tLEFT JOIN users ON comments.owner_id=users.id\n\t\t\t\t\tORDER BY comments.id DESC\n\t\t\t\t\tLIMIT 10\n\t\t\t\t\t");
            $data = "";
            foreach ($comments as $comment) {
                $image_id = $comment['image_id'];
                $comment_id = $comment['comment_id'];
                $link = make_http(make_link("post/view/{$image_id}"));
                $owner = html_escape($comment['user_name']);
                $posted = date(DATE_RSS, $comment['posted_timestamp']);
                $comment = html_escape($comment['comment']);
                $content = html_escape("{$owner}: {$comment}");
                $data .= "\n\t\t\t\t\t<item>\n\t\t\t\t\t\t<title>{$owner} comments on {$image_id}</title>\n\t\t\t\t\t\t<link>{$link}</link>\n\t\t\t\t\t\t<guid isPermaLink=\"false\">{$comment_id}</guid>\n\t\t\t\t\t\t<pubDate>{$posted}</pubDate>\n\t\t\t\t\t\t<description>{$content}</description>\n\t\t\t\t\t</item>\n\t\t\t\t";
            }
            $title = $config->get_string('title');
            $base_href = make_http($config->get_string('base_href'));
            $version = $config->get_string('version');
            $xml = <<<EOD
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
\t<channel>
\t\t<title>{$title}</title>
\t\t<description>The latest comments on the image board</description>
\t\t<link>{$base_href}</link>
\t\t<generator>{$version}</generator>
\t\t<copyright>(c) 2007 Shish</copyright>
\t\t{$data}
\t</channel>
</rss>
EOD;
            $page->set_data($xml);
        }
    }
开发者ID:nsuan,项目名称:shimmie2,代码行数:37,代码来源:main.php

示例14: do_rss

 private function do_rss($images, $search_terms, $page_number)
 {
     global $page;
     global $config;
     $page->set_mode("data");
     $page->set_type("application/rss+xml");
     $data = "";
     foreach ($images as $image) {
         $link = make_http(make_link("post/view/{$image->id}"));
         $tags = $image->get_tag_list();
         $owner = $image->get_owner();
         $thumb_url = $image->get_thumb_link();
         $image_url = $image->get_image_link();
         $posted = date(DATE_RSS, $image->posted_timestamp);
         $content = html_escape("<p>" . Themelet::build_thumb_html($image) . "</p>" . "<p>Uploaded by " . $owner->name . "</p>");
         $data .= "\n\t\t<item>\n\t\t\t<title>{$image->id} - {$tags}</title>\n\t\t\t<link>{$link}</link>\n\t\t\t<guid isPermaLink=\"true\">{$link}</guid>\n\t\t\t<pubDate>{$posted}</pubDate>\n\t\t\t<description>{$content}</description>\n\t\t\t<media:thumbnail url=\"{$thumb_url}\"/>\n\t\t\t<media:content url=\"{$image_url}\"/>\n\t\t</item>\n\t\t\t";
     }
     $title = $config->get_string('title');
     $base_href = make_http($config->get_string('base_href'));
     $search = "";
     if (count($search_terms) > 0) {
         $search = html_escape(implode(" ", $search_terms)) . "/";
     }
     if ($page_number > 1) {
         $prev_url = make_link("rss/images/{$search}" . ($page_number - 1));
         $prev_link = "<atom:link rel=\"previous\" href=\"{$prev_url}\" />";
     } else {
         $prev_link = "";
     }
     $next_url = make_link("rss/images/{$search}" . ($page_number + 1));
     $next_link = "<atom:link rel=\"next\" href=\"{$next_url}\" />";
     // no end...
     $version = VERSION;
     $xml = "<" . "?xml version=\"1.0\" encoding=\"utf-8\" ?" . ">\n<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n    <channel>\n        <title>{$title}</title>\n        <description>The latest uploads to the image board</description>\n\t\t<link>{$base_href}</link>\n\t\t<generator>Shimmie-{$version}</generator>\n\t\t<copyright>(c) 2007 Shish</copyright>\n\t\t{$prev_link}\n\t\t{$next_link}\n\t\t{$data}\n\t</channel>\n</rss>";
     $page->set_data($xml);
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:36,代码来源:main.php

示例15: send

    public function send()
    {
        $headers = "From: " . $this->sitename . " <" . $this->siteemail . ">\r\n";
        $headers .= "Reply-To: " . $this->siteemail . "\r\n";
        $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
        $headers .= "errors-to: " . $this->siteemail . "\r\n";
        $headers .= "Date: " . date(DATE_RFC2822);
        $headers .= 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $message = '
		
<html>
<head>
	<link rel="stylesheet" href="' . $this->style . '" type="text/css">
</head>

<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" bgcolor="#EEEEEE" >  
<table width="100%" cellpadding="10" cellspacing="0" class="backgroundTable" bgcolor="#EEEEEE" > 
<tr> 
<td valign="top" align="center"> 
 
 
<table width="550" cellpadding="0" cellspacing="0"> 
 
<tr> 
<td style="background-color:#FFFFFF;border-top:0px solid #333333;border-bottom:10px solid #FFFFFF;"><center><a href="' . $this->sitedomain . '"><IMG SRC="' . $this->header_img . '"  alt="' . $this->sitename . '" name="Header" BORDER="0" align="center" title="' . $this->sitename . '"></a> 
</center></td> 
</tr> 

</table> 
 
<table width="550" cellpadding="20" cellspacing="0" bgcolor="#FFFFFF"> 
<tr> 
<td bgcolor="#FFFFFF" valign="top" style="font-size:12px;color:#000000;line-height:150%;font-family:trebuchet ms;"> 
 
<p> 
<span style="font-size:20px; font-weight:bold; color:#3399FF; font-family:arial; line-height:110%;">' . $this->header . '</span><br> 
<span style="font-size:11px;font-weight:normal;color:#666666;font-style:italic;font-family:arial;">' . $this->date . '</span><br> 
</p> 
<p>' . $this->body . '</p> 
<p>' . $this->footer . '</p> 
</td> 
</tr> 
 
<tr> 
<td style="background-color:#FFFFCC;border-top:10px solid #FFFFFF;" valign="top"> 
<span style="font-size:10px;color:#996600;line-height:100%;font-family:verdana;"> 
This email was sent to you since you are a member of <a href="' . $this->sitedomain . '">' . $this->sitename . '</a>. To change your email preferences, visit your <a href="' . make_http(make_link("preferences")) . '">Account preferences</a>.<br /> 
 
<br /> 
Contact us:<br /> 
<a href="' . $this->siteemail . '">' . $this->siteemail . '</a><br /><br />
Copyright (C) <a href="' . $this->sitedomain . '">' . $this->sitename . '</a><br />
</span></td> 
</tr> 
 
</table> 

</td> 
</tr> 
</table> 

</body> 
</html>
		';
        $sent = mail($this->to, $this->subject, $message, $headers);
        if ($sent) {
            log_info("mail", "Sent message '{$this->subject}' to '{$this->to}'");
        } else {
            log_info("mail", "Error sending message '{$this->subject}' to '{$this->to}'");
        }
        return $sent;
    }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:73,代码来源:email.class.php


注:本文中的make_http函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。