Results 1 to 9 of 9

Thread: total number of categories and links

  1. #1
    Join Date
    Jul 2002
    Posts
    19

    Default total number of categories and links

    hi;

    i would like to display the total number of categories and links on
    my mainpage.

    someon know the code i must insert to index.php?

    thanx
    egi

  2. #2
    Join Date
    Sep 2002
    Posts
    14

    Default 3 steps

    Hi,

    There are three steps to including a variable on a page.
    Here is an example to include the variable $active links in index.html.

    1. put the variable in the global statement

    // vars template
    global $category,$new_links,$hot_links,$login_box,$rec_li nks,$user_status, $active_links;

    2. pass the variable to the DisplayTemplate function

    DisplayTemplate($theme_path."index.html","\$catego ry,\$new_links,\$hot_links,\$login_box,\$featured_ link,\$opening_text,\$active_links,\$user_status");

    3. include the variable in the html page in the format <%var_name%>

    Herb

  3. #3
    Join Date
    Jun 2002
    Posts
    25

    Default

    I added that to my site (URL in sif) but the total number of links does not show up

    <%active_links%> was used and the code in the message above was added!!! What do i have to do EXACTLY
    http://www.myfootballforum.com

  4. #4
    Join Date
    Jun 2002
    Posts
    25

    Default

    well!!!!!

    I need help
    http://www.myfootballforum.com

  5. #5
    Join Date
    Jul 2002
    Posts
    19

    Default

    hi !

    i made a copy of summary.php called summary_de.php
    and changed the code to:

    include("application.php");

    // ---------------
    // functions
    // ---------------

    function ShowMainPage() {
    global $conn,$admin_template_path,$cookie_admin_last_visi t;
    global $active_links,$active_categories,$active_reviews,
    $await_links,$await_reviews,$bad_links,$mailing_li st_subscribers;

    $query = "select count(category_id) as active_categories from idx_category";
    $result = $conn->Execute($query);
    $active_categories = $result->Fields("active_categories");

    $query = "select count(link_id) as active_links from idx_link";
    $result = $conn->Execute($query);
    $active_links = $result->Fields('active_links');




    DisplayTemplate($admin_template_path."summary_de.h tml",
    "\$active_links,\$active_categories");
    }

    // ---------------
    // main program
    // ---------------

    $conn = ConnectDB();

    include($admin_template_path."msg.php");




    DisplayTemplate($admin_template_path."header.html" ,"\$title_page");
    ShowMainPage();
    DisplayTemplate($admin_template_path."footer.html" ,"\$novar");

    ?>


    then i made a template http://de.hammer.st/admin_tpl/summary_de.html

    and includet summary-de.php with iframes in my mainpage.


    the methode from hjrader is better but i can not get it run.


    egi

    http://de.hammer.st

  6. #6
    Join Date
    Jun 2002
    Posts
    25

    Default

    http://www.myfootballforum.com/search/

    Have a look, there are no categories and no links shown?

    Where do I put the files in the directory?
    http://www.myfootballforum.com

  7. #7
    Join Date
    Jun 2002
    Posts
    25

    Default

    I just get this error:

    include("application.php"); // --------------- // functions // --------------- function ShowMainPage() { global $conn,$admin_template_path,$cookie_admin_last_visi t; global $active_links,$active_categories,$active_reviews, $await_links,$await_reviews,$bad_links,$mailing_li st_subscribers; $query = "select count(category_id) as active_categories from idx_category"; $result = $conn->Execute($query); $active_categories = $result->Fields("active_categories"); $query = "select count(link_id) as active_links from idx_link"; $result = $conn->Execute($query); $active_links = $result->Fields('active_links'); DisplayTemplate($admin_template_path."summary_de.h tml", "\$active_links,\$active_categories"); } // --------------- // main program // --------------- $conn = ConnectDB(); include($admin_template_path."msg.php"); DisplayTemplate($admin_template_path."header.html" ,"\$title_page"); ShowMainPage(); DisplayTemplate($admin_template_path."footer.html" ,"\$novar"); ?>
    http://www.myfootballforum.com

  8. #8
    Join Date
    Jun 2002
    Posts
    25

    Default

    This is the contents of my summary_de.html file which is in the foloowing locataion

    http://www.myfootballforum.com/searc...ummary_de.html
    Code:
    <table width=395  border="0" bgcolor="#F0EBEB" bordercolor="#F0EBEB">
      <tr align="left"  > 
        <td width="173" border="0" > <font face="Arial, Helvetica, sans-serif" size="2">
        Gategories:</font> 
          <b> 
          <%active_categories%>
          </b> </td>
        <td width="222" border="0"> 
          <p> <font face="Arial, Helvetica, sans-serif" size="2">Links:</font> <b> 
            <%active_links%>
            </b> 
        </td>
      </tr>
    </table>
    And here is the code for the summary_de.php file which is in this location on my server:

    http://www.myfootballforum.com/search/summary_de.php

    Code:
    include("application.php"); 
    
    // --------------- 
    // functions 
    // --------------- 
    
    function ShowMainPage() { 
    global $conn,$admin_template_path,$cookie_admin_last_visi
    t; 
    global $active_links,$active_categories,$active_reviews, 
    $await_links,$await_reviews,$bad_links,$mailing_li
    st_subscribers; 
    
    $query = "select count(category_id) as active_categories from idx_category"; 
    $result = $conn->Execute($query); 
    $active_categories = $result->Fields("active_categories"); 
    
    $query = "select count(link_id) as active_links from idx_link"; 
    $result = $conn->Execute($query); 
    $active_links = $result->Fields('active_links'); 
    
    
    
    
    DisplayTemplate($admin_template_path."summary_de.html", 
    "\$active_links,\$active_categories"); 
    } 
    
    // --------------- 
    // main program 
    // --------------- 
    
    $conn = ConnectDB(); 
    
    include($admin_template_path."msg.php"); 
    
    
    
    
    DisplayTemplate($admin_template_path."header.html","\$title_page"); 
    ShowMainPage(); 
    DisplayTemplate($admin_template_path."footer.html","\$novar"); 
    
    ?>
    Is there anything that I have to change or should it just work?
    http://www.myfootballforum.com

  9. #9
    Join Date
    Jun 2002
    Posts
    25

    Default

    thanks!!

    I got it working now

    <?php


    was missing from the top of the php file!!!
    http://www.myfootballforum.com

Similar Threads

  1. Moving from G-T Links 2
    By esm in forum Pre-Sales Questions
    Replies: 14
    Last Post: 05-30-2005, 04:26 PM
  2. can I show number of links in cat_view.php?
    By richonmaui in forum v5.x
    Replies: 0
    Last Post: 06-04-2004, 09:24 PM
  3. question how many categories max and links ?
    By s2kinteg916 in forum Pre-Sales Questions
    Replies: 9
    Last Post: 03-04-2004, 05:55 AM
  4. delete links and categories
    By egi in forum v5.x
    Replies: 2
    Last Post: 12-19-2002, 10:04 AM

Posting Permissions

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