UBB.Dev
I have a simple HTML page that lists certain members of my board. What I want to do is have those names change automatically if they change their public name. In other words, I want it to pull the most current display name for a list of members each time this page loads.

How can I accomplish this?
Posted By: AllenAyres Re: UBB Data through External Web Page? - 04/09/2004 7:42 PM
Is it viewed by the public or just you?
Posted By: Gizmo Re: UBB Data through External Web Page? - 04/09/2004 7:48 PM
I think everyone as he could probably care less if they change their names wink ...

Wait on brett, he has a php function built just for pulling PDN's on a project he's doing for me wink ...
Posted By: Ron M Re: UBB Data through External Web Page? - 04/09/2004 9:26 PM
I've got one of those already done:

Code
function UBB_login_bits($CGIURL) {
if (isset($_COOKIE["ubber{$Cookie_Number}"])) {
$ubbinfo = split("&",$_COOKIE["ubber{$Cookie_Number}"]);
$ubbdisplayname = $ubbinfo[2];
$ubbhexpwd = $ubbinfo[1];
$ubbmemberid = $ubbinfo[4];
$displine = "<font size="1">Welcome <a href="$CGIURL/ultimatebb.cgi?ubb=my_profile">".$ubbdisplayname."</a> [<a href="$CGIURL/ultimatebb.cgi?ubb=logoff">Logoff</a>]</font>";
echo($displine);
} else {
echo("<font size="1"><a href="$CGIURL/ultimatebb.cgi?ubb=login">Login</a>, <a href="$CGIURL/ultimatebb.cgi?ubb=agree">Register</a> or <a href="$CGIURL/ultimatebb.cgi?ubb=lost_password">Lost Password</a></font>
");
}
}
Note: I am including my vars_config.inc.php to get the $CGIURL and the cookie number
Posted By: Gizmo Re: UBB Data through External Web Page? - 04/09/2004 9:41 PM
lol looks like bretts a bit wink
But it doesn't help me with my specific problem.

As I said, I have a list of people to contend with. It is a list that everyone will see. Example:
Quote
quote:
This line mentions member #2221.
And this line mentions member # 3334.
I want this to look like:
quote:
[qb]This line mentions Jake the Snake.
And this line mentions The Iron Sheik.[/qb]
The list of member numbers will be hardcoded, but I want the names to change if they change their display name.
Posted By: Gizmo Re: UBB Data through External Web Page? - 04/09/2004 10:06 PM
The code Sub posted above should relay the PDN. You'll need to adapt it a bit but it basically replicates the welcome on the board...
Posted By: Ron M Re: UBB Data through External Web Page? - 04/09/2004 10:31 PM
Actually, for his list, we might need to do some reading of pdnlist.cgi
Posted By: Ron M Re: UBB Data through External Web Page? - 04/09/2004 10:37 PM
Here's some quick and untested code to get the DispName of the usernumber you pass to it, with the leading zeros:

Code
	function UBB_dispname($ubbmemberid) {
// UBB.classic Variables
$varspath = "/path/to/noncgi";
include("$varspath/vars_config.inc.php");
$ubbpath = $MembersPath . "/";
$ubbmemberfile = $ubbpath . $ubbmemberid . ".cgi";
if (file_exists($ubbmemberfile)) {
$ubbfileinfo = file($ubbmemberfile);
$ubbdisplayname = trim($ubbfileinfo[15]);
}
echo "<a href="$CGIURL/ultimatebb.cgi?ubb=profile;u=$ubbmemberid">$ubbdispname</a>
";
}
Posted By: Gizmo Re: UBB Data through External Web Page? - 04/09/2004 11:34 PM
Looks good; I'm going to try to integrate most of UGN into the board, as much as possible that is wink ..
Thanks, I'll try it out.
Could you do me a favor and write me a sample HTML page with your function that displays, say, member #2? I can’t seem to get mine working.
Posted By: Ron M Re: UBB Data through External Web Page? - 04/12/2004 8:30 PM
Try this zip out

https://www.ubbdev.com/ubb/upload/00014968/sample.zip
Posted By: Brett Re: UBB Data through External Web Page? - 04/13/2004 12:50 AM
As mentioned earlier by Gizzy, i was helping him out making a PHP readable script. Right now, it just reads the user cookie, but functions are in there to do other things like get profile by login name or public name.

http://www.pavioni.com/profile.txt

To get a profile by number just use the function.
Code
$profile = OpenProfile('00000001');
$profile = OpenProfile('1');
This file can be use/modified for reference as needed by anyone. smile
© UBB.Developers