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
  #41  
Old 08-31-2011, 05:55 PM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,935
fadillzzz is an unknown quantity at this point
Default

Oh and btw, I just noticed that when you click on 'Click here to sort your adoptables' the table somehow gets aligned to the left a little bit more.
If you're wondering how to fix that, I think the following code should do the trick
HTML Code:
    $(document).ready(function(){
        
        $('body').undelegate('click').delegate('p#activate_sort', 'click', function(){
            var realBg = $('table#sortable_adoptables').css('background-color');
            var submitForm = '<form name="submit_order" id="submit_order" action="" method="post"><fieldset><label for="submit">Submit Changes</label><input type="submit" id="submit" value="Submit"></fieldset></form>';
            $('table#sortable_adoptables').css({backgroundColor: '#FFFF66', paddingRight: '0'}).animate({ backgroundColor: realBg },  'slow' ).find('tbody').sortable({ cursor: 'pointer' });
            $(submitForm).insertAfter('p#activate_sort').hide().slideDown();
            $('p#activate_sort').attr('id', 'deactivate_sort');
        });
        
        $('body').undelegate('submit').delegate('form#submit_order', 'submit', function(event){
            event.preventDefault();
            var data = $('table#sortable_adoptables tbody').sortable('serialize');
            $.post('ajax_sort.php', data, function(result){
                $('form#submit_order').html(result).delay(5000).fadeOut('slow', function(){
                    $(this).remove();                    
                });
            });
            $('table#sortable_adoptables tbody').sortable('destroy');
            $('p#deactivate_sort').attr('id', 'activate_sort');
        });
Reply With Quote
  #42  
Old 08-31-2011, 06:43 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 97,591
SilverDragonTears is on a distinguished road
Default

still did it...
__________________

Check out SilvaTales
Reply With Quote
  #43  
Old 08-31-2011, 10:27 PM
Teshia's Avatar
Teshia Teshia is offline
Art Director &amp; Developer
 
Join Date: Sep 2010
Location: On the Road
Posts: 99
Gender: Female
Credits: 6,451
Teshia
Default

Sorting! Awesome!
Reply With Quote
  #44  
Old 09-08-2011, 10:57 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,935
fadillzzz is an unknown quantity at this point
Default

First post updated:
Fixed a bug where trading adoptables can cause duplicate entries in the sorting tables.
The table structure now only have 'adoptable_id' as the primary key.
Reply With Quote
  #45  
Old 10-22-2011, 04:56 AM
PokePets PokePets is offline
Premium Member
 
Join Date: Jun 2010
Posts: 228
Gender: Male
Credits: 22,594
PokePets
Default

Thank you for this mod :)
Works perfect on my site!
Reply With Quote
  #46  
Old 11-23-2011, 02:25 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 97,591
SilverDragonTears is on a distinguished road
Default

Why won't it save the sort anymore (After Maple added in a tabs feature for our adopts)?

PHP Code:
include("inc/functions.php");

//***************//
//  START SCRIPT //
//***************//

$id $_GET["id"];
$act $_GET["act"];
$more $_GET["more"];
$abilityid $_GET["abilityid"];
$tab $_GET['tab'];

if(
$isloggedin == "yes"){

if(
$act == ""){

$tabs gettabs();
$article_title .="{$loggedinname}'s Den";
        
$article_content .="


        <table width='60%' style='text-align:center;' class='shop'><center><tr><td><p class='sort' id='activate_sort'>
                         Sort Adopts - Currently NOT Working.
                    </p><center></td></tr></table></center>
        <table width='60%' style='text-align:center;' class='shop'><tr><td width='20%'><a href='trade.php'>Trade</a>-<a href='search.php'>Search</a></td>
        <td width='20%'><a href='breeding.php'>Breed</a></td>
        <td width='20%'><a href='embed.php'>Embed All</a></td>
        <td width='20%'><a href='inventory.php'>Kit Inventory</a></td><td width='20%'><a href='inventory2.php'>Adult Inventory</a></td></tr></table></center>
        <br>
         <table width='60%' style='text-align:center;' class='shop'><tr><td width='20%'><a href='tab.php'>Manage Dens</td></a>
        <td width='20%'>Select a den to go to: <select name='tab' id='tab' ONCHANGE='location = this.options[this.selectedIndex].value;'>
                                                <option value='#'>Please Select one below:</option><option value='myadopts.php'>Default</option>"
.$tabs."
                                                </select></td>
</tr></table></center>
        <br><div style='float:left;'>"
;
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_collectables WHERE type = 'Halloween' AND owner = '".$loggedinname."'";
        
$result runquery($query);
    
$num mysql_numrows($result);
if(
$num 0){
$article_content .="<img src='images/candypumpkin.png' title='Trick or Treat 2011'>";
}else{
$article_content .="";
}
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables WHERE type = '911 Silvfox' AND owner = '".$loggedinname."'";
        
$result runquery($query);
    
$num mysql_numrows($result);
if(
$num 0){
$article_content .="<img src='images/us.png' title='911 Event'>";
}else if(
$type == '911 Wolf'){
$article_content .="<img src='images/us.png' title='911 Event'>";
}else{
$article_content .="";
}
$query "SELECT * FROM ".$GLOBALS['prefix']."owned_adoptables LEFT JOIN ".$GLOBALS['prefix']."sort_adoptables 
                        ON "
.$GLOBALS['prefix']."owned_adoptables.aid = ".$GLOBALS['prefix']."sort_adoptables.adoptable_id WHERE owner = '".$loggedinname."' ORDER BY ".$GLOBALS['prefix']."sort_adoptables.sorting_id, ".$GLOBALS['prefix']."owned_adoptables.currentlevel ASC";
    
$result runquery($query);
    
$numpets mysql_numrows($result);

if(
$numpets >= 500){
        
$article_content .="<img src='/images/trophy-gold.png' title='Gold Trophy - Over 500 SilvAdopts'>";
} else if(
$numpets >= 200){
        
$article_content .="<img src='/images/silvertrophy.png' title='Silver Trophy - Over 200 SilvAdopts'>";
} else if(
$numpets >= 50){
        
$article_content .="<img src='/images/trophy-bronze.png' title='Bronze Trophy - Over 50 SilvAdopts'>";
}else{
        
$article_content .="";
}
$article_content .="</div><br><br>
        <br>Share this link with others to show them your Den<br>
        <input type='text' size='100' value='http://silvadopts.com/profile.php?user=
$loggedinname'><br>
        <a href='http://silvadopts.com/profile.php?user=
$loggedinname'>http://silvadopts.com/profile.php?user=$loggedinname</a><br>";

        
$article_content .= "<div style='height:100%;
        color: #fff;
    border: 1px solid #282828;
    border-top: 1px solid #363636;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    padding: 5px;'><table style='width: 100%;' class='madopt' id='sortable_adoptables' ><tbody>
    <tr><th>SilvAdopt</th><th>Name</th><th>Level</th><th>Manage</th><th>Get Codes</th><th>Clicks</th></tr><br>"
;


    
// We need to get all of the user's adoptables from the database and display them...
   /* $query = "SELECT * FROM ".$prefix."owned_adoptables, ".$prefix."levels WHERE ".$prefix."owned_adoptables.owner = '{$loggedinname}'" 
    ." AND ".$prefix."owned_adoptables.type = ".$prefix."owned_adoptables.type AND ".$prefix."levels.thisislevel = ".$prefix."owned_adoptables.currentlevel AND ".$prefix."levels.adoptiename = " 
    .$prefix."owned_adoptables.type ORDER BY ".$prefix."owned_adoptables.sort, ".$prefix."owned_adoptables.totalclicks";
*/
$query "    SELECT * 
                    FROM 
{$prefix}owned_adoptables 
                    LEFT JOIN 
{$prefix}sort_adoptables 
                        ON 
{$prefix}owned_adoptables.aid = {$prefix}sort_adoptables.adoptable_id
                    INNER JOIN 
{$prefix}levels 
                        ON 
{$prefix}levels.thisislevel = {$prefix}owned_adoptables.currentlevel
                    INNER JOIN 
{$prefix}adoptables
                        ON 
{$prefix}owned_adoptables.type = {$prefix}adoptables.type
                    WHERE 
{$prefix}owned_adoptables.owner = '{$loggedinname}' AND {$prefix}owned_adoptables.tab = '{$tab}'
                    AND 
{$prefix}levels.adoptiename = {$prefix}adoptables.type
                    ORDER BY 
{$prefix}sort_adoptables.sorting_id, {$prefix}owned_adoptables.currentlevel ASC";  

    
$result runquery($query);
    
$num mysql_numrows($result);
    
//Loop out code
    
$i=0;
    while (
$i $num) {
        
$aid=@mysql_result($result,$i$prefix."owned_adoptables.aid");
        
$currentlevel=@mysql_result($result,$i$prefix."owned_adoptables.currentlevel");
        
$gender=@mysql_result($result,$i$prefix."owned_adoptables.gender");
        
$isfrozen=@mysql_result($result,$i$prefix."owned_adoptables.isfrozen");
        
$type=@mysql_result($result,$i$prefix."owned_adoptables.type");
        
$name=@mysql_result($result,$i$prefix."owned_adoptables.name");
        
$eggimage=@mysql_result($result,$i$prefix."adoptables.eggimage");
        
$usealternates=@mysql_result($result,$i$prefix."owned_adoptables.usealternates");
        
$totalclicks=@mysql_result($result,$i$prefix."owned_adoptables.totalclicks");
        
$primaryimage=@mysql_result($result,$i$prefix."levels.primaryimage");
        
$alternateimage=@mysql_result($result,$i$prefix."levels.alternateimage");
        if (
$usealternates=='yes') { $image $alternateimage; }
        else { 
$image $primaryimage; }
        if (
$currentlevel==0) { $image $eggimage; }
        if (
$image=='') { $image $primaryimage; }
    
$article_content .= "<tr id='orderaid_{$aid}'><td width='20%'><a href='myadopts.php?act=stats&id=".$aid."'><img src='$image'></a></td><td width='20%'>";

if(
$isfrozen == 'no') {
    
$article_content .= '';
} else {
    
$article_content .= '<img src=\'images/snowflake.png\'>';
    

__________________

Check out SilvaTales
Reply With Quote
  #47  
Old 03-23-2012, 02:52 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 97,591
SilverDragonTears is on a distinguished road
Default

Do you have a fix for this code for 1.3?

Code:
function secure($data, $key = NULL) {
    //This function performs security checks on all incoming form data
    if ($key === 'orderaid')
    {
            //var_dump($data);    var_dump($key); die;
        foreach($data as $dataKey => $dataVal)
        {
            $data[$dataKey] = abs(intval($dataVal));
        }
            //var_dump($data);die;
        return $data;
    }    
    if(is_array($data)) {
        die("Hacking Attempt!");
    }   
    $data = htmlentities($data);
    $data = mysql_real_escape_string($data);
    $data = strip_tags($data, '');  
    if ($key === NULL)
    {
        return $data;
    }    
    $GLOBALS['_POST'][$key] = $data;
}
This does not work in 1.3
__________________

Check out SilvaTales
Reply With Quote
  #48  
Old 03-23-2012, 04:03 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 37,935
fadillzzz is an unknown quantity at this point
Default

That's odd. There isn't any big change to that function in Mys 1.3.
Perhaps you installed it incorrectly. But more importantly, what do you mean by "does not work"? Can you be more specific?
Reply With Quote
  #49  
Old 03-23-2012, 06:53 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 97,591
SilverDragonTears is on a distinguished road
Default

I fixed it :) It was late last night so I don't even know how I did it :/
__________________

Check out SilvaTales
Reply With Quote
  #50  
Old 03-23-2012, 07:11 PM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 125
Gender: Female
Credits: 21,465
Kesstryl is on a distinguished road
Default

If you do remember, can you post it? I'd like to get this working on 1.3 but I've been waiting for it to get updated to 1.3. This is too useful to not have.
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
"Fairy State" theme by Bobbybighoof (Mysidia 1.3.3) bobbybig Templates and Themes 3 07-18-2018 07:54 PM
Sort "myadopts" page SilverDragonTears Questions and Supports 23 06-12-2017 06:39 PM
Removing of prefix "class", "abstract", "interface" Suggestions FounderSim Suggestions and Feature Requests 3 10-05-2014 06:35 PM
Creating a "Faction" for adoptables/owned adoptables Vaporman87 Questions and Supports 1 03-04-2014 04:38 PM
Changing... or "masking" existing URLs Vaporman87 Questions and Supports 7 03-03-2014 08:10 PM


All times are GMT -5. The time now is 06:44 AM.

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