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
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
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
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
well!!!!!
I need help
http://www.myfootballforum.com
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
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
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
This is the contents of my summary_de.html file which is in the foloowing locataion
http://www.myfootballforum.com/searc...ummary_de.html
And here is the code for the summary_de.php file which is in this location on my server: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>
http://www.myfootballforum.com/search/summary_de.php
Is there anything that I have to change or should it just work?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"); ?>
http://www.myfootballforum.com
thanks!!
I got it working now
<?php
was missing from the top of the php file!!!
http://www.myfootballforum.com