![]() |
Vbulletin Page Counter
Here is the code I am now using for my page counter on the forumhome. Can anyone please tell me if there is a better way to do this?
PHP Code:
|
You can shuffle them around and reduce them to 3 statements. ;)
But it is not much of a gain anyways. :D PHP Code:
|
Since this adds 2 queries, would it be better to write it to a text file and read it from there? Would that save the 2 queries?
|
I think with text files you have no way of imposing any kind of mutual exclusion (semaphore). If 1 browser session is writing while the other one is trying to read, or if multiple sessions are trying to update at the same time, they may clubber each other and you can actually lose the counter value in that file.
This won't happen with the query. |
yeah it would, i would`ve used that from start personally, as iid want to use the extra queries on something a bit more important :P
|
The generous use of queries will be ok if forum traffic is not heavy. ;)
|
Quote:
|
PHP Code:
|
Thank you, sir. That worked. ;)
|
All times are GMT. The time now is 09:20 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|