backport
git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.2@915 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
9044abdfc2
commit
4b666a8f1a
@ -14,10 +14,7 @@ class FlashFileHandler extends Extension {
|
|||||||
if(is_a($event, 'DataUploadEvent') && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
if(is_a($event, 'DataUploadEvent') && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
||||||
$hash = $event->hash;
|
$hash = $event->hash;
|
||||||
$ha = substr($hash, 0, 2);
|
$ha = substr($hash, 0, 2);
|
||||||
if(!copy($event->tmpname, "images/$ha/$hash")) {
|
if(!move_upload_to_archive($event)) return;
|
||||||
$event->veto("Flash Handler failed to move file from uploads to archive");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
||||||
$image = $this->create_image_from_data("images/$ha/$hash", $event->metadata);
|
$image = $this->create_image_from_data("images/$ha/$hash", $event->metadata);
|
||||||
if(is_null($image)) {
|
if(is_null($image)) {
|
||||||
|
24
contrib/piclens/main.php
Normal file
24
contrib/piclens/main.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Name: PicLens Button
|
||||||
|
* Author: Shish <webmaster@shishnet.org>
|
||||||
|
* License: GPLv2
|
||||||
|
* Description: Adds a link to piclensify the gallery
|
||||||
|
*/
|
||||||
|
class PicLens extends Extension {
|
||||||
|
public function receive_event($event) {
|
||||||
|
if(is_a($event, 'PageRequestEvent')) {
|
||||||
|
$event->page->add_header("<script type=\"text/javascript\" src=\"http://lite.piclens.com/current/piclens.js\"></script>");
|
||||||
|
}
|
||||||
|
if(is_a($event, 'PostListBuildingEvent')) {
|
||||||
|
$foo='
|
||||||
|
<a href="javascript:PicLensLite.start();">Start Slideshow
|
||||||
|
<img src="http://lite.piclens.com/images/PicLensButton.png"
|
||||||
|
alt="PicLens" width="16" height="12" border="0"
|
||||||
|
align="absmiddle"></a>';
|
||||||
|
$event->page->add_block(new Block("PicLens", $foo, "left", 20));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_event_listener(new PicLens());
|
||||||
|
?>
|
@ -50,6 +50,8 @@ class RSS_Images extends Extension {
|
|||||||
$link = make_link("post/view/{$image->id}");
|
$link = make_link("post/view/{$image->id}");
|
||||||
$tags = $image->get_tag_list();
|
$tags = $image->get_tag_list();
|
||||||
$owner = $image->get_owner();
|
$owner = $image->get_owner();
|
||||||
|
$thumb_url = $image->get_thumb_link();
|
||||||
|
$image_url = $image->get_image_link();
|
||||||
$posted = strftime("%a, %d %b %Y %T %Z", $image->posted_timestamp);
|
$posted = strftime("%a, %d %b %Y %T %Z", $image->posted_timestamp);
|
||||||
$content = html_escape(
|
$content = html_escape(
|
||||||
"<p>" . Themelet::build_thumb_html($image) . "</p>" .
|
"<p>" . Themelet::build_thumb_html($image) . "</p>" .
|
||||||
@ -63,6 +65,8 @@ class RSS_Images extends Extension {
|
|||||||
<guid isPermaLink=\"true\">$link</guid>
|
<guid isPermaLink=\"true\">$link</guid>
|
||||||
<pubDate>$posted</pubDate>
|
<pubDate>$posted</pubDate>
|
||||||
<description>$content</description>
|
<description>$content</description>
|
||||||
|
<media:thumbnail url=\"$thumb_url\"/>
|
||||||
|
<media:content url=\"$image_url\"/>
|
||||||
</item>
|
</item>
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
@ -71,7 +75,7 @@ class RSS_Images extends Extension {
|
|||||||
$base_href = $config->get_string('base_href');
|
$base_href = $config->get_string('base_href');
|
||||||
$version = VERSION;
|
$version = VERSION;
|
||||||
$xml = "<"."?xml version=\"1.0\" encoding=\"utf-8\" ?".">
|
$xml = "<"."?xml version=\"1.0\" encoding=\"utf-8\" ?".">
|
||||||
<rss version=\"2.0\">
|
<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss\">
|
||||||
<channel>
|
<channel>
|
||||||
<title>$title</title>
|
<title>$title</title>
|
||||||
<description>The latest uploads to the image board</description>
|
<description>The latest uploads to the image board</description>
|
||||||
|
@ -255,7 +255,7 @@ function get_base_href() {
|
|||||||
function move_upload_to_archive($event) {
|
function move_upload_to_archive($event) {
|
||||||
$hash = $event->hash;
|
$hash = $event->hash;
|
||||||
$ha = substr($hash, 0, 2);
|
$ha = substr($hash, 0, 2);
|
||||||
if(!copy($event->tmpname, "images/$ha/$hash")) {
|
if(!@copy($event->tmpname, "images/$ha/$hash")) {
|
||||||
$event->veto("Failed to copy file from uploads ({$event->tmpname}) to archive (images/$ha/$hash)");
|
$event->veto("Failed to copy file from uploads ({$event->tmpname}) to archive (images/$ha/$hash)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,7 @@ class PixelFileHandler extends Extension {
|
|||||||
if(is_a($event, 'DataUploadEvent') && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
if(is_a($event, 'DataUploadEvent') && $this->supported_ext($event->type) && $this->check_contents($event->tmpname)) {
|
||||||
$hash = $event->hash;
|
$hash = $event->hash;
|
||||||
$ha = substr($hash, 0, 2);
|
$ha = substr($hash, 0, 2);
|
||||||
if(!copy($event->tmpname, "images/$ha/$hash")) {
|
if(!move_upload_to_archive($event)) return;
|
||||||
$event->veto("Pixel Handler failed to copy file from uploads ({$event->tmpname}) to archive (images/$ha/$hash)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
|
||||||
$image = $this->create_image_from_data("images/$ha/$hash", $event->metadata);
|
$image = $this->create_image_from_data("images/$ha/$hash", $event->metadata);
|
||||||
if(is_null($image)) {
|
if(is_null($image)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user