Updates to files.

Forum
Last Post
Threads / Messages

Bloodrun

I am, who I am.
Premium Member
Joined
Apr 20, 2009
Messages
532
Points
0
Age
33
Mysidian Dollar
15,756
Okay, so there was an update to the old script.
I need to know what old files were changed and what was changed.

For example, what was changed in the registration file, the account file, etc.

Knowing this will save a lot of time in the migration process for new and old modifications.
 
I see, I can give a you a list of files and change logs later tonight. Most of them are additions of new script files, such as trade.php, abandon.php and so on. Others are slight modifications of sql query lines, you will see soon.
 
I see, I can give a you a list of files and change logs later tonight. Most of them are additions of new script files, such as trade.php, abandon.php and so on. Others are slight modifications of sql query lines, you will see soon.

Alright, thanks a lot of HoF. =D
 
Alright, here's the scripts that we've modified in latest release:

admin.php
account.php
doadopt.php
levelup.php
myadopts.php
register.php
inc/bbcodes.php
inc/function.php(added one function getcash(), which actually does nothing)

The new script files are listed below:
abandon.php
cash.php
doadoptab.php
mycash.php
redeem.php
shoutbox.php
trade.php

Also I've modified the script files inside the folder install, but guess they aint really that important to you since you already had a site long time ago. I will post in the next reply for detailed change log if you request.
 
Alright, here's the scripts that we've modified in latest release:

admin.php
account.php
doadopt.php
levelup.php
myadopts.php
register.php
inc/bbcodes.php
inc/function.php(added one function getcash(), which actually does nothing)

The new script files are listed below:
abandon.php
cash.php
doadoptab.php
mycash.php
redeem.php
shoutbox.php
trade.php

Also I've modified the script files inside the folder install, but guess they aint really that important to you since you already had a site long time ago. I will post in the next reply for detailed change log if you request.

Yes, I would like to know the detailed change in admin, account and function.php

Also, why does the added function in the function.php file not work?
 
I've only glanced at it, but from that glance it seemed like it would work, although it's possible it's just not being used currently.

Hmm, Ill see if i can get it to work for you guys.
I'll have to get the money system to work for the forum now anyway, so I kinda have to.
 
Database Structure Change:
New tables:
PHP:
$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:
$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:
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:
<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:
if($name == ""){
$name = $type;
}

Add below:

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

Then update the sql query line:

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

To:

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



In myadopts.php, change:

PHP:
$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:
$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:
$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:
$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:
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:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0')");



In levelup.php, find:

PHP:
// 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:
// 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(5, 15);
                      $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:
function getcash(){

}
 
Thank you for the detailed list, I will get to work on adapting the modifications now. =D
 
You are very welcome Bloodrun. I actually intentionally left out Bokkun's abandon system in this changelog, since the dev staff have somewhat reached an agreement that we should get rid of it and use an improved version.

Hall of Famer
 
Database Structure Change:
New tables:
PHP:
$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:
$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! :usedusedused: I've been looking for that :BIGO:
 
Oh you do? Actually you can pretty much upgrade from RA v1.0.0 by yourself. XD I know you are a coder good enough to follow these steps in each modification. ^^

Just keep in mind that Bokkun's abandon script actually clones an adoptable whenever a user abandons his/hers. I fixed his script myself in Mys/RA v1.1.0, just a reminder for you if you are upgrading your site manually.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top