paFileDB problem- Ostatnio dodane pliki
: 13 maja 2006, 10:32
Witam, ostatnio wgrałem do swego phpbb modyfikacje dodająca system downloadu paFileDB.Wszystko ładnie fajnie , ale mam wielki problem ... mianowicie jak wyświetlić ostatnio dodane np 10 plików?.Przeszukałem całe google i znalazłem tylko cos takiego:
skrypt do wyswietlania top20 pobieranych plikow:
ps. tylko nie wiem jak to zmodyfikowac aby zamiast top20 wyswietlal ostatnio dodane pliki?.
z góry dziękuje za pomoc.
Pozdrawiam
skrypt do wyswietlania top20 pobieranych plikow:
ps. tylko nie wiem jak to zmodyfikowac aby zamiast top20 wyswietlal ostatnio dodane pliki?.
Kod: Zaznacz cały
<?php
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////Top Files in Main Page Addon for PafileDB (http://www.phparena.net)//////
//////////Written by Wh1t3w0lf (wh1t3w0lf@decayandcorrupt.com) (fixed by NightWolf www.belesh.net )/////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Instructions:
//Change the settings bellow (and the layout in the bottom of this file if you wish).
//After that put include this file in the page and in the place where you want to show the top files
//via the include php command
//Settings
$dbhostname= "hostname"; //Your MySQL Host name
$dbusername= "username"; //Your MySQL Username
$dbpassword= "password"; //Your MySQL Password
$dbdatabase= "databasename"; //Your MySQL Database Name
$url= "http://www.****.info/forum/dload.php"; //The Url where you have installed pafiledb.php e.g "http://www.yoursite.com/files/pafile.php"
$table ="phpbb_pa_files"; //Table name including the prefix
$topfilecount= 20; // Top X files to show. e.g Top 10
//Don't mess with the following :P
$db = @mysql_connect($dbhostname,$dbusername,$dbpassword);
if (!$db) {
echo( "<p>Unable to connect to the " .
"database server at this time.</p>" );
exit();
}
if (! @mysql_select_db($dbdatabase) ) {
echo( "<p>Error locating the file " .
"database at this time.</p >" );
exit();
}
$result = @mysql_query("SELECT file_id, file_name, file_dls FROM $table ORDER BY file_dls DESC", $db);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
$files = mysql_num_rows($result);
//Style. Change accoridngly e.g Add html tags or css styles to match your site's design.
echo "<body bgcolor='#E0E8EF' text='#000000' link='#2F486F' vlink='#2F486F' alink='#2F486F'>";
echo "<style>
body{
scrollbar-face-color: #DEE3E7;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #DEE3E7;
scrollbar-3dlight-color: #D1D7DC;
scrollbar-arrow-color: #006699;
scrollbar-track-color: #A9BAC9;
scrollbar-darkshadow-color: #98AAB1;
}
A.pFo:link {color:#2F486F; text-decoration:overline;}
A.pFo:visited {color:#2F486F; text-decoration:overline;}
A.pFo:active {color:#2F486F; text-decoration:overline;}
A.pFo:hover {color:#8AA0B4; text-decoration:overline;}
</style>";
echo "<center><u><b>Top 20 Downloads</b></u>:";
echo "<br><center><font face='Arial, Helvetica, sans-serif' size='-1'>";
$i=1;
while (($myrow = mysql_fetch_row($result)) And ($i<=$topfilecount)){
$i=$i + 1;
echo "<a href='$url?action=file&file_id=$myrow[0]' target='_parent'>$myrow[1]</a><br>\n";}
///////////////////////////////////////////////////////////////////////////////
/////Top Files in Main Page Addon for PafileDB (http://www.phparena.net)///////
//////////Written by Wh1t3w0lf (wh1t3w0lf@decayandcorrupt.com)/////////////////
///////////////////////////////////////////////////////////////////////////////
?>Pozdrawiam