The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Im trying to find the way to do this with the least overhead.
I know I can add some code to index.php to run a query to count the number of birthdays from today, but I'd have to add a number of functions that are redundant of ones in /includes/functions_databuild.php. Right now the only thing sent to ForumHome is a string value containing all of the current birthdays. I figure that the only way to get the number of birthdays from the string is to count the commas. Unfortunately I am a bit too new in PHP to fugure this one out. Is there is a PHP function that counts the number of occurances of one string inside another string? If not, I will probably have to create a loop that cycles through the string counting the commas (Chr(44)) then add 1 to get the number of birthdays (unless the string is zero-length in which case there are no birthdays). Any ideas? |
#2
|
||||
|
||||
![]() PHP Code:
You could also count for '<a href="member.php?u' - I really doubt somebody would have this string in his username ![]() IMHO the best solution would be to modify build_birthdays() to also put the number into cache. This way there would be zero overhead when displaying. I'll post more details for this in a few minutes. Update: https://vborg.vbsupport.ru/showthread.php?t=61610 |
#3
|
||||
|
||||
![]()
Sweet! Thank you very much.
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|