Home > Panele > 3 panele pliki i artyku

3 panele pliki i artyku

Dodane przez: piciu
opis:
Panel pokazuje 3 panele z Najnowsze *
*pliki do pobrania
*Top 5 pliki do pobrania
*Najnowsze artykuły
Kod:
  1. echo "<table width='100%'>
  2. <tr>
  3. <td width='33%'>";
  4. openside("Najnowsze pliki do pobrania");
  5. echo "<div class='side-label'><b>Nowa praca</b></div>\n";
  6. $result = dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_datestamp DESC LIMIT 0,5");
  7. if (dbrows($result) != 0) {
  8. echo "<table width='100%' cellpadding='0' cellspacing='0'>";
  9. while ($data = dbarray($result)) {
  10. echo "<tr>
  11. <td class='small'>
  12. <img src='".THEME."images/bullet.gif'>
  13. <a href='".BASEDIR."downloads.php?cat_id=".$data['download_cat']."&download_id=".$data['download_id']."' title='".$data['download_title']."' class='side'>".trimlink($data['download_title'], 23)."</a>
  14. </td>
  15. <td align='right'>".$data['download_count']."</td>
  16. </tr>";
  17. }
  18. echo "</table>";
  19. } else {
  20. echo "<div style='text-align:center'>".$locale['004']."</div>\n";
  21. }
  22. echo "";
  23. closeside();
  24. echo "</td>
  25. <td width='33%'>";
  26. openside("Top 5 pliki do pobrania");
  27. echo "<div class='side-label'><b>Top 5 plików</b></div>\n";
  28. $result = dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_count DESC LIMIT 0,5");
  29. if (dbrows($result) != 0) {
  30. echo "<table width='100%' cellpadding='0' cellspacing='0'>";
  31. while($data = dbarray($result)) {
  32. $itemsubject = trimlink($data['download_title'], 23);
  33. echo "<tr>\n<td class='small'><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."downloads.php?cat_id=".$data['download_cat']."&download_id=".$data['download_id']."' title='".$data['download_title']."' class='side'>$itemsubject</a></td>\n
  34. <td align='right'>".$data['download_count']."</td>\n</tr>\n";
  35. }
  36. echo "</table>";
  37. } else {
  38. echo "<center>".$locale['004']."</center>\n";
  39. }
  40. closeside();
  41. echo "</td>
  42. <td width='33%'>";
  43. openside("Najnowsze artykuły ");
  44. echo "<div class='side-label'><b>Najnowsze artykuły</b></div>\n";
  45. $result = dbquery(
  46. "SELECT ta.*,tac.* FROM ".$db_prefix."articles ta
  47. INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
  48. WHERE ".groupaccess('article_cat_access')." ORDER BY article_datestamp DESC LIMIT 0,5"
  49. );
  50. if (dbrows($result) != 0) {
  51. while($data = dbarray($result)) {
  52. $itemsubject = trimlink($data['article_subject'], 23);
  53. echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."readarticle.php?article_id=".$data['article_id']."' title='".$data['article_subject']."' class='side'>$itemsubject</a><br>\n";
  54. }
  55. } else {
  56. echo "<center>".$locale['004']."</center>\n";
  57. }
  58. closeside();
  59. echo "</tr>
  60. </table>";

©