PDA

View Full Version : PHP... Hmm..



Blob
23-02-2007, 04:00 PM
This is mainly to anyone that can use explode (THOMAS OR NETS LOL)

Anyway, is it possible, just like your MySpacePicture thing, to get the avatar, name and usertitle out of someones profile? And their VIP status

Cos you could have

function habbox($id){

Then have

echo habbox("ID FOR UR ACCOUNT HERE");

thanks.

Tomm
23-02-2007, 04:05 PM
Indeed you could.

Blob
23-02-2007, 04:10 PM
Ok, i need to reprashe that:

Can anyone write a code for it please?

ZAG
23-02-2007, 04:12 PM
Do you mean from HabboxForum?

If so I could try write one for you.

Blob
23-02-2007, 04:12 PM
Yes please :D

Tomm
23-02-2007, 04:21 PM
You can't do it though.

Logout and go to:

http://www.habboxforum.com/member.php?u=36091

You'll get:

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
You are not logged in. Fill in the form at the bottom of this page and try again.
You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Blob
23-02-2007, 04:26 PM
Thats preeeety dumb.

Edit: But if you transfer it into GD, and put it in your sig, I suppose most members would be logged in looking at it..

ZAG
23-02-2007, 04:27 PM
I was just about to post that. I did code it though.



<?php

function getHabboxName($id){
$data = file_get_contents("http://www.habboxforum.com/member.php?u=".$id);
$name = explode('<td class="tcat">View Profile<span class="normal">: ', $data);
$name = explode('</span></td>', $name[1]);
$name = trim($name[0]);
return $name;
}
//Example
echo getHabboxName(36091)."<br><br>";

function getHabboxAvatar($id){
$data = file_get_contents("http://www.habboxforum.com/member.php?u=".$id);
$avatar = explode('<td><img src="image.php?u=', $data);
$avatar = explode('"', $avatar[1]);
$avatar = trim($avatar[0]);
$avatar = "http://www.habboxforum.com/image.php?u=".$avatar;
return $avatar;
}
//Example
echo '<img src="'.getHabboxAvatar(36091).'" /><br><br>';

function getHabboxUserTitle($id){
$data = file_get_contents("http://www.habboxforum.com/member.php?u=".$id);
$usertitle = explode('<div class="smallfont"><b><font size=1>', $data);
$usertitle = explode('</font></b></div>', $usertitle[1]);
$usertitle = trim($usertitle[0]);
}

//Example
echo getHabboxUserTitle(36091)."<br><br>";

function isVIP($id){
$data = file_get_contents("http://www.habboxforum.com/member.php?u=".$id);
if(eregi('<img src="images/ranks/VIP.gif" alt="" border="" />', $data)){
return true;
}else{
return false;
}
}

//Example
if(isVIP(36091)){
echo "VIP";
}else{
echo "Not VIP";
}

?>

Obviously it doesnt work and I dont know if theres errors :P

Blob
23-02-2007, 04:28 PM
I was just about to post that. I did code it though.

Post please :D

ZAG
23-02-2007, 04:29 PM
Its my post above :)

Blob
23-02-2007, 04:39 PM
I guess that was usless, lol :( Hmm what else could you do it on..

ZAG
23-02-2007, 04:41 PM
Well you obviously could do it on forums that allow it (dont see why Habbox dont).

Carlsta
23-02-2007, 04:46 PM
Mmmm i uploaded it to my site

www.carlstac.com/test.php

ZAG
23-02-2007, 04:47 PM
Yeah we've already said it doesnt work.

Carlsta
23-02-2007, 04:48 PM
It does work sort off..

Blob
23-02-2007, 04:50 PM
Lol, Im thinking, hmm how about this:

On project washing machine, you can have a custom message, when you click your washing machine it comes up with the message. The message is in the source of the page anyway, so see if you can get the custom message of a washing machine by the user (in the source aswell) by using that:

Basicly:

It gets the custom message from the source by looking for the member

Link:

http://www.tehwasher.co.uk/view.php

ZAG
23-02-2007, 05:04 PM
<?php
function getMessage($name){
$data = file_get_contents("http://www.tehwasher.co.uk/view.php");
$message = explode($name."'s Washing Machine<br />Custom Message: <br />", $data);
$message = explode('">', $message[1]);
$message = trim($message[0]);
return $message;
}
echo getMessage("Ryan");
?>

I havent tried it.

Blob
23-02-2007, 05:05 PM
<?php
function getMessage($name){
$data = file_get_contents("http://www.tehwasher.co.uk/view.php");
$message = explode($name."'s Washing Machine<br />Custom Message: <br />", $data);
$message = explode('">', $message[1]);
$message = trim($message[0]);
return $message;
}
echo getMessage("Ryan");
?>

I havent tried it.

Well done! It works!

ZAG
23-02-2007, 05:07 PM
Thanks :) .

Blob
23-02-2007, 06:21 PM
Thanks :) .

I put it into gd, hold on:

http://tehwasher.co.uk/message/Ryan/

Want to hide these adverts? Register an account for free!