Xaraya / Postnuke CVS Notices - Message

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 Notice

Directory filter : [ all ] / postnuke_modules / articles [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
05 Aug 2002 23:17:13postnuke_modules/articlespnuser.php,1.40,1.41 pnuserapi.php,1.33,1.34Mike
 search by author and use pnVarSetCached for info useful in blocks

Update of /home/cvsroot/postnuke_modules/articles
In directory ns7.hostnuke.net:/tmp/cvs-serv5461

Modified Files:
	pnuser.php pnuserapi.php 
Log Message:
search by author and use pnVarSetCached for info useful in blocks


Index: pnuser.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pnuser.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** pnuser.php	5 Aug 2002 01:46:02 -0000	1.40
--- pnuser.php	5 Aug 2002 23:17:11 -0000	1.41
***************
*** 44,50 ****
      list($startnum,
           $cids,
!          $ptid) = pnVarCleanFromInput('startnum',
!                                       'cids',
!                                       'ptid');
  
      // Default parameters
--- 44,52 ----
      list($startnum,
           $cids,
!          $ptid,
!          $authorid) = pnVarCleanFromInput('startnum',
!                                           'cids',
!                                           'ptid',
!                                           'authorid');
  
      // Default parameters
***************
*** 55,59 ****
  // Example : show only frontpage-approved news articles by default
      // publication type ID (for news, sections, reviews, ...)
!     if (!isset($cids) && !isset($ptid)) {
          $ishome = 1;
          // news articles
--- 57,61 ----
  // Example : show only frontpage-approved news articles by default
      // publication type ID (for news, sections, reviews, ...)
!     if (!isset($cids) && !isset($ptid) && !isset($authorid)) {
          $ishome = 1;
          // news articles
***************
*** 66,69 ****
--- 68,74 ----
          $status = array(3,2);
      }
+     if (!isset($authorid)) {
+         $authorid = '';
+     }
  
      // Create output object
***************
*** 115,118 ****
--- 120,124 ----
                                     'cids' => $cids,
                                     'ptid' => (isset($ptid) ? $ptid : null),
+                                    'authorid' => $authorid,
                                     'numitems' => $numitems,
                                     'status' => $status,
***************
*** 320,323 ****
--- 326,330 ----
                                  array('cids' => $cids,
                                        'ptid' => (isset($ptid) ? $ptid : null),
+                                       'authorid' => $authorid,
                                        'status' => $status,
                                        'enddate' => time())),
***************
*** 414,419 ****
--- 421,428 ----
      // 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',
***************
*** 469,472 ****
--- 478,482 ----
          $data['summary'] = $article['summary'];
      } else {
+         $data['author'] = '';
          $data['summary'] = '';
      }
***************
*** 504,507 ****
--- 514,524 ----
                                               array('aid' => $aid,
                                                     'ptid' => $ptid)));
+ 
+     // Save some variables to (temporary) cache for use in blocks etc.
+     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']);
  
      // Template depending on publication type

Index: pnuserapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pnuserapi.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** pnuserapi.php	5 Aug 2002 01:46:03 -0000	1.33
--- pnuserapi.php	5 Aug 2002 23:17:11 -0000	1.34
***************
*** 928,931 ****
--- 928,936 ----
          $path = '/' . $module . '/';
      } elseif ($func == 'view') {
+ // TODO: review logic of possible combinations
+         if (isset($authorid) && $authorid > 1) {
+             $path = '/' . $module . '/' . pnML('by_author') . '/'
+                     . $authorid . '.html';
+         }
          if (isset($ptid) && isset($pubtypes[$ptid])) {
              $path = '/' . $module . '/' . $pubtypes[$ptid]['name'] . '/';
***************
*** 1049,1052 ****
--- 1054,1063 ----
          }
          return array('archive', $args);
+ 
+     } elseif ($params[1] == pnML('by_author')) {
+         if (!empty($params[2]) && preg_match('/^(\d+)/',$params[2],$matches)) {
+             $args['authorid'] = $matches[1];
+             return array('view', $args);
+         }
  
      } elseif (preg_match('/^c(\d+)/',$params[1],$matches)) {


Directory filter : [ all ] / postnuke_modules / articles [ view in CVS ]

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