Previous Thread
Next Thread
Print Thread
Rate Thread
#117221 04/02/2001 1:14 PM
Joined: Mar 2001
Posts: 14
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 14
How can I display the total number of replies to a topic on the public_topic_page? I tried referencing $total_replies, but it doesn't display anything. Basically I just want to take the value from public_forum_page and put it on public_topic_page. Any ideas?

Sponsored Links
#117222 04/02/2001 2:18 PM
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
You'll have to find the array that holds the complete thread file (find a call to &OpenTopic()) - the value of scalar(@array) for that array will be the total number of POSTS in the thread. Subtract one to get the number of replies. (This information should be in lib_posting)


UBB.classic: Love it or hate it, it was mine.
#117223 04/02/2001 4:51 PM
Joined: Mar 2001
Posts: 14
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 14
ok thanks, but is there any way to just reference $total_replies like in the public_forum_page.pl file? Where does that variable come from?

Thanks,

Jeremy

#117224 04/02/2001 6:44 PM
Joined: Jan 2000
Posts: 313
Member
Member
Offline
Joined: Jan 2000
Posts: 313
The $total_replies variable comes from the ubb_forum.cgi file, so you can't use it on the threads page. Like Charles said, you will have to call the file that holds the array for the thread file in ubb_lib_posting.cgi, if you want to be able to use that variable in the public_topic_page.pl template.

#117225 04/02/2001 6:45 PM
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
You will have to create it:

my $total_replies = scalar(@array_that_contains_the_posts);


UBB.classic: Love it or hate it, it was mine.
Sponsored Links
#117226 04/02/2001 7:01 PM
Joined: Mar 2001
Posts: 14
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 14
Thanks guys...I think that I need to study up on my PERL because I don't really know how to do what you are saying. How do I call the file that holds the array for the thread file? Is there any way you could give me the exact syntax?

#117227 04/02/2001 8:00 PM
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
You shouldn't need to (and should NOT) do that on your own - the array exists.

Search through lib_posting and the other two ubb_ files dealing with creating a new thread and creating a reply. There will be calls to the OpenTopic() subroutine.. it's just a matter of finding which one is doing the job you want...


UBB.classic: Love it or hate it, it was mine.
#117228 04/03/2001 8:55 AM
Joined: Mar 2001
Posts: 14
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 14
OK. So all I need to do is call the subroutine that creates the thread? How do I pass the array into the public_topic_pages file? I would appreciate it forever if you could tell me the syntax for "calling" subroutine in the lib and ubb files. I'm just not familiar with the PERL syntax.

Thanks...


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
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)