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