direct transload in 2.1

git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@687 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-01-03 00:25:31 +00:00
parent 918a85e721
commit 96fb17b5f1
2 changed files with 24 additions and 0 deletions

View File

@ -40,6 +40,21 @@ class Upload extends Extension {
$this->theme->display_error($event->page, "Upload Denied", "Anonymous posting is disabled");
}
}
else if(!empty($_GET['url'])) {
global $user;
if($this->can_upload($user)) {
$url = $_GET['url'];
$tags = array('tagme');
if(!empty($_GET['tags']) && $_GET['tags'] != "null") {
$tags = tag_explode($_GET['tags']);
}
$ok = $this->try_transload($url, $tags, $url);
$this->theme->display_upload_status($event->page, $ok);
}
else {
$this->theme->display_error($event->page, "Upload Denied", "Anonymous posting is disabled");
}
}
else {
$this->theme->display_page($event->page);
}

View File

@ -42,6 +42,15 @@ class UploadTheme extends Themelet {
<div id='upload_completions' style='clear: both;'><small>(Max file size is $max_kb)</small></div>
";
if($tl_enabled) {
global $config;
$link = 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());