PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
mavrick1971
New Member
New Member


Joined: Jul 10, 2005
Posts: 2

PostPosted: Sun Jul 10, 2005 7:55 pm Reply with quote Back to top

I need a block updated to new sql layer, just want my site completely upto new sql layer. Possible to add 5 newest web links.

Check author website and there no longer around.

Code:

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* PHP All Info Block v2.0 by: SlimBrady (tbrady85@netcommander.com)    */
/* http://unitedgamerz.net - http://fraggedout.com                      */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

/************************/
/*      Variables       */
/************************/

// Number of Headlines to show
$headlines = 15;
// Number of downloads to show for Top Downloads
$downloadnumbertop = 5;
// Number of downloads to show for New Downloads
$downloadnumbernew = 10;
// Title of headlines section
$titleheadlines = "Headlines";
// Title of Top Downloads section
$titletopdownloads = "Top Downloads";
// Title of New Downloads section
$titlenewdownloads = "New Downloads";

/************************/
/*     End Variables    */
/************************/

// Stops people from accessing it directly
if (eregi("block-All_Info.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

global $prefix, $multilingual, $currentlang, $db, $dbi;

// Headlines
if ($multilingual == 1) {
    $querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
    $querylang = "";
}
$content = "<table width=\"100%\" border=\"0\">";
$content .= "<tr><td align=\"left\"><b>$titleheadlines:</b><br>";
$a = 1;
$sql = "SELECT sid, title, comments, time, counter FROM ".$prefix."_stories $querylang ORDER BY sid DESC LIMIT 0,$headlines";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
    $sid = $row[sid];
    $title = $row[title];
    $comtotal = $row[comments];
    $counter = $row[counter];
    $content .= "$a: <a href=\"modules.php?name=News&amp;file=article&amp;sid=$sid\">$title</a>&nbsp;<em>($counter "._READS.")</em><br>";
   $a++;
}
$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=News\">More News...</td>";

// Top Downloads
$content .= "<td valign=\"top\"><b>$titletopdownloads:</b><br>";
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by hits DESC limit 0,$downloadnumbertop", $dbi);

while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
    $title2 = ereg_replace("_", " ", $title);
    $content .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$title2</a>&nbsp;<em>($hits hits)</em><br>";
    $a++;
}

// New Downloads
$content .= "<br><b>$titlenewdownloads:</b><br>";
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$downloadnumbernew", $dbi);
while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
      $title2 = ereg_replace("_", " ", $title);
     $content .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$title2</a>&nbsp;<em>($hits hits)</em><br>";
      $a++;
}
$content .= "</table></td>";
   ?>
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15235
Location: Kansas

PostPosted: Sun Jul 10, 2005 9:36 pm Reply with quote Back to top

Old
Code:
// Top Downloads
$content .= "<td valign=\"top\"><b>$titletopdownloads:</b><br>";
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by hits DESC limit 0,$downloadnumbertop", $dbi);

while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
    $title2 = ereg_replace("_", " ", $title);
    $content .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$title2</a>&nbsp;<em>($hits hits)</em><br>";
    $a++;
}

// New Downloads
$content .= "<br><b>$titlenewdownloads:</b><br>";
$a = 1;
$result = sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$downloadnumbernew", $dbi);
while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
      $title2 = ereg_replace("_", " ", $title);
     $content .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$title2</a>&nbsp;<em>($hits hits)</em><br>";
      $a++;
}

New
Code:
// Top Downloads
$content .= "<td valign=\"top\"><b>$titletopdownloads:</b><br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by hits DESC limit 0,$downloadnumbertop");

while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
    $title2 = ereg_replace("_", " ", $title);
    $content .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$title2</a>&nbsp;<em>($hits hits)</em><br>";
    $a++;
}

// New Downloads
$content .= "<br><b>$titlenewdownloads:</b><br>";
$a = 1;
$result = $db->sql_query("select lid, title, hits from ".$prefix."_downloads_downloads order by date DESC limit 0,$downloadnumbernew");
while(list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
      $title2 = ereg_replace("_", " ", $title);
     $content .= "$a: <a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid=$lid&amp;title=$title\">$title2</a>&nbsp;<em>($hits hits)</em><br>";
      $a++;
}
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
mavrick1971
New Member
New Member


Joined: Jul 10, 2005
Posts: 2

PostPosted: Sun Jul 10, 2005 10:28 pm Reply with quote Back to top

thank you very much Groovy
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum