PDA

View Full Version : Page that will display a user's pets (non layout destroying update)


kisazeky
04-02-2009, 02:00 AM
This script will neatly display a given user's pets, in rows of 5, up to 100.

Everybody's profile link will be:

profile.php?owner=username

See an example here:
http://digiadopt.l4rge.com/profile.php?owner=kisazeky

zhiichiro
04-02-2009, 02:29 AM
we have that already yey!!

mattalien
04-02-2009, 10:10 AM
It destroys my layout though.....

http://www.pokeframesadoptionstation.comuf.com/profile.php?owner=Mattalien

rosepose
04-02-2009, 10:44 AM
How would one change the number of pets per row?

kisazeky
04-02-2009, 01:22 PM
Rose find this line:


$query = "SELECT * FROM owned_adoptables WHERE owner = '$owner' ORDER BY uid DESC LIMIT 0,5 ";


Change the 5 to the number of pets you'd like to display. But that means, you have to change every $query to reflect that new number. For example if you want 8, you'd have to change the next $query from


$query = "SELECT * FROM owned_adoptables WHERE owner = '$owner' ORDER BY uid DESC LIMIT 5,5";

to

$query = "SELECT * FROM owned_adoptables WHERE owner = '$owner' ORDER BY uid DESC LIMIT 8,8";


and then...


$query = "SELECT * FROM owned_adoptables WHERE owner = '$owner' ORDER BY uid DESC LIMIT 10,5";

to

$query = "SELECT * FROM owned_adoptables WHERE owner = '$owner' ORDER BY uid DESC LIMIT 16,8";


and so on.

Just find next $query and replace the values.

Killgore
04-02-2009, 07:29 PM
Slight issue: Some of my members have spaces in their username, and it refuses to even acknowledge that the user exists. Is there a way to fix this, or am i over-looking something?

Seapyramid
04-02-2009, 09:22 PM
Slight issue: Some of my members have spaces in their username, and it refuses to even acknowledge that the user exists. Is there a way to fix this, or am i over-looking something?

I had the same issue but was able to fix the problem

if you replace line 77 with

$owner = preg_replace("/[^a-zA-Z0-9\x20]/", "", $owner); it will accept the space but still disallow other chara for security

Sea

Ashje
04-03-2009, 01:40 AM
Awesome, Thanks =). But how do I make a table like zhiichiro on the users page, with the ID, Username and Currency shown?

kisazeky
04-03-2009, 02:56 PM
Like this. *download the file I included*

Note for the pets link you also need the profile.php, which I also inclded.

Hall of Famer
11-05-2009, 07:58 PM
This can be easily remade into a pokedex system. XD

Bloodrun
11-05-2009, 08:06 PM
This can be easily remade into a pokedex system. XD


This is already a part of the current release, and yes it has been made. ;)

Hall of Famer
11-05-2009, 08:14 PM
This can be easily remade into a pokedex system. XD


This is already a part of the current release, and yes it has been made. ;)


Umm what do you mean? I didnt happen to find it after installing Rusnak's script.

Well pokedex system should list pets from number 001 to xxx, and the detailed descriptions should be accessible only for the pets you own. Dunno if this is what you are talking about.

Bloodrun
11-05-2009, 08:27 PM
This can be easily remade into a pokedex system. XD


This is already a part of the current release, and yes it has been made. ;)


Umm what do you mean? I didnt happen to find it after installing Rusnak's script.

Well pokedex system should list pets from number 001 to xxx, and the detailed descriptions should be accessible only for the pets you own. Dunno if this is what you are talking about.


Go to your profile, if you have any adopted pets, you will see them listed.

And what I was talking about for the pokedex is that someone did make a site about pokemon wether or not they literally have a pokedex I do not know.