The Arcive of vBulletin Modifications Site. |
|
Vbulletin Page Counter Details »»
|
|||||||||||||||||||||||||
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:
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
You can shuffle them around and reduce them to 3 statements.
![]() But it is not much of a gain anyways. ![]() PHP Code:
|
|
#3
|
||||
|
||||
|
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?
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
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
|
|
#6
|
||||
|
||||
|
The generous use of queries will be ok if forum traffic is not heavy.
|
|
#7
|
||||
|
||||
|
Quote:
|
|
#8
|
|||
|
|||
|
PHP Code:
|
|
#9
|
||||
|
||||
|
Thank you, sir. That worked.
|
![]() |
|
|