Page 1 of 1

create a new bbcode tag for inserting pictures from album

PostPosted: Mon May 22, 2006 3:17 am
Author: sanji
Hi there,

I am now using a couple of modifications that allow users to add pictures from the album in their message, displaying at the same time the id of the picture in the album.

However, so far, they need to insert the following line to add a clickable thumbnail in their text :

Code: Select all
[url=http][flash=,]http://www.secret-japan.com/forum/album_thumbnail.php?pic_id=XX[/flash:y5mj2i6d][/url]


This is obviously not very convenient, so I wonder if it would be difficult to create a simple extra bbcode, allowing users to only use the id of the picture bewteen a tag like for example

Code: Select all
[picalbum]56[/picalbum]


which would insert the picture 56 with the corresponding link.

I unfortunately how no idea how to add a new bbcode, so if you have any suggestion where I should start looking at, it would be greatly appreciated. I haven't find any mod doing that so far...

Thanks in advance,

sanji

PostPosted: Mon May 22, 2006 7:03 am
Author: Adrian Rea

PostPosted: Mon May 22, 2006 2:37 pm
Author: sanji
Thanks, but I get the following message when I try to click on the link :

"Sorry, but only users granted special access can read topics in this forum."

sanji

PostPosted: Mon May 22, 2006 2:39 pm
Author: Adrian Rea
Sorry, that was my fault. It is being considered for addition in 141, I did not realise it was in the team forums. I will try to post the contents if the author is happy.

A

PostPosted: Mon May 22, 2006 2:55 pm
Author: sanji
Great, looking forward to looking at this topic <img>

sanji

PostPosted: Mon May 22, 2006 4:01 pm
Author: tmotley
In archives:

http://www.integrmod.com/home/viewtopic.php?t=7751

Look for a post by jon. It's the fifth posting...Mon Sep 19, 2005 8:01 pm

Might be a little old but I think it's the one I did a long time ago. Worth a try with appropriate backup?

PostPosted: Mon May 22, 2006 4:18 pm
Author: sanji
Thanks tmotley...

but I was Jon on the previous forum <img>

In fact, the modification works to allow the use of picture from the album in a message (otherwise impossible to protect prevent other sites from linking to your album), but the taf itself is not working.

That is why I now use the code written in my first post. I suspect the code has to be rewritten somehow, but I have no idea how...

Thanks,

sanji

Re: create a new bbcode tag for inserting pictures from albu

PostPosted: Mon May 22, 2006 5:21 pm
Author: tmotley
Wow, now that I slowly read your initial post, it makes more sense now. I must have been smoking something...

One button click, type in only number of picture from album, outputs code to make the image thumbnail linked to the full image...

Does your album image posting still work? Mine still does.

PostPosted: Mon May 22, 2006 6:43 pm
Author: sanji
Album image posting works fine - you can have a look at my forum (link in the signature). But it is not convenient for posters to have to copy the whole code line, so this extra bbcode would be handy...

sanji

PostPosted: Mon May 22, 2006 6:53 pm
Author: tmotley
I do understand the niceness of your requested bbcode. I wasn't sure from your 'but the taf itself is not working' whether yours was still functional.

I've installed Jason Sanborn's Advanced BBCode and it works wonderfully. Supposedly you can add different bbcodes into the Advanced BBCode in a fairly straightforward manner.

PostPosted: Tue May 23, 2006 12:56 am
Author: Adrian Rea
gffb
Can we add the bbcode [siteimg] this will allow users to directly link the a picture in an album on the forum as at the moment no album pictures can be shown in a post, unless you can find out thier true url here is my suggestion
Code: Select all
 ##-----[ OPEN ]------------------------------------------#includes/bbcode.php  ##-----[ FIND ]------------------------------------------#// We do URLs in several different ways..     $bbcode_tpl['url1'] = str_replace('{URL}', '\1', $bbcode_tpl['url']);     $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\1', $bbcode_tpl['url1']);  ##-----[ BEFORE, ADD ]------------------------------------------#        // site img code for doing local images in the press mod.    $bbcode_tpl['siteimg'] = str_replace('{IMG_NUM}', '\1', $bbcode_tpl['siteimg']);    // end site image    ##-----[ FIND ]------------------------------------------#    // [flash=,]image_url_here[/flash:p988ikp3] code..    // This one gets first-passed..  ##-----[ BEFORE, ADD ]------------------------------------------#          //site image for printing press    // [siteimg]image number here[/img]    $local_patterns[5] = "#[siteimg:$uid]([0-9]+)[/siteimg:$uid]#si";    $local_replacements[5] = $bbcode_tpl['siteimg'];     $text = preg_replace($local_patterns, $local_replacements, $text);     //site image for printing press end    ##-----[ FIND ]------------------------------------------#     // [flash=,:p988ikp3]image_url_here[/flash:p988ikp3] code..     $text = preg_replace("#[img]((http|ftp|https|ftps)://)([^ ?&=#"nrt<]*?(.(jpg|jpeg|gif|png)))[/img]#sie", "'[img]\1' . str_replace(' ', '%20', '\3') . '[/img]'", $text);    ##-----[ BEFORE, ADD ]------------------------------------------              // [siteimg]image_url_here[/img] code..    $text = preg_replace("#[siteimg]([0-9]+)[/siteimg]#sie", "'[siteimg:$uid]\1[/siteimg:$uid]'", $text);       // siteimg-end  ##-----[ OPEN ]------------------------------------------#templates/fisubice/bbcode.tpl  ##-----[ FIND ]------------------------------------------#<BEGIN><a>{DESCRIPTION}</a><END>  ##-----[ AFTER, ADD ]------------------------------------------#  <BEGIN><a><img></a><END>      ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------#  

This will allow the use of code
Code: Select all
[siteimage]thumbnail id number (ie 3 )[/siteimage] for example [siteimage]3[/siteimage]


The only other thing to add to this would be a site image bbcode button.[hr]gffb
Also been able to add the bbc image and .js script

upload any image called album_pic.gif to YOURFORUMFOLDERbbcode_boximages

Code: Select all
 ##-----[ OPEN ]------------------------------------------#templatespost_message.js  ##-----[ FIND ]------------------------------------------#fade_help = "Fade text]text[/fade:p988ikp3]";  ##-----[ AFTER, ADD ]------------------------------------------#  siteimg_help = "Insert Pic ID # from album gallery:[siteimg]Pic ID#[/siteimg]";  ##-----[ FIND ]------------------------------------------#var is_submit = false;  ##-----[ AFTER, ADD ]------------------------------------------#  var siteimg = 0;  function BBCsiteimg() {var FoundErrors = '';var enterURL = prompt("Enter the Pic ID#");if (!enterURL) {FoundErrors += "You didn't enter the number";}if (FoundErrors) {alert("Error :"+FoundErrors);return;}var ToAdd = "[siteimg]"+enterURL+"[/siteimg]";document.post.message.value+=ToAdd;document.post.message.focus();}  ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------#  
[hr:p988ikp3]Jason Sanborn
I can add this into the Advanced BBCode Box as well. I'll create a new image for it, and place it next to the image button. I can update that tomorrow.[hr:p988ikp3]Jason Sanborn
Advanced BBCode Box was updated. I added [siteimg=left] and [siteimg=right] to the code as well, to keep with similar functionality of the [img] tag.[hr:p988ikp3]Hope that helps

A

PostPosted: Tue May 23, 2006 2:06 am
Author: Tom_S
That works pretty good <img>

PostPosted: Tue May 23, 2006 5:27 am
Author: Adrian Rea
http://integramod.com/forum/viewtopic.php?p=6956#6956 this is the post about adding this to advanced bbcode box.

A

PostPosted: Tue May 23, 2006 5:32 am
Author: Tom_S
I first installed just the code to use the siteimg tag in bbcode. After I saw that work I then installed the complete Advanced BBCode Mod which is AWESOME! The img tag works great with the new setup.

PostPosted: Mon Sep 04, 2006 2:49 pm
Author: richiebgood
would it now be easier if it Changing album output from 'album_pic.php?pic_id=52' to 52.jpg.

Can this be done?