Dragonfly CMS v9 ⇒ Coppermine ⇒ Pictures only from a specific category with account plus ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks Coppermine

Pictures only from a specific category with account plus Reply to topic


I am using account plus for members profiles and I modified the Coppermine function in yourcpg.php to try and show only pictures from a specific category. Currently it is coded to only pull last uploaded pictures the member uploaded. My issue with this call is I can not sucessfully get the category of the album. This is what I have so far.

if (!defined('CPG_NUKE')) { exit; } global $prefix, $db, $CONFIG, $cpg_dir, $cpg_prefix, $USER_DATA, $CAT_LIST, $CURRENT_ALBUM_DATA; $cpg_dir = 'coppermine'; if (!is_active($cpg_dir)) { $content = 'ERROR'; return trigger_error($cpg_dir.' module is inactive', E_USER_WARNING); } $catz = 'User fun pics'; $cpg_block = true; require_once('modules/'.$cpg_dir.'/include/load.inc'); $cpg_block = false; $length = $CONFIG['thumbcols']; # number of thumbs $userid = getusrdata($username, 'user_id'); $content = $thumb_title = ''; $result = $db->sql_query("SELECT p.filepath, p.filename, p.owner_id, p.aid, p.title, pid, c.catname FROM {$prefix}_cpg_pictures p INNER JOIN {$prefix}_cpg_albums a ON (p.aid = a.aid AND ".VIS_GROUPS.") INNER JOIN {$prefix}_cpg_categories c ON (p.aid = c.cid) WHERE approved=1 AND p.owner_id='$userid[user_id]' AND c.catname ='$catz' GROUP BY aid ORDER BY aid DESC LIMIT 10"); $num_pics = $db->sql_numrows($result);

I have tried everything to pull in the album category catname as a variable to use but fail at every time. Can anyone point me in the right direction on how to get this? I have tried using $CURRENT_ALBUM_DATA['category'] and still could not pull this in. Any help will be greatly appreciated.

Thanks

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux,apache,5.0.11.,5.6.30,9.3.4.1

All times are UTC


Jump to: