Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Chaos Dragon on June 07, 2008, 09:18:44 PM

Title: clickable images bbcode
Post by: Chaos Dragon on June 07, 2008, 09:18:44 PM
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
Title: Re: clickable images bbcode
Post by: Cheese Head on March 08, 2009, 12:13:07 PM
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 . . .
Title: Re: clickable images bbcode
Post by: SA™ on March 08, 2009, 03:11:59 PM
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']),
Title: Re: clickable images bbcode
Post by: Ferrin on March 13, 2009, 06:26:58 AM
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!
Title: Re: clickable images bbcode
Post by: Cheese Head on March 13, 2009, 07:47:07 AM
Thanks, works automatically for me now :D.
Title: Re: clickable images bbcode
Post by: Walgermo on April 16, 2009, 06:16:52 PM
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?
Title: Re: clickable images bbcode
Post by: SA™ on April 23, 2009, 02:11:00 AM
is this in your language folder


modifactions.englsih.php

$txt['clickable image'] = 'clickable image';
Title: Re: clickable images bbcode
Post by: ysNoi on April 23, 2009, 04:16:44 AM
Any screen shots please...!
Title: Re: clickable images bbcode
Post by: chefjohnnie on May 24, 2009, 06:58:25 PM
./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
Title: Re: clickable images bbcode
Post by: SA™ on May 24, 2009, 10:53:59 PM
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
Title: Re: clickable images bbcode
Post by: chefjohnnie on May 26, 2009, 05:21:43 PM
dude how simple thank you spent 2 hours tryin to fig it out
Title: Re: clickable images bbcode
Post by: SA™ on May 26, 2009, 08:28:13 PM
np  :D
Title: Re: clickable images bbcode
Post by: Realinfo on July 16, 2009, 10:01:26 AM
Execute Modification     .\Themes\default/Post.template.php     Test failed

I have SMF 1.1.10
Title: Re: clickable images bbcode
Post by: SA™ on July 17, 2009, 02:58:54 PM
another mod has allready modified that code post up that file please
Title: Re: clickable images bbcode
Post by: Groundhog on September 30, 2009, 01:35:44 PM
Excellent Chaos Dragon

I always have to check which order the tags should be in.

Another useful little improvement   8)
Title: Re: clickable images bbcode
Post by: bpratt on November 16, 2009, 07:19:34 PM
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 :)
Title: Re: clickable images bbcode
Post by: 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
Title: Re: clickable images bbcode
Post by: TomW on December 31, 2009, 12:33:19 AM
Has it been updated for 2.0 RC2 yet ?
Title: Re: clickable images bbcode
Post by: Realinfo on January 04, 2010, 02:47:55 AM
is it working for 1.1.11 ?
Title: Re: clickable images bbcode
Post by: Chaos Dragon on January 04, 2010, 09:21:30 PM
Unless there had been major changes to the coding other than security it should work for 1.1.11.
Title: Re: clickable images bbcode
Post by: Realinfo on January 05, 2010, 05:00:16 AM
Not working in my Smf 1.1.10............
Title: Re: clickable images bbcode
Post by: bpratt on January 31, 2010, 07:37:58 AM
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 ?  :)
Title: Re: clickable images bbcode
Post by: TomW on March 29, 2010, 10:38:55 PM
RC3 ?
Title: Re: clickable images bbcode
Post by: Rattler on May 03, 2010, 06:56:38 AM
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
Title: Re: clickable images bbcode
Post by: Rattler on May 03, 2010, 09:10:57 AM
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
Title: Re: clickable images bbcode
Post by: piers38 on December 07, 2010, 05:25:07 AM
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/
Title: Re: clickable images bbcode
Post by: Apllicmz on December 26, 2011, 08:51:53 AM
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&aacute;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&aacute;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&aacute;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&aacute;vel';
]]></add>
        </operation>
    </file>