4 |
--- Content management functions include file. |
--- Content management functions include file. |
5 |
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
6 |
--- rabit, 01:04 27.08.2004 |
--- rabit, 01:04 27.08.2004 |
7 |
--- $$id$$ |
--- $Id$ |
8 |
------------------------------------------------------------------------------*/ |
------------------------------------------------------------------------------*/ |
9 |
|
|
|
//---------------------------------------------------------- |
|
|
|
|
10 |
function cms_getcontent($type, $keyname, $language_id = 0) { |
function cms_getcontent($type, $keyname, $language_id = 0) { |
11 |
|
|
12 |
$sql = "SELECT |
$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;"; |
|
contents.content, contents.description, UNIX_TIMESTAMP(contents.timestamp), languages.name, users.name |
|
|
FROM |
|
|
contents, languages, users |
|
|
WHERE |
|
|
contents.type='$type' |
|
|
AND |
|
|
contents.keyname='$keyname' |
|
|
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; |
16 |
|
|
17 |
$row = mysql_fetch_row($res); |
$row = mysql_fetch_row($res); |
28 |
|
|
29 |
} |
} |
30 |
|
|
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 |
|
|
49 |
//------------------------------------------------------------------------------ |
//------------------------------------------------------------------------------ |
50 |
|
|
51 |
?> |
?> |