|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
triggsley Smarty Rookie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Tue May 04, 2004 1:40 pm Post subject: speed issues with small index page |
|
|
Hi all
I'm having troubles while loading the index.php file for my site, i use a small page with hardly any processing at all
index.php
[php:1:3f3542a74e]<?php
///////////////////////////////////////////////////////
// SESSION - start
///////////////////////////////////////////////////////
session_start();
header("Cache-control: private"); // IE 6 Fix.
///////////////////////////////////////////////////////
// INCLUDES
// SMARTY.CLASS.PHP => smarty template engine
// COLOR_SCHEME.PHP => holds color information
///////////////////////////////////////////////////////
require '../libs/Smarty.class.php';
include ('color_scheme.php');
///////////////////////////////////////////////////////
// ARRAY - $PAGE_HOME
// assigns values to page
///////////////////////////////////////////////////////
$page_home = array( 'img_back' => '2C67A5', 'montage' => 'montage_nhs.jpg',
'table_back'=> $color_menu[0]["table_back"],
'map_back'=> $color_menu[0]["map_back"]);
///////////////////////////////////////////////////////
// SMARTY DEBUG & COMPILE
// assigns login vars to smarty
///////////////////////////////////////////////////////
// create new smarty class
$smarty = new Smarty;
//$smarty->compile_check = false;
//$smarty->debugging = true;
$smarty->use_sub_dirs=false;
//$smarty->clear_compiled_tpl();
///////////////////////////////////////////////////////
// LOGIN CHECK
// checks user/password
///////////////////////////////////////////////////////
$err = $_GET["accpt"];
$err_msg = "";
if($err == "NO")
{
$err_msg = "Invalid Username and Password combination!!!";
$smarty->assign('err_msg', $err_msg);
}
elseif($err == "nien")
{
$err_msg = "Please login to the site through this page";
$smarty->assign('err_msg', $err_msg);
}
// PANEL NAVIGATION ARRAYS
$smarty->assign('page_content', $page_home);
$smarty->display('temp_5.tpl');
?>[/php:1:3f3542a74e]
template file temp_5.tpl has a header include / footer include and a small login standard form
when the index.php loads it takes around 15-20 seconds to load.
i've noticed in the header file
Code: | {literal}
<SCRIPT LANGUAGE="JavaScript" SRC="overlib.js"></SCRIPT>
.......other JS functions here..........
{/literal} |
this is a large javascript(44k) , if i take out this script it takes about 6 seconds to load, i cant seem make it load any quicker.
any ideas would be much appriciated
many thanks
trigg |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|