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: Category Title for title, and alt (without link)  (Read 2782 times)

0 Members and 1 Guest are viewing this topic.

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Category Title for title, and alt (without link)
« on: May 21, 2011, 05:38:39 am »

My Gallery

I have one more question, I have gotten my category icons to work(thanks to andre), and I would now like to add the category name to the title="" and alt=""

is it possible to add this?

Code: [Select]
preg_match('/<a href="index\.php\?cat=([0-9]+)">/', $category[0], $matches);
        if (!isset($category['cat_icon'])) { $category['cat_icon'] = '<img src="http://www.mysite.net/cpg/images/categories/catid_'.$matches[1].'.jpg" title="Cat Name" alt="Cat Name" width="80px" height="80px" border="0" hspace="0" vspace="0" />'; }
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Category Title for title, and alt (without link)
« Reply #1 on: May 23, 2011, 10:22:29 am »

According to that solution, replace the code with
Code: [Select]
        preg_match('/<a href="index\.php\?cat=([0-9]+)">(.*)<\/a>/', $category[0], $matches);
        if (!isset($category['cat_icon'])) { $category['cat_icon'] = '<img src="http://www.mysite.net/cpg/images/categories/catid_'.$matches[1].'.jpg" title="'.$matches[2].'" alt="'.$matches[2].'" width="80px" height="80px" border="0" hspace="0" vspace="0" />'; }
Logged

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Re: Category Title for title, and alt (without link)
« Reply #2 on: May 23, 2011, 11:12:04 am »

Thanks, worked perfectly :D

Marking as solved.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.