Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=19236
Postga havola
Clubmix [123] [off]
$totalcat = mysql_result(mysql_query("SELECT COUNT(*) FROM `downpath` WHERE `refid` = '" . $cat ."'"), 0);
if ($totalcat > 0) {
$zap = mysql_query("SELECT * FROM `downpath` WHERE `refid` = '" . $cat . "' ORDER BY `position`");
$cachetime = time()-$down_setting['cachetime']*3600;
if(is_file('download/cache/'.$cat.'.dat') && filemtime('download/cache/'.$cat.'.dat') > $cachetime)
{
$count_cache = file_get_contents('download/cache/'.$cat.'.dat');
$count_cache = unserialize($count_cache);
$opencache = 'true';
}else{
$count_cache = array();
}
$i = 0;
while ($zap2 = mysql_fetch_array($zap))
{
//echo ($i % 2) ? '<div class="menu">' : '<div class="menu">';
++$i;
if(!$count_cache[$zap2['id']])
{
$countf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type` != 1 AND `status` = 1 && `way` LIKE '" . $zap2['way'] ."%' "), 0);
$old = time() - (3 * 24 * 3600);
$countnf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type` != 1 AND `status` = 1 && `time` > '".$old."' && `way` LIKE '" . $zap2['way'] ."%' "), 0);
//$countp = mysql_result(mysql_query("SELECT COUNT(*) FROM `downpath` WHERE `way` LIKE '" . $zap2['way'] ."%';"), 0);
//$countp--; // if($countnf){ $countnf = '/<span class="red">+'.$countnf.'</span>'; }else{ $countnf = ''; }
$count_cache[$zap2['id']] = $countf.$countnf;
}
echo '<div class="menu"><img src="/img/2.gif" alt="*"> <a href="/download/dir_' . $zap2['id'] . '.html"> ' . $zap2['name'] .' </a> ('.$count_cache[$zap2['id']].') </div>';
// echo'</div>';
}
if(!$opencache && $arr = fopen('download/cache/'.$cat.'.dat', "w")){
fwrite($arr, serialize($count_cache));
fclose($arr);
//echo 'Кэш обновлен или создан!';
}
}
Mana shu kod downloaddagi papkalarni bosh sahifaga shiqaradigan kod ekan, Shu koddan faqat (palon papkada) nechta fayl borligini hisoblaydigan joyini olib beringlar + va rahmat mendan.
if ($totalcat > 0) {
$zap = mysql_query("SELECT * FROM `downpath` WHERE `refid` = '" . $cat . "' ORDER BY `position`");
$cachetime = time()-$down_setting['cachetime']*3600;
if(is_file('download/cache/'.$cat.'.dat') && filemtime('download/cache/'.$cat.'.dat') > $cachetime)
{
$count_cache = file_get_contents('download/cache/'.$cat.'.dat');
$count_cache = unserialize($count_cache);
$opencache = 'true';
}else{
$count_cache = array();
}
$i = 0;
while ($zap2 = mysql_fetch_array($zap))
{
//echo ($i % 2) ? '<div class="menu">' : '<div class="menu">';
++$i;
if(!$count_cache[$zap2['id']])
{
$countf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type` != 1 AND `status` = 1 && `way` LIKE '" . $zap2['way'] ."%' "), 0);
$old = time() - (3 * 24 * 3600);
$countnf = mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `type` != 1 AND `status` = 1 && `time` > '".$old."' && `way` LIKE '" . $zap2['way'] ."%' "), 0);
//$countp = mysql_result(mysql_query("SELECT COUNT(*) FROM `downpath` WHERE `way` LIKE '" . $zap2['way'] ."%';"), 0);
//$countp--; // if($countnf){ $countnf = '/<span class="red">+'.$countnf.'</span>'; }else{ $countnf = ''; }
$count_cache[$zap2['id']] = $countf.$countnf;
}
echo '<div class="menu"><img src="/img/2.gif" alt="*"> <a href="/download/dir_' . $zap2['id'] . '.html"> ' . $zap2['name'] .' </a> ('.$count_cache[$zap2['id']].') </div>';
// echo'</div>';
}
if(!$opencache && $arr = fopen('download/cache/'.$cat.'.dat', "w")){
fwrite($arr, serialize($count_cache));
fclose($arr);
//echo 'Кэш обновлен или создан!';
}
}
Mana shu kod downloaddagi papkalarni bosh sahifaga shiqaradigan kod ekan, Shu koddan faqat (palon papkada) nechta fayl borligini hisoblaydigan joyini olib beringlar + va rahmat mendan.