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 |
$res = mysql_query($sql); |
29 |
if(!$res) return false; |
30 |
|
31 |
$row = mysql_fetch_row($res); |
32 |
|
33 |
$contentdata = array( |
34 |
'content' => $row[0], |
35 |
'description' => $row[1], |
36 |
'unixtime' => $row[2], |
37 |
'language_name' => $row[3], |
38 |
'creator_name' => $row[4] |
39 |
); |
40 |
|
41 |
return $contentdata; |
42 |
|
43 |
} |
44 |
|
45 |
//------------------------------------------------------------------------------ |
46 |
|
47 |
?> |