Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / articles [ view in CVS ]
Date | Directory [filter] | File(s) [view] | Author [filter] |
09 Aug 2002 00:00:45 | postnuke_modules/articles | pnuser.php,1.42,1.43 | Mike |
show category count, add browse, change faq summary display |
Update of /home/cvsroot/postnuke_modules/articles In directory ns7.hostnuke.net:/tmp/cvs-serv15761 Modified Files: pnuser.php Log Message: show category count, add browse, change faq summary display Index: pnuser.php =================================================================== RCS file: /home/cvsroot/postnuke_modules/articles/pnuser.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** pnuser.php 8 Aug 2002 23:03:20 -0000 1.42 --- pnuser.php 9 Aug 2002 00:00:43 -0000 1.43 *************** *** 80,83 **** --- 80,85 ---- // TODO: drop $output once we're templated + + // TODO: show this *after* category list when we start from categories :) $row = articles_user_showpubtypes($output,$ptid,$ishome); if (count($row) > 0) { *************** *** 167,171 **** // TODO: make this dependent on publication type too ? ! $output->Text(pnML('Category') . ' : '); $output->Text('[ '); $output->URL(pnModURL('articles', --- 169,173 ---- // TODO: make this dependent on publication type too ? ! $output->Text(pnML('Browse in') . ' : '); $output->Text('[ '); $output->URL(pnModURL('articles', *************** *** 267,271 **** 'user', 'view', ! array('cids' => array($info['id']))), pnVarPrepForDisplay(pnVarCensor($info['name']))); if (isset($pubcatcount[$info['id']][$curptid])) { --- 269,274 ---- 'user', 'view', ! array('cids' => array($info['id']), ! 'ptid' => $ptid)), pnVarPrepForDisplay(pnVarCensor($info['name']))); if (isset($pubcatcount[$info['id']][$curptid])) { *************** *** 283,286 **** --- 286,291 ---- } // TODO: make 1 call to get all + $row = array(); + $output->SetOutputMode(_PNH_RETURNOUTPUT); $rootcats = split(';',$string); foreach ($rootcats as $cid) { *************** *** 292,303 **** 'getcatinfo', array('cid' => $cid)); ! $output->URL(pnModURL('articles', ! 'user', ! 'view', ! array('cids' => array($info['cid']), ! 'ptid' => $ptid)), ! pnVarPrepForDisplay(pnVarCensor($info['name']))); ! $output->Text(' '); } $output->Linebreak(2); } --- 297,311 ---- 'getcatinfo', array('cid' => $cid)); ! $row[] = $output->URL(pnModURL('articles', ! 'user', ! 'view', ! array('cids' => array($info['cid']), ! 'ptid' => $ptid)), ! pnVarPrepForDisplay(pnVarCensor($info['name']))); } + $output->SetOutputMode(_PNH_KEEPOUTPUT); + $output->SetInputMode(_PNH_VERBATIMINPUT); + $output->Text('[ ' . join(' | ',$row) . ' ]'); + $output->SetInputMode(_PNH_PARSEINPUT); $output->Linebreak(2); } *************** *** 475,485 **** 'modid' => pnModGetIDFromName('articles'), 'reverse' => 0)); $icons = ''; // display one (or more) bread-crumb trails of categories $data['trails'] = array(); - $cidlist = array(); foreach ($cids as $cid => $ids) { $trailitem['cid'] = $cid; - $cidlist[] = $cid; $trail = pnModAPIFunc('categories', 'user', --- 483,507 ---- 'modid' => pnModGetIDFromName('articles'), 'reverse' => 0)); + + // get the counts for all categories this article belongs to + $seencid = array(); + foreach ($cids as $cid => $ids) { + $seencid[$cid] = 1; + } + $catlist = array_keys($seencid); + $pubcatcount = pnModAPIFunc('articles', + 'user', + 'getpubcatcount', + // frontpage or approved + array('status' => array(3,2), + 'cids' => $catlist, + 'ptid' => $ptid, + 'reverse' => 1)); + $icons = ''; // display one (or more) bread-crumb trails of categories $data['trails'] = array(); foreach ($cids as $cid => $ids) { $trailitem['cid'] = $cid; $trail = pnModAPIFunc('categories', 'user', *************** *** 488,491 **** --- 510,518 ---- 'return_itself' => true, 'getparents' => true)); + if (isset($pubcatcount[$cid][$ptid])) { + $trailitem['cidcount'] = $pubcatcount[$cid][$ptid]; + } else { + $trailitem['cidcount'] = ''; + } // TODO: make sure permissions are taken into account here ! $trailitem['parentlinks'] = array(); *************** *** 528,532 **** // TODO: add pnVarCensor ? ! if (!empty($pubtypes[$ptid]['config']['author'])) { $data['author'] = pnUserGetVar('name', $article['authorid']); } else { --- 555,559 ---- // TODO: add pnVarCensor ? ! if (!empty($pubtypes[$ptid]['config']['authorid'])) { $data['author'] = pnUserGetVar('name', $article['authorid']); } else { *************** *** 595,599 **** pnVarSetCached('Blocks.articles','aid',$aid); pnVarSetCached('Blocks.articles','ptid',$ptid); ! pnVarSetCached('Blocks.articles','cids',$cidlist); pnVarSetCached('Blocks.articles','authorid',$article['authorid']); pnVarSetCached('Blocks.articles','author',$data['author']); --- 622,626 ---- pnVarSetCached('Blocks.articles','aid',$aid); pnVarSetCached('Blocks.articles','ptid',$ptid); ! pnVarSetCached('Blocks.articles','cids',$catlist); pnVarSetCached('Blocks.articles','authorid',$article['authorid']); pnVarSetCached('Blocks.articles','author',$data['author']);
View Statistics - Next Notice - Previous Notice
Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |