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?

Top Downloads

Asked Modified Viewed 1,115 times
L
LuigiMdg
L
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
asked
Newbie

Hi,
i'm new on php-fusion, i'm italian and i'am in creating of site directory to download softwares.
I have found the solution in php-fusion but i need a panel to perfection the cms..
In specific i need a panel for a list of the 5 Top Downloaded Files..
It exist or not?
0 replies

4 posts

K
KasteR
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

You can use this, it's similar to a previous panel I setup earlier today:
<?php
$result = dbquery("SELECT download_title,download_count,download_id,download_cat FROM ".DB_DOWNLOADS." WHERE ".groupaccess('download_cat_access')." ORDER BY download_count DESC LIMIT 5");
openside('Top 5 Downloads');
if (dbrows($result)) {
   echo '<ol>';
      while($data = dbarray($result)) {
         echo '<li><a href="'.BASEDIR.'downloads.php?cat_id='.$data['download_cat'].'&download_id='.$data['download_id'].'" alt="'.$data['download_title'].'" title="'.$data['download_title'].'">'.trimlink($data['download_title'], 23)."</a>&nbsp;&#40;".$data['download_count']."&#41;".'</li>';
      }
   echo '</ol>';
} else {
   echo "<div style='text-align:center'>No downloads have been created yet.</div>\n";
}
closeside();
?>

Ref: https://php-fusion.co.uk/forum/viewth...ost_193148
0 replies
L
LuigiMdg
L
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Newbie

this is the result.. :-/
Parse error: syntax error, unexpected '$result' (T_VARIABLE) in /data/vhosts/smetterefumare.biz/test/infusions/top_downloads_panel/top_downloads_panel.php on line 1
0 replies
K
KasteR
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

Ok no problem. Make sure you add the semi-colon at the end of that line. Somehow it must not have copied when you created the file.

Most likely you have it as this:
$result = dbquery(
   "SELECT td.*,tdc.* FROM ".$db_prefix."downloads td
   INNER JOIN ".$db_prefix."download_cats tdc ON td.download_cat=tdc.download_cat_id
   WHERE ".groupaccess('download_cat_access')." ORDER BY download_count DESC LIMIT 5"
);
openside('Top 5 Downloads');
if (dbrows($result)) {
   echo '<ol>';
      while($data = dbarray($result)) {
         echo '<li><a href="'.BASEDIR.'downloads.php?cat_id='.$data['download_cat'].'&download_id='.$data['download_id'].'" alt="'.$data['download_title'].'" title="'.$data['download_title'].'">'.trimlink($data['download_title'], 23)."</a>&nbsp;&#40;".$data['download_count']."&#41;".'</li>';
      }
   echo '</ol>';
} else {
   echo "<div style='text-align:center'>No downloads have been created yet.</div>\n";
}
closeside();

Let me know if you have any other issues with it.
Edited by KasteR on 31-01-2015 02:46,
0 replies
L
LuigiMdg
L
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
answered
Newbie

Perfect.. It work..
Thank you so much much much :D
0 replies

Labels

None yet

Statistics

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

2 participants

K
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
L
L
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet