Maciek20 Posted March 2, 2008 Share Posted March 2, 2008 I would like to have a script on my website about MMORPG TIBIA. If someone could write script which will show on my website information if player is online/offline I would be thankful. Script would take information about player who I would to see if hes online/offline on my page from there: http://www.tibia.com/community/?subtopic=whoisonline&world=Mythera Thanks for help. Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/ Share on other sites More sharing options...
shocker-z Posted March 2, 2008 Share Posted March 2, 2008 think you should post this in freelance forum mate http://www.phpfreaks.com/forums/index.php/board,8.0.html Regards Liam Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481879 Share on other sites More sharing options...
ohdang888 Posted March 2, 2008 Share Posted March 2, 2008 this forum isn't for us to create it for you. If you want someone to do that for you, hire them. Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481882 Share on other sites More sharing options...
thebadbad Posted March 2, 2008 Share Posted March 2, 2008 Since I like some exercise now and then, I wrote it for you. It's pretty simple: You load in the page in question, and check whether the given player name is present or not. <?php $playerName = 'Name here'; $world = 'Mythera'; $url = 'http://www.tibia.com/community/?subtopic=whoisonline&world='.$world; $pageString = file_get_contents($url); if (strpos($pageString, $playerName) !== false) { echo $playerName, ' is online in ', $world, '.'; } else { echo $playerName, ' is offline in ', $world, '.'; } ?> Edit: Be aware that the page we're loading is around 241 KB in size. May take a little while. Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481899 Share on other sites More sharing options...
thebadbad Posted March 2, 2008 Share Posted March 2, 2008 Oops, realized I made some mistakes, this should work as intended: <?php $playerName = 'Name here'; $playerName = str_replace(' ', ' ', $playerName); $world = 'Mythera'; $url = 'http://www.tibia.com/community/?subtopic=whoisonline&world='.$world; $pageString = file_get_contents($url); if (strpos($pageString, '">'.$playerName.'</A>') !== false) { echo $playerName, ' is online in ', $world, '.'; } else { echo $playerName, ' is offline in ', $world, '.'; } ?> Edit: Argh! The forum is wrecking my ampersand on line 2 in the code. It should read $playerName = str_replace(' ', ' ', $playerName); Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481926 Share on other sites More sharing options...
SirChick Posted March 2, 2008 Share Posted March 2, 2008 Oops, realized I made some mistakes, this should work as intended: <?php $playerName = 'Name here'; $playerName = str_replace(' ', '\ ', $playerName); $world = 'Mythera'; $url = 'http://www.tibia.com/community/?subtopic=whoisonline&world='.$world; $pageString = file_get_contents($url); if (strpos($pageString, '">'.$playerName.'</A>') !== false) { echo $playerName, ' is online in ', $world, '.'; } else { echo $playerName, ' is offline in ', $world, '.'; } ?> Ya really shouldn't just make scripts for people who can't be bothered to do it themselves or pay a freelance, because then other people will ask assuming that we will help do the same for them etc. Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481929 Share on other sites More sharing options...
thebadbad Posted March 2, 2008 Share Posted March 2, 2008 I agree that they should go to the freelance forum instead, I was just helping this time. Go away greedy people! Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481932 Share on other sites More sharing options...
corbin Posted March 2, 2008 Share Posted March 2, 2008 While we're complaining about this thread, I also hate vague titles. "Please help me with this." Then again, it got me to click it. Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481935 Share on other sites More sharing options...
SirChick Posted March 2, 2008 Share Posted March 2, 2008 While we're complaining about this thread, I also hate vague titles. "Please help me with this." Then again, it got me to click it. LOL Link to comment https://forums.phpfreaks.com/topic/94067-please-help-me-with-this/#findComment-481947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.