Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
I reused the ubb cookie for the website's login system and it works great but I am not sure what to do to get the new PM messages too on all pages of the website.

thanks if you have any clue wink


Do you believe in love at first sight,
or should I walk by again?
Sponsored Links
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
I just did this on my main page, here's what you have to do.

First, install Allen\'s CP style hack .

Then, go into cp_style_php.cgi.

FIND:
Code
my @needs_escape = qw( " ); # you can add any character after "
ADD AFTER:

Code
$pleh = $show_logout;
$teh = qq~echo checkUserPMs()~;
$eh = qq!blahblah!;


$pleh =~ s/<?php echo checkUserPMs(); ?>/$eh/eisg;
then

FIND:

Code
$var .= sprintf qq($TableBottom 	= "%s";n), esc($TBB);
ADD AFTER:

Code
$var .= sprintf qq($thisShowLogout    	= "%s";n), esc($pleh);
In your (PHP) webpage add the following...

From ultimatebb.php, the following functions:
getuserid ()
checkUserPMs ()
find_environmental ()

After those in your PHP code, add

Code
	$monkey = checkUserPMs();

$thisShowLogout = preg_replace("/blahblah/", $monkey, $thisShowLogout);
where you wish to add the

"Hello, Ian
You have 1 unread private messages."

put this into your code...

$thisShowLogout

This only works with PHP pages, but it does work smile

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Or you can do a quick function in your PHP page to get the info yourself:

Code
$gen_pm1msg      = " New Message";
$gen_pmmulti = " New Messages";
$mbrfile = $ubbnotifypath . $ubbmemberid . ".cgi";

if (file_exists($mbrfile)){
$newpm = "TRUE";
$pmfile = file($mbrfile);
$numpm = $pmfile[0];
} else {
$newpm = "FALSE";
}
if ($numpm > 1)
$newpm_msg = $gen_pmmulti;
else
$newpm_msg = $gen_pm1msg;

if ($newpm == "TRUE") {
echo "<font size="1">
<a href="/cgi-bin/ultimatebb.cgi?ubb=my_profile">$numpm $newpm_msg</a></font>
";
}
That's the basics. You can adapt that to say the full "You have XX new Private Messages" or whatever you like.

That's the basic code to accomplish that.

(Yes, I know that some of the code can be cleaned up, but that's just lazyness on my part as the code does work)


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)