Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
defined('_VALID_INCLUDE') or die('Direct access to this file not allowed.');
defined('_VALID_CRINC') or die();
include "FCKEditor/fckeditor3.php";
//===================================================
// UPDATE VIEWS
//-----------------------------------------------------------------
mysql_query("UPDATE ccms_news SET views = views + 1 WHERE id='$_REQUEST[id]'");
//===================================================
// DISPLAY REQUESTED NEWS
//-----------------------------------------------------------------
$news_story = mysql_query("SELECT * FROM ccms_news WHERE id='$_REQUEST[id]'");
while ($row = mysql_fetch_assoc($news_story)) {
$id = $row[id];
$title = $row[title];
$prev_news = $row[prev_news];
$date = $row[date];
$source = $row[source];
$authemail = $row[email];
$source = $row[source];
$news = str_replace("<a ", "<a class=\"content\"", $row[news]);
$news2 = str_replace("<a ", "<a class=\"content\"", $row[news2]);
$views = $row[views];
$author = $row[author];
$ntimestamp = $row[timestamp];
$linked_console = $row[platform];
$linked_game = $row[game];
$allow_rating = $row[allow_rating];
$allow_comments = $row[allow_comments];
$q = mysql_query("SELECT * from ccms_news_comments WHERE w_id='$id'");
$count = mysql_num_rows($q);
//===================================================
// DISPLAY TEMPLATE
//-----------------------------------------------------------------
$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);
$title_seo_glob = str_replace(' ', '-', $title_start);
echo " <table border=\"0\" width=\"700px\" cellspacing=\"0\" cellpadding=\"8\">
<tr>
<td width=\"700px\">
<SPAN class=\"texthuge\">$row[title]</SPAN><br />
<SPAN class=\"contentlight\">$lang_posted_by <a class=\"contentlight\" href=\"profile-$author.html\">$author</a>, ";
//===================================================
// DATE & TIME DISPLAY
//-----------------------------------------------------------------
if ($ntimestamp == "0" || !$ntimestamp) {
echo "$lang_on $date";
} else {
//Display "time ago" format (dynamic). See dates.php to mess around with my code
echo timedisplay($ntimestamp);
//Display regular comment time format (static)
//echo date("$time_an", $ntimestamp);
}
//===================================================
echo " <img border=\"0\" src=\"images/date.gif\" align=\"absmiddle\" alt=\"";
if ($ntimestamp == "0" || !$ntimestamp) {
echo date("$time_an", $ntimestamp);
} else {
echo "$date";
}
echo "\"></SPAN>
</td>
</tr>\n";
if (!$linked_console && !$linked_game) {
} else {
echo " <tr>
<td width=\"100%\">\n";
//===================================================
// GAME NAVIGATION BAR
//-----------------------------------------------------------------
include "includes/gamebar.php";
//===================================================
echo " </td>
</tr>\n";
}
echo " </td>
</tr>
<tr>
<td width=\"700px\"><DIV class=\"content\">$news</DIV></td>
</tr>\n";
if (!$news2) {
} else {
//===================================================
// DISPLAY ADVERTISMENT IN NEWS GAP
//-----------------------------------------------------------------
if ($uads == '1') {
$adspot = mysql_query("SELECT * from ccms_ads where location='News' order by rand() limit 1");
while ($row = mysql_fetch_assoc($adspot)) {
echo " <tr>
<td width=\"100%\" class=\"adsplit\" align=\"center\">";
if ($row[code_img] == 'code') {
echo "$row[code]";
}
if ($row[code_img] == 'img') {
echo "<a href=\"$row[link]\" target=\"_new\"><img border=\"0\" src=\"$row[imgurl]\"></a>";
}
echo " </td>
</tr>
<tr>\n";
}
}
//===================================================
// DISPLAY PART TWO OF THE NEWS
//-----------------------------------------------------------------
echo " <tr>
<td width=\"100%\"><a name=\"#part2\"><DIV class=\"content\">$news2</DIV></td>
</tr>\n";
}
//===================================================
// SHOW PREVIOUS / NEXT NEWS RESULT
//-----------------------------------------------------------------
echo " <tr>
<td width=\"100%\"><SPAN class=\"content\">\n";
$previous_story = mysql_query("SELECT * from ccms_news WHERE id < '$_REQUEST[id]' ORDER BY id DESC LIMIT 1");
while ($row = mysql_fetch_assoc($previous_story)) {
$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);
echo " <SPAN class=\"content\"><img src=\"images/prev.gif\" align=\"absmiddle\" /> <strong>$lang_previous:</strong> <a class=\"content\" href=\"story-$row[id]-$title_seo.html\">$row[title]</a><br />";
}
$next_story = mysql_query("SELECT * from ccms_news WHERE id > '$_REQUEST[id]' ORDER BY id ASC LIMIT 1");
while ($row = mysql_fetch_assoc($next_story)) {
$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);
echo " <SPAN class=\"content\"><img src=\"images/next.gif\" align=\"absmiddle\" /> <strong>$lang_next:</strong> <a class=\"content\" href=\"story-$row[id]-$title_seo.html\">$row[title]</a>";
}
echo " </td>
</tr>
</table>\n";
//===================================================
// RATING & SOCIAL BOOKMARKING
//-----------------------------------------------------------------
[color=red]
тук трябва да са бутоните за споделяне...[/color]
//===================================================
// COMMENTS DIVIDER
//-----------------------------------------------------------------
$divtitle = "$lang_comments";
include "templates/$skin/divtitle.php";
//===================================================
echo " <table border=\"0\" width=\"700px\" cellspacing=\"0\" cellpadding=\"8\">
<tr>
<td width=\"100%\"><SPAN class=\"content\">";
//===================================================
// COMMENT RULES
//-----------------------------------------------------------------
echo " <fieldset class=\"fieldset\">
<legend><SPAN class=\"reg_text\"><strong>$lang_commentrules</strong></SPAN></legend>
<DIV class=\"padding10\">
<SPAN class=\"reg_text\">\n";
include "pages/commentrules.php";
echo " </SPAN>
</DIV>
</fieldset>\n";
?>
<form action="story-<?echo "$_REQUEST[id]"?>-<?echo "$title_seo_glob"?>.html" method="post">
<?php
//===================================================
// COMMENTS
//-----------------------------------------------------------------
$query = "SELECT * from ccms_news where id='$_REQUEST[id]'";
$result = mysql_query($query);
if (!$username || $access_comments == '0') {
if (!$username) {
echo "<br /><SPAN class=\"content_large\"><strong>$lang_you_must_login_comments</strong></SPAN>";
} else {
echo "<br /><SPAN class=\"content_large\"><strong>$lang_not_allowed_comment</strong></SPAN>";
}
} else {
while ($rows = mysql_fetch_row($result)) {
//===================================================
// FLOOD CONTROL
//------------------------------------------------------------------
$fctrl = mysql_query("SELECT lastinsert from ccms_user where username='$username'");
while ($row = mysql_fetch_assoc($fctrl)) {
$lastinsert = $row[lastinsert];
}
$today = time();
$difference = $today - $lastinsert;
$difference -= 84600 * floor($difference / 84600);
$difference -= 3600 * floor($difference / 3600);
if (floor($difference / 60) > 0) {
$thedate = date("$time_c");
echo " <input name=\"w_id\" type=\"hidden\" value=\"$_REQUEST[id]\">
<input name=\"name\" type=\"hidden\" value=\"$username\">
<input name=\"ip\" type=\"hidden\" value=\"$_SERVER[REMOTE_ADDR]\">";
$oFCKeditor = new FCKeditor('comment') ;
$oFCKeditor->BasePath = 'FCKEditor/';
$oFCKeditor->Value = "";
$oFCKeditor->Create() ;
echo " <input type=\"hidden\" name=\"vdate\" value=\"$thedate\">
<input type=\"image\" src=\"$imagepath/submit.jpg\" name=\"SUBMIT\" value=\"SUBMIT\" vspace=\"2\">
</form></SPAN>\n";
}
}
}
//===================================================
// INSERT COMMENT INTO DATABASE
//-----------------------------------------------------------------
if (!$_POST[comment]) {
} else {
$comment = str_replace("'", "’", $_POST[comment]);
mysql_query("INSERT INTO ccms_news_comments (w_id,name,ip,comment,date,timestamp) VALUES ('$_POST[w_id]','$_POST[name]','$_POST[ip]','$comment','$_POST[vdate]','$timestamp')");
mysql_query("UPDATE ccms_user SET lastinsert='$timestamp' WHERE username='$username'");
}
echo " </SPAN>
</td>
</tr>
</table>\n";
//===================================================
// COMMENT REPORTING
//------------------------------------------------------------------
if ($_REQUEST[op] == "reportcomment") {
mysql_query("UPDATE ccms_news_comments set flagged='1', flagged_by='$username' where id='$_REQUEST[commentid]' order by id asc");
}
//===================================================
// COMMENT DISPLAY
//-----------------------------------------------------------------
$commentnum = mysql_query("SELECT * from ccms_news_comments where w_id='$_REQUEST[id]' order by id asc");
$num = mysql_num_rows($commentnum);
if ($num < 1) {
} else {
echo " <table width=\"96%\" align=\"center\" $tablereg>";
$c = 1;
while($row = mysql_fetch_array($commentnum)) {
if ($odd = $c%2 ) {
$style = "$tdreg2";
} else {
$style = "$tdreg";
}
$c_comment = $row[comment];
$c_un = $row[name];
$c_date = $row[date];
$c_id = $row[id];
$c_timestamp = $row[timestamp];
if ($user_system == "ccms") {
$user_details = mysql_query("SELECT * FROM ccms_user where username='$c_un'");
while ($r = mysql_fetch_assoc($user_details)) {
$c_country = $r[country];
$c_utitle = $r[title];
$c_avatar = $r[avatar];
}
}
$posts_counter = mysql_query("SELECT * FROM ccms_news_comments where name='$c_un'");
$countposts = mysql_num_rows($posts_counter);
include "templates/$skin/comment_display.php";
$c++;
}
echo " </table>";
}
}
echo "<img src=\"images/spacer2.gif\">\n";
?>
<iframe width="468" scrolling="no" height="60" src="http://www.shopping.bg/ad/MzI3/MTIw/ZzZ4cGR2ank0NQ==/b/" frameborder="0"></iframe>