Results 1 to 8 of 8

Thread: browse.html

  1. #1
    Join Date
    Jan 2002
    Posts
    46

    Default browse.html

    Hi,
    is possible insert tag "login here" "directory statistic" "who is online" hot site" in browse.html??

    Thanks.
    Marko

  2. #2
    Join Date
    Sep 2001
    Posts
    170

    Default

    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

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    In the ShowCategoryPage function of browse.php find:

    PHP Code:
      // vars template
      
    global $category,$link,$pagination,$category_path,$content,$editor$category_path_search_opt
    and insert the following right after it


    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

    PHP 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"); 
    to

    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"); 
    then in browse.html you will need to add the following somewhere:

    PHP Code:
    <!-- mod to insert the login -->
        <!--
    login -->
    <
    P>Login:</P>
    <
    table width=100cellpadding=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 --> 
    the above code has been copied out of index.php and index.html

    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."

    .

  4. #4
    Join Date
    Jan 2002
    Posts
    46

    Default

    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

  5. #5
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    It looks like that error has to do with the DisplayTemplate function. In my original post, I stated.

    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 PHP 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"); 
    Here it is again using the QUOTE button:

    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");
    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.

    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...

    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"); 
    Here it is using the QUOTE

    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");
    For whatever reason vBulletin inserts a line break after 50 characters. That sucks...
    Attached Files Attached Files
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  6. #6
    Join Date
    Jan 2002
    Posts
    46

    Default

    Thanks a lot

    Bye Marco

  7. #7
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Adding the login, hot, stats in the header template

    Here is another version that will allow the information to be printed in the header section

    change
    $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;
    ?>

    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;

    // 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;
    ?>
    Now just place the tags ( <%login_box%>, <%hot_links%>, <%total_link%> etc ) in the cat_header.html file.

    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."

    .

  8. #8
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Check out what esm done in hack forum. I think the hack by including new misc.php file is far simple and reduce headache.

Similar Threads

  1. Show meta description in browse.html
    By binto in forum v5.x
    Replies: 3
    Last Post: 06-07-2004, 06:39 PM
  2. Replies: 6
    Last Post: 03-31-2004, 10:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •