/[cvs]/nfo/site/htdocs/inc/cms/cms.php.inc
ViewVC logotype

Annotation of /nfo/site/htdocs/inc/cms/cms.php.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Mon Aug 30 04:16:24 2004 UTC (20 years ago) by rabit
Branch: MAIN
Changes since 1.2: +20 -16 lines
+ List query function (cms_getlist())

1 rabit 1.1 <?php
2     /*------------------------------------------------------------------------------
3     --- www.netfrag.org
4     --- Content management functions include file.
5     --------------------------------------------------------------------------------
6     --- rabit, 01:04 27.08.2004
7 rabit 1.3 --- $Id$
8 rabit 1.1 ------------------------------------------------------------------------------*/
9    
10     function cms_getcontent($type, $keyname, $language_id = 0) {
11    
12 rabit 1.3 $sql = "SELECT contents.content, contents.description, UNIX_TIMESTAMP(contents.timestamp), languages.name, users.name FROM contents, languages, users WHERE contents.type='$type' AND contents.keyname='$keyname'" . ($language_id ? " AND languages.id='$language_id'" : '') . " AND users.id=contents.creator_id AND languages.id=contents.language_id LIMIT 0,1;";
13 rabit 1.1
14     $res = mysql_query($sql);
15     if(!$res) return false;
16    
17     $row = mysql_fetch_row($res);
18    
19     $contentdata = array(
20     'content' => $row[0],
21     'description' => $row[1],
22     'unixtime' => $row[2],
23     'language_name' => $row[3],
24     'creator_name' => $row[4]
25     );
26    
27     return $contentdata;
28    
29     }
30 rabit 1.3
31     //----------------------------------------------------------
32    
33     function cms_getlist($types, $keynames, $daterange = '', $languageids = '', $languages = '') {
34    
35     $sql = "SELECT contents.id, contents.description, UNIX_TIMESTAMP(contents.timestamp), languages.id, languages.name, users.name FROM contents, languages, users WHERE contents.type='$types' AND contents.keyname='$keynames' AND users.id=contents.creator_id AND languages.id=contents.language_id;";
36    
37     $res = mysql_query($sql);
38    
39     $rowcount = 0;
40    
41     while($row = mysql_fetch_row($res)) $rows[$rowcount++] = $row;
42    
43     return $rows;
44    
45     }
46    
47     //----------------------------------------------------------
48 rabit 1.1
49     //------------------------------------------------------------------------------
50    
51     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed