|
|
Joined: Mar 2001
Posts: 14
Junior Member
|
Junior Member
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?
|
|
|
|
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.
|
|
|
|
Joined: Mar 2001
Posts: 14
Junior Member
|
Junior Member
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
|
|
|
|
Joined: Jan 2000
Posts: 313
Member
|
Member
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.
|
|
|
|
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.
|
|
|
|
Joined: Mar 2001
Posts: 14
Junior Member
|
Junior Member
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?
|
|
|
|
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.
|
|
|
|
Joined: Mar 2001
Posts: 14
Junior Member
|
Junior Member
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...
|
|
|
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.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|