PDA

View Full Version : Adoptable Search Addon [by Kae]


Kaeliah
01-20-2011, 03:15 PM
Adoptable Search Addon
By Kaeliah

Modification TOS (http://www.mysidiaadoptables.com/forum/blog.php?cp=3)
**Note that there is no viewable credit required for this mod**

This was suggested for a new release of the MysAdopts version 1.2.0 I believe.

Functions: Adoptable search allows searching using name, type or owner and is similar to a search engine. If you type in 'sea', you're results may look like: sea, sea bass, horsea, etc. Results are listed in order of adoptable ID. Guests cannot search, this is to prevent server overload from malicious guests and spambots.

Installation: Upload the file adoptsearch.php to your main folder. Also included is some CSS arrangements specifically for the table on the page. You can see them below, add them pretty much anywhere on your CSS page to use them.


table#searchresults {
border: 1px solid black;
width: 490px;
}
table#searchresults td {
padding: 5px;
border: 1px solid black;
}

Enjoy!

Hall of Famer
01-20-2011, 03:19 PM
Wow this is just, marvelous! Thank you so much for doing this Kaeliah, this will surely be added to the next release. ^^ Glad you posted in public modification forum too, it will help users whose sites are already heavily modified and thus cannot upgrade to Mys v1.2.0 easily.

Kaeliah
01-20-2011, 03:20 PM
Thank you. :smile: I also try to keep installations as simple as possible. It doesn't get much better than this one. XD

PTGigi
01-20-2011, 04:21 PM
Oh yus searching! :D Now to add this when my homework is done >.>

RoconzaArt
01-20-2011, 05:11 PM
I like how your scripts are easy to install. Amazing work Kaeliah (http://www.mysidiaadoptables.com/forum/member.php?u=8722)

Kaeliah
01-20-2011, 05:19 PM
@Gigi - Yay hopefully it will be useful for you.

@Roconza - Well see, as a coder it's my job to provide support. If a script is hard to install, it means more work for me explaining how to install it and move problems that could arise. So it works better for everyone if the install is easy. :smile:

PokePets
01-21-2011, 09:14 AM
Thaaaaaaaaaaaaanks :)

Kaeliah
01-21-2011, 09:43 AM
Your welcome :smile:

Missy Master
01-23-2011, 08:15 AM
you're EPICCCC for this!!!

Thank you so much!! **runs to install this ***

RoconzaArt
01-24-2011, 05:07 PM
I found a error in this:

$article_content = $article_content."<tr><td>".$aid."</td><td><a href='http://kaedemolition.comlu.com/adoptables/levelup.php?id=".$id."'>".$name."</a></td>
<td>".$type."</td><td><a href='profile.php?user=".$owner."'>".$owner."</a></td><td>".$level."</td><td>".$gender."</td></tr>";


I change it to my site url and a invalid ID error.

Kaeliah
01-24-2011, 08:29 PM
Woops, my bad... I'll fix that... *goes to fix*

Just download and upload the new file, it'll work properly. :smile:

Hall of Famer
01-24-2011, 09:55 PM
^^ Glad you fixed this problem already Kaeliah. Looks like it was a similar mistake I made when adding cash system for leveling up pets, which connected to the table adopts_users instead of prefix_users. XD

Kaeliah
01-25-2011, 12:44 AM
I just left the entire link in by accident... >.> *facepalm*

PTGigi
01-25-2011, 02:29 PM
And I hate to bring up another error but it's only a minor one :ohnoes:

else{
$article_content = $article_content."<table id=\"searchresults\"><tr><td>ID</td><td>Name</td><td>Type</td><td>Owner</td><td>Level</td><td>Gender</td></tr>";
$i = 0;
while($i < $num){
$name=@mysql_result($result,$i,"name");
$aid=@mysql_result($result,$i,"aid");
$type=@mysql_result($result,$i,"type");
$owner=@mysql_result($result,$i,"owner");
$level=@mysql_result($result,$i,"currentlevel");
$gender=@mysql_result($result,$i,"gender");

$article_content = $article_content."<tr><td>".$aid."</td><td><a href='levelup.php?id=".$id."'>".$name."</a></td>
<td>".$type."</td><td><a href='profile.php?user=".$owner."'>".$owner."</a></td><td>".$level."</td><td>".$gender."</td></tr>";

$i++;
}
$article_content = $article_content."</table>";
}Should be:
else{
$article_content = $article_content."<table id=\"searchresults\"><tr><td>ID</td><td>Name</td><td>Type</td><td>Owner</td><td>Level</td><td>Gender</td></tr>";
$i = 0;
while($i < $num){
$name=@mysql_result($result,$i,"name");
$id=@mysql_result($result,$i,"aid");
$type=@mysql_result($result,$i,"type");
$owner=@mysql_result($result,$i,"owner");
$level=@mysql_result($result,$i,"currentlevel");
$gender=@mysql_result($result,$i,"gender");

$article_content = $article_content."<tr><td>".$id."</td><td><a href='levelup.php?id=".$id."'>".$name."</a></td>
<td>".$type."</td><td><a href='profile.php?user=".$owner."'>".$owner."</a></td><td>".$level."</td><td>".$gender."</td></tr>";

$i++;
}
$article_content = $article_content."</table>";
} So the ID number link works :meow:

Hall of Famer
01-25-2011, 04:20 PM
umm does it really make a big difference if you use 'id' instead of 'aid'?

PTGigi
01-25-2011, 04:30 PM
Well it had both $aid and $id so that messed it up, and personally I like $id so I changed the $aid to match the other $id X3

This is the line with the exact error:
$article_content = $article_content."<tr><td>".$aid."</td><td><a href='levelup.php?id=".$id."'>".$name."</a></td>See how there's an $aid and an $id? But up top only one is specified. :catfish:

Kaeliah
01-25-2011, 07:05 PM
Fixed, again.