Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1253)
somone asked me to creat this mod so i did
wrap LINK TAGS around image so image could link to another site.
not many people know how to post images which are linkable, so this mod would be great
Wraps LINK TAGS around images.
A BBC button will be added after the image button to your post screen.
Clicking the button will place[url=http://][/url] in your post box.
Simply plug in the URL of the image between the [img]http://tags. and the url in the url tags
Use Like:
[url=http://url to site][img]url to image[/img][/url]
Changelog
1.0 - 7th june 2008
o Initial release
wayne83, looks like great mod.
I tried to install from my SMF version 2.0 RC1 forum's Admin > Main > Download Packages > Browse > BBC > clickable images bbcode.
But I get message "Although the package was downloaded to the server it appears to be empty . . .".
Can you fix or please?
Much appreciated . . .
work for me in my test site
Admin > Main > Download Packages > Browse > BBC > clickable images bbcode.
where you get that from
admin packages download packages install thats it
or install it manulay it one edit
$sourcedir/Subs-Editor.php
find
'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt['image']),
after add
'clickableImage' => array('code' => 'url/img', 'before' => '[url=][img]', 'after' => '[/img][/url]', 'description' => $txt['clickable image']),
How can i make this as javascript?
Like this:
// Java script to handle IMG input boxes ...
echo '<script language="JavaScript" type="text/javascript">
<!--
function imgINPT(){
var imgLINK = prompt("Vollen Bildlink eingeben:");
if (imgLINK == null ){ //cancel pressed . . .
}
else if (imgLINK == "" || imgLINK == " "){
alert("keinen Bildlink eingegeben!");
}
else
{ //ok pressed and there is something :)
var imgNAME = ("");
if (imgNAME == null ){ //cancel pressed . . .
}
else if (imgNAME == "" || imgNAME == " "){ //ok pressed but with notext so use URL only!
surroundText(\'[img]\'+imgLINK+\'\', \'[/img]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
}
else //ok pressed with text so use URL and Name!
surroundText(\'[img=\'+urlLINK+\']\'+imgNAME+\'\', \'[/img]\', document.', $context['post_form'], '.', $context['post_box_name'], ');
}
}
// -->
</script>';
Thanks for any help!
Thanks, works automatically for me now :D.
getting an error in the log..
8: Undefined index: clickable image
File: /****/Sources/Subs-Editor.php
Line: 1224
-line 1224--> 'clickableImage' => array('code' => 'url/img', 'before' => '(http://',%20'after'%20=>%20') (//http://)', 'description' => $txt['clickable image']),
i cant see any problem, some suggestions?
is this in your language folder
modifactions.englsih.php
$txt['clickable image'] = 'clickable image';
Any screen shots please...!
./Sources/Subs-Editor.php File not found
when parsing this mod for the new update 1.19 i don not have the Subs-Editor.php how can or where can i get this file
you are try to install the wrong one
this is the one
http://custom.simplemachines.org/mods/index.php?action=download;mod=1253;id=58036
dude how simple thank you spent 2 hours tryin to fig it out
np :D
Execute Modification .\Themes\default/Post.template.php Test failed
I have SMF 1.1.10
another mod has allready modified that code post up that file please
Excellent Chaos Dragon
I always have to check which order the tags should be in.
Another useful little improvement 8)
Just trying to install this under 2.0RC2 and when I search for :-
'img' => array('code' => 'img', 'before' => '(http://',%20'after'%20=>%20')', 'description' => $txt['image']),
in the Subs-Editor.php file, as it says in manually adding it, that text can not be found.
I imagine there might have been some changes to RC2 that weren't updated in the manual install stuff.
edit: I did download the one for 2.0 too :)
Hasn't been updated for RC2 yet will hopefully have it by the end of the week
Has it been updated for 2.0 RC2 yet ?
is it working for 1.1.11 ?
Unless there had been major changes to the coding other than security it should work for 1.1.11.
Not working in my Smf 1.1.10............
Quote from: Chaos Dragon on November 25, 2009, 04:25:31 AM
Hasn't been updated for RC2 yet will hopefully have it by the end of the week
Just a quick wondering how the RC2 version is coming along ? :)
RC3 ?
Installed and worked w/o probs on 1.1.11, but before being able to install - as I FTP the unzipped mod file manually to the Packages - had to change the filename: Package Manager was not reacting to the way it ws spelled: "clickableimage1[1].0": When I took the "[1]" out it worked.
As my users were not sure what to put behind the "url=" I changed it so it now displays "url=http://someSite":
In ./Themes/default/Post.template.php
replaced
'clickableImage' => array('code' => 'url', 'before' => '[url=][img]', 'after' => '[/img][/url]', 'description' => $txt['clickable image']),
with
'clickableImage' => array('code' => 'url', 'before' => '[url=http://someSite][img]', 'after' => '[/img][/url]', 'description' => $txt['clickable image']),
Also, to make the mouseover keeping with the other BBCode icon mouseover standards, modified the test to "Insert Clickable Image" here:
Replaced, at the file end of ./Themes/default/languages/Modifications.english.php
$txt['clickable image'] = 'clickable image';
with
$txt['clickable image'] = 'Insert Clickable Image';
Thanks for that helpful snippet.
Rattler
While I was at it, I used your little mod to also help with the "descriptive link" BBCode, another thing my users always have to look the tag up for (and hence rarely use it).
- Created an icon for insertion of descriptive link (see attached, feel free to use) and then modified and added your code for ths function:
- At file end of ./Themes/default/languages/Modifications.english.php
Found:
?>
Added before:
$txt['descriptive link'] = 'Insert Descriptive Link';
- In ./Themes/default/Post.template.php
Found (in the BBCode array)
'clickableImage' => array('code' => 'url', 'before' => '[url=http://someSite][img]', 'after' => '[/img][/url]', 'description' => $txt['clickable image']),
'url' => array('code' => 'url', 'before' => '[url]', 'after' => '[/url]', 'description' => $txt[257]),
'email' => array('code' => 'email', 'before' => '[email]', 'after' => '[/email]', 'description' => $txt[258]),
and replaced with
'clickableImage' => array('code' => 'url', 'before' => '[url=http://someSite][img]', 'after' => '[/img][/url]', 'description' => $txt['clickable image']),
'url' => array('code' => 'url', 'before' => '[url]', 'after' => '[/url]', 'description' => $txt[257]),
'descriptiveLink' => array('code' => 'url', 'before' => '[url=http://someSite]yourText', 'after' => '[/url]', 'description' => $txt['descriptive link']),
'email' => array('code' => 'email', 'before' => '[email]', 'after' => '[/email]', 'description' => $txt[258]),
- Moved the attched icon to ./Themes/default/images/bbc/
Works, thanks agin for the idea!
Rattler
Got it working on 2.0 RC4
In /Sources/Subs-Editor.php
Find:
array(
'image' => 'img',
'code' => 'img',
'before' => '[img]',
'after' => '[/img]',
'description' => $txt['image']
),
Add after
array(
'image' => 'clickableImage',
'code' => 'url/img',
'before' => '[url=http://][img]',
'after' => '[/img][/url]',
'description' => $txt['clickable image']
),
In /Themes/default/languages/Modifications.english.php
Find
?>
Add before
$txt['clickable image'] = 'Insert clickable image';
Then upload clickableImage.gif to /themes/default/images/bbc/
Thanks
good work
when Update dont forhet portuguese
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
$txt['clickable image'] = 'Imagem clicável';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
$txt['clickable image'] = 'Imagem clicável';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
$txt['clickable image'] = 'Imagem clicável';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
<operation>
<search position="end"></search>
<add><![CDATA[
$txt['clickable image'] = 'Imagem clicável';
]]></add>
</operation>
</file>