When you're not logged in here at daniweb, you see a message that shows the total number of members, the number of people online now and the number of members online in the past 24 hours.

I like it a lot, and I'm also using vBulletin. How did you do it?

Dani AI

Generated

Good instincts from the original replies: the guest line is not static HTML — it comes from vBulletin's phrase/template system and the numbers are inserted when the page is built. was right to point at templates; was right to think phrases are involved; and 's pointer to existing threads shows this has been done before.

Practical approach to reproduce it:

  1. Locate the phrase text in the Phrase Manager (search for the visible guest text).
  2. Decide whether to inject numbers into that phrase when it is constructed, or to alter the template that prints the phrase so it echoes the already-computed counts. Passing values into a phrase (so translators can reorder words) is cleaner; changing the template is simpler if the template already has the count variables available.
  3. Reuse whatever internal counts the board already computes (online count, member total, 24-hour activity) rather than running fresh full-table queries in the header. If the counts are not exposed to the template, add them at render time (construct the phrase with values or use a small, cached lookup).

Troubleshooting and cautions:

  • Clear both template and phrase caches after edits and test while logged out or in a private window.
  • Avoid expensive SQL in a page header; use cached counters or a lightweight aggregated query.
  • If edits don't take effect, search templates and include files for overrides (custom styles, plugins, or hooks can replace the header/phrase).
  • For multi-language sites, keep the phrase as a format string and supply numbers to it rather than hard-coding the text order.

This keeps the UI translatable, performant, and easy to maintain while matching the guest experience shown in the thread.

Recommended Answers

All 6 Replies

That other thread isn't related to this one. What I'm asking about is the message that appears at the top of the page when you visit these forums as a guest (not logged in). vBulletin has a default message, but here they've added some dynamic elements (total members, number of people online now, and members online in past 24 hours).

I'm betting that these are simply vBulletin variables that are available to insert using the Phrase Manager, but being fairly new to vBulletin, I'm not certain.

If you have a look in your templates, you will find some <if> and <else> statments from memory (your navbar is your best bet).
They hold other values of what user/usergroups see whats.

The text I'm referring to is found in the following global phrase: first_visit_message

The default text looks like this:

If this is your first visit, be sure to check out the <a href="{1}"><strong>FAQ</strong></a> by clicking the link above.
You may have to <a href="{2}"><strong>register</strong></a> before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.

I'm guessing that there are some similar variables that I can insert to show the total members, online user count, etc. somewhere within this phrase. I'm not sure where to find them though.

Along with the guest message (which is contained in the variable I mentioned above), new members with less than 10 posts see this message:

Welcome to the DaniWeb community. However, you do not yet have access to all of the privileges that being a DaniWeb member has to offer. Once you have contributed ten posts, you will be able to use private messaging, forum signatures, and create your own blog. If you run a website, you'll also be able to advertise in our Webmaster Marketplace forums.

I've searched and searched and finally found an excellent article that covers exactly how to do this with vBulletin:

Woo-hoo!

Well, im glad you have found it. And Atomica is right also about the <if> and <else> statments.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.