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?

Latest Downloads Panel

Asked Modified Viewed 2,413 times
T
T-N-Z
T
T-N-Z 10
  • Member, joined since
  • Contributed 53 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
asked
Member

Hello , i need latest downloads panel with php-fusion.co.uk/themes/Gillette/images/panel_on.gif like in this website , i got this for v6

@opensidex("Latest Downloads", off); 
$result=dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_datestamp DESC LIMIT 0,10");

echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
if(dbrows($result)!=0){
echo "<tr><td colspan='2' class='small'>(Move the mouse over the link to see a longer title.)</td></tr>";
while($data=dbarray($result)){

echo "<tr>
<td class='small'><a href='".BASEDIR."downloads.php?cat_id=$data[download_cat]&amp;download_id=$data[download_id]'
title='".$data['download_title']."' class='side'>".trimlink($data['download_title'], 22)."</a></td>
<td align='right' class='side'>$data[download_count]</td>
</tr>
<tr>
<td class='small'>".$download_cat_name."</td>
</tr>\n";

}
}
echo "</table>\n";
@closesidex();
?>


but on v7 i got error
Notice: Undefined variable: download_cat_name in /home/user/url.xz.lt/administration/panel_editor.php(128) : eval()'d code on line 13

how to fix this ?
0 replies

7 posts

M
Matonor
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

it's no error, it's a notice of sloppy coding. in this case you are referencing a undefined var.
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

Try this...

$result=dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_datestamp DESC LIMIT 0,10");

$cats = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats"));
   
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n"; 
if(dbrows($result)!=0){ 
echo "<tr><td colspan='2' class='small'>(Move the mouse over the link to see a longer title.)</td></tr>"; 
while($data=dbarray($result)){ 
   
echo "<tr> 
<td class='small'><a href='".BASEDIR."downloads.php?cat_id=$data[download_cat]&amp;download_id=$data[download_id]'  title='".$data['download_title']."' class='side'>".trimlink($data['download_title'], 22)."</a></td> 
<td align='right' class='side'>$data[download_count]</td> 
</tr> 
<tr> 
<td class='small' colspan='2'>".$cats['download_cat_name']."</td> 
</tr>\n"; 
   


echo "</table>\n";
Edited by HobbyMan on 03-07-2008 18:57,
0 replies
T
T-N-Z
T
T-N-Z 10
  • Member, joined since
  • Contributed 53 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions
answered
Member

now no errors but now download don't works , dislays only text of download name.
Edited by T-N-Z on 03-07-2008 20:17,
0 replies
E
Elactos
E
Elactos 10
Infusions & modifications for PHP-Fusion v7
http://www.redward.org
  • Member, joined since
  • Contributed 138 posts on the community forums.
  • Started 5 threads in the forums
answered
Member

<?php
   @opensidex("Latest Downloads", off);
   echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
   $result = dbquery("SELECT * FROM ".$db_prefix."downloads d
   LEFT JOIN ".DB_PREFIX."download_cats dc ON d.download_cat=download_cat_id
   ORDER BY download_datestamp DESC LIMIT 0,10");
   if (dbrows($result)) {
   echo "<tr><td colspan='2' class='small'>(Move the mouse over the link to see a longer title.)</td></tr>";
   while ($data = dbarray($result)) {
      echo "<tr>
            <td class='small'>
            <a href='".BASEDIR."downloads.php?cat_id=".$data['download_cat']."&amp;download_id=".$data['download_id']."' title='".$data['download_title']."' class='side'>".trimlink($data['download_title'], 22)."</a>
            </td>
            <td align='right' class='side'>".$data['download_count']."</td>
         </tr>
         <tr>
            <td class='small'>".$data['download_cat_name']."</td>
         </tr>\n";
   }
   }
   echo "</table>\n";
   @closesidex();
   ?>
0 replies
X
Xessive
X
I am not always right, but I'm never wrong.
http://www.xessive.nl
  • Senior Member, joined since
  • Contributed 327 posts on the community forums.
  • Started 4 threads in the forums
answered
Senior Member

If I'm correct that's V6 code.
Can the left join stuff also been done with the V7 code line db_downloads..??

I mean, how is that done with this line:
LEFT JOIN ".DB_PREFIX."download_cats dc ON d.download_cat=download_cat_id

when you want to convert that to the V7 code using DB_DOWNLOAD_CATS??
Edited by Xessive on 04-07-2008 09:21,
0 replies
E
Elactos
E
Elactos 10
Infusions & modifications for PHP-Fusion v7
http://www.redward.org
  • Member, joined since
  • Contributed 138 posts on the community forums.
  • Started 5 threads in the forums
answered
Member

DB_PREFIX."download_cats" is the same as DB_DOWNLOAD_CATS.
0 replies
X
Xessive
X
I am not always right, but I'm never wrong.
http://www.xessive.nl
  • Senior Member, joined since
  • Contributed 327 posts on the community forums.
  • Started 4 threads in the forums
answered
Senior Member

Quote

Elactos wrote:
DB_PREFIX."download_cats" is the same as DB_DOWNLOAD_CATS.


Yeah I know that, but will / can this line:
LEFT JOIN ".DB_PREFIX."download_cats dc ON d.download_cat=download_cat_id

look like this:
LEFT JOIN DB-DOWNLOAD_CATS dc ON d.DB_DOWNLOAD_CAT=DB_DOWNLOAD_CAT_ID

or something..

How is this: d.download_cat=download_cat_id
converted to use the V7 variables then??
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

M
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
E
E
Elactos 10
Infusions & modifications for PHP-Fusion v7
http://www.redward.org
  • Member, joined since
  • Contributed 138 posts on the community forums.
  • Started 5 threads in the forums
H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
X
X
I am not always right, but I'm never wrong.
http://www.xessive.nl
  • Senior Member, joined since
  • Contributed 327 posts on the community forums.
  • Started 4 threads in the forums
T
T
T-N-Z 10
  • Member, joined since
  • Contributed 53 posts on the community forums.
  • Started 10 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet