Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
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?


"For who would lie idle when the king has returned?"
www.MinasTirith.com
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Is it viewed by the public or just you?


- Allen wavey
- What Drives You?
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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 ...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
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

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
lol looks like bretts a bit wink


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
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.


"For who would lie idle when the king has returned?"
www.MinasTirith.com
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Actually, for his list, we might need to do some reading of pdnlist.cgi

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
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>
";
}

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Looks good; I'm going to try to integrate most of UGN into the board, as much as possible that is wink ..


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
Thanks, I'll try it out.


"For who would lie idle when the king has returned?"
www.MinasTirith.com
Joined: Nov 2001
Posts: 96
Member
Member
Offline
Joined: Nov 2001
Posts: 96
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.


"For who would lie idle when the king has returned?"
www.MinasTirith.com
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745

Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
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


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
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
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
WebGuy 2
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 20240430)