Access post count of logged-in user in template?

Posted by sheik 
Access post count of logged-in user in template?
February 15, 2007 03:58PM
I would like to show Google ads after the first post in each thread to anybody that has made less than "n" posts. How can I access this in the read.tpl template please?

I've already resorted to a PHP counter to work out where the 1st message ends, as I can't remember how to do that in Phorum template code.

Thanks,

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Access post count of logged-in user in template?
February 15, 2007 05:02PM
The template code does not have any computational features (like x = x + 1), so you'll have to revert to PHP code for that. Nothing wrong with that solution. The post count would be in the user data. Because the template language doesn't support relative checks either (like <), you'll have to revert to PHP for that as well. Without testing:
if ($PHORUM["user"]["posts"] < 1234) {
   .... do your advertisement thing ....
}


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Access post count of logged-in user in template?
February 15, 2007 05:34PM
Seems to work a treat, many thanks!

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Your IP address, domain or ISP has been blocked. Please contact the forum administrators.
Sorry, only registered users may post in this forum.

Click here to login