coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: sportsrant on March 11, 2004, 04:57:43 PM

Title: [Solved]: How to get html to work inside descriptions
Post by: sportsrant on March 11, 2004, 04:57:43 PM
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
Title: How to get html to work inside descriptions
Post by: sportsrant on March 11, 2004, 05:03:23 PM
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
Title: How to get html to work inside descriptions
Post by: Nibbler on March 11, 2004, 06:51:25 PM
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.
Title: Re: How to get html to work inside descriptions
Post by: sportsrant on June 30, 2004, 05:25:09 PM
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!
Title: Re: How to get html to work inside descriptions
Post by: Casper on June 30, 2004, 05:32:58 PM
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]
Title: Re: How to get html to work inside descriptions
Post by: sportsrant on June 30, 2004, 05:41:18 PM
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
Title: Re: How to get html to work inside descriptions
Post by: Casper on June 30, 2004, 05:46:46 PM
Sorry, I edited my post at the same time you were posting.

See the edit above.
Title: Re: How to get html to work inside descriptions
Post by: sportsrant on June 30, 2004, 05:55:58 PM
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!!!

Title: Re: How to get html to work inside descriptions
Post by: Nibbler on June 30, 2004, 06:39:34 PM
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  ;)
Title: Re: How to get html to work inside descriptions
Post by: sportsrant on June 30, 2004, 06:41:47 PM
thanks man, I really apprecaite that    :-X
Title: Re: How to get html to work inside descriptions
Post by: Casper on June 30, 2004, 06:52:41 PM
I have the ideas, Nibbler has the knowhow.  Got there though,  :D
Title: Re: How to get html to work inside descriptions
Post by: sportsrant on June 30, 2004, 07:00:17 PM
put that code in and it works perfect, Thanks both of you for the fast and outstanding work!!
Title: Re: [Solved]: How to get html to work inside descriptions
Post by: Jack76 on August 17, 2004, 07:06:04 PM
Unfortunately in 1.3.0 version Nibbler's code doesn't work :-[
How to do it in this version?