View Single Post
  #2  
Old 02-01-2011, 07:57 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 33,354
fadillzzz is an unknown quantity at this point
Default

Try this code
PHP Code:
<?php

// **********************************************************************
// Mysidia Adoptables Script: index.php
// Copyright 2011 Mysidia Adoptables staff team
// For help and support: http://www.mysidiaadoptables.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************


// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include(
"inc/config.php");
include(
"inc/bbcode.php");

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads getads("any");

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content];


// Convert the BBCODE to HTML
$article_content bbconvert($article_content);

// Convert line breaks to <br>
$article_content nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle grabanysetting("browsertitle");
$sitename grabanysetting("sitename");
$slogan grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************
$article_content $article_content."<p>Only for a limited time - receive a special item when you visit this page!";
if (
$isloggedin == "yes") {
$result mysql_query("SELECT * FROM ".$prefix."useritems WHERE owner = '$loggedinname'");
$num mysql_numrows($result);

$i 0;
$oh 0;

while (
$num){
$isit = @mysql_query($result,'0','Item');
if (
$isit == "Pile of Ice Blocks") {
$oh 'oh';
}
else {}

i++;
}

if (
$oh == 'oh'){
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('','$loggedinname','Pile of Ice Blocks')");
}
else if (
$oh == 0){
$article_content $article_content."<br>You have already received this item.";
}
}
else {
$article_content $article_content."<p>You must be logged in to receive the item.";
}

// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file $themeurl;

// Do the template changes and echo the ready template
$template file_get_contents($file);

$template replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':ARTICLEDATE:',$article_date,$template);

$template replace(':BROWSERTITLE:',$browsertitle,$template);
$template replace(':SITENAME:',$sitename,$template);

//Define our links
$template replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...

$sidebar getsidebar();
$template replace(':SIDEFEED:',$sidebar,$template);

//Get the ad content...
$template replace(':ADS:',$ads,$template);

//Get the slogan info
$template replace(':SLOGAN:',$slogan,$template);


echo 
$template;

// **********************************************************************
// End Template Definition
// **********************************************************************



?>