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] |
| 29 Jul 2002 13:27:55 | postnuke_modules/articles | pnuser.php,1.31,1.32 | Mike |
| viewmap by publication type | |||
Update of /home/cvsroot/postnuke_modules/articles
In directory ns7.hostnuke.net:/tmp/cvs-serv8809
Modified Files:
pnuser.php
Log Message:
viewmap by publication type
Index: pnuser.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pnuser.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** pnuser.php 28 Jul 2002 17:39:42 -0000 1.31
--- pnuser.php 29 Jul 2002 13:27:53 -0000 1.32
***************
*** 85,89 ****
$numitems = pnModGetVar('articles', 'itemsperpage');
}
! if ($numitems < 1)
{
$numitems = pnModGetVar('articles', 'itemsperpage');
--- 85,89 ----
$numitems = pnModGetVar('articles', 'itemsperpage');
}
! if (empty($numitems))
{
$numitems = pnModGetVar('articles', 'itemsperpage');
***************
*** 177,228 ****
'modid' => pnModGetIDFromName('articles')));
! $tree = pnModAPIFunc('categories',
! 'user',
! 'getcat',
! array('cid' => $cids[0],
! 'return_itself' => true,
! 'getchildren' => true));
! // TODO: make sure permissions are taken into account here !
! foreach ($tree as $info) {
! if ($info['cid'] == $cids[0]) {
! $startindent = $info['indentation'];
! $oldindent = $info['indentation'];
! } else {
! $tags = '';
! if ($info['indentation'] > $oldindent) {
! for ($i=$oldindent;$i<$info['indentation'];$i++) {
! $tags .= "<ul>\n";
! }
! } elseif ($info['indentation'] < $oldindent) {
! for ($i=$info['indentation'];$i<$oldindent;$i++) {
! $tags .= "</ul>\n";
! }
! }
! $tags .= '<li> ';
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text($tags);
! // TODO: show icons instead of (or in addition to) a link if available ?
! $output->URL(pnModURL('articles',
! 'user',
! 'view',
! array('cids' => array($info['cid']))),
! pnVarPrepForDisplay(pnVarCensor($info['name'])));
! if (isset($count[$info['cid']])) {
! $tags = ' (' . $count[$info['cid']] . ')</li>';
! } else {
! $tags = '</li>';
! }
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text($tags);
! $oldindent = $info['indentation'];
! }
}
! if ($oldindent > $startindent) {
! $tags = '';
! for ($i=$startindent;$i<$oldindent;$i++) {
! $tags .= "</ul>\n";
}
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text($tags);
}
$output->Linebreak();
--- 177,206 ----
'modid' => pnModGetIDFromName('articles')));
! if (!pnModAPILoad('categories', 'visual')) {
! $output->Text(_LOADFAILED);
! return $output->GetOutput();
}
!
! // TODO: make sure permissions are taken into account here !
! $list = pnModAPIFunc('categories',
! 'visual',
! 'listarray',
! array('cid' => $cids[0]));
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! foreach ($list as $info) {
! if ($info['id'] == $cids[0]) {
! continue;
}
! $output->Text($info['beforetags']);
! // TODO: show icons instead of (or in addition to) a link if available ?
! $output->URL(pnModURL('articles',
! 'user',
! 'view',
! array('cids' => array($info['id']))),
! pnVarPrepForDisplay(pnVarCensor($info['name'])));
! if (isset($count[$info['id']])) {
! $output->Text(' (' . $count[$info['id']] . ')');
! }
! $output->Text($info['aftertags']);
}
$output->Linebreak();
***************
*** 429,433 ****
// Navigation links
! $data['publinks'] = articles_user_getpublinks();
$data['maplink'] = pnModURL('articles','user','viewmap',array());
--- 407,411 ----
// Navigation links
! $data['publinks'] = pnModAPIFunc('articles','user','getpublinks');
$data['maplink'] = pnModURL('articles','user','viewmap',array());
***************
*** 450,454 ****
/**
! * view category map
*/
function articles_user_viewmap()
--- 428,432 ----
/**
! * view article map
*/
function articles_user_viewmap()
***************
*** 460,545 ****
// And in the meantime... :-)
- // Create output object
- $output = new pnHTML();
-
- // TODO: drop $output once we're templated
- $row = articles_user_showpubtypes($output);
- if (count($row) > 0) {
- $output->Text(pnML('Publication Type'));
- $output->Text(' : ');
- $output->SetInputMode(_PNH_VERBATIMINPUT);
- $output->Text(join(' - ',$row));
- $output->SetInputMode(_PNH_PARSEINPUT);
- $output->LineBreak(2);
- }
-
- $output->Text("
- // TODO: filter out by supported 'root categories'
- ");
- $output->LineBreak();
-
- $output->Text(pnML('Category'));
- $output->Text(' : ');
-
if (!pnModAPILoad('categories', 'user')) {
$output->Text(_LOADFAILED);
return $output->GetOutput();
}
if (!pnModAPILoad('articles', 'user')) {
$output->Text(_LOADFAILED);
return $output->GetOutput();
}
! $count = pnModAPIFunc('categories',
! 'user',
! 'groupcount',
! array('groupby' => 'category',
! 'modid' => pnModGetIDFromName('articles')));
! // TODO: make sure permissions are taken into account here !
! $tree = pnModAPIFunc('categories',
! 'user',
! 'getcat',
! array());
! $startindent = 0;
! $oldindent = 0;
! foreach ($tree as $info) {
! $tags = '';
! if ($info['indentation'] > $oldindent) {
! for ($i=$oldindent;$i<$info['indentation'];$i++) {
! $tags .= "<ul>\n";
! }
! } elseif ($info['indentation'] < $oldindent) {
! for ($i=$info['indentation'];$i<$oldindent;$i++) {
! $tags .= "</ul>\n";
}
}
! $tags .= '<li> ';
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text($tags);
// TODO: show icons instead of (or in addition to) a link if available ?
! $output->URL(pnModURL('articles',
! 'user',
! 'view',
! array('cids' => array($info['cid']))),
! pnVarPrepForDisplay(pnVarCensor($info['name'])));
! if (isset($count[$info['cid']])) {
! $tags = ' (' . $count[$info['cid']] . ')</li>';
! } else {
! $tags = '</li>';
}
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text($tags);
! $oldindent = $info['indentation'];
}
! if ($oldindent > $startindent) {
! $tags = '';
! for ($i=$startindent;$i<$oldindent;$i++) {
! $tags .= "</ul>\n";
}
- $output->SetInputMode(_PNH_VERBATIMINPUT);
- $output->Text($tags);
}
! return $output->GetOutput();
}
--- 438,521 ----
// And in the meantime... :-)
if (!pnModAPILoad('categories', 'user')) {
$output->Text(_LOADFAILED);
return $output->GetOutput();
}
+ if (!pnModAPILoad('categories', 'visual')) {
+ $output->Text(_LOADFAILED);
+ return $output->GetOutput();
+ }
+ /*
if (!pnModAPILoad('articles', 'user')) {
$output->Text(_LOADFAILED);
return $output->GetOutput();
}
+ */
! // get the links and counts for all publication types
! $publinks = pnModAPIFunc('articles','user','getpublinks',array('all' => 1));
! // build the list of root categories for all publication types
! // and save results in publinks as well
! $catlist = array();
! for ($i=0;$i<count($publinks);$i++) {
! $ptid = $publinks[$i]['pubid'];
! $string = pnModGetVar('articles','cids.' . $ptid);
! if (!empty($string)) {
! $rootcats = split(';',$string);
! foreach ($rootcats as $cid) {
! $catlist[$cid] = 1;
}
+ $publinks[$i]['rootcats'] = $rootcats;
}
! }
!
! // get the counts for all categories
! $catcount = pnModAPIFunc('categories',
! 'user',
! 'groupcount',
! array('groupby' => 'category',
! 'modid' => pnModGetIDFromName('articles')));
!
! // create the category tree for each root category
! // TODO: make sure permissions are taken into account here !
! $cattree = array();
! foreach ($catlist as $cid => $val) {
! if (empty($val)) {
! continue;
! }
! $list = pnModAPIFunc('categories',
! 'visual',
! 'listarray',
! array('cid' => $cid));
!
! // Add link and count information
! for ($i=0;$i<count($list);$i++) {
! $info = $list[$i];
// TODO: show icons instead of (or in addition to) a link if available ?
! $list[$i]['link'] = pnModURL('articles',
! 'user',
! 'view',
! array('cids' => array($info['id'])));
! $list[$i]['name'] = pnVarPrepForDisplay(pnVarCensor($info['name']));
! if (isset($catcount[$info['id']])) {
! $list[$i]['count'] = $catcount[$info['id']];
! } else {
! $list[$i]['count'] = '';
! }
}
! $cattree[$cid] = $list;
}
! for ($i=0;$i<count($publinks);$i++) {
! $publinks[$i]['cats'] = array();
! foreach ($publinks[$i]['rootcats'] as $cid) {
! $item['item'] = $cattree[$cid];
! $publinks[$i]['cats'][] = $item;
}
}
!
! return array('publinks' => $publinks,
! 'cattree' => $cattree,
! 'list' => $list);
}
***************
*** 577,613 ****
return $row;
- }
-
- /**
- * get links to publication types
- */
- function articles_user_getpublinks($ptid = null)
- {
- if (!pnModAPILoad('articles', 'user')) {
- $output->Text(_LOADFAILED);
- return $output->GetOutput();
- }
-
- // Get publication types
- $pubtypes = pnModAPIFunc('articles','user','getpubtypes');
- $pubcount = pnModAPIFunc('articles','user','getpubcount');
-
- $publinks = array();
- foreach ($pubtypes as $id => $pubtype) {
- if (isset($pubcount[$id]) && $pubcount[$id] > 0) {
- $item['pubtitle'] = $pubtype['descr'];
- if (isset($ptid) && $ptid == $id) {
- $item['publink'] = '';
- } else {
- $item['publink'] = pnModURL('articles','user','view',array('ptid' => $id));
- }
- $item['pubcount'] = $pubcount[$id];
- $publinks[] = $item;
- } else {
- // $output->Text($pubtype['descr']);
- }
- }
-
- return $publinks;
}
--- 553,556 ----
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 |