Arkadaşlar elimde mkportalda kullanılan popüler 100 dosya bloğunu kendi içinde nasıl sayfalayabilirim...
<?php
/********************************************************/
/* Download stats block v1.0 for Mkportal 1.0 */
/* By: Ice2003 */
/*
http://www.mkportal.it */
/* Copyright 2005 and Beyond by Ice2003 */
/********************************************************/
global $MK_BOARD;
// Edit the 3 first lines to adjust how much you want to show in the block
$maxshow =100; // Show how many files to be listed in downloads block
$downloadstoshow = 100; // how many files to be listed in most downloads section
$usemarquee = 0; // 0=No scrolling , 0=Scolling
$scrolldirection = "Up"; // ummm up=up and down=down , duh ya should know that
// Don't change anything under this line or your server will self destruct

$most = "<img src=\"$this->images/ok.png\" align=\"right\" alt=\"\" /><a href=\"
http://egitimciyizbiz.net/index.php?pid=68\">Popüler 100 Dosya[/url] <img src=\"$this->images/ok.png\" align=\"right\" alt=\"\" /><a href=\"
http://egitimciyizbiz.net/index.php?pid=66\">Son Eklenen Dosyalar[/url]<img src=\"$this->images/ok.png\" align=\"right\" alt=\"\" /><a href=\"
http://egitimciyizbiz.net/mkportal/blocks/dosyaekleyenler.php\">Dosya Gönderenler[/url]<img src=\"$this->images/ok.png\" align=\"right\" alt=\"\" /><a href=\"
http://egitimciyizbiz.net/index.php?ind=downloads&op=search\">Dosyalarda Ara[/url]";
$latest = "Son Eklenen 100 Dosya";
$totalfiles = "Top. Dosya Sayısı";
$totalcategories = "Kategori Sayısı ";
$totaldownloads = "İndirme Sayısı ";
$content = "";
// ok lets count how many files are in the dabase oh yeah
$result = mysql_query("select * from mkp_download");
$files = mysql_num_rows($result);
// How many catagories do we have, well lets count them then duh
$result = mysql_query("select * from mkp_download_sections");
$cats = mysql_num_rows($result);
// How many files have been downloaded, let the results be seen now
$result = mysql_query("select id, name, downloads from mkp_download");
while(list($id, $name, $downloads) = mysql_fetch_row($result)) {
$title2 = ereg_replace("_", " ", $name);
$a = 1;
$total_hits = $total_hits + $downloads;
$a++;
}
// What is the size of the total amount of data delt out to ya leeches
// yeah i am looking at you baby
$result=mysql_query("select * from mkp_download");
$numrows = mysql_num_rows($result);
$result=mysql_query("select sum(peso*downloads) as serv from mkp_download");
while(list($serv) = mysql_fetch_row($result)) {
$served = $serv;
}
$gb = 1024*1024*1024;
$mb = 1024*1024;
$kb = 1024;
if ($served >= $gb){
$mysizes = sprintf ("%01.2f",$served/$gb) . " Gb ";
} elseif ($served >= $mb) {
$mysizes = sprintf ("%01.2f",$served/$mb) . " Mb ";
} elseif ($served >= $kb) {
$mysizes = sprintf ("%01.2f",$served/$kb) . " Kb ";
} else{
$mysizes = $served . " B ";
}
$content .= " $totalfiles:
$files $totalcategories:
$cats $totaldownloads:
$total_hits İndirilen Veri:
$mysizes";
if ($usemarquee == 1) {
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"870\" ScrollAmount=\"2\" ScrollDelay=\"100\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\">
";
}
// Lets show the most downloaded files, Probably the porn ones i reckon, hahahahahahaha
$content .= "
<center>
".$most."</center>";
$a = 1;
$result = mysql_query( "SELECT id, name, downloads FROM mkp_download WHERE validate = '1' ORDER BY `downloads` DESC LIMIT $downloadstoshow");
while(list($id, $name, $downloads) = mysql_fetch_row($result)) {
$title2 = ereg_replace("_", " ", $name);
$content .= " $a- <a href=\"$this->siteurl/index.php?ind=downloads&op=entry_view&iden=$id$title\">$title2 : [/url]
($downloads) ";
$a++;
}
unset($maxshow);
unset($mysql_query);
unset($id);
unset($name);
unset($downloads);
?>