Not sure if this is possible... How can I get a count of users in action x? I want to add this somewhere into the index.template.php.
Same way who's online does it - slowly. Relies on who's online being enabled, too. Also helps to know what the action is because that *directly* affects the code, as does whether it's SMF 1 or SMF 2.
Lainaus käyttäjältä: Arantor - lokakuu 03, 2013, 07:02:30 IP
Same way who's online does it - slowly. Relies on who's online being enabled, too. Also helps to know what the action is because that *directly* affects the code, as does whether it's SMF 1 or SMF 2.
1) SMF 1.x
2) 1st action is arcade
3) 2nd action is gallery
And you want to run two expensive queries every page for what reason?
Question of the day: are you using memcache or a similar proper caching method?
Lainaus käyttäjältä: Arantor - lokakuu 03, 2013, 07:39:26 IP
And you want to run two expensive queries every page for what reason?
Question of the day: are you using memcache or a similar proper caching method?
Yes... I want to see if it's possible, that's all. I make my decision based on performance. Many times I chuck an idea in the garbage 10 minutes after adding it. I want to learn how it's done and code needed to make it work.
Sure it's possible. Who's online does it. You can even display who's viewing a board or topic much the same way - going through the mess that is the log_online table searching for the right bit of string to do it.
But this is a table that is updated very regularly, and a table scan will not be quick - and you want to do this every single page, twice. (Since you can't differentiate efficiently between the two in a single query)
If you were using any kind of cache backend, I'd show you how to do it including using the cache to not kill your site's performance. But without that, not a chance. I will not help you cripple your site's performance by adding two slow queries to every single page.
If you want to see how it looks, mock it up with some numbers (you can see who's online to get an idea of what the numbers would be), and then if you like it and the cache backend is workable, then we can talk about doing it.
I have a clear vision for how I want it to look.
I am using APC as a caching agent.
Can anyone else help?