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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by rabit, Mon Aug 30 04:16:24 2004 UTC revision 1.4 by joko, Tue Aug 31 09:42:06 2004 UTC
# Line 9  Line 9 
9    
10  function cms_getcontent($type, $keyname, $language_id = 0) {  function cms_getcontent($type, $keyname, $language_id = 0) {
11    
12    $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;";    $sql = "SELECT contents.content, contents.description, UNIX_TIMESTAMP(contents.timestamp), languages.name, users.name, contents.keyname 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    
14    $res = mysql_query($sql);    $res = mysql_query($sql);
15    if(!$res) return false;    if(!$res) return false;
# Line 21  function cms_getcontent($type, $keyname, Line 21  function cms_getcontent($type, $keyname,
21     'description' => $row[1],     'description' => $row[1],
22     'unixtime' => $row[2],     'unixtime' => $row[2],
23     'language_name' => $row[3],     'language_name' => $row[3],
24     'creator_name' => $row[4]     'creator_name' => $row[4],
25       'keyname' => $row[5],
26    );    );
27    
28    return $contentdata;    return $contentdata;
# Line 42  function cms_getlist($types, $keynames, Line 43  function cms_getlist($types, $keynames,
43    
44    return $rows;    return $rows;
45    
46    }
47    
48    //----------------------------------------------------------
49    
50    function cms_getindex($type) {
51    
52      $sql = "
53    SELECT contents.id, contents.keyname, contents.description,
54            UNIX_TIMESTAMP(contents.timestamp) as timestamp, languages.id,
55            languages.name as lang, users.name as creator
56    FROM contents, languages, users
57    WHERE contents.type='$type' AND users.id=contents.creator_id AND languages.id=contents.language_id;";
58    
59      $res = mysql_query($sql);
60    
61      $rowcount = 0;
62    
63      while($row = mysql_fetch_assoc($res)) $rows[$rowcount++] = $row;
64    
65      return $rows;
66    
67  }  }
68    
69  //----------------------------------------------------------  //----------------------------------------------------------

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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