clickable images bbcode

Started by Chaos Dragon, June 07, 2008, 09:18:44 PM

Previous topic - Next topic

Chaos Dragon

Link to Mod

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
"Never stop exploring new ideas, concepts and techniques, but never forget the old ones, they just may come in handy someday!"
"Don't give up! Otherwise you do not win and nothing gets accomplished!"
Einstein "Insanity is doing the same thing over and over again, and expecting different results..."
Do Not PM me for Support. They will be Ignored. Use the Threads the have been provided.

Cheese Head

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 . . .

SA™

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']),
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Ferrin

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!
My English is not the best. German is more my language.

Cheese Head

Thanks, works automatically for me now :D.

Walgermo

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' => ' [nofollow]', 'description' => $txt['clickable image']),

i cant see any problem, some suggestions?

SA™

is this in your language folder


modifactions.englsih.php

$txt['clickable image'] = 'clickable image';
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

ysNoi

"Don't fix it if it ain't broken, don't break it if you can't fix it."

chefjohnnie

./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

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

chefjohnnie

dude how simple thank you spent 2 hours tryin to fig it out

SA™

http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Realinfo

Execute Modification     .\Themes\default/Post.template.php     Test failed

I have SMF 1.1.10

SA™

another mod has allready modified that code post up that file please
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Groundhog

Excellent Chaos Dragon

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

Another useful little improvement   8)

bpratt

Just trying to install this under 2.0RC2 and when I search for :-

   'img' => array('code' => 'img', 'before' => '', '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 :)

Chaos Dragon

Hasn't been updated for RC2 yet will hopefully have it by the end of the week
"Never stop exploring new ideas, concepts and techniques, but never forget the old ones, they just may come in handy someday!"
"Don't give up! Otherwise you do not win and nothing gets accomplished!"
Einstein "Insanity is doing the same thing over and over again, and expecting different results..."
Do Not PM me for Support. They will be Ignored. Use the Threads the have been provided.

TomW

Has it been updated for 2.0 RC2 yet ?

Realinfo


Chaos Dragon

Unless there had been major changes to the coding other than security it should work for 1.1.11.
"Never stop exploring new ideas, concepts and techniques, but never forget the old ones, they just may come in handy someday!"
"Don't give up! Otherwise you do not win and nothing gets accomplished!"
Einstein "Insanity is doing the same thing over and over again, and expecting different results..."
Do Not PM me for Support. They will be Ignored. Use the Threads the have been provided.

Advertisement: