Hi,
is possible insert tag "login here" "directory statistic" "who is online" hot site" in browse.html??
Thanks.
Marko
Hi,
is possible insert tag "login here" "directory statistic" "who is online" hot site" in browse.html??
Thanks.
Marko
At a guess you should be able to!
I would say you would need to do a hack - bring the related code from index.php to browse.php
In the ShowCategoryPage function of browse.php find:
and insert the following right after itPHP Code:// vars template
global $category,$link,$pagination,$category_path,$content,$editor, $category_path_search_opt;
PHP Code:// mod to add login, hot links, who's online and stats - start
// show hot links
global $main_hot_links, $total_member,$total_milis;
global $total_online, $members_online, $guess_online, $username_online;
// vars template
global $category,$new_links,$hot_links,$login_box,$rec_links,$recomended_listing,
$total_link,$total_hits,$total_category,$total_member,$total_milis;
$hot_links_obj = new clsLink;
$hot_links_obj->InitDB($dbServer,$dbHostname,$dbUsername,$dbPassword,$dbName);
$hot_links_obj->query = "select * from idx_link where suspended = 0 order by hits desc";
$hot_links_obj->table_name = "idx_link";
$hot_links_obj->category_table_name = "idx_category";
$hot_links_obj->max_rows = $main_hot_links;
$hot_links_obj->template = $msg["10002"];
$hot_links_obj->enable_cache = false;
$hot_links = $hot_links_obj->Display();
// show login box
$users_obj = new clsUsers;
$users_obj->InitDB($dbServer,$dbHostname,$dbUsername,$dbPassword,$dbName);
$users_obj->table_name = "idx_users";
$users_obj->login_box_with_form_template = $msg["10003"];
$users_obj->login_box_with_username_template = $msg["10004"];
$login_box = $users_obj->DisplayLoginBox();
// who's online
$who = GetWhosOnline();
$total_online = $who[0];
$members_online = $who[1];
$guess_online = $who[2];
$i=3;
while($i<sizeof($who)) {
$un = $who[$i];
$username_online .= "<a href=user_detail.php?u=$un>$un</a> ";
$i++;
}
// directory statistics
$query = "select count(*) as tl, sum(hits) as h from idx_link";
$result = $conn->Execute($query);
$total_link = $result->Fields("tl");
$total_hits = $result->Fields("h");
$query = "select count(*) as tc from idx_category";
$result = $conn->Execute($query);
$total_category = $result->Fields("tc");
$query = "select count(*) as tu from idx_users where status = 1";
$result = $conn->Execute($query);
$total_member = $result->Fields("tu");
$query = "select count(*) as tm from idx_mailing_list where status = 1";
$result = $conn->Execute($query);
$total_milis = $result->Fields("tm");
// mod to add login, hot links, who's online and stats - end
then change
toPHP Code:DisplayTemplate($theme_path."browse.html","\$category_path,\$category_path_search_opt,\$category,".
"\$header,\$footer,\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link");
then in browse.html you will need to add the following somewhere:PHP Code:// mod to add ,\$hot_links,\$login_box \$total_online,\$members_online,\$guess_online,\$username_online,".
//"\$total_link,\$total_hits,\$total_category,\$total_member,\$total_milis");
DisplayTemplate($theme_path."browse.html","\$category_path,\$category_path_search_opt,\$category,\$hot_links,\$login_box,".
"\$header,\$footer,\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link,".
"\$total_online,\$members_online,\$guess_online,\$username_online,".
"\$total_link,\$total_hits,\$total_category,\$total_member,\$total_milis");
the above code has been copied out of index.php and index.htmlPHP Code:<!-- mod to insert the login -->
<!--login -->
<P>Login:</P>
<table width=100% cellpadding=3 cellspacing=0 bgcolor=#E3EB98>
<tr>
<td>
<%login_box%>
</td>
</tr>
</table>
<!-- mod to insert the login -->
<!-- mod to insert the hot listing -->
<!-- hot listing -->
<p><img src="images/top_10_website.jpg">
<P>Hot</P>
<table width=100%>
<tr>
<td>
<%hot_links%>
</td>
</tr>
</table>
<!-- mod to insert the hot listing -->
<!-- mod to insert the directory stat -->
<!-- directory stat -->
<p><img src="images/directory_stat.jpg">
<table width=100%>
<tr>
<td>Links</td>
<td align="right"><div align=right><%total_link%></td>
</tr>
<tr>
<td>Categories</td>
<td align="right"><div align=right><%total_category%></td>
</tr>
<tr>
<td>Registered Users</td>
<td align="right"><div align=right><%total_member%></td>
</tr>
<tr>
<td>Mailing List Subscribers</td>
<td align="right"><div align=right><%total_milis%></td>
</tr>
<tr>
<td>Unique Outgoing Hits</td>
<td align="right"><div align=right><%total_hits%></td>
</tr>
</table>
<!-- mod to insert the directory stat -->
<!-- mod to insert the whos online listing -->
<!-- whos online listing -->
<p><img src="images/whosonline.jpg">
<table width=100%>
<tr>
<td>
<p>There are currently <%total_online%> users online <br>
(<%members_online%> members and <%guess_online%> guests)
<p><i><%username_online%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- mod to insert the whos online listing -->
vBulletin has inserted line breaks in the code. you will need to remove them. I am not going to take the time to figure out why vB is doing that or how to correct. For example take a look at the code above for DisplayTemplate. It should look similar to the code in the index.php
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
Thanks for you support..
I've following your instruction... but I've received an error:
Parse error: parse error, unexpected '<', expecting T_VARIABLE or '$' in /home/virtual/site6/fst/var/www/html/lib/template.lib.php(61) : eval()'d code on line 1
Could you help me?
Thanks
It looks like that error has to do with the DisplayTemplate function. In my original post, I stated.
Here it is again using the PHP button:vBulletin has inserted line breaks in the code. you will need to remove them.
I am not going to take the time to figure out why vB is doing that or how to correct.
For example take a look at the code above for DisplayTemplate.
It should look similar to the code in the index.php
Here it is again using the QUOTE button:PHP Code:DisplayTemplate($theme_path."browse.html","\$category_path,\$category_path_search_opt,\$category,\$hot_links,\$login_box,".
"\$header,\$footer,\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link,".
"\$total_online,\$members_online,\$guess_online,\$username_online,".
"\$total_link,\$total_hits,\$total_category,\$total_member,\$total_milis");
In the actual file, there are only four lines of code. As you can see vBulletin is adding line breaks in some sort of random fashion to both.DisplayTemplate($theme_path."browse.html","\$categ ory_path,\$category_path_search_opt,\$category,\$h ot_links,\$login_box,".
"\$header,\$footer,\$num_rows,\$pagination,\$cat,\ $link,\$content,\$start_number,\$ma,\$editor,\$fea tured_link,".
"\$total_online,\$members_online,\$guess_online,\$ username_online,".
"\$total_link,\$total_hits,\$total_category,\$tota l_member,\$total_milis");
I have attached a text file with the entire code. All you may need is to replace the code for the Display Template.
I don't recall the earlier vBulletin board doing this. It needs to be fixed by someone or it will be difficult to post MODs.
Just in case anyone is wondering, I use a simple ascii text editor found at EditPlus..com. EditPlus has an option to show line breaks, tabs, and spaces. There are no tabs or spaces in the above code just the line breaks at the end of MY four lines.
Here it is as just one long line - no tabs, spaces and with just the four line breaks...
Here it is using the QUOTEPHP Code:DisplayTemplate($theme_path."browse.html","\$category_path,\$category_path_search_opt,\$category,\$hot_links,\$login_box,\$header,\$footer,\$num_rows,\$pagination,\$cat,\$link,\$content,\$start_number,\$ma,\$editor,\$featured_link,\$total_online,\$members_online,\$guess_online,\$username_online,\$total_link,\$total_hits,\$total_category,\$total_member,\$total_milis");
For whatever reason vBulletin inserts a line break after 50 characters. That sucks...DisplayTemplate($theme_path."browse.html","\$categ ory_path,\$category_path_search_opt,\$category,\$h ot_links,\$login_box,\$header,\$footer,\$num_rows, \$pagination,\$cat,\$link,\$content,\$start_number ,\$ma,\$editor,\$featured_link,\$total_online,\$me mbers_online,\$guess_online,\$username_online,\$to tal_link,\$total_hits,\$total_category,\$total_mem ber,\$total_milis");
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
Thanks a lot![]()
Bye Marco
Here is another version that will allow the information to be printed in the header section
change
to$header = $category_obj->GetHeader($cat);
$footer = $category_obj->GetFooter($cat);
$pg_title = $category_obj->GetPageTitle($cat);
if(empty($pg_title)) $page_title = $title;
else $page_title = $pg_title;
$ma = 1;
if(empty($header))
DisplayTemplate($theme_path."cat_header.html","\$p age_title,\$cat,\$meta_keywords,\$meta_description ");
else
print $header;
ShowCategoryPage();
if(empty($footer))
DisplayTemplate($theme_path."footer.html","\$cat,\ $ma");
else
print $footer;
?>
Now just place the tags ( <%login_box%>, <%hot_links%>, <%total_link%> etc ) in the cat_header.html file.$header = $category_obj->GetHeader($cat);
$footer = $category_obj->GetFooter($cat);
$pg_title = $category_obj->GetPageTitle($cat);
if(empty($pg_title)) $page_title = $title;
else $page_title = $pg_title;
$ma = 1;
// mod for misc - online, hot, stats
include("misc.php");
if(empty($header))
DisplayTemplate($theme_path."cat_header.html","".
"\$page_title,\$cat,\$meta_keywords," .
"\$meta_description,\$hot_links,\$login_box," . // this should be on line above
"\$total_online,\$members_online,\$guess_onlin e," . // online
"\$username_online,\$total_link,\$total_hits," . // online and stats
"\$total_category,\$total_member,\$total_milis"); // stats
else
print $header;
ShowCategoryPage();
if(empty($footer))
DisplayTemplate($theme_path."footer.html","\$cat,\ $ma");
else
print $footer;
?>
Once again, I don't know the effect of this but it seems to work...
More on the "else" part of that ( $header ) later...
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."
.
Check out what esm done in hack forum. I think the hack by including new misc.php file is far simple and reduce headache.![]()