Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Suggestions and Feature Requests

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2011, 05:37 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 682,212
Hall of Famer is on a distinguished road
Default

Database Structure Change:
New tables:
PHP Code:
$query "CREATE TABLE ".$prefix."shoutbox (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, user varchar(50), date varchar(30), comment varchar(2500))";
mysql_query($query);

$query "CREATE TABLE ".$prefix."trades (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, userrequestingtrade varchar(50), tradetype varchar(20), adoptableoffered INT, cashoffered INT, adoptabledesired INT, custommessage varchar(150), offerstatus varchar(30), tradeto varchar(40))";
mysql_query($query);

$query "CREATE TABLE ".$prefix."cash_logs (to varchar(40), from varchar(40), type varchar(40), amount int(10), date varchar(25))";
mysql_query($query); 
Also add the column 'gender'(VARCHAR) in table 'owned_adoptables', and 'dollar'(INT) in table 'user'
After this is done, insert the following three rows in the table 'settings':
PHP Code:
$query "INSERT INTO ".$prefix."settings (name, value) VALUES ('enabletrades', 'yes')";
mysql_query($query);

$query "INSERT INTO ".$prefix."settings (name, value) VALUES ('tradecost', '0')";
mysql_query($query);

$query "INSERT INTO ".$prefix."settings (name, value) VALUES ('tradeoffercost', '0')";
mysql_query($query); 





Scripts Modifications:

In admin.php, find the lines below to add more bbcodes buttons:

PHP Code:
if($pagetitle != "" or $pagecontent != ""){

$article_content $article_content="Here you can edit an existing page.  Use the text editor below to change the page title or content.
You may use some limited BBCodes in the box below.<br><form name='form1' method='post' action='admpost.php'>
  <p><b><u>Currently Editing Page:</u> "
.$more."</b>
    <input name='pageurl' type='hidden' id='pageurl' value='"
.$more."'>
</p>
  <p>Page Title: 
    <input name='pagetitle' type='text' id='pagetitle' value='"
.$pagetitle."'>
</p>
  <p>Page Content: </p>
  <p><input type=\"button\" value=\"Bold\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[b]Bold Text Here[/b]'\">
<input type=\"button\" value=\"Italics\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[i]Italic Text Here[/i]'\"> 
<input type=\"button\" value=\"Underline\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[u]Underlined Text Here[/u]'\">
<input type=\"button\" value=\"URL / Link\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[url=http://www.yoursite.com]Link text goes here[/url]'\">
<input type=\"button\" value=\"Image\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[img]http://www.somesite.com/images/someimage.gif[/img]'\">
<input type=\"button\" value=\"Image w/ Link\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[url=http://www.yourlinksite.com][img]http://www.somesite.com/images/someimage.gif[/img][/url]'\"> 
Add below:

PHP Code:
<input type=\"button\" value=\"Links a Text\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[urlsame=]Linked Text Here[/urlsame]'\">
<input type=\"button\" value=\"Striking Format\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[s]Strike Text Here[/s]'\">
<input type=\"button\" value=\"Youtube Video\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[youtube]http://www.youtube.com/videoname[/youtube]'\">
<input type=\"button\" value=\"User Profile\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[profile]Username[/profile]'\">
<input type=\"button\" value=\"Image Maps\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[imgmap]http://www.urlhere.com/[/imgmap]'\">
<input type=\"button\" value=\"Map Locations\" onClick=\"document.forms['form1']. elements['pagecontent'].value=document.forms['form1']. elements['pagecontent'].value+'[map][where=#,#,#,#=http://www.firstlinkhere.com/][wherecirc=#,#,#=http://www.secondinkhere.com/][/map]'\"> 

In doadopt.php, find:

PHP Code:
if($name == ""){
$name $type;

Add below:

PHP Code:
//The gender mod
$tempgender rand(01);
if(
$tempgender == "0") {
$gender "Female";
unset(
$tempgender);
}
else {
$gender "Male";
unset(
$tempgender);

Then update the sql query line:

PHP Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no')"); 
To:

PHP Code:
mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no','$gender')"); 


In myadopts.php, change:

PHP Code:
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$totalclicks=@mysql_result($result,$i,"totalclicks"); 
To:

PHP Code:
$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");
$gender=@mysql_result($result,$i,"gender");
$totalclicks=@mysql_result($result,$i,"totalclicks"); 
Then change:

PHP Code:
$article_title $name."'s Statistics:";
$article_content "<img src='".$image."'><br><br>
<b>Total Clicks: "
.$totalclicks."<br>
Current Level: "
.$currentlevel."<br>
Next Level: "
.$nloutput."<br></b>"
To:

PHP Code:
$article_title $name."'s Statistics:";
$article_content "<img src='".$image."'><br><br>
<b>Total Clicks: "
.$totalclicks."<br>
Gender: "
.$gender."<br>
Current Level: "
.$currentlevel."<br>
Next Level: "
.$nloutput."<br></b>"


In register.php, find:

PHP Code:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','')"); 
Replace with:(this makes sure the number of columns in user.php is correct)

PHP Code:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0')"); 


In levelup.php, find:

PHP Code:
// Show a thank you message along with the adoptable's information to the user...

    
$image getcurrentimage($id); // Get the current image of the adoptable...

    
$article_title $lang_gave."".$name." one ".$lang_unit;
    
$article_content "<img src='".$image."'><br>".$lang_gave."".$name." one ".$lang_unit.".<br>".$lang_levelup_encourage;
    

    } 
// Adoptable is not frozen, end isfrozen else check 
Add below:

PHP Code:
// Start Rewards
                  
                  // ************************************************  
                  
                  
                  //Get currency on level up
                  
                  
$query "SELECT * FROM `".$prefix."users` WHERE `username`='$loggedinname'";
                  
$result mysql_query($query);
                  
$num mysql_numrows($result);
                  
                  
$i 0;
                  while (
$i 1) {
                      
$dollar = @mysql_result($result$i"dollar");
                      
                      
// Change this number 10 to the number of currency you want users to earn on level up  
                      
$amount rand(515);
                      
$newbalance $dollar $amount;
                      
                      
$i++;
                  }
                  
                  
mysql_query("UPDATE `".$prefix."users` SET `dollar`='" $newbalance "' WHERE `username`='$loggedinname'");  
                  
                  
                  
$article_content $article_content "<div align='center'><br />You have earned "$amount ." Dollars for leveling up this Adoptable. <br />You now have  " $newbalance " Dollars.</div>";
    

    

    } 
In inc/bbcodes.php

Simply replace your old bbcode php file with the one in Mys/RA v1.10, plain and simple.

In inc/function.php

Add this line to somewhere in your function.php, it defines a blank function that does nothing but to prevent an error from occurring:

PHP Code:
function getcash(){


__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #2  
Old 01-18-2011, 05:50 PM
PTGigi's Avatar
PTGigi PTGigi is offline
Crazily Friendly~HoF
 
Join Date: Jul 2009
Location: Somewhere >.>
Posts: 370
Gender: Female
Credits: 39,788
PTGigi
Default

Quote:
Originally Posted by Hall of Famer View Post
Database Structure Change:
New tables:
PHP Code:
$query "CREATE TABLE ".$prefix."shoutbox (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, user varchar(50), date varchar(30), comment varchar(2500))";
mysql_query($query);

$query "CREATE TABLE ".$prefix."trades (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, userrequestingtrade varchar(50), tradetype varchar(20), adoptableoffered INT, cashoffered INT, adoptabledesired INT, custommessage varchar(150), offerstatus varchar(30), tradeto varchar(40))";
mysql_query($query);

$query "CREATE TABLE ".$prefix."cash_logs (to varchar(40), from varchar(40), type varchar(40), amount int(10), date varchar(25))";
mysql_query($query); 
Also add the column 'gender'(VARCHAR) in table 'owned_adoptables', and 'dollar'(INT) in table 'user'
After this is done, insert the following three rows in the table 'settings':
PHP Code:
$query "INSERT INTO ".$prefix."settings (name, value) VALUES ('enabletrades', 'yes')";
mysql_query($query);

$query "INSERT INTO ".$prefix."settings (name, value) VALUES ('tradecost', '0')";
mysql_query($query);

$query "INSERT INTO ".$prefix."settings (name, value) VALUES ('tradeoffercost', '0')";
mysql_query($query); 


Oh thank you! I've been looking for that
__________________


"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
insert flash / .swf files voni Questions and Supports 7 06-15-2014 10:55 AM
Uploading files!? EpicEquestrian Questions and Supports 3 05-27-2012 07:54 PM
css files superdude44 Questions and Supports 5 05-06-2012 05:46 PM
How to get a PHP file to be included in the files in different directories? robertson Other Chat 4 11-09-2010 10:20 AM


All times are GMT -5. The time now is 09:16 PM.

Currently Active Users: 954 (0 members and 954 guests)
Threads: 4,081, Posts: 32,043, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636