[Solved]: How to get html to work inside descriptions [Solved]: How to get html to work inside descriptions
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Solved]: How to get html to work inside descriptions

Started by sportsrant, March 11, 2004, 04:57:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sportsrant

I have been trying to get simple html tags to work inside the descriptions of my gallery.  Examples would be just adding a simple URL or EMAIL.  IS there some change that I need To make becuase I cannot get it to work


Thanks in advance,
Mike

sportsrant

You can see an example at http://www.sportsrant.com/gallery and look at the 2004 February Rant Girl Of the Month.  I am trying, as you see, a simple link to point to her site.  I searched these forums and cannot find a solution, if there is one.

Thanks

Mike

Nibbler

You can use BBcode in the descriptions for links, in exactly the same way as you can use them in this very forum. You can use [email] tags for mailto links.

sportsrant

how do you use the alt email tags instead of placing the email address!!

example on some BB codes:

Quotemike ("email@email.com")or
mike (email@email.com)

is there a way to ALT the tags to show the name for the email, this does not work in the album description

Thanks in advance!

Casper

#4
You do it using bb code, as Nibbler said.
For what you want, you would use;

[email=mike@mike.com]Mike[/email]

Note, if you upgrade to version 1.3.0, there is bb code help

edit;
The above code won't work,  :-[ it only works with urls.

You would just use;

[email]mike@mike.com[/email]
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

sportsrant

see if you go to my album and look at the description for the top album, you will see that I entered that exact email that you entered and it is not working!

http://www.sportsrant.com/gallery/

scroll down through the description and let me know if I am making a mistake

Casper

Sorry, I edited my post at the same time you were posting.

See the edit above.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

sportsrant

thanks, I got that.

I appreciate the help!!  ;)

umm, I have customized my gallery, which is 1.2, and do not want to upgrade now since I have it tied in and working with VB 3.0.1.  I have placed some custom code to stop people from seeing the large pictures unless they have been a member of my forums for so many days!!!  and I am going to add in there inthe future a minimum post count!!!


Nibbler

I don't have an install of 1.2 to test this on, but you can add your own regexps into functions.inc.php to do that.

Under:
$bbcode_tpl['email']= '<span class="bblink"><a href="mailto:{EMAIL}">{EMAIL}</a></span>';

add:
$bbcode_tpl['emailv2']= '<span class="bblink"><a href="mailto:{EMAIL_ADDR}">{EMAIL}</a></span>';

under:
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);

add;
$bbcode_tpl['emailv2'] = str_replace('{EMAIL_ADDR}', '\\1', $bbcode_tpl['emailv2']);
$bbcode_tpl['emailv2'] = str_replace('{EMAIL}', '\\3', $bbcode_tpl['emailv2']);


under:

                // [email]user@domain.tld[/email] code..
                $patterns[5] = "#\[email\]([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
                $replacements[5] = $bbcode_tpl['email'];


add:


                // [email=me@domain.com]mail me[/email] code..
                $patterns[6] = "#\[email=([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\](.*?)\[/email\]#si";
                $replacements[6] = $bbcode_tpl['emailv2'];


Which should let you use Casper's made up email tags  ;)

sportsrant


Casper

I have the ideas, Nibbler has the knowhow.  Got there though,  :D
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

sportsrant

put that code in and it works perfect, Thanks both of you for the fast and outstanding work!!

Jack76

Unfortunately in 1.3.0 version Nibbler's code doesn't work :-[
How to do it in this version?