The topic is about PHP to do CMS management system discuz problem, so answer the question to discuz people.
The problem is this: I want to bring the system to the tail of the statistics online number of people on the head, so I copied this code into the head, but the strange is displayed as garbled, at least thought to be the reason for the condition judgment, and then repeatedly checked, feeling is not.
The following code i copy, I do not know why put in the head.htm is not, how should write is correct?
{lang Onlinemember} - $onlinenum {lang onlines}- $membercount {lang index_members} ($invisiblecount {lang Index_invisibles}),$guestcount {lang index_guests}-{lang index_mostonlines} $onlineinfo [0] {lang on} $onlineinfo [1].
{lang onlinemember} {lang onlinemember} -{lang total} $onlinenum {lang onlines}
- $membercount {lang index_members},$guestcount {lang index_guests}
-{lang Index_mostonli NES} $onlineinfo [0] {lang on} $onlineinfo [1].
-
$_g[cache][onlinelist][legend]
-
- $online [Username] $online [username]
- {lang online_only_guests}
Reply to discussion (solution)
Is the result of copying the above code
Clear the cache to see.
Clear the cache to see.
Please cache this is the minimum common sense!
Statistics online people, that is the function of the homepage, such as: $onlinenum, $invisiblecount, etc., are defined in the \source\module\forum\forum_index.php
And Header.htm is all the pages to be referenced, the variables are in the initialization of the time taken out into the $_g inside, so you directly copy the code does not take effect
There are two ways to do this:
1> queries the database when initializing in source\class\discuz\discuz_application.php and puts it into $_g (not recommended for beginners)
2> call a function in header.htm, such as: , Getnolineinfo () method in the source\function\function_core.php itself, the specific implementation code, please refer to the source\ Module\forum\forum_index.php the code in the If inside of 178 rows or so