Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: How to get html to work inside descriptions  (Read 5776 times)

0 Members and 1 Guest are viewing this topic.

sportsrant

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
[Solved]: How to get html to work inside descriptions
« 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
« Last Edit: June 30, 2004, 07:12:41 pm by GauGau »
Logged

sportsrant

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
How to get html to work inside descriptions
« Reply #1 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
Logged

Nibbler

  • Guest
How to get html to work inside descriptions
« Reply #2 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.
Logged

sportsrant

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: How to get html to work inside descriptions
« Reply #3 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:

Quote
mike ("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!
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: How to get html to work inside descriptions
« Reply #4 on: June 30, 2004, 05:32:58 pm »

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

Code: [Select]
[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;

Code: [Select]
[email]mike@mike.com[/email]
« Last Edit: June 30, 2004, 05:45:16 pm by Casper »
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: How to get html to work inside descriptions
« Reply #5 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
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: How to get html to work inside descriptions
« Reply #6 on: June 30, 2004, 05:46:46 pm »

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

See the edit above.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: How to get html to work inside descriptions
« Reply #7 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!!!

Logged

Nibbler

  • Guest
Re: How to get html to work inside descriptions
« Reply #8 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:
Code: [Select]
$bbcode_tpl['email']= '<span class="bblink"><a href="mailto:{EMAIL}">{EMAIL}</a></span>';
add:
Code: [Select]
$bbcode_tpl['emailv2']= '<span class="bblink"><a href="mailto:{EMAIL_ADDR}">{EMAIL}</a></span>';
under:
Code: [Select]
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
add;
Code: [Select]
$bbcode_tpl['emailv2'] = str_replace('{EMAIL_ADDR}', '\\1', $bbcode_tpl['emailv2']);
$bbcode_tpl['emailv2'] = str_replace('{EMAIL}', '\\3', $bbcode_tpl['emailv2']);

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

add:

Code: [Select]
                // [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  ;)
Logged

sportsrant

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: How to get html to work inside descriptions
« Reply #9 on: June 30, 2004, 06:41:47 pm »

thanks man, I really apprecaite that    :-X
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: How to get html to work inside descriptions
« Reply #10 on: June 30, 2004, 06:52:41 pm »

I have the ideas, Nibbler has the knowhow.  Got there though,  :D
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: How to get html to work inside descriptions
« Reply #11 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!!
Logged

Jack76

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: [Solved]: How to get html to work inside descriptions
« Reply #12 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?
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 18 queries.