PDA

View Full Version : Who's Online journal addition


sabret00the
01-26-2003, 04:27 AM
i'm sure for a coder of any more experience than myself this is a peice of :p but for me i've stumbled, basically i'm trying to make the online.php say "Viewing Journal of {username} but i've stumbled, i tried to adapt apfeifer "Show Who's Profile User is Viewing in Who's Online" hack to accomodate my needs, but upon testing realised i just didn't do anything, help me please, someone!!! :)

Open online.php and find

global $thread, $post, $forum, $event, $gotforum, $hideprivateforums, $bbuserinfo, $timeformat, $enableemail, $enablepms, $bbtitle, $usergroupdef, $numberguests;


just before the semi-colon add

, $DB_site;

Now find

case 'gallery':
$userinfo[where] = "Viewing Picture <a href='gallery.php?s=$session[sessionhash]'>Gallery</a>";
break;


and directly below it add

case 'journal':
$userid = explode("=", $userinfo[location]);
$username=$DB_site->query("SELECT username FROM user WHERE userid='$userid'");
$username=$DB_site->fetch_array($username);
if (!$username[username]) {
$userinfo[where] = "$bbtitle <a href='index.php?s=$session[sessionhash]'>Main Index</a>";
} else {
$userinfo[where] = "Viewing journal of <a href='journal.php?journalid=$userid&action=view&s=$session[sessionhash]'>$username[username]</a>";
}
break;


Now find

case 'gallery.php':
$userinfo[activity] = 'gallery';
break;


and directly below it add

case 'journal.php':
$userinfo[activity] = 'gallery';
break;


Save, Close and upload ;)

sabret00the
01-26-2003, 04:50 PM
does nobody have a clue as how to make this work?

Brad
01-27-2003, 11:44 PM
Try changing this:

case 'journal':
$userid = explode("=", $userinfo[location]);
$username=$DB_site->query("SELECT username FROM user WHERE userid='$userid'");
$username=$DB_site->fetch_array($username);
if (!$username[username]) {
$userinfo[where] = "$bbtitle <a href='index.php?s=$session[sessionhash]'>Main Index</a>";
} else {
$userinfo[where] = "Viewing journal of <a href='journal.php?journalid=$userid&action=view&s=$session[sessionhash]'>$username[username]</a>";
}
break;

to this:

case 'journal':
$userid = explode("=", $userinfo[location]);
$username=$DB_site->query("SELECT username FROM user WHERE userid='$userid'");
$username2=$DB_site->fetch_array($username);
if (!$username2[username]) {
$userinfo[where] = "$bbtitle <a href='index.php?s=$session[sessionhash]'>Main Index</a>";
} else {
$userinfo[where] = "Viewing journal of <a href='journal.php?journalid=$userid&action=view&s=$session[sessionhash]'>$username2[username]</a>";
}
break;

then change this:

case 'journal.php':
$userinfo[activity] = 'gallery';
break;

to this:

case 'journal.php':
$userinfo[activity] = 'journal';
break;

sabret00the
01-28-2003, 06:03 PM
thanks loo :D :D :D :D :D, i'll try it now

sabret00the
01-28-2003, 06:28 PM
sadly it didn't work, but hey you tried so thank you!

Bane
02-11-2003, 07:52 PM
This SHOULD work :) Let me know if not.

OPEN online.php

Remove any journal stuff you added

FIND
case 'spider':
$userinfo[where] = "Search Engine Spider";
break;





ABOVE that INSERT
// [BEGIN Edit] Show Who's Journal is being read
case 'journal':
$userid = explode("=", $userinfo[location]);
$username=$DB_site->query("SELECT username FROM user WHERE userid='$userid[2]'");
$username=$DB_site->fetch_array($username);
if (!$username[username]) {
$userinfo[where] = "Viewing <a href='journal.php?s=$session[sessionhash]'>Journals</a>";
} else {
$userinfo[where] = "Viewing Journal of <a href='journal.php?s=$session[sessionhash]&userid=$userid[2]&action=view'>$username[username]</a>";
}
break;
// [END Edit] Show Who's Journal is being read





FIND
case '/robots.txt':
$userinfo[activity] = 'spider';
break;





ABOVE that INSERT
// [BEGIN Edit] Show Who's Journal is being read
case 'journal.php':
$userinfo[activity] = 'journal';
break;
// [END Edit] Show Who's Journal is being read

sabret00the
02-20-2003, 12:42 PM
yay it works, thank you so much bane ^_^

Bane
02-20-2003, 01:03 PM
=) Glad to help.

Rose
02-20-2003, 01:25 PM
:$ I hope you don't mind, but with a minor edit here and there, this has helped me greatly to add a few locations to my WOL. :D Thanks! :$

zefman
03-08-2003, 05:55 AM
thks too ! i have added this feature for my board :)

the journal hack is a fantastic thing but suffer of the absence of possibility to search in the members journals