git-svn-id: file:///home/shish/svn/shimmie2/trunk@92 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
ffbb867b58
commit
fc4e906aba
3 changed files with 60 additions and 46 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
/*
|
||||||
|
* This file may not be distributed without its readme.txt
|
||||||
|
**/
|
||||||
|
|
||||||
/* * * Link to Image * * */
|
/* * * Link to Image * * */
|
||||||
#link_to_image {
|
#link_to_image {
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
* This file may not be distributed without its readme.txt
|
||||||
|
**/
|
||||||
class LinkImage extends Extension {
|
class LinkImage extends Extension {
|
||||||
//event handler
|
//event handler
|
||||||
public function receive_event($event) {
|
public function receive_event($event) {
|
||||||
|
@ -6,7 +9,7 @@ class LinkImage extends Extension {
|
||||||
global $page;
|
global $page;
|
||||||
global $config;
|
global $config;
|
||||||
$data_href = $config->get_string("data_href");
|
$data_href = $config->get_string("data_href");
|
||||||
$page->add_header("<link rel='stylesheet' href='$data_href/ext/link_image/style.css' type='text/css'>",0);
|
$page->add_header("<link rel='stylesheet' href='$data_href/ext/link_image/_style.css' type='text/css'>",0);
|
||||||
$page->add_main_block(new Block("Link to Image", $this->get_html($event->image)));
|
$page->add_main_block(new Block("Link to Image", $this->get_html($event->image)));
|
||||||
}
|
}
|
||||||
if(is_a($event, 'SetupBuildingEvent')) {
|
if(is_a($event, 'SetupBuildingEvent')) {
|
||||||
|
|
|
@ -4,63 +4,70 @@ Author: Erik Youngren <artanis.00@gmail.com>
|
||||||
|
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
|
|
||||||
=Use=
|
Submit a Bug Report or Suggestion for Link to Image:
|
||||||
|
* http://trac.shishnet.org/shimmie2/newticket?owner=artanis.00@gmail.com&component=third%20party%20extensions&keywords=link_to_image
|
||||||
|
|
||||||
|
= Use =
|
||||||
There is one option in Board Config: Text Link Format.
|
There is one option in Board Config: Text Link Format.
|
||||||
It takes the following arguments as well as plain text.
|
It takes the following arguments as well as plain text.
|
||||||
===arg=== ===replacement===
|
|| arguments || replacement ||
|
||||||
$id The image ID
|
|| $id || The image ID. ||
|
||||||
$hash The MD5 hash of the image
|
|| $hash || The MD5 hash of the image. ||
|
||||||
$tags The image's tag list.
|
|| $tags || The image's tag list. ||
|
||||||
$base The base HREF as set in Config
|
|| $base || The base HREF as set in Config. ||
|
||||||
$ext The image's extension.
|
|| $ext || The image's extension. ||
|
||||||
$size The image's display size.
|
|| $size || The image's display size. ||
|
||||||
$filesize The image's size in KB.
|
|| $filesize || The image's size in KB. ||
|
||||||
$filename The image's original filename.
|
|| $filename || The image's original filename. ||
|
||||||
$title The site title as set in Config.
|
|| $title || The site title as set in Config. ||
|
||||||
Link to Image will default this option to '$title - $id ($ext $size $filesize)'.
|
Link to Image will default this option to '$title - $id ($ext $size $filesize)'.
|
||||||
To reset to the default, simply clear the current setting. Link to Image will then fill in the default value after the save.
|
To reset to the default, simply clear the current setting. Link to Image will then fill in the default value after the save.
|
||||||
|
|
||||||
To leave the setting blank for any reason, leave a space (' ') in it.
|
To leave the setting blank for any reason, leave a space (' ') in it.
|
||||||
|
|
||||||
=Install=
|
= Install =
|
||||||
# Copy the folder 'contrib/link_image' to 'ext'.
|
1. Copy the folder 'contrib/link_image' to 'ext'.
|
||||||
# In the Config panel, make sure Base URL is set (you may as well set Data URL while you're there, if you haven't already.)
|
2. In the Config panel, make sure Base URL is set (you may as well set Data URL while you're there, if you haven't already.)
|
||||||
# Make sure Image Link, Thumb Link, and Short Link all contain the full path ("http://" and onward,) either by using $base or plain text. Link to Image will not be able to retrieve the correct paths without these variables.
|
3. Make sure Image Link, Thumb Link, and Short Link all contain the full path ("http://" and onward,) either by using $base or plain text. Link to Image will not be able to retrieve the correct paths without these variables.
|
||||||
# If you use .htaccess to make Nice URLs[http://trac.shishnet.org/shimmie2/wiki/NiceURLs], make sure that a it allows access to the /ext/ folder, or else Link to Image will not be able to access ext/link_image/style.css. You can find the needed line here[http://trac.shishnet.org/shimmie2/wiki/NiceURLs].
|
4. If you use .htaccess to make NiceURLs, make sure that a it allows access to the /ext/ folder, or else Link to Image will not be able to access ext/link_image/style.css.
|
||||||
|
* http://trac.shishnet.org/shimmie2/wiki/NiceURLs - Nice URLs
|
||||||
|
|
||||||
=Change Log=
|
= Change Log =
|
||||||
|
|
||||||
==v 0.1.3==
|
== Version 0.1.3b - 20070509 ==
|
||||||
* Created Readme.txt
|
* Renamed style.css to _style.css to avoid the auto loader.
|
||||||
* Merged 0.1.2 into 0.1.2b
|
|
||||||
* Removed uneeded documentation from main.php
|
|
||||||
* Rewrote the css to be unique. Previously used css I was wrote for elsewhere. Styled to reduce space consumption.
|
|
||||||
* Added code to insert the css import.
|
|
||||||
** Updated Nice URLs[http://trac.shishnet.org/shimmie2/wiki/NiceURLs] to allow access to the /ext/ folder. (Why is my stylesheet returning html instead of css?)
|
|
||||||
* First SVN update.
|
|
||||||
|
|
||||||
==Version 0.1.2b==
|
== Version 0.1.3 - 20070508 ==
|
||||||
|
* Created Readme.txt
|
||||||
|
* Merged 0.1.2 into 0.1.2b
|
||||||
|
* Removed uneeded documentation from main.php
|
||||||
|
* Rewrote the css to be unique. Previously used css I was wrote for elsewhere. Styled to reduce space consumption.
|
||||||
|
* Added code to insert the css import.
|
||||||
|
* Updated Nice URLs to allow access to the /ext/ folder. (Why is my stylesheet returning html instead of css?)
|
||||||
|
* First SVN update.
|
||||||
|
|
||||||
|
== Version 0.1.2b - 20070507 ==
|
||||||
(fairly simultaneous with 0.1.2)
|
(fairly simultaneous with 0.1.2)
|
||||||
* shish:
|
* shish:
|
||||||
** Updated to new extension format
|
* Updated to new extension format
|
||||||
*** Created folder link_image in trunk/contrib
|
* Created folder link_image in trunk/contrib
|
||||||
*** Renamed link_image.ext.php to main.php and moved to /link_image/
|
* Renamed link_image.ext.php to main.php and moved to /link_image/
|
||||||
*** Created style.css { /* 404'd :|*/ }
|
* Created style.css { /* 404'd :|*/ }
|
||||||
** Documentation (different from mine.)
|
* Documentation (different from mine.)
|
||||||
** Changed add_text_option() and added add_label() in SetupBuildingEvent because I was using an edited version of the function that shish didn't know about. It was a wonder that didn't throw massive errors.
|
* Changed add_text_option() and added add_label() in SetupBuildingEvent because I was using an edited version of the function that shish didn't know about. It was a wonder that didn't throw massive errors.
|
||||||
** Published on SVN.
|
* Published on SVN.
|
||||||
|
|
||||||
==Version 0.1.2==
|
== Version 0.1.2 - 20070506 ==
|
||||||
* Textboxes now select-all when they gain focus.
|
* Textboxes now select-all when they gain focus.
|
||||||
* Commenting and documentation.
|
* Commenting and documentation.
|
||||||
|
|
||||||
==Version 0.1.1==
|
== Version 0.1.1 - 20070506 ==
|
||||||
* Fixed HTML thumbnail link code. (image tag was being html_escaped twice, resulting in "$gt;" and "<" from the first escape becoming "&gt;" and "&lt;") It turns out that html_escape was completely unnecessary, all I had to do was replace the single-quotes around the attributes with escaped double-quotes ('\"'.)
|
* Fixed HTML thumbnail link code. (image tag was being html_escaped twice, resulting in "$gt;" and "<" from the first escape becoming "&gt;" and "&lt;") It turns out that html_escape was completely unnecessary, all I had to do was replace the single-quotes around the attributes with escaped double-quotes ('\"'.)
|
||||||
|
|
||||||
==Version 0.1.0==
|
== Version 0.1.0 - 20070506 ==
|
||||||
* Release.
|
* Release.
|
||||||
|
|
||||||
=Links=
|
= Links =
|
||||||
* http://trac.shishnet.org/shimmie2/wiki/Contrib/Extensions/LinkToImage - Home
|
* http://trac.shishnet.org/shimmie2/wiki/Contrib/Extensions/LinkToImage - Home
|
||||||
* http://forum.shishnet.org/viewtopic.php?p=153 - Discussion
|
* http://forum.shishnet.org/viewtopic.php?p=153 - Discussion
|
||||||
* http://trac.shishnet.org/shimmie2/browser/trunk/contrib/link_image - Shimmie2 Trac SVN
|
* http://trac.shishnet.org/shimmie2/browser/trunk/contrib/link_image - Shimmie2 Trac SVN
|
||||||
|
|
Reference in a new issue