PDA

View Full Version : help



Trigs
24-12-2007, 03:12 PM
I have an invisionfree forum and I want to integrate the usersystem into my main site. What PHP code would i use to display user info like username, number of members, etc on the main site?

+rep to anyone that helps http://habbos.net/imagehosting/44630b6c9db8df.gif

Moved by Agesilaus (Forum Moderator) from Design and Development: Please post in the correct forum.

Alexz0r
24-12-2007, 03:45 PM
What PHP code would i use to display user info like username, number of members, etc on the main site?

+rep to anyone that helps http://habbos.net/imagehosting/44630b6c9db8df.gif

no soz.

Edited by --ss-- (Forum Super Moderator): Please do not post pointlessly.

Trigs
24-12-2007, 03:52 PM
lolsz u.

Do i echo it?

Snex
24-12-2007, 03:55 PM
What he meant is there is no way to show Invision Free stats on your site. It's impossible. If you have saw it before they weren't using Invision Free.

MrCraig
24-12-2007, 04:03 PM
You could use file_get_contents and explode it a couple of times (dependant on what information is shown on your actual forum)

Trigs
24-12-2007, 04:32 PM
Im not to good with PHP so I have no idea what that means.

Yeah my theory was that remotely hosted files cannot be echoed.

MrCraig
24-12-2007, 04:33 PM
They can be echo'd if you do some stuff with them first...

for example, thats how habbo signature scripts are made..

lolwut
24-12-2007, 04:39 PM
Give us the URL to your forum and I'll see what I can do.

Trigs
24-12-2007, 04:47 PM
www.habbosworldforum.ca.gs or do you want it uncloaked?
Thanks :)

MrCraig
24-12-2007, 05:01 PM
try..



<?php
$site = @file_get_contents("http://www.habbosworldforum.ca.gs");
$reg_1 = explode("We have ",$site);
$reg_2 = explode(" registered members",$reg_1[1]);
$regmem = $reg_2[0];
echo("There are $regmem members registered on the forum!");
?>

lolwut
24-12-2007, 05:11 PM
See if this works:


<?php

$file = file_get_content("http://z7.invisionfree.com/HabbosWorld_Forums/index.php");

eregi('Our members have made a total of <b>(.*)</b> posts<br>', $file, $totP);

eregi('We have <b>(.*)</b> registered members<br>', $file, $totM);

echo("<b>Forum Statistics:</b>");

echo("<br />Total Posts: ");
echo $totP[1];

echo("<br />Total Members: ");
echo $totM[1];

?>

Trigs
24-12-2007, 07:09 PM
I got the following error:


Fatal error: Call to undefined function file_get_content() in /www/**********/h/a/b/b/o/s/w/o/habbosworld/htdocs/test/systemtest.php on line 3

MrCraig
24-12-2007, 07:37 PM
someone made a spelling mistake :P

Corrected Vers:

<?php

$file = file_get_contents("http://z7.invisionfree.com/HabbosWorld_Forums/index.php");

eregi('Our members have made a total of <b>(.*)</b> posts<br>', $file, $totP);

eregi('We have <b>(.*)</b> registered members<br>', $file, $totM);

echo("<b>Forum Statistics:</b>");

echo("<br />Total Posts: ");
echo $totP[1];

echo("<br />Total Members: ");
echo $totM[1];

?>

Trigs
24-12-2007, 07:40 PM
Another error :(


Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /www/**********/h/a/b/b/o/s/w/o/habbosworld/htdocs/test/systemtest.php on line 5

Warning: file_get_contents(http://z7.invisionfree.com/HabbosWorld_Forums/index.php) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /www/**********/h/a/b/b/o/s/w/o/habbosworld/htdocs/test/systemtest.php on line 5
Forum Statistics:
Total Posts:
Total Members:

MrCraig
24-12-2007, 08:06 PM
I cant help you then as your php config doesnt allow file_get_contents.

Trigs
24-12-2007, 08:14 PM
Ill try a different host 1 sec.

EDIT-
k i tried it on freehostia but all I got was this:

(.*) posts
', $file, $totP); eregi('We have (.*) registered members
', $file, $totM); echo("Forum Statistics:"); echo("
Total Posts: "); echo $totP[1]; echo("
Total Members: "); echo $totM[1]; ?>

Trigs
26-12-2007, 10:51 PM
bump

btw are the files even readable?

Robbie
28-12-2007, 10:01 PM
Might not be tidy but it works. Can't remember where I saved get_string_between from.


<?php

function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}

$data = file_get_contents("http://z7.invisionfree.com/HabbosWorld_Forums/index.php");

$members = get_string_between($data, "We have", "registered members");

echo ("Total members: $members");

$posts = get_string_between($data, "Our members have made a total of", "posts");

echo ("<br>Total posts: $posts");

?>

Trigs
29-12-2007, 05:50 AM
Thanks for the help but all I got was:


Total posts: $posts"); ?>

Earthquake
29-12-2007, 06:14 AM
I don't understand, you want someone to work for you to help your site improve?

Robbie
29-12-2007, 11:15 AM
Works fine for me on localhost.
Are you saving it as php?

Trigs
29-12-2007, 05:52 PM
Yep.

Its saved in PHP

Flisker
01-01-2008, 11:09 AM
but is it saved in .php and not .html

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