Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.1.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2009, 03:45 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,187
Fireballchad
Default Adoptables Shop - Working Again!

Ok I am 100% done with this version. I will make a new version with more features. But this one works and is running.
First you will need to install Sea's cash system.
http://www.rusnakweb.com/forum/showthread.php?tid=1333
Next follow my steps (I will try to do this so it makes since)
Around line 169 in your admin.php add this:
PHP Code:
   <input name='cba' type='radio' value='pricenum'>
Only when users pay this much BP
<
input name='price' type='text' id='price'>
 <
p>
    <
input name='shop' type='checkbox' id='shop' value='enabled'
   
Sell This In Your Shop!</p>
<
br
In your nadopt.php file add this around line 112:
PHP Code:
$price $_POST["price"];
$price secure($price);

$shop $_POST["shop"];
$shop secure($shop); 
Still in the same file change this:
PHP Code:
if($cba != "always" and $cba != "promo"  and $cba != "conditions"){
$error "You did not choose a valid scenario when this adoptable can be adopted.  Please go back and either select the Always option, the Promo option or the Conditions option.";

To This:
PHP Code:
if($cba != "always" and $cba != "promo"  and $cba != "pricenum" and $cba != "conditions"){
$error "You did not choose a valid scenario when this adoptable can be adopted.  Please go back and either select the Always option, the Promo option or the Conditions option.";

Around Line 172 add this:
PHP Code:
//If we are using money to buy this, we should have a amount in the box...
if($cba == "pricenum" and $price == ""){
$error "You selected that this adoptable is available for adoption only with money, but you did not enter in a money amount.  Please go back and either change this setting or type in a valid amount.";
}
if(
$shop == "enabled"$shop2 "1"
Add $shop2 also add $price into the data base insert around line 251:
PHP Code:
mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$shop2','$price')"); 
Insert this in doadopt.php around line 104:
PHP Code:
$price=@mysql_result($result,$i,"price"); 
In doadopt.php use this... Again it is done for my site so it may be wierd... and my coding isn't great lol... as in not neet
PHP Code:
$query "SELECT * FROM `adopts_users` WHERE `username`='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

$i 0;
while (
$i 1) {
$money = @mysql_result($result$i"money");
$newbalance $money $price;
$i++;
}

if (
$money $price$get ='';
else 
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no')");
//This Line Above This Comment Was Moved From Around Line 138 Delete That One!
//Prevents From getting an adopt if no money.

if ($price == 0$get '';
else 
$get '<br> Thanks for buying your Bud! Now you have '.$newbalance.' coins!';
    
    if (
$money $price$get ='<br><br>There was an Error!<br>You Do Not Have Enough Coins';
else    
mysql_query("UPDATE `adopts_users` SET `money`='" $newbalance "' WHERE `username`='$loggedinname'");
// money buying addon
//prevents from going negative money.
$article_title "You got ".$name." successfully";
$article_content "<img src='".$eggimage."'><br>".$congrats1." ".$name.".  You can now manage ".$name." on the 
<a href='myadopts.php'>My Buds</a> page.<br><br><b><a href='myadopts.php?act=manage&id="
.$id."'>Click Here to Manage ".$name."</a><br>
<a href='myadopts.php?act=bbcode&id="
.$id."'>Click Here to get BBCodes / HTML Codes for ".$name."</a> ".$get." </b><br><br>"
Last But not least insert this into your data base under adopts_adoptables
Code:
`shop` tinyint(1) NOT NULL default 'NULL', and `price` int(10) NOT NULL default 'NULL'
Ok I hope it works for you
shop.php is attached it is adopt.php but shows items that cost money instead of being free and adopt.php now should show items that do not cost money.


Credit goes to Sea and Arianna for the code to get this working
Sorry for not fixing broken links and such!
Attached Files
File Type: php shop.php (8.0 KB, 3 views)
File Type: php adopt.php (8.1 KB, 3 views)
Reply With Quote
  #2  
Old 12-01-2009, 07:11 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,159
Tequila is on a distinguished road
Default RE: Item Shop - 50% Done

So will this be compatible with Sea's mod? If so, I'll stop working on mine. :)
Reply With Quote
  #3  
Old 12-01-2009, 10:54 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,187
Fireballchad
Default RE: Item Shop - 50% Done

Quote:
Originally Posted by enddayne
So will this be compatible with Sea's mod? If so, I'll stop working on mine. :)
Yup it uses Sea's mod :D and the beginnings of Arianna buying pets code :D
Reply With Quote
  #4  
Old 12-02-2009, 12:01 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,270
Arianna will become famous soon enough
Default RE: Item Shop - 50% Done

Ooh, awesome! :D For the items, can it use my deco mod? Because that needs a shop and is already finished, so they could maybe work together, along with the cash. :)
Reply With Quote
  #5  
Old 12-02-2009, 12:10 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,187
Fireballchad
Default RE: Item Shop - 50% Done

Quote:
Originally Posted by Arianna
Ooh, awesome! :D For the items, can it use my deco mod? Because that needs a shop and is already finished, so they could maybe work together, along with the cash. :)
Yup I can try to get it into it xD. Right now I am half way scraping what I have for the store... I realized the most easy way to do this and is way easier to put out to the public... so I am cutting my losses lol and going an easier route... I might even have it done tonight we will see :)
Reply With Quote
  #6  
Old 12-02-2009, 01:54 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,187
Fireballchad
Default RE: Item Shop - 100% Done (For Now)

hmmm the thing doesn't turn green from edits :( so this is a bump I guess but I changed my first post so it really isnt a bump >.> :)
Reply With Quote
  #7  
Old 12-02-2009, 10:04 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,270
Arianna will become famous soon enough
Default RE: Item Shop - 100% Done (For Now)

I already did something like this...? Apart from the else if, there's a code pretty much exactly like this on Sea's cash thread, on the last page, I think.
Reply With Quote
  #8  
Old 12-02-2009, 11:29 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,187
Fireballchad
Default RE: Item Shop - 100% Done (For Now)

Quote:
Originally Posted by Arianna
I already did something like this...? Apart from the else if, there's a code pretty much exactly like this on Sea's cash thread, on the last page, I think.
Yup you did... it didn't work lol... I made it work and added a few things like the shop page. I am sorry in that thread I put the credit for you, I forgot to on this thread I will fix it :D And I am working on adding some cool things to it. I just got it working so it separates the free from the bought. Some cool things will be setting it so an item can be set to give its clicks to one of your adopts and I am working on adding your deco mod.
Reply With Quote
  #9  
Old 12-02-2009, 01:37 PM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,270
Arianna will become famous soon enough
Default RE: Item Shop - 100% Done (For Now)

Oh, that's weird. xD Why didn't it work? The users of my site seem to be able to be buying pets just fine. xD
Reply With Quote
  #10  
Old 12-02-2009, 04:29 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,187
Fireballchad
Default RE: Item Shop - 100% Done (For Now)

Quote:
Originally Posted by Arianna
Oh, that's weird. xD Why didn't it work? The users of my site seem to be able to be buying pets just fine. xD
I have no clue... I followed your guide but I had to add a few things before it worked lol...

Also has anyone tried this yet? lol I want to know if anyone can get it to install so I can make sure I did it right lol
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
images on adoptables not working. Mortain Questions and Supports 7 11-14-2015 09:39 AM
Choosing Adoptables Type [EASY ADOPTABLES SCRIPT ONLY] Ashje Addons/Mods Graveyard 2 05-24-2009 03:17 AM
Help adoptables site isn't working!!! GamingMotion Questions and Supports 7 05-17-2009 05:02 AM
Shop and... 12345 Questions and Supports 1 03-05-2009 07:59 AM
Shop? trollis76 Questions and Supports 6 02-20-2009 12:46 AM


All times are GMT -5. The time now is 06:26 PM.

Currently Active Users: 592 (0 members and 592 guests)
Threads: 4,080, Posts: 32,024, 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