coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: SolidSnake2003 on May 21, 2011, 05:38:39 AM

Title: Category Title for title, and alt (without link)
Post by: SolidSnake2003 on May 21, 2011, 05:38:39 AM
My Gallery (http://www.joshuaharrislegacy.net/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?


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" />'; }
Title: Re: Category Title for title, and alt (without link)
Post by: ΑndrĂ© on May 23, 2011, 10:22:29 AM
According to that (http://forum.coppermine-gallery.net/index.php/topic,72517.msg350264.html#msg350264) solution, replace the code with
        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" />'; }
Title: Re: Category Title for title, and alt (without link)
Post by: SolidSnake2003 on May 23, 2011, 11:12:04 AM
Thanks, worked perfectly :D

Marking as solved.