The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
getting date
greetings.
i am trying to get the date added to this snippet of code. I *believe* file_time table has the date info .. question is how do I fetch it along with the rest of the info? this script pulls the top10 newest files added to my download database, but i also want to get the date using file_time in format: D. M, j, Y .. any help? Code:
<?php $dbhostname= "blah"; $dbusername= "blah"; $dbpassword= "blah"; $dbdatabase= "blah"; $url= "./files/index.php"; $table ="filedb_files"; $listfiles= 10; $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_time DESC", $db); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } $files = mysql_num_rows($result); echo "<b><u><center>Newest Files by Date</center></b></u><br>"; $i=1; $r=0; while (($myrow = mysql_fetch_row($result)) And ($i<=$listfiles)){ $r=$r + 1; $i=$i + 1; echo "$r - <a href='$url?action=file&id=$myrow[0]''><b>$myrow[1]</b></a> ( Downloaded $myrow[2] times )<br>\n"; } echo "<br><br>\n"; ?> |
#2
|
||||
|
||||
come on, i know this is a piece of cake for some of you people!
|
#3
|
||||
|
||||
Somthing along the lines of:
PHP Code:
PHP Code:
Note $datevar is the variable you have the date stored in. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|