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] |
13 Aug 2002 22:58:48 | postnuke_modules/articles | pnuser.php,1.46,1.47 | Mike |
matrix/pivot overview of categories (under construction) |
Update of /home/cvsroot/postnuke_modules/articles In directory ns7.hostnuke.net:/tmp/cvs-serv13225 Modified Files: pnuser.php Log Message: matrix/pivot overview of categories (under construction) Index: pnuser.php =================================================================== RCS file: /home/cvsroot/postnuke_modules/articles/pnuser.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** pnuser.php 12 Aug 2002 17:24:45 -0000 1.46 --- pnuser.php 13 Aug 2002 22:58:46 -0000 1.47 *************** *** 902,905 **** --- 902,960 ---- } + // TODO: show matrix/pivottable for categories (this is just a demo) + // get the counts for all groups of (N) categories + $pubcatcount2 = pnModAPIFunc('articles', + 'user', + 'getpubcatcount', + // frontpage or approved + array('status' => array(3,2), + 'numcids' => 2, // depends on ptid cids. + 'reverse' => 1)); + $dump = 'TODO: show matrix/pivottable for categories (under construction)<br />'; + list($two,$one) = $publinks[0]['rootcats']; + $typeone = array_shift($cattree[$one]); + $typetwo = array_shift($cattree[$two]); + foreach ($cattree[$one] as $info1) { + $matrix[$info1['id']] = array(); + $name[$info1['id']] = $info1['name']; + foreach ($cattree[$two] as $info2) { + $matrix[$info1['id']][$info2['id']] = 0; + $name[$info2['id']] = $info2['name']; + } + } + foreach ($pubcatcount2 as $cids => $counts) { + list($ca,$cb) = explode('+',$cids); + if (isset($matrix[$ca][$cb])) { + $matrix[$ca][$cb] = $counts['total']; + } elseif (isset($matrix[$cb][$ca])) { + $matrix[$cb][$ca] = $counts['total']; + } else { + $dump .= "not found : $cids"; + } + } + $dump .= '<table border="1" cellpadding="3"><tr><td align="right">' . + $typetwo['name'] . '<br />-<br />' . $typeone['name'] . '</td>'; + foreach ($matrix as $cid1 => $list) { + foreach ($list as $cid2 => $val) { + $dump .= '<td>' . $name[$cid2] . '</td>'; + } + break; + } + $dump .= '</tr>'; + foreach ($matrix as $cid1 => $list) { + $dump .= '<tr><td>' . $name[$cid1] . '</td>'; + foreach ($list as $cid2 => $val) { + if ($val > 0) { + // TODO: support andcids as parameter :-) + $link = pnModURL('articles','user','view',array('cids' => array("$cid1+$cid2"))); + $dump .= '<td align="center"><a href="' . $link . '"> ' .$val . ' </a></td>'; + } else { + $dump .= '<td align="center"> </td>'; + } + } + $dump .= '</tr>'; + } + $dump .= '</table>'; + $archivelink = pnModURL('articles','user','archive'); *************** *** 907,911 **** 'maplabel' => pnML('View Article Map'), 'archivelabel' => pnML('View Archives'), ! 'archivelink' => $archivelink); } --- 962,966 ---- 'maplabel' => pnML('View Article Map'), 'archivelabel' => pnML('View Archives'), ! 'archivelink' => $archivelink, 'dump' => $dump); }
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 |