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 02-02-2011, 05:15 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: 110,104
Tequila is on a distinguished road
Default Another multi-currency question.

I want to use a secondary currency for 'donor' adoptables. All users will have 10 of these available for a taste of donor appeal.

Thing is the currency selected for the adoptable purchase is the dollar amount and not the gem amount.

Where in the files would I have to edit for this to work?
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #2  
Old 02-02-2011, 05:35 PM
Tony's Avatar
Tony Tony is offline
I program.
 
Join Date: Jan 2011
Posts: 75
Gender: Male
Credits: 9,360
Tony is on a distinguished road
Default

Are you using a previously installed addon made by someone for the shopping system? I would need the code.
Reply With Quote
  #3  
Old 02-02-2011, 05:39 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: 110,104
Tequila is on a distinguished road
Default

Quote:
Originally Posted by tonyhh View Post
Are you using a previously installed addon made by someone for the shopping system? I would need the code.
I'm using the 1.1.4 release as the base for my site, it has a shop included for adoptables. Items on the other hand...
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #4  
Old 02-02-2011, 05:41 PM
Tony's Avatar
Tony Tony is offline
I program.
 
Join Date: Jan 2011
Posts: 75
Gender: Male
Credits: 9,360
Tony is on a distinguished road
Default

Okay, I'll download 1.1.4 and take a look.
Reply With Quote
  #5  
Old 02-02-2011, 05:47 PM
PTGigi's Avatar
PTGigi PTGigi is offline
Crazily Friendly~HoF
 
Join Date: Jul 2009
Location: Somewhere >.>
Posts: 370
Gender: Female
Credits: 31,290
PTGigi
Default

I could try to sort through my code and help you out ^-^" *is not the neatest person* Since I have 6 cash types it shouldn't be too hard XD

But I believe I only had to modify the admin, doadopt, nadopt, cash, mycash, and adopt pages.
__________________


"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo
My Adoptables|Nuzlocke Webcomic
Reply With Quote
  #6  
Old 02-02-2011, 05:54 PM
Tony's Avatar
Tony Tony is offline
I program.
 
Join Date: Jan 2011
Posts: 75
Gender: Male
Credits: 9,360
Tony is on a distinguished road
Default

There's only one type of currency.
To add the new currency called 'donor', go to admin.php to edit that first, then do some of the minor chages required in nadopts.php and finish off by editing adopt.php/doadopt.php to your liking.

Oh and edit the mycash page to show it.

Do you need step by step instructions? I'm assuming you know php. :D

Last edited by Tony; 02-02-2011 at 05:58 PM.
Reply With Quote
  #7  
Old 02-02-2011, 05:54 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: 110,104
Tequila is on a distinguished road
Default

Quote:
Originally Posted by pokemontrainergigi View Post
I could try to sort through my code and help you out ^-^" *is not the neatest person* Since I have 6 cash types it shouldn't be too hard XD

But I believe I only had to modify the admin, doadopt, nadopt, cash, mycash, and adopt pages.
I've already messed with a few, but I wouldn't mind some small help. :)
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #8  
Old 02-02-2011, 06:34 PM
PTGigi's Avatar
PTGigi PTGigi is offline
Crazily Friendly~HoF
 
Join Date: Jul 2009
Location: Somewhere >.>
Posts: 370
Gender: Female
Credits: 31,290
PTGigi
Default

Alright let's hope I don't fail and forget something XD I didn't know what you were using for cash so I just used $cash2 for everything X3 Change as you like

Admin.php should read like this for the cash:
PHP Code:
  <p><strong>Adoptables Pricing Settings:</strong></p>
  <
p>This section allows you to set if you want to enable pricing for this adoptablePlease either disable this option or enter a positive number here.. </p>
  <
p><strong>
   <
input name='pricestatus' type='checkbox' id='pricestatus' value='enabled'>
  </
strong>Set a price for this adoptable</p>
  <
p>You can now decide how much money to charge for this particular adoptable:</p>
  <
input name='pricevalue' type='text' id='pricevalue' size='10' maxlength='10'>Cash 1<br>
  <
input name='pricevalue2' type='text' id='pricevalue2' size='10' maxlength='10'>Cash 2<br>
<
p
The cash check in doadopt should read:
PHP Code:
// Now we determine if the user has enough cash left to purchase an adoptable, if its price status is enabled.

$pris getpricestatus($id); 
$priv getpricevalue($id);
$priv2 getpricevalue2($id);
$mycash getcash($loggedinname);
$mycash2 getcash2($loggedinname);

$cashleft $mycash $priv;
$casj2left $mycash2 $priv;

if(
$cashleft or $cash2left 0){
  
$article_title $name." cannot be adopted";
  
$article_content "It appears that you do not have enough money to acquire this adoptable, please come back later.";

And just a couple lines below that should read:
PHP Code:
//Next, the user's lost an amount of money equal to the adoptable's price value.
$query "UPDATE ".$prefix."users SET dollar='".$cashleft."' WHERE username='".$loggedinname."'";
mysql_query($query);
$query "UPDATE ".$prefix."users SET cash2='".$cash2left."' WHERE username='".$loggedinname."'";
mysql_query($query); 
And in functions you need to add:
PHP Code:
function getcash2($loggedinname){

include(
"config.php");

//First we see if we are logged in or not

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

$query "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);

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

$cash2=@mysql_result($result,$i,"cash2");

$i++;
}

return 
$cash2;


And

PHP Code:
function getpricevalue2($aid){

include(
"config.php");

//This function retrieves an adoptable's price from sql database.

$pricestatus "no";

$query "SELECT * FROM ".$prefix."adoptables WHERE id='$aid'";
$result mysql_query($query);
$num mysql_numrows($result);

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

$pricestatus=@mysql_result($result,$i,"pricestatus");
$pricevalue2=@mysql_result($result,$i,"pricevalue2");
$i++;
}

if(
$pricestatus == "enabled"){
$priceval2 $pricevalue2;
}
else{
$priceval2 0;
}

return 
$priceval2;


And I'm going to have to double check those other files in a bit, I have to eat dinner soon. D:

EDIT: Durr forgot nadopt XD Give me a minute and I'll have that up XD

EDIT2:

nadopt.php: Find the 'pricestats = $_Post" part and replace with this:
PHP Code:
$pricestatus $_POST["pricestatus"];
$pricestatus secure($pricestatus);

$pricevalue $_POST["pricevalue"];
$pricevalue secure($pricevalue);

$pricevalue2 $_POST["pricevalue2"];
$pricevalue2 secure($pricevalue2); 
__________________


"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo
My Adoptables|Nuzlocke Webcomic

Last edited by PTGigi; 02-02-2011 at 06:36 PM.
Reply With Quote
  #9  
Old 02-04-2011, 10: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: 110,104
Tequila is on a distinguished road
Default

Well that works so far. Now it removes all currencies...

Hm...
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #10  
Old 02-04-2011, 10:18 PM
PTGigi's Avatar
PTGigi PTGigi is offline
Crazily Friendly~HoF
 
Join Date: Jul 2009
Location: Somewhere >.>
Posts: 370
Gender: Female
Credits: 31,290
PTGigi
Default

Aw D: I don't recall that happening with me O.o
__________________


"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo
My Adoptables|Nuzlocke Webcomic
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
Mysidia Currency question. Phoeniix Questions and Supports 6 02-02-2015 03:38 PM
Second Currency and Currency icon Rovick Suggestions and Feature Requests 14 11-11-2014 06:29 PM
AEF Multi AllMw2 Other Chat 5 06-02-2010 01:30 PM
Multi Account jcga Questions and Supports 3 11-12-2009 01:39 PM


All times are GMT -5. The time now is 08:20 AM.

Currently Active Users: 1168 (0 members and 1168 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