Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2011, 01:20 PM
PokePets PokePets is offline
Premium Member
 
Join Date: Jun 2010
Posts: 228
Gender: Male
Credits: 14,643
PokePets
Default Click X adoptables to receive a special adoptable

// I know, I have terrible loooong coding, but it works anyway ;D

Demo:
http://pokepets.comlu.com/index.php (levelup).

1) We gone edit the database, go to adopts_settings, insert 3 new rows:
Code:
Name: clickevent 
Value: Yes
Name: eventneeded 
Value: What you want, example: 100
Name: eventprize
Value: The type of adoptable users get when they clicked X adopables, example: Pikachu
Now change also your _users table!
Add a new field;
Code:
eventclicks (varchar 5) default: 0
2) Now we gone edit our levelup.php
Search for this:

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."{$owned_adoptable['name']} one ".$lang_unit;
    
$article_content "<img src='{$image}'><br>{$lang_gave}{$owned_adoptable['name']}    one {$lang_unit}.<br>".$lang_levelup_encourage;
    

    } 
// Adoptable is not frozen, end isfrozen else check 
And add this under;

PHP Code:
$query "SELECT * FROM ".$prefix."settings WHERE name='clickevent'";
         
$result mysql_query($query);
         
$num mysql_numrows($result); 
       

    
$clickevent=@mysql_result($result,$i,"value");
    
             
$query2 "SELECT * FROM ".$prefix."users WHERE username='{$loggedinname}'";
             
$result2 mysql_query($query2);
             
$num2 mysql_numrows($result2); 
             
               
$eventclicks=@mysql_result($result2,$i,"eventclicks");
               
             
$query3 "SELECT * FROM ".$prefix."settings WHERE name='eventneeded'";
             
$result3 mysql_query($query3);
             
$num3 mysql_numrows($result3); 
             
               
$eventneeded=@mysql_result($result3,$i,"value");
               
             
$query4 "SELECT * FROM ".$prefix."settings WHERE name='eventprize'";
             
$result4 mysql_query($query4);
             
$num4 mysql_numrows($result4); 
             
               
$eventprize=@mysql_result($result4,$i,"value");
               
$newevent $eventclicks 1;
               
$eventstillneeded $eventneeded $newevent;
      
    if(
$clickevent == "yes" and $newevent $eventneeded){ 
   
    
runquery("UPDATE {$GLOBALS['prefix']}users SET `eventclicks` = '{$newevent}' WHERE `username` = '{$loggedinname}'");
    
$event "There is a click event! You have clicked {$newevent} adoptables, you need to click {$eventstillneeded} adoptables more to 
              receive a 
{$eventprize}.";
    }

     elseif(
$newevent == $eventneeded){ 
     
runquery("UPDATE {$GLOBALS['prefix']}users SET `eventclicks` = '{$newevent}' WHERE `username` = '{$loggedinname}'");
     
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$eventprize}', 'Congratz','$loggedinname','0','0', '$code', '','$alts','fortrade','no', 'None','0')");
     
$event "There is a click event! You have clicked {$newevent} adoptables, that's enaugh to receive a {$eventprize}. It's automatic
              added to your account.'"
;
    
    }
    
elseif(
$newevent $eventneeded){ 
   
runquery("UPDATE {$GLOBALS['prefix']}users SET `eventclicks` = '{$newevent}' WHERE `username` = '{$loggedinname}'");
    
$event "You already received a click promo, you can't get another one.";
    
    }
    else{
     
    
$event "";
    } 
3) Now change your levelup content, find
PHP Code:
$article_content $article_content "<div align='center'><br /><br><br>You have earned {$reward} ".grabanysetting('cost')." for leveling up this adoptable. <br />You now have {$newamount} ".grabanysetting('cost')."</div>"
And change it to;

PHP Code:
$article_content $article_content "<div align='center'><br />{$event}<br><br>You have earned {$reward} ".grabanysetting('cost')." for leveling up this adoptable. <br />You now have {$newamount} ".grabanysetting('cost')."</div>"
Now it should work :D



FIX THAT GUESTS CAN'T GET IT WILL COME ;)

Last edited by fadillzzz; 12-23-2011 at 11:55 PM.
Reply With Quote
  #2  
Old 12-24-2011, 04:52 AM
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: 227,333
Hall of Famer is on a distinguished road
Default

Well I am afraid it will not work unless you modify a line at register.php since the structure of table prefix_users has changed:

PHP Code:
Now change also your _users table!
Add a new field
Unless this happened to be a typo...
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 12-24-2011, 06:09 AM
PokePets PokePets is offline
Premium Member
 
Join Date: Jun 2010
Posts: 228
Gender: Male
Credits: 14,643
PokePets
Default

Quote:
Originally Posted by Hall of Famer View Post
Well I am afraid it will not work unless you modify a line at register.php since the structure of table prefix_users has changed:

PHP Code:
Now change also your _users table!
Add a new field
Unless this happened to be a typo...
Indeed *changing* ;)
Reply With Quote
Reply

Thread Tools
Display Modes

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
Special characters not showing PokePets Questions and Supports 7 02-02-2012 12:28 PM
Adoptable hosts Vs Mysidia Adoptables RoconzaArt Adoptables Buzz 43 08-12-2011 04:17 PM
Random Adoptable Click page AlkseeyaKC Suggestions and Feature Requests 4 07-01-2011 03:49 PM
Add Special Pets to Account Blue Icebox Questions and Supports 4 02-20-2009 11:45 PM
Special Prize Pets LilPixie Questions and Supports 0 12-31-1969 07:00 PM


All times are GMT -5. The time now is 12:34 AM.

Currently Active Users: 291 (0 members and 291 guests)
Threads: 4,078, Posts: 31,984, 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 - 2021, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636