<?php
/*--------------------------------------------+
| PHP-Fusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."games.php";
if (!isset($cat_id)) {
opentable($locale['400']);
echo "<table border='3' cellpadding='1' cellspacing='1' width='100%'class='tbl'>
<tr><td align='center' valign='top' width='50%'><img src='".BASEDIR."images/games.jpg' alt='".$locale['414']."'></a></span>";
//settings
//0 = no, 1= yes
//show author?
$ticker_author = "0";
//show date?
$ticker_date = "0";
//show commentcount?
$ticker_comments = "0";
//show readcounts?
$ticker_reads = "0";
//the higher the value the slower, default is 100
$ticker_speed = "100";
//ticker width? (use either % or px values)
$ticker_width = "100%";
$tickerquery = dbquery("SELECT tn.*, tu.user_id,user_name ,COUNT(comment_item_id) AS game_comments
FROM ".$db_prefix."game tn
LEFT JOIN ".$db_prefix."users tu ON tn.game_name=tu.user_id
LEFT JOIN ".$db_prefix."comments ON game_id=comment_item_id AND comment_type='K'
GROUP BY game_id
ORDER BY game_datestamp DESC LIMIT 0,10");
$ticker_content = "<marquee Behavior='scroll' Direction='right' ScrollDelay='".$ticker_speed."' align='right' width='".$ticker_width."' onmouseover='this.stop()' onmouseout='this.start()'>";
while($data = dbarray($tickerquery)) {
$ticker_content .= "<span style='font-weight:bold;'><a href=\"".BASEDIR."games.php?game_id=".$data['game_id']."\"><img src='".BASEDIR."images/flashe/".$data['game_subject'].".gif' style='border: 1px solid #000; width: 70px; height: 59px; alt='".$data['game_subject']."' border='0'></a></span> ";
if($ticker_author+$ticker_date+$ticker_comments+$ticker_reads != "0" ) {
$ticker_content .= "[";
if($ticker_author == "1") {
$ticker_content .= $locale['040'].$data[user_name];
if($ticker_date+$ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_date == "1") {
$ticker_content .= showdate("shortdate", $data['game_datestamp']);
if($ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_comments == "1") {
$ticker_content .= $data['game_comments'] .$locale['043'];
if($ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_reads == "1") {
$ticker_content .= $locale['413'] .$data['game_reads'] .$locale['412'];
}
$ticker_content .= "]";
}
$ticker_content .= " ";
}
$ticker_content .= "</marquee></td></tr></table>";
echo $ticker_content;
$result = dbquery("SELECT * FROM ".$db_prefix."game_cats ORDER BY game_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$column = 0;
echo "<table width='100%' cellspacing='0' cellpadding='0' class='tbl'>\n";
echo "<tr><td>
<table border='3' cellpadding='1' cellspacing='1' width='100%'>
<tr><td align='center' valign='top' width='50%'>".$locale['408']." <span class='small2'></td></tr></table>";
echo "<td>
<table border='3' cellpadding='1' cellspacing='1' width='100%'>
<tr><td align='center' valign='top' width='50%'>".$locale['409']." <span class='small2'></td></tr></table></td>";
echo "<td>
<table border='3' cellpadding='1' cellspacing='1' width='100%'>
<tr><td align='center' valign='top' width='50%'>".$locale['410']." <span class='small2'></td></tr></table></td>";
while ($data = dbarray($result)) {
if (checkgroup($data['game_cat_access'])) {
if ($column == 0) { $row1 = "<tr>\n"; } else { $row1 = ""; }
if ($column == 1) { $row2 = "</tr>\n"; $column=-1; } else { $row2 = ""; }
$column++;
$num = dbcount("(game_cat)", "game", "game_cat='".$data['game_cat_id']."'");
echo $row1."<tr><td>
<table border='2' cellpadding='1' cellspacing='1' width='100%'>
<tr><td align='center' valign='top' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['game_cat_id']."'>".$data['game_cat_name']."</a> <span class='small2'></table><td>
<table border='1' cellpadding='1' cellspacing='1' width='100%'>
<tr><td align='center' valign='top' width='50%'>($num)</span></table>
\n";
if ($data['game_cat_description'] != "") echo "<td>
<table border='2' cellpadding='1' cellspacing='1' width='100%'>
<tr><td align='center' valign='top' width='50%'>\n<span class='small'>".$data['game_cat_description']."</span></table>\n";
echo "</td></tr>\n".$row1;
}
}
echo "</tr>\n</table>\n";
} else {
echo "<center><br>\n".$locale['401']."<br><br>\n</center>\n";
}
echo "<table border='3' cellpadding='1' cellspacing='1' width='100%' class='tbl'>
<tr><td align='center' valign='top' width='50%'><img src='".BASEDIR."images/games2.jpg' alt='".$locale['411']."'></a>";
//settings
//0 = no, 1= yes
//show author?
$ticker_author = "0";
//show date?
$ticker_date = "0";
//show commentcount?
$ticker_comments = "0";
//show readcounts?
$ticker_reads = "0";
//the higher the value the slower, default is 100
$ticker_speed = "100";
//ticker width? (use either % or px values)
$ticker_width = "100%";
$tickerquery = dbquery("SELECT tn.*, tu.user_id,user_name ,COUNT(comment_item_id) AS game_comments
FROM ".$db_prefix."game tn
LEFT JOIN ".$db_prefix."users tu ON tn.game_name=tu.user_id
LEFT JOIN ".$db_prefix."comments ON game_id=comment_item_id AND comment_type='K'
GROUP BY game_id
ORDER BY game_reads DESC LIMIT 0,10");
$ticker_content = "<marquee Behavior='scroll' Direction='left' ScrollDelay='".$ticker_speed."' width='".$ticker_width."' onmouseover='this.stop()' onmouseout='this.start()'>";
while($data = dbarray($tickerquery)) {
$ticker_content .= "<span style='font-weight:bold;'><a href=\"".BASEDIR."games.php?game_id=".$data['game_id']."\"><img src='".BASEDIR."images/flashe/".$data['game_subject'].".gif' style='border: 1px solid #000; width: 70px; height: 59px; alt='".$data['game_subject']."' border='0'></a></span> ";
if($ticker_author+$ticker_date+$ticker_comments+$ticker_reads != "0" ) {
$ticker_content .= "[";
if($ticker_author == "1") {
$ticker_content .= $locale['040'].$data[user_name];
if($ticker_date+$ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_date == "1") {
$ticker_content .= showdate("shortdate", $data['game_datestamp']);
if($ticker_comments+$ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_comments == "1") {
$ticker_content .= $data['game_comments'] .$locale['043'];
if($ticker_reads != "0"){
$ticker_content .= " | ";
}
}
if($ticker_reads == "1") {
$ticker_content .= $locale['413'] .$data['game_reads'] .$locale['412'];
}
$ticker_content .= "]";
}
$ticker_content .= " ";
}
$ticker_content .= "</marquee></td></tr></table>";
echo $ticker_content;
closetable();
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."game_cats WHERE game_cat_id='$cat_id'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['game_cat_access'])) {
$res = 1;
opentable($locale['400'].": ".$cdata['game_cat_name']);
$rows = dbcount("(game_id)", "game", "game_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."game WHERE game_cat='$cat_id' ORDER BY game_subject LIMIT $rowstart,15");
$numrows = dbrows($result); $i = 1;
echo "<table border='0' width='100%' cellpadding='0' cellspacing='1'>";
while ($data = dbarray($result)) {
if ($data['game_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='small'>[".$locale['402']."]</span>";
} else {
$new = "";
}
if($i%4 == 0) { $tr = "</tr><tr>"; }
elseif($i == 0) { $tr = "<tr>"; } else { $tr = "";}
if($i == $rows) { $tre = "</tr>"; } else { $tre = "";}
echo "$tr
<td align='center' class='tbl'>".$data['game_subject']."<br><a href='games.php?game_id=".$data['game_id']."' title='".$data['game_subject']."'><img src='".BASEDIR."images/flashe/".$data['game_subject'].".gif' style='border: 1px solid #000; width: 70px; height: 59px; alt='".$data['game_subject']."' border='0'></a><br>$new<br>".$locale['405']." ".$data['game_reads']."</td>$tre";
$i++;
}
echo "</table>";
closetable();
echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,15,$rows,3,FUSION_SELF."?cat_id=$cat_id&")."\n</div>\n";
} else {
echo "<center>".$locale['403']."</center>\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
require_once "side_right.php";
require_once "footer.php";
?>
Skoro potrafisz modyfikować wtyki/mody (sygnaturka), to dostosujesz sobie to do swoich potrzeb. możesz dać ulepszoną wersję na forum ;).
Nie pomagam na komunikatorach oraz PW!
|