本文整理汇总了PHP中make_http函数的典型用法代码示例。如果您正苦于以下问题:PHP make_http函数的具体用法?PHP make_http怎么用?PHP make_http使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了make_http函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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="' . $link . '?url="+location.href+"&tags="+prompt("enter tags")">' . $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
示例16: display_page
public function display_page(Page $page)
{
global $config;
$tl_enabled = $config->get_string("transload_engine", "none") != "none";
// Uploader 2.0!
$upload_list = "";
for ($i = 0; $i < $config->get_int('upload_count'); $i++) {
$a = $i + 1;
$s = $i - 1;
if (!$i == 0) {
$upload_list .= "<tr id='row{$i}' style='display:none'>";
} else {
$upload_list .= "<tr id='row{$i}'>";
}
$upload_list .= "<td width='15'>";
if ($i == 0) {
$upload_list .= "<div id='hide{$i}'><img id='wrapper' src='ext/upload/minus.png' />" . "<a href='#' onclick='javascript:document.getElementById("row{$a}").style.display = "";document.getElementById("hide{$i}").style.display = "none";document.getElementById("hide{$a}").style.display = "";'>" . "<img src='ext/upload/plus.png'></a></div></td>";
} else {
$upload_list .= "<div id='hide{$i}'>\n\t\t\t\t\t\t<a href='#' onclick='javascript:document.getElementById("row{$i}").style.display = "none";" . "document.getElementById("hide{$i}").style.display = "none";" . "document.getElementById("hide{$s}").style.display = "";" . "document.getElementById("data{$i}").value = "";" . "document.getElementById("url{$i}").value = "";'>" . "<img src='ext/upload/minus.png' /></a>";
if ($a == $config->get_int('upload_count')) {
$upload_list .= "<img id='wrapper' src='ext/upload/plus.png' />";
} else {
$upload_list .= "<a href='#' onclick='javascript:document.getElementById("row{$a}").style.display = "";" . "document.getElementById("hide{$i}").style.display = "none";" . "document.getElementById("hide{$a}").style.display = "";'>" . "<img src='ext/upload/plus.png' /></a>";
}
$upload_list .= "</div></td>";
}
$upload_list .= "<td width='60'><form><input id='radio_buttona' type='radio' name='method' value='file' checked='checked' onclick='javascript:document.getElementById("url{$i}").style.display = "none";document.getElementById("url{$i}").value = "";document.getElementById("data{$i}").style.display = ""' /> File<br>";
if ($tl_enabled) {
$upload_list .= "<input id='radio_buttonb' type='radio' name='method' value='url' onclick='javascript:document.getElementById("data{$i}").style.display = "none";document.getElementById("data{$i}").value = "";document.getElementById("url{$i}").style.display = ""' /> URL</ br></td></form>\n\t\t\t\t\t\n\t\t\t\t\t<td><input id='data{$i}' name='data{$i}' class='wid' type='file'><input id='url{$i}' name='url{$i}' class='wid' type='text' style='display:none'></td>\n\t\t\t\t\t";
} else {
$upload_list .= "</form></td>\n\t\t\t\t\t<td width='250'><input id='data{$i}' name='data{$i}' class='wid' type='file'></td>\n\t\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 type='text/javascript'>\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" . make_form(make_link("upload"), "POST", $multipart = True) . "\n\t\t\t\t<table id='large_upload_form' class='vert'>\n\t\t\t\t\t{$upload_list}\n\t\t\t\t\t<tr><td></td><td>Tags<td colspan='3'><input id='tag_box' name='tags' type='text'></td></tr>\n\t\t\t\t\t<tr><td></td><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"));
if ($config->get_bool('nice_urls')) {
$delimiter = '?';
} else {
$delimiter = '&';
}
$title = "Upload to " . $config->get_string('title');
$html .= '<p><a href="javascript:location.href="' . $link . $delimiter . 'url="+location.href+"&tags="+prompt("enter tags")">' . $title . '</a> (Drag & drop onto your bookmarks toolbar, then click when looking at an image)';
/* Danbooru > Shimmie Bookmarklet.
This "should" work on any site running danbooru, unless for some odd reason they switched around the id's or aren't using post/list.
Most likely this will stop working when Danbooru updates to v2, all depends if they switch the ids or not >_>.
Clicking the link on a danbooru image page should give you something along the lines of:
'http://www.website.com/shimmie/upload?url="http://sonohara.donmai.us/data/crazylongurl.jpg&tags="too many tags"&rating="s"&source="http://danbooru.donmai.us/post/show/012345/"'
TODO: Possibly make the entire/most of the script into a .js file, and just make the bookmarklet load it on click (Something like that?)
*/
$title = "Danbooru to " . $config->get_string('title');
$html .= '<p><a href="javascript:' . 'var ste="' . $link . $delimiter . 'url=";var tag=document.getElementById("post_tags").value;var rtg=document.documentElement.innerHTML.match("<li>Rating: (.*)<\\/li>");var srx="http://" + document.location.hostname+document.location.href.match("\\/post\\/show\\/.*\\/");' . 'if (confirm("OK = Use Current tags.\\nCancel = Use new tags.")==true){' . 'if(tag.search(/\\bflash\\b/)==-1){' . 'location.href=ste+document.getElementById("highres").href+"&tags="+tag+"&rating="+rtg[1]+"&source="+srx;}' . 'else{' . 'location.href=ste+document.getElementsByName("movie")[0].value+"&tags="+tag+"&rating="+rtg[1]+"&source="+srx;}' . '}else{' . 'var p=prompt("Enter Tags","");' . 'if(tag.search(/\\bflash\\b/)==-1){' . 'location.href=ste+document.getElementById("highres").href+"&tags="+p+"&rating="+rtg[1]+"&source="+srx;}' . 'else{' . 'location.href=ste+document.getElementsByName("movie")[0].value+"&tags="+p+"&rating="+rtg[1]+"&source="+srx;}' . '}">' . $title . '</a> (As above, Click on a Danbooru-run image page. (This also grabs the tags/rating/source!))';
}
$page->set_title("Upload");
$page->set_heading("Upload");
$page->add_block(new NavBlock());
$page->add_block(new Block("Upload", $html, "main", 20));
}
开发者ID:nsuan,项目名称:shimmie2,代码行数:61,代码来源:theme.php
示例17: h_bookmarklets
/**
* @return string
*/
protected function h_bookmarklets()
{
global $config;
$link = make_http(make_link("upload"));
$main_page = make_http(make_link());
$title = $config->get_string('title');
$max_size = $config->get_int('upload_size');
$max_kb = to_shorthand_int($max_size);
$delimiter = $config->get_bool('nice_urls') ? '?' : '&';
$html = '';
$js = 'javascript:(
function() {
if(typeof window=="undefined" || !window.location || window.location.href=="about:blank") {
window.location = "' . $main_page . '";
}
else if(typeof document=="undefined" || !document.body) {
window.location = "' . $main_page . '?url="+encodeURIComponent(window.location.href);
}
else if(window.location.href.match("\\/\\/' . $_SERVER["HTTP_HOST"] . '.*")) {
alert("You are already at ' . $title . '!");
}
else {
var tags = prompt("Please enter tags", "tagme");
if(tags != "" && tags != null) {
var link = "' . $link . $delimiter . 'url="+location.href+"&tags="+tags;
var w = window.open(link, "_blank");
}
}
}
)();';
$html .= '<a href=\'' . $js . '\'>Upload to ' . $title . '</a>';
$html .= ' (Drag & drop onto your bookmarks toolbar, then click when looking at an image)';
// Bookmarklet checks if shimmie supports ext. If not, won't upload to site/shows alert saying not supported.
$supported_ext = "jpg jpeg gif png";
if (class_exists("FlashFileHandler")) {
$supported_ext .= " swf";
}
if (class_exists("ICOFileHandler")) {
$supported_ext .= " ico ani cur";
}
if (class_exists("MP3FileHandler")) {
$supported_ext .= " mp3";
}
if (class_exists("SVGFileHandler")) {
$supported_ext .= " svg";
}
if (class_exists("VideoFileHandler")) {
$supported_ext .= " flv mp4 ogv webm m4v";
}
$title = "Booru to " . $config->get_string('title');
// CA=0: Ask to use current or new tags | CA=1: Always use current tags | CA=2: Always use new tags
$html .= '<p><a href="javascript:
var ste="' . $link . $delimiter . 'url=";
var supext="' . $supported_ext . '";
var maxsize="' . $max_kb . '";
var CA=0;
void(document.body.appendChild(document.createElement("script")).src="' . make_http(get_base_href()) . "/ext/upload/bookmarklet.js" . '")
">' . $title . '</a> (Click when looking at an image page. Works on sites running Shimmie / Danbooru / Gelbooru. (This also grabs the tags / rating / source!))';
return $html;
}
开发者ID:shish,项目名称:shimmie2,代码行数:63,代码来源:theme.php
示例18: onCommentPosting
public function onCommentPosting($event)
{
global $user;
$this->msg(make_http(make_link("post/view/" . $event->image_id)) . " - " . $user->name . ": " . str_replace("\n", " ", $event->comment));
}
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:5,代码来源:main.php
示例19: add_sitemap_queue
/**
* Adds an array of urls to the sitemap with the given information.
*
* @param array $urls
* @param string $changefreq
* @param string $priority
* @param string $date
*/
private function add_sitemap_queue($urls, $changefreq = "monthly", $priority = "0.5", $date = "2013-02-01")
{
foreach ($urls as $url) {
$link = make_http(make_link("{$url}"));
$this->sitemap_queue .= "\n <url>\n <loc>{$link}</loc>\n <lastmod>{$date}</lastmod>\n <changefreq>{$changefreq}</changefreq>\n <priority>{$priority}</priority>\n </url>";
}
}
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:15,代码来源:main.php
-
(1)var修饰符添加var是地址传递,会修改原有的变量vars:string;beginS:='Hello';C
阅读:578|2022-07-18
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1213|2022-08-30
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1119|2022-08-17
-
This affects all versions of package node-import. The params argument of module
阅读:566|2022-07-29
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:930|2022-11-06
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1329|2022-08-18
-
rainy1998/latex
阅读:891|2022-08-13
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:478|2022-08-16
-
When sending malicous data to kernel by ioctl cmd FBIOPUT_VSCREENINFO,kernel wil
阅读:592|2022-07-29
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:631|2022-11-06
|
请发表评论