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 12:13:49 | postnuke_modules/articles | pnuserapi.php,1.22,1.23 | Mike |
| add getpublinks function | |||
Update of /home/cvsroot/postnuke_modules/articles
In directory ns7.hostnuke.net:/tmp/cvs-serv8201
Modified Files:
pnuserapi.php
Log Message:
add getpublinks function
Index: pnuserapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pnuserapi.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** pnuserapi.php 28 Jul 2002 23:20:33 -0000 1.22
--- pnuserapi.php 29 Jul 2002 12:13:47 -0000 1.23
***************
*** 302,305 ****
--- 302,356 ----
/**
+ * get array of links and counts for publication types
+ * @param $args['ptid'] optional publication type ID for which you *don't*
+ * want a link (e.g. for the current publication type)
+ * @param $args['all'] optional flag (1) if you want to include publication
+ * types that don't have articles too (default 0)
+ * @returns array
+ * @return array of array('pubtitle' => descr,
+ * 'pubid' => id,
+ * 'publink' => link,
+ * 'pubcount' => count)
+ */
+ function articles_userapi_getpublinks($args)
+ {
+ // Get arguments from argument array
+ extract($args);
+
+ // Argument check
+ if (!isset($ptid)) {
+ $ptid = null;
+ }
+ if (!isset($all)) {
+ $all = 0;
+ }
+
+ // 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) || $all) {
+ $item['pubtitle'] = $pubtype['descr'];
+ $item['pubid'] = $id;
+ if (isset($ptid) && $ptid == $id) {
+ $item['publink'] = '';
+ } else {
+ $item['publink'] = pnModURL('articles','user','view',array('ptid' => $id));
+ }
+ if (isset($pubcount[$id])) {
+ $item['pubcount'] = $pubcount[$id];
+ } else {
+ $item['pubcount'] = 0;
+ }
+ $publinks[] = $item;
+ }
+ }
+
+ return $publinks;
+ }
+
+ /**
* get the name and description of all publication types
* @returns array
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 |