create a new bbcode tag for inserting pictures from album

Support for IntegraMOD 140

Moderator: Integra Moderator

create a new bbcode tag for inserting pictures from album

PostAuthor: sanji » Mon May 22, 2006 3:17 am

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
Last edited by sanji on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[img]http://www.secret-japan.com/forum/images/banners/fuji%20secret-japan%2088x31.gif[/img] [url=http]Secret Japan[/url] : discover Japan off the beaten tracks

sanji
Sr Integra Member
Sr Integra Member
 
Posts: 291
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:18 pm
Cash on hand: 0.00

PostAuthor: Adrian Rea » Mon May 22, 2006 7:03 am

Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: sanji » Mon May 22, 2006 2:37 pm

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
Last edited by sanji on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[img]http://www.secret-japan.com/forum/images/banners/fuji%20secret-japan%2088x31.gif[/img] [url=http]Secret Japan[/url] : discover Japan off the beaten tracks

sanji
Sr Integra Member
Sr Integra Member
 
Posts: 291
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:18 pm
Cash on hand: 0.00

PostAuthor: Adrian Rea » Mon May 22, 2006 2:39 pm

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
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: sanji » Mon May 22, 2006 2:55 pm

Great, looking forward to looking at this topic <img>

sanji
Last edited by sanji on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[img]http://www.secret-japan.com/forum/images/banners/fuji%20secret-japan%2088x31.gif[/img] [url=http]Secret Japan[/url] : discover Japan off the beaten tracks

sanji
Sr Integra Member
Sr Integra Member
 
Posts: 291
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:18 pm
Cash on hand: 0.00

PostAuthor: tmotley » Mon May 22, 2006 4:01 pm

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?
Last edited by tmotley on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
tmotley
IntegraMODerators
IntegraMODerators
 
Posts: 524
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 3:56 am
Cash on hand: 0.00
Location: Missouri, USA

PostAuthor: sanji » Mon May 22, 2006 4:18 pm

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
Last edited by sanji on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[img]http://www.secret-japan.com/forum/images/banners/fuji%20secret-japan%2088x31.gif[/img] [url=http]Secret Japan[/url] : discover Japan off the beaten tracks

sanji
Sr Integra Member
Sr Integra Member
 
Posts: 291
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:18 pm
Cash on hand: 0.00

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

PostAuthor: tmotley » Mon May 22, 2006 5:21 pm

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.
Last edited by tmotley on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
tmotley
IntegraMODerators
IntegraMODerators
 
Posts: 524
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 3:56 am
Cash on hand: 0.00
Location: Missouri, USA

PostAuthor: sanji » Mon May 22, 2006 6:43 pm

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
Last edited by sanji on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[img]http://www.secret-japan.com/forum/images/banners/fuji%20secret-japan%2088x31.gif[/img] [url=http]Secret Japan[/url] : discover Japan off the beaten tracks

sanji
Sr Integra Member
Sr Integra Member
 
Posts: 291
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:18 pm
Cash on hand: 0.00

PostAuthor: tmotley » Mon May 22, 2006 6:53 pm

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.
Last edited by tmotley on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
tmotley
IntegraMODerators
IntegraMODerators
 
Posts: 524
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 3:56 am
Cash on hand: 0.00
Location: Missouri, USA

PostAuthor: Adrian Rea » Tue May 23, 2006 12:56 am

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
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: Tom_S » Tue May 23, 2006 2:06 am

That works pretty good <img>
Last edited by Tom_S on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 8:23 am
Cash on hand: 0.00

PostAuthor: Adrian Rea » Tue May 23, 2006 5:27 am

http://integramod.com/forum/viewtopic.php?p=6956#6956 this is the post about adding this to advanced bbcode box.

A
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: Tom_S » Tue May 23, 2006 5:32 am

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.
Last edited by Tom_S on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 8:23 am
Cash on hand: 0.00

PostAuthor: richiebgood » Mon Sep 04, 2006 2:49 pm

would it now be easier if it Changing album output from 'album_pic.php?pic_id=52' to 52.jpg.

Can this be done?
Last edited by richiebgood on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

richiebgood
Sr Integra Member
Sr Integra Member
 
Posts: 329
Likes: 0 post
Liked in: 0 post
Joined: Tue Aug 08, 2006 1:01 am
Cash on hand: 0.00
Location: Ireland


Return to IntegraMOD 140

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]