Previous Thread
Next Thread
Print Thread
Rate Thread
#115820 05/25/2004 9:20 AM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
How do you go about displaying the post count for a user other than in public_display_profile and public_topic_page ?

I know its in $Authorextra (well 3 fields are) and that it also refers to user_profile[7]

however putting those variables elsewhere in the template files dont call the post count? Do I need to do a "require" or..?

Sponsored Links
#115821 05/25/2004 10:54 AM
Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
You'll probably need to declare @user_profile, since it's not declared globally.

Code
@user_profile = &OpenProfile($user_number);
That will open the profile for the current logged-in user and place their profile data in the @user_profile array. smile

#115822 05/25/2004 11:25 AM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
Actually I've tried that, but no success just yet.

Code
	if (!$this_user_number) {

# old post- we need to find user number
$this_user_number = &GetUserNumber($thisline[2]);

if ((&FileExists("$vars_config{MembersPath}/$this_user_number.cgi")) && ($this_user_number ne '')) {
@user_profile = &OpenProfile("$this_user_number");
} else {
$thisline[8] = 'unreg';

if (!$public_name) {
$show_public_name = $thisline[2];
} else {
$show_public_name = $public_name;
}

$user_status = $vars_wordlets{unregistered};
}

} else {

# already have user number
@user_profile = &OpenProfile("$this_user_number");

}

# author info options
undef($post_total_line);
undef($location_line);
undef($regdate_line);
@author_extra = @blank;


$post_total_line = qq( $vars_wordlets{author_posts} <b>$user_profile[7]</b> );
push (@author_extra, $post_total_line);


if ($author_extra[0]) {
$AuthorExtra = join ("|", @author_extra);
} else {
$AuthorExtra = '';
}

#115823 05/25/2004 12:22 PM
Joined: Nov 2001
Posts: 1,704
CTM Offline
Moderator / Da Masta
Moderator / Da Masta
Offline
Joined: Nov 2001
Posts: 1,704
So what exactly are you trying to do, and where?

#115824 05/25/2004 12:56 PM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
ubb_forum_summary is where the code should go, Im assuming. Im trying to display total post count somewhere on public_forum_summary and possibly when the user registered.

Sponsored Links
#115825 05/25/2004 1:50 PM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
Havoq, more specifically, who's post count are you trying to show? The post count of the newest member, the viewers post count, another person's post count?

#115826 05/25/2004 6:28 PM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
post count of any user logged in & if they their not logged in, it'll show nothing smile

#115827 05/25/2004 6:37 PM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
You guys are approaching this all wrong then. This can be done quite easily with a simple edit Allen\'s Fsum Status mod .

#115828 05/25/2004 11:24 PM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
huh? I know Ian, what do u think I've been using! lol

Im trying to get a variable in there that isnt though.. a.k.a post count

#115829 05/26/2004 12:50 AM
Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
Ok I figured out the hard part wink

open up ubb_status.cgi

add:
Code
print qq~document.posts = "$user_profile[7]";

document.getElementById('posts').appendChild(document.createTextNode('$user_profile[7]'));~;
but when u sign out and are a guest, ur post count says nothing, its a blank. How can I make it to say 0 or none?


OK then, n/m took some thought but I figured it all out! Thanks havoq! thumbsup

Sponsored Links

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
isaac
isaac
California
Posts: 1,157
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
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)