Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2009, 01:36 PM
Killgore Killgore is offline
Member
 
Join Date: Dec 2008
Posts: 82
Credits: 10,840
Killgore is an unknown quantity at this point
Default Currency Mod

How would i edit the currency mod so that it doesn't repeat, like it does HERE
PHP Code:
<?php

// Easy Adoptables Script by Brandon Rusnak
// Get our includes out of the way

include("inc/functions.php");
include(
"inc/config.php");
include(
"inc/settings.php");
include(
"inc/nbbc.php");  // BBCODE Parser
$bbcode = new BBCode;

$stop 0;

// Connect to our database

$conn mysql_connect($dbhost$dbuser$dbpass) or die ('Error connecting to mysql database!');
mysql_select_db($dbname);


//Set up our login info...
$username "";
$password "";

//Check for cookie

if (isset($_COOKIE['adoptu']) and isset($_COOKIE['adoptp'])){

$username $_COOKIE['adoptu'];
$password $_COOKIE['adoptp'];

$username preg_replace("/[^a-zA-Z0-9\\040.]/"""$username);
$password preg_replace("/[^a-zA-Z0-9s]/"""$password);

//Run login operation
$query "SELECT * FROM users WHERE username = '$username'";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$luser=@mysql_result($result,$i,"username");
$lpass=@mysql_result($result,$i,"password");

$i++;
}

    if(
$username == $luser and $password == $lpass){
        
$isloggedin "yes";
    }
    else{
    if (isset(
$_COOKIE['adoptu'])){
    
$past time() - 10
    
setcookie("adoptu",$username,$past);
    }

    if (isset(
$_COOKIE['adoptp'])){
    
$past time() - 10
    
setcookie("adoptp",$password,$past);
    }
    
$isloggedin "no";
    }

}
else
{
//User is not logged in
$isloggedin "no";




// Define our Template File

$file $current_theme;



// Get our content for the adoptables page
if($isloggedin == "yes" and $aID == ""){

$article_title "Shop";
$article_content "Welcome, welcome! We've been expecting you! From what we understand, you've helped some creatures grow up, so to reward you we're letting you pick one creature from below, in a color of your choice!<br><br>";

$query "SELECT * FROM adoptables WHERE memberlevel = 'shop'";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i $num) {

$aID=@mysql_result($result,$i,"uid");
$name=@mysql_result($result,$i,"name");
$imageurl=@mysql_result($result,$i,"imageurl");
$cost=@mysql_result($result,$i,"description");

//Begin our content output...
$article_content=$article_content."<center><table border='2' bordercolor='#3d3d3d' cellpadding='5' cellspacing='1'>
            <tr>
            <td bgcolor='#575757'><p><font face='Verdana' size='1' color='ffffff'><center>Blue Mudskip<p><img src='images/shop_adoptables/mudskip_blue.png' /><p>250 Pearls<p><a href='buy.php?aID=20'>Buy a Blue Mudskip!</a></td>
            <td bgcolor='#575757'><p><font face='Verdana' size='1' color='ffffff'><center>Green Mudskip<p><img src='images/shop_adoptables/mudskip_green.png' /><p>250 Pearls<p><a href='buy.php?aID=21'>Buy a Green Mudskip!</a></td>
            <td bgcolor='#575757'><p><font face='Verdana' size='1' color='ffffff'><center>Purple Mudskip<p><img src='images/shop_adoptables/mudskip_purple.png' /><p>250 Pearls<p><a href='buy.php?aID=22'>Buy a Purple Mudskip!</a></td>
                        </tr>
                        <tr>
            <td bgcolor='#575757'><p><font face='Verdana' size='1' color='ffffff'><center>Red Mudskip<p><img src='images/shop_adoptables/mudskip_red.png' /><p>250 Pearls<p><a href='buy.php?aID=23'>Buy a Red Mudskip!</a></td>
                        <td></td>
            <td bgcolor='#575757'><p><font face='Verdana' size='1' color='ffffff'><center>Yellow Mudskip<p><img src='images/shop_adoptables/mudskip_yellow.png' /><p>250 Pearls<p><a href='buy.php?aID=24'>Buy a Yellow Mudskip!</a></td>
                        </tr>
                        </table></center>"
;


$i++;
}

$article_title stripslashes($article_title);
$article_content stripslashes($article_content);



}
else if (
$isloggedin == "no" and $aID == ""){
// Guest is viewing the available adoptables

$article_title "Shop";
$article_date date('Y-m-d');
$article_content "Please log in to buy adoptables.";


$article_title stripslashes($article_title);
$article_content stripslashes($article_content);

}
else if (
$isloggedin == "no" and $aID != ""){
// Guest is trying to adopt an adoptable -- not allowed for tracking purposes

$article_title "Error";
$article_date date('Y-m-d');
$article_content "You must <a href='register.php'>register</a> an account before you can buy adoptables.";

$article_title stripslashes($article_title);
$article_content stripslashes($article_content);

}



// Should we show the extra pages in the nav bar?

$link1 "";
if(
$show_extra_page1 == "yes"){
$link1 "<li><a href='$extra_page1_link'>$extra_page1_name<span class='tab-l'></span><span class='tab-r'></span></a></li>"
}

$link2 "";
if(
$show_extra_page2 == "yes"){
$link2 "<li><a href='$extra_page2_link'>$extra_page2_name<span class='tab-l'></span><span class='tab-r'></span></a></li>"
}


// Do the template changes and echo the ready template

$template file_get_contents($file);
$template replace(':SITETITLE:',$site_title,$template);
$template replace(':SITENAME:',$site_name,$template);
$template replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLEDATE:',$article_date,$template);
$template replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':LINK1:',$link1,$template);
$template replace(':LINK2:',$link2,$template);
$template replace(':LINK3:',$link3,$template);

//Get the featured adoptable...
$featured getfeatured();
$template replace(':FEATURED:',$featured,$template);

//Ad Management
$header = @file_get_contents("ads/header.txt");
$footer = @file_get_contents("ads/footer.txt");
$tower = @file_get_contents("ads/tower.txt");

$header stripslashes($header);
$footer stripslashes($footer);
$tower stripslashes($tower);

$template replace(':HEADERAD:',$header,$template);
$template replace(':FOOTERAD:',$footer,$template);
$template replace(':TOWERAD:',$tower,$template);


//Is the user logged in?
//$isloggedin = "no";
if ($isloggedin == "yes"){
$template replace(':WELCOMEORREGISTER:','',$template);
$template replace(':LOGINORACCT:''<p>Hi, <a href="profile.php?owner='.$username.'">'.$username.'</a>
<p><a href="logout.php">Log out</a>' 
,$template);
}
else{

//User is not logged in
$template replace(':WELCOMEORREGISTER:','Hi there, please login or register',$template);
$loginform "<form name='form1' method='post' action='login.php'>
  <p><font size=1>Username 
    <input name='username' type='text' id='username' size=10>
</p>
  <p><font size=1>Password</font>
    <input name='password' type='password' id='password' size=10>
</p>
  <p>
    <input type='submit' name='submit' value='Let`s Go!'>
  </p>
</form>
"
;
$template replace(':LOGINORACCT:'$loginform ,$template);
}

echo 
$template;
?>
Reply With Quote
  #2  
Old 04-10-2009, 09:04 PM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 12,732
Ashje
Default RE: Currency Mod

I'm pretty sure you're starting a new table every time you enter one... Not sure how to fix it though...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Currency Question ilrak Questions and Supports 1 03-09-2015 12:47 PM
Second Currency and Currency icon Rovick Suggestions and Feature Requests 14 11-11-2014 06:29 PM
Mod: Currency Magnie Addons/Mods Graveyard 12 06-05-2010 11:05 AM
New Release Currency trollis76 Suggestions and Feature Requests 19 05-27-2009 04:49 PM
New Release Currency trollis76 Questions and Supports 0 12-31-1969 07:00 PM


All times are GMT -5. The time now is 06:47 AM.

Currently Active Users: 1200 (0 members and 1200 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636