"; $rel_links .= ""; $i = 0; $connection = @mysql_connect($dbhost, $dbuser, $dbpass) or die ("Can not connect to database"); $db = @mysql_select_db($dbname, $connection) or die ("Can not select database."); $sql_rel = "SELECT co.id, co.name FROM $t_rel cr, $t_contents co WHERE content_id = '$cid' AND co.id=cr.releated_id AND co.active = '1' ORDER BY co.name"; $result_rel = mysql_query($sql_rel); while (list($cr_id, $cr_subject) = mysql_fetch_row($result_rel)) { $cr_subject = stripslashes($cr_subject); $i++; $rel_links .= ":: ".Translator($cr_id, "content", $user_lang, "subject", $cr_subject).""; if (is_int($i/3)) { $rel_links .= " "; } } $rel_links .= ""; $rel_links .= ""; // Print content page $filename = "$theme_root/$user_theme/contents.htm"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); // Print content if content is active if ($active == 1) { $contents = eregi_replace ("images", "$theme_url/$user_theme/images", $contents); $contents = eregi_replace ("---SUBJECT---", Translator($cid, "content", $user_lang, "subject", $subject), $contents); $contents = eregi_replace ("---CONTENT---", Translator($cid, "content", $user_lang, "body", $content), $contents); $contents = eregi_replace ("---DATE---", $date, $contents); $contents = eregi_replace ("---WRITER---", $writer, $contents); $contents = eregi_replace ("---HITS---", "".LANG_HITS.": ".$new_hit, $contents); $contents = eregi_replace ("---BACKTOCAT---", SelectTopContentCat($cat_id)." >>", $contents); $contents = eregi_replace ("---LANG_COMMENTS---", LANG_COMMENTS." ".LANG_ADD_COMMENT."", $contents); if (($action == "addcomment") && (isset($HTTP_COOKIE_VARS["dcp5_member_id"]))) { $contents .= "
".LANG_COMMENT.":
"; } else if (($action == "write") && (isset($HTTP_COOKIE_VARS["dcp5_member_id"]))) { $result = mysql_query("INSERT INTO $t_comments VALUES ('', '$cid', '".$HTTP_COOKIE_VARS["dcp5_member_id"]."', '".htmlspecialchars($comment)."', now(), '1')"); $contents .= LANG_COMMENT_ADDED; } $contents = eregi_replace ("---COMMENTS---", ContentComments($cid), $contents); if ($i > 0) { $contents = eregi_replace ("---LANG_RELLINKS---", LANG_RELLINKS, $contents); $contents = eregi_replace ("---RELLINKS---", $rel_links, $contents); } else { $contents = eregi_replace ("---LANG_RELLINKS---", "", $contents); $contents = eregi_replace ("---RELLINKS---", "", $contents); } // Print error if content is not active } else { $contents = eregi_replace ("images", "$theme_url/$user_theme/images", $contents); $contents = eregi_replace ("---SUBJECT---", LANG_UNACTIVECONTENT, $contents); $contents = eregi_replace ("---CONTENT---", LANG_UNACTIVECONTENTERR, $contents); $contents = eregi_replace ("---DATE---", "", $contents); $contents = eregi_replace ("---WRITER---", "", $contents); $contents = eregi_replace ("---HITS---", "", $contents); $contents = eregi_replace ("---BACKTOCAT---", SelectTopContentCat($cat_id)." >>", $contents); $contents = eregi_replace ("---LANG_RELLINKS---", "", $contents); $contents = eregi_replace ("---RELLINKS---", "", $contents); } echo $contents; @mysql_close($connection); echo PrintTheme("footer"); ?>