View Single Post
02-27-2005, 10:57 PM
#9
TheWebJunkie is offline TheWebJunkie
Status: Sin Binner
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 129
iTrader: 0 / 0%
 

TheWebJunkie is on a distinguished road

  Old

here is the code of my page in the screenshot

PHP Code:
<?
require_once("conn.php");

//compose the info variables

//  "data" of the week (for exaopmle: Joke of the week)
//  can be specify by the admin and saved at the settings table
$MyWeek $aset[OfTheWeek];

$q1 "select * from dd_items where ItemID = '$MyWeek' ";
$r1 mysql_query($q1) or die(mysql_error());
$a1 mysql_fetch_array($r1);

$MyText explode("|"$a1[ItemText]);

$Of_The_Week substr($MyText[1], 0180);
$Of_The_Week .= "... <a class=TitleLinks href=\"view.php?ItemID=$a1[ItemID]\">more</a>";


//        TOP 10
$q1 "select ItemID, sum(Rating) as mr from dd_rating group by ItemID order by mr desc limit 0,9";
$r1 mysql_query($q1) or die(mysql_error());
while(
$a1 mysql_fetch_array($r1))
{
    
$q2 "select ItemTitle from dd_items where ItemID = '$a1[0]' ";
    
$r2 mysql_query($q2) or die(mysql_error());
    while(
$a2 mysql_fetch_array($r2))
    {
        
$Top_10 .= "<a class=TitleLinks href=\"view.php?ItemID=$a1[0]\">$a2[0]</a><br>\n";
    }
}

//        NEWEST
$q1 "select * from dd_items where ItemStatus = 'approved' order by DateAdded desc limit 0,9";
$r1 mysql_query($q1) or die(mysql_error());
while(
$a1 mysql_fetch_array($r1))
{
    
$Newest .= "<a class=TitleLinks href=\"view.php?ItemID=$a1[ItemID]\">$a1[ItemTitle]</a><br>\n";
}


//get the templates
require_once("templates/MainHeader.php");
require_once(
"templates/MainIndex.php");
require_once(
"templates/MainFooter.php");
?>