PDA

View Full Version : Buddies online/offline on non-vb page


Sebastian
02-26-2003, 10:00 PM
This hack will allow your members to see when their buddies are online or offline on any page.

To Use:
1) edit variable $path to the path of your forums, including trailing slash at the end.
2) edit variable $path2 to the name of your forum directory.
3) to display on any page add include("/path/to/buddy.php"); to your page.

If you get include errors check you have the correct path to your forums directory
If you get safe mode errors delete: chdir("$path");

Hack information:
If you have no members on your buddies list then "none" appears.
If you do have buddies on your list but they aren't online "none" appears as well.
If you aren't logged in or not registered, nothing appears.

Hack Requirements:
1) some HTML knowledge to edit the way you want the buddies online to appear.

Other information:
Clicking the red X will remove the buddy, just like in the user cpanel.
Clicking the user's name will take you to the Send PM page.

As always, I will support this hack only in this thread.

Cheers :)

Sebastian
02-27-2003, 01:59 AM
when a user is online:

Sebastian
02-27-2003, 01:59 AM
when a user is offline:

sabret00the
02-27-2003, 04:29 PM
nice it just so happens that for what i'm working on this could really come in handy and released at the right time too

Dean C
02-27-2003, 05:40 PM
Nice hack Sebastien.

- miSt

sabret00the
02-27-2003, 08:48 PM
funny thing, it wouldn't work when i included it, so i c&p'd the data straight into the file, then it said something about it's already got the header and can't include it again and now it's just refusing to work 0_o

Lionel
02-28-2003, 03:45 AM
works nicely everywhere... php, shtml... thanks

VeoMorphine
03-01-2003, 09:45 PM
I get this error:
Parse error: parse error, unexpected T_STRING in c:\wwwroot\www\buddy.php on line 6

Sebastian
03-01-2003, 11:29 PM
@VeoMorphine, line 6 is $path2 = "forums";
I see you are using windows, what did you put for $path?


@sabret00the, if you are including into a .php file that is sending a header then remove these two lines from buddy.php:


chdir("$path");
require("./global.php");


and add this to the top of the .php file that you are including buddy.php into, under <?php

if you need more help, post the file that you are adding buddy.php to.


chdir("/path/to/forums/");
require("./global.php");

// rest of your file...

VeoMorphine
03-02-2003, 07:57 PM
Fixed it!

Works great.

nagasadow
03-28-2003, 01:57 AM
thanks Sebastian, I'm going to try it ;) Nice work ;)

Sylvus
08-13-2003, 02:52 PM
Having difficulty getting this working.

I added this to my index.shtml:

<!--#include file="/mnt/web/guide/site/forum/buds.php" -->

This is my buds.php

<?php
//------------------------------------------+
// path to forums must have a trailing slash
$path = "/mnt/web/guide/site/forum/";
// name of your forum directory
$path2 = "forum";
//------------------------------------------+
// support will only be provided below:
// https://vborg.vbsupport.ru/showthread.php?s=&threadid=49416
//
// that's all...
//------------------------------------------

chdir("$path");
require("./global.php");

I receive the following error:

[an error occurred while processing this directive]

Thanks,

Syl...

Sylvus
08-15-2003, 06:00 PM
Bumpin' it up for you Sebastian!

Syl...