Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

downloads.php modify

Asked Modified Viewed 1,483 times
L
loghan
L
loghan 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

Hello! I justwas wondering how to modify download.php to show all files (with pagination 10 per page), no matter the category. Just to show me last 10 files.
I don't need panel. I need to edit/modify download.php to show the files that way.
Order by datestamp , latest 10-15 files in all category.
0 replies

2 posts

L
Layzee
L
Layzee 10
Seen it - done it!
  • Member, joined since
  • Contributed 113 posts on the community forums.
  • Started 20 threads in the forums
answered
Member

Well, why not use the code of panel "latest_downloads"?

Try this:
$result = dbquery(
      "SELECT td.download_id, td.download_title, td.download_cat, td.download_datestamp,
            tc.download_cat_id, tc.download_cat_access
         FROM ".DB_DOWNLOADS." td
         INNER JOIN ".DB_DOWNLOAD_CATS." tc ON td.download_cat=tc.download_cat_id
         ".(iSUPERADMIN ? "" : " WHERE ".groupaccess('download_cat_access'))."
         ORDER BY download_datestamp DESC LIMIT 0,10");
if (dbrows($result)) {
   while($data = dbarray($result)) {
      $download_title = trimlink($data['download_title'], 40);
      echo THEME_BULLET." <a href='".BASEDIR."downloads.php?download_id=".$data['download_id']."' title='".$data['download_title']."' class='side'>".$download_title."</a><br />\n";
   }
} else {
   echo "<div style='text-align:center'>".$locale['global_033']."</div>\n";


In line:
ORDER BY download_datestamp DESC LIMIT 0,10");

it's sorted by datestamp. You can set number of downloads to show (10) and kind of sort (DESC).
0 replies
L
loghan
L
loghan 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

This code hasn't pagination, so it's useless ... I tried to edit the database querries in download.php to get the right list of added downloads, but it's a little bit harder than I was thinkin' it ...

http://graph-pieces.com/Downloads - this is the page I want to change ... Look what I've done and now just want to see last 10 downloads in the index of download.php file, because now, it shows the last 3 files from each category, no matter I'm not added them ... :)
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

L
L
loghan 10
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
L
L
Layzee 10
Seen it - done it!
  • Member, joined since
  • Contributed 113 posts on the community forums.
  • Started 20 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet