miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Replies, views amounts for registered only on the first page

 
Author Jaime
Partaker
#1 | Posted: 5 Jan 2013 09:01 
In main_forums_cell.html i have the variables $numTopics and $numPosts. How do I get it out that this information can only be seen by registered users? With the stats on main_topic_cell.html i had no problems.

And all of you a happy new year!

Author tom322
Active Member
#2 | Posted: 5 Jan 2013 16:50 
For registered users, use this condition in bb_plugins:

if($user_id>0) {$showTopics=$numTopics; $showPosts=$numPosts;}

and then paste {$showTopics} and {$showPosts} in main_forums_cell.html.

Author Jaime
Partaker
#3 | Posted: 6 Jan 2013 09:27 
tom322
Thank you for your note. So I had also experimented, but I got no issue with it.

In function parseTopic i have

if($GLOBALS['user_id']>0){
$GLOBALS['xyzPost']=<<<out
.. html-code ..
{$GLOBALS['topic_views']}
.. html-code ..
{$GLOBALS['numReplies']}
.. html-code ...
out;
}
else {
$GLOBALS['xyzPost']=<<<out
... html-code ...
out;
}
Thats works fine in main_topics_cell. Reg users see there an other design and stats as an guest.

And just now I wanted to work on the main page, but unfortunately it was not going.

Maybe I can do this only with a new database access? Similarly as described here ... But I must confess that I have not been busy enough with db_simpleSelect. But perhaps I am just me and myself in the way and I think just too complicated? :)

Author tom322
Active Member
#4 | Posted: 6 Jan 2013 17:52 
Yes, parseTopic function only works for topic pages, not for the main page. I think it can only be done by db_simpleSelect (but I don't know exactly how to do it..).

Author Paul
Lead Developer 
#5 | Posted: 7 Jan 2013 18:48 
If you would check the template serving your primary page (it could be main_modern_lcell.html or main_last_discuss_cell.html), you would see different variables are keeping values for views and replies. Respectively, they are $numReplies and $topic_views. parseTopic function is enabled for the primary page. May be you could start from that.

Specific miniBB Support Forums / Specific /
 Replies, views amounts for registered only on the first page
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑