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?
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)
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
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.
You will have to create it:
my $total_replies = scalar(@array_that_contains_the_posts);
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?
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...
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...