Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Problema su downloads

Parašė Poker· 2008 Kov. 11 18:03:13
#1

Susiduriau su viena problema,mano downloads atvaizduoja visus sudetus siuntinius.Pwz sudedu 100 siuntiniu ir juos man atvaizduoja viename pulspyje.Klausimas ar neitu perdaryt jog atvaizduotu viename puslapyje 15 siuntiniu?:?

Mano downloads.php

<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright &#234; 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| NextGen Downloads v1.3 (C) 2007
| by &#209;&#242;&#224;&#237;&#232;&#241;&#235;&#224;&#226; &#212;åä&#238;&#242;&#238;&#226; aka SAF
| http://compgdev.com
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."downloads.php";

if (isset($download_id) && !isNum($download_id)) fallback("index.php");

if (isset($download_id)) {
   $res = 0;
   if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) {
      $cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
      if (checkgroup($cdata['download_cat_access'])) {
         $res = 1;
         $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'");
         redirect($data['download_url']);
      }
   }
   if ($res == 0) redirect(BASEDIR."downloads.php");
}

if (!isset($cat_id)) {
   opentable($locale['400']);
   echo "<br>";
   $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE ".groupaccess('download_cat_access')." ORDER BY download_cat_name");
   $rows = dbrows($result);
   if ($rows != 0) {
      $counter = 0; $columns = 1;
      while ($data = dbarray($result)) {
         if ($counter != 0 && ($counter % $columns == 0)) echo "<br>";
         $num = dbcount("(download_cat)", "downloads", "download_cat='".$data['download_cat_id']."'");
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='2'>".$data['download_cat_name']."</td>
</tr>";
if ($data['download_cat_description']) {
echo "<tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($data['download_cat_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>".$locale['D001'].$num."</small></td>
<td class='tbl2' align='center' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['download_cat_id']."&sort=1'><small>".$locale['D002']."</small></a></td>
</tr>
</table>";
         $counter++;
      }
   echo "<br>";
   } else {
      echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
   }
   closetable();
} else {
   include INCLUDES."comments_include.php";
   include INCLUDES."ratings_include.php";
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id='$info_id'");
   if ($info_id) {
            while ($data = dbarray($result)) {
   opentable($locale['400']." &raquo; ".$data['download_title']);
   echo "<br><br><table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'><tr>
   <td colspan='3' class='forum-caption'>".$locale['D003']."</td>
   </tr><tr>
   <td class='tbl1' width='200' align='center' valign='middle' rowspan='8'>";
   if ($data['download_screen']) {
   echo "<img src='".$data['download_screen']."' alt='' width='160px' height='120px'>";
   echo "<br><br><small>[ <a href='".$data['download_screen']."' target='_blank'>".$locale['D004']."</a> ]</small></td>";
   } else {
   echo "<img src='images/nonscreen.gif' alt='' width='160px' height='120px'>";
   echo "<br><br><small>[ ".$locale['D004']." ]</small></td>";
   }
   echo "<td class='tbl2' width='1%' nowrap><b>".$locale['D005']."</b></td>
   <td class='tbl1'>".$data['download_title']."</td>
   </tr>
   <tr>
   <td class='tbl2'width='1%' nowrap><b>".$locale['D006']."</b></td>
   <td class='tbl1'>".$data['download_author']."</td>
   </tr>
   <tr>
   <td class='tbl2'width='1%' nowrap><b>".$locale['D007']."</b></td>
   <td class='tbl1'>".$data['download_filesize']."</td>
   </tr>
   <tr>
   <td class='tbl2'width='1%' nowrap><b>".$locale['D008']."</b></td>
   <td class='tbl1'>".$data['download_license']."</td>
   </tr>
   <tr>
   <td class='tbl2'width='1%' nowrap><b>".$locale['D009']."</b></td>
   <td class='tbl1'>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</td>
   </tr>
   <tr>
   <td class='tbl2'width='1%' nowrap><b>".$locale['D010']."</b></td>
   <td class='tbl1'>".$data['download_count']."</td>
   </tr><tr>
   <td class='tbl2'width='1%' nowrap><b>".$locale['D011']."</b></td>
   <td class='tbl1'>".$data['download_os']."</td>
   </tr><tr>
   <td class='tbl2' align='center' height='30px' colspan='2'><small>";
   if ($data['download_copyright']) {
   echo $data['download_copyright'];
   } else {
   echo "&nbsp;";
   }
   echo "</small></td>";
   echo "</tr></table>";
   echo "<br>";
   if ($data['download_description']) {
   echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
   <tr>
   <td class='forum-caption'>".$locale['D012']."</td>
   </tr>
   <tr>
   <td class='tbl1'>".nl2br(stripslashes($data['download_description']))."</td>
   </tr>
   </table>";
   echo "<br>";
   }
   echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'><tr>";
         if ($data['download_mirror']) {
   echo "<td class='forum-caption' colspan='4'>".$locale['D013']."</td>";   
         } else {
   echo "<td class='forum-caption' colspan='3'>".$locale['D013']."</td>"; }
   echo "</tr><tr>
   <td class='tbl1' width='33%' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&amp;download_id=".$data['download_id']."' target='_blank'>Atsisiøsti</a></td>";
      if ($data['download_mirror']) {
   echo "<td class='tbl1' width='33%' align='center'><a href='".$data['download_mirror']."' target='_blank'>Vaizdas</a></td>";
         }
   echo "<td class='tbl1' width='33%' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&amp;info_id=".$data['download_id']."&amp;act=rate'>Ivertinti</a></td>
   <td class='tbl1' width='33%' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&amp;info_id=".$data['download_id']."&amp;act=comment'>Komentuoti</a></td>
   </tr></table><br><br>";
closetable();
if ($act == "rate") {
showratings("D",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=rate");
}
if ($act == "comment") {
showcomments("D","downloads","download_id",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=comment");
}
}
} else {
   $res = 0;
   if (!isNum($cat_id)) fallback(FUSION_SELF);
   $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'");
   if (dbrows($result) != 0) {
      $cdata = dbarray($result);
      if (checkgroup($cdata['download_cat_access'])) {
         $res = 1;
         opentable($locale['400']." - ".$cdata['download_cat_name']);
            echo "<br>";
         echo "<table width='70%' align='center' cellspacing='1' cellpadding='1' class='tbl-border'>";
         echo "<tr>";
         echo "<td align='center' width='33%' class='".(FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "tbl1" : "tbl2")."'><span class='small'>\n";
         echo (FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "<b>".$locale['D014']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=1'>".$locale['D014']."</a>")."</span></td>\n";

         echo "<td align='center' width='33%' class='".($sort == 3 ? "tbl1" : "tbl2")."'><span class='small'>\n";
         echo ($sort == 3 ? "<b>".$locale['D015']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=3'>".$locale['D015']."</a>")."</span></td>\n";

         echo "<td align='center' width='33%' class='".($sort == 2 ? "tbl1" : "tbl2")."'><span class='small'>\n";
         echo ($sort == 2 ? "<b>".$locale['D016']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=2'>".$locale['D016']."</a>")."</span></td>\n";
         echo "</tr></table><br>";

         $rows = dbcount("(*)", "downloads", "download_cat='$cat_id'");
         if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
         if (!isset($sort) || !isNum($sort)) $sort = 0;
         $sorting = $cdata['download_cat_sorting'];
         if ($sort == 1)   $sorting = "download_title ASC";
         if ($sort == 2)   $sorting = "download_count DESC";
         if ($sort == 3)   $sorting = "download_datestamp DESC, download_title ASC";
         if ($rows != 0) {
            $result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat='$cat_id' ORDER BY $sorting LIMIT $rowstart,60");

            $numrows = dbrows($result); $i = 1;
            while ($data = dbarray($result)) {
               if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span style='font-size:8px;'><blink><color='red'>".$locale['410']."</color></blink></span>";
               } else {
                  $new = "";
               }
echo "<table border='0' width='95%' align='center' cellspacing='1' cellpadding='0' class='tbl-border'>
<tr>
<td class='forum-caption' colspan='4'>".$data['download_title']." $new</td>
</tr>";
if ($data['download_description']) {
echo "<tr>
<td class='tbl1' colspan='4' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripslashes($data['download_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' colspan='2' align='center'><small>".showdate("%d.%m.%Y %H:%M:%S", $data['download_datestamp'])."</small></td>
<td class='tbl2' colspan='1' align='center'><small>".$locale['D017'].$data['download_count']."</small></td>
<td class='tbl2' colspan='1' align='center'><a href='".FUSION_SELF."?cat_id=$cat_id&amp;info_id=".$data['download_id']."'><small>".$locale['D018']."</small></a></td>
</tr>
<tr>
<td class='tbl2' align='center' width='25%'><small>".$data['download_filesize']."</small></td>
<td class='tbl2' align='center' width='25%'><small>".$data['download_license']."</small></td>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='D' AND rating_item_id='".$data['download_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='D' AND rating_item_id='".$data['download_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td class='tbl2' align='center' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
<td class='tbl2' align='center' width='25%'><a href='".FUSION_SELF."?cat_id=$cat_id&amp;info_id=".$data['download_id']."&amp;act=comment'><small>".$locale['D020']."</small></a></td>
</tr>
</table>";
            echo ($i != $numrows ? "<br>" : "\n"); $i++;
            }
echo "<br>";
            closetable();
            if ($rows > 20) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,20,$rows,3,FUSION_SELF."?cat_id=$cat_id&amp;sort=$sort&amp;")."\n</div>\n";
         } else {
            echo $locale['431']."\n";
            closetable();
         }
      }
   }

   if ($res == 0) redirect(FUSION_SELF);
}
}

require_once "side_right.php";
require_once "footer.php";
?>




Iš anksto dėkui už bet kokias pastangas.;)