Hello Ronny,
Wednesday, April 21, 2004, 2:30:37 PM, you wrote:
RH You're missing my point. Saran saya di atas itu, di index.php anda
RH kasih redirect ke home.php kalo tidak ada token yg seharusnya diset di
RH home.php.
RH Kenapa memangnya kok perlu dipisah home.php dan index.php? Gabung aja
RH jadi satu kan beres.
RH Ronny
wah itu ga bisa ... soalnya home.php itu main template, sedang
index.php itu sub template.
jadi semua script akan memanggil home.php dulu untuk meload
templatenya. (saya menggunakan smarty template juga).
jadi, biasanya home.php akan memanggil index.php dan script php
lainnya.
masalahnya, di httpd.conf, saya udah set agar semua / setelah hostname
diredirect ke home.php dan sisanya akan diload melalui home.php.
ini saya kasi home.php (ini pakai smarty template juga):
?php
/*** Author : Adwin Frederick /
/*** THE MAIN TEMPLATE AND THE MAIN FILE of THE SITE **/
include_once(dirname(__FILE__)./../include.php);
ob_start('ob_gzhandler');
session_start();
$smarty = new Smarty;
$smarty-caching = false ;
$smarty-assign('accountType', $_SESSION['accountType']);
$smarty-assign('full_name', ucwords($_SESSION['full_name']));
/ my addition **/
$location = dirname($_SERVER['REQUEST_URI']).'/' ;
if(file_exists(dirname(__FILE__).'/'.$location.'page_configuration.php')){
require(dirname(__FILE__).'/'.$location.'page_configuration.php');
if($links_member_name[$selected_link] != ''){
$smarty-assign('selected_link',
$links_member_name[$selected_link]);
} else {
$smarty-assign('selected_link', $links_name[$selected_link]);
}
}
if(is_dir(dirname(__FILE__).$_SERVER['PATH_INFO']))
$inc_file = dirname(__FILE__)./.$_SERVER['PATH_INFO']./index.php;
else
$inc_file = dirname(__FILE__)./.$_SERVER['PATH_INFO'];
#$inc_file = ltrim($inc_file, /);
if(ereg(^.basename(__FILE__), $inc_file))
Header(Location: /);
//print incfile: $inc_file br/ self: $_SERVER[PHP_SELF] br/. ;
preg_match(/\.(.*)$/, basename($inc_file), $ext);
$smarty-assign('GET', $_GET);
$smarty-assign('filetype', $ext[1]);
$smarty-assign('inc_file', $inc_file);
$smarty-assign('breadcrumb', url2bc());
/*** news and topic ***/
dbConnect();
/** News */
$query = sql_query(SELECT * FROM awillr_news ORDER BY date DESC LIMIT 0,10);
while($tmp = sql_fetch_array($query))
$result_news[$tmp['id']] = $tmp;
/** Topics */
$query2 = sql_query(
SELECT T.id AS id, T.topic AS topic, TC.category as category
FROM awillr_topic T, awillr_topic_category TC
WHERE T.active AND T.category=TC.id
ORDER BY T.category,T.priority
);
while($info = mysql_fetch_assoc($query2))
{
$result_topic[$info['category']][$info['id']] = $info['topic'];
}
/** Assign variables for SMARTY */
$smarty-assign('news', $result_news);
$smarty-assign('topics', $result_topic);
$smarty-assign('letters', range('A','Z'));
$smarty-display(dirname(__FILE__).'/templates/main_template.html');
ob_end_flush();
?
--
Best regards,
adwinwijaya
mailto:[EMAIL PROTECTED]
--
Unsubscribe: kirim email kosong ke [EMAIL PROTECTED]
Arsip dan info di http://linux.or.id/milis.php
FAQ milis http://linux.or.id/faq.php