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] |
| 28 Jul 2002 01:39:14 | postnuke_modules/articles | pnuser.php,1.28,1.29 | Mike |
| templating article display | |||
Update of /home/cvsroot/postnuke_modules/articles
In directory ns7.hostnuke.net:/tmp/cvs-serv27172
Modified Files:
pnuser.php
Log Message:
templating article display
Index: pnuser.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pnuser.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** pnuser.php 11 Jul 2002 00:08:47 -0000 1.28
--- pnuser.php 28 Jul 2002 01:39:11 -0000 1.29
***************
*** 242,262 ****
/*
* End of Mike�s modification
- *
- * Hmmm, why were you retrieving the articles here *again* ?
-
- // Get articles
- // Retrive an array of stories
- $articles = pnModAPIFunc
- (
- 'articles',
- 'user',
- 'getall',
- array
- (
- 'startnum' => $startnum,
- 'cids' => $cids,
- 'numitems' => $numitems
- )
- );
*/
--- 242,245 ----
***************
*** 315,319 ****
$output->Linebreak(2);
! // TODO: make count depend on publication type (and language in the future)
$output->Pager($startnum,
pnModAPIFunc('articles', 'user', 'countitems', array('cids' => $cids, 'ptid' => (isset($ptid) ? $ptid : null) )),
--- 298,302 ----
$output->Linebreak(2);
! // TODO: make count depend on language in the future
$output->Pager($startnum,
pnModAPIFunc('articles', 'user', 'countitems', array('cids' => $cids, 'ptid' => (isset($ptid) ? $ptid : null) )),
***************
*** 353,374 ****
}
- // 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);
- }
-
// Load API
if (!pnModAPILoad('articles', 'user')) {
! $output->Text(_LOADFAILED);
! return $output->GetOutput();
}
--- 336,342 ----
}
// Load API
if (!pnModAPILoad('articles', 'user')) {
! return _LOADFAILED;
}
***************
*** 384,388 ****
if (!is_array($article)) {
! $output->Text(_ARTICLESITEMFAILED);
}
--- 352,356 ----
if (!is_array($article)) {
! return _ARTICLESITEMFAILED;
}
***************
*** 390,395 ****
// their name and description) for this article at once
if (!pnModAPILoad('categories', 'user')) {
! $output->Text(_LOADFAILED);
! return $output->GetOutput();
}
$cids = pnModAPIFunc('categories',
--- 358,362 ----
// their name and description) for this article at once
if (!pnModAPILoad('categories', 'user')) {
! return _LOADFAILED;
}
$cids = pnModAPIFunc('categories',
***************
*** 401,405 ****
--- 368,374 ----
$icons = '';
// display one (or more) bread-crumb trails of categories
+ $trails = array();
foreach ($cids as $cid => $ids) {
+ $trailitem['cid'] = $cid;
$trail = pnModAPIFunc('categories',
'user',
***************
*** 409,422 ****
'getparents' => true));
// TODO: make sure permissions are taken into account here !
foreach ($trail as $info) {
! $output->URL(pnModURL('articles',
! 'user',
! 'view',
! array('cids' => array($info['cid']))),
! pnVarPrepForDisplay(pnVarCensor($info['name'])));
if ($info['cid'] != $cid) {
! $output->Text(" - ");
! } elseif (!empty($info['image'])) {
// TODO: improve the case where we have several icons :)
$icons .= '<a href="' .
pnModURL('articles','user','view',
--- 378,396 ----
'getparents' => true));
// TODO: make sure permissions are taken into account here !
+ $trailitem['parentlinks'] = array();
foreach ($trail as $info) {
! $item['link'] = pnModURL('articles',
! 'user',
! 'view',
! array('cids' => array($info['cid'])));
! $item['title'] = pnVarPrepForDisplay(pnVarCensor($info['name']));
if ($info['cid'] != $cid) {
! $item['join'] = ' - ';
! } else {
! $item['join'] = '';
! }
! $trailitem['parentlinks'][] = $item;
// TODO: improve the case where we have several icons :)
+ if ($info['cid'] == $cid && !empty($info['image'])) {
$icons .= '<a href="' .
pnModURL('articles','user','view',
***************
*** 428,466 ****
}
}
! $output->Linebreak();
}
! $output->Linebreak();
! $output->SetInputMode(_PNH_PARSEINPUT);
// Display article
- /*
- // Title
- $output->Text(_ARTICLESTITLE . ': ');
- $output->Text(pnVarCensor($article['title']));
- $output->Linebreak(2);
-
- // Author
- $output->Text(_ARTICLESAUTHOR . ': ');
- $output->Text(pnUserGetVar('name', $article['authorid']));
- $output->Linebreak(2);
-
- // Date published
- $output->Text(_ARTICLESDATE . ': ');
- $output->Text(strftime(_DATETIMELONG, $article['pubdate']));
- $output->Linebreak(2);
-
- // Summary
- $output->Text(_ARTICLESSUMMARY . ': ');
- $output->SetInputMode(_PNH_VERBATIMINPUT);
- $output->Text(pnVarPrepHTMLDisplay(pnVarCensor($article['summary'])));
- $output->SetInputMode(_PNH_PARSEINPUT);
- $output->Linebreak(4);
-
- // Body
- $output->SetInputMode(_PNH_VERBATIMINPUT);
- $output->Text(pnVarPrepHTMLDisplay(pnVarCensor($article['body'])));
- $output->SetInputMode(_PNH_PARSEINPUT);
- $output->Linebreak(2);
- */
// TODO: improve the case where we have several icons :)
--- 402,410 ----
}
}
! $trails[] = $trailitem;
}
! $article['trails'] = $trails;
// Display article
// TODO: improve the case where we have several icons :)
***************
*** 478,506 ****
$article['date'] = strftime(_DATETIMELONG, $article['pubdate']);
}
! $template = $pubtypes[$article['pubtypeid']]['name'];
! $out = pnModTemplate('articles', 'user', $template . '-content', $article);
!
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text($out);
! $output->SetInputMode(_PNH_PARSEINPUT);
// Hooks
! $output->SetInputMode(_PNH_VERBATIMINPUT);
! $output->Text(pnModCallHooks('item',
! 'display',
! $aid,
! pnModURL('articles',
! 'user',
! 'display',
! array('aid' => $aid))));
! $output->SetInputMode(_PNH_PARSEINPUT);
! $output->URL(pnModURL('articles',
! 'user',
! 'viewmap',
! array()),
! pnML('View Article Map'));
! return $output->GetOutput();
}
--- 422,444 ----
$article['date'] = strftime(_DATETIMELONG, $article['pubdate']);
}
!
! // Navigation links
! $article['publinks'] = articles_user_getpublinks();
! $article['maplink'] = pnModURL('articles','user','viewmap',array());
// Hooks
! $article['hooks'] = pnModCallHooks('item',
! 'display',
! $aid,
! pnModURL('articles',
! 'user',
! 'display',
! array('aid' => $aid)));
! // Template depending on publication type
! $template = $pubtypes[$article['pubtypeid']]['name'];
! // return template out
! return pnModTemplate('articles', 'user', $template . '-content', $article);
}
***************
*** 628,631 ****
--- 566,602 ----
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;
}
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 |