Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Problema su top menesio ir savaites

Parašė feelsoundas· 2011 Rugs. 6 17:09:33
#1

Sveiki,

Turiu problema su mėnesio ir savaitės panele. Versija: V7.02.03.
I pridetinius:


    <?php
    $result = dbquery("ALTER TABLE ".$db_prefix."downloads ADD download_count_s INT UNSIGNED NOT NULL ,
    ADD download_count_m INT UNSIGNED NOT NULL");
    $result = dbquery("ALTER TABLE ".$db_prefix."settings ADD menesis TINYINT( 2 ) UNSIGNED NOT NULL ,
    ADD savaite TINYINT( 2 ) UNSIGNED NOT NULL");
    ?>


I downloads.php pakeisti:


download_count=download_count+1, download_count_s=download_count_s+1, download_count_m=download_count_m+1


Ir panele:


 
if (date("m", time()) != $settings['menesis']) {
 
$result = dbquery("UPDATE ".$db_prefix."downloads SET download_count_m='0'");
 
$result = dbquery("UPDATE ".$db_prefix."settings SET menesis='".date("m", time())."'");
 
}
 
if (date("W", time()) != $settings['savaite']) {
 
$result = dbquery("UPDATE ".$db_prefix."downloads SET download_count_s='0'");
 
$result = dbquery("UPDATE ".$db_prefix."settings SET savaite='".date("W", time())."'");
 
}
 
 
 
echo "<table width='100%'>
 
<tr>
 
<td width='33%'>";
 
openside("Savaitės topas");
 
 
 
echo "<div class='side-label'><b></b></div>\n";
 
$result = dbquery("SELECT download_cat, download_title, download_count_s FROM ".$db_prefix."downloads ORDER BY download_count_s DESC LIMIT 20");
 
if (dbrows($result) != 0) {
 
 
 
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
 
 
 
while($data = dbarray($result)) {
 
 
 
$itemsubject = trimlink($data['download_title'], 40);
 
echo "<tr>\n<td class='small'><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."downloads.php?cat_id=".$data['download_cat']."&download_id=".$data['download_id']."' title='".$data['download_title']."' class='side'>$itemsubject</a></td>\n
 
<td align='right'>".$data['download_count_s']."</td>\n</tr>\n";
 
}
 
echo "</table>";
 
 
 
} else {
 
echo "<center>".$locale['004']."</center>\n";
 
}
 
closeside();
 
 
 
 
 
echo "</td>
 
 
 
<td width='33%'>";
 
openside("Mėnėsio topas");
 
echo "<div class='side-label'><b></b></div>\n";
 
 
 
$result = dbquery("SELECT download_cat, download_title, download_count_m FROM ".$db_prefix."downloads ORDER BY download_count_m DESC LIMIT 20");
 
if (dbrows($result) != 0) {
 
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
 
while($data = dbarray($result)) {
 
$itemsubject = trimlink($data['download_title'], 40);
 
echo "<tr>\n<td class='small'><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."downloads.php?cat_id=".$data['download_cat']."&download_id=".$data['download_id']."' title='".$data['download_title']."' class='side'>$itemsubject</a></td>\n
 
<td align='right'>".$data['download_count_m']."</td>\n</tr>\n";
 
}
 
echo "</table>";
 
} else {
 
echo "<center>".$locale['004']."</center>\n";
 
}
 
 
 
closeside();
 
echo "</tr>
 
</table>";
 



Viskas butu kaip ir gerai, atvaizduoja puikiai nuorodas. Bet yra problema kad MYSQL DB negauna UPDATE uzklausos (bent taip as supratau). Todel paskui paneleje neatvaizduoja kiek kartu siustasi...

Gal pagelbesit? Aciu.