MF-B wrote on Jan 19
th, 2007 at 6:05pm:
@Ron
Why you not use in Recent, Search the same code as in Printpage? Use this and not needed parse message and use $counter++;
The reason for not reusing the same code in Recent, Search and Printpage is basically because the three scripts work different.
In Search we loop through the array $message using a for/next with $counter as a counter variable.
In Printpage we loop through the thread array called $threadpost with a foreach (so no counter)
In Recent we loop through $message again with a for/next loop but now with $i as counter variable.
The reason for increasing the counter even if I skip the message is to remain the correct message reference in all the links (if you do not increase the counter and click quote/edit in a thread where there are invisible messages as a non admin you'll grab the wrong message).
I will have to think about Last message pointing to a hidden message a little as this means adding extra info in the recent/last file (which could cause problems while upgrading to Y2.2 later)
For the same reasons I choose not to tamper with the message counter in the message index page.
I just show the total number of message even if a member will see less.
Keep in mind that I did not intend for this option to be completely stealth.... and I do not care that the observing user will see missing reply# numbers in the thread.
It's OK for users to be aware of the fact that certain messages are not for their eyes but present in the thread.