| |
<?php
$common_image_dir ="./library";
if(is_array($HTTP_GET_VARS)) extract($HTTP_GET_VARS,EXTR_SKIP);
/**
* Gets core libraries and defines some variables
*/
require_once './library/common.php';
require_once './library/configuration.php';
parse_str(decode($coded));
//if(empty($page_id)) {include("index-jurpo.com.php"); exit;} /*
khusus jurpo.com */
$conn_id = connect();
//- content
$web = new speed_template($template_path);
if(empty($page_id)) {
$template_name ="form_note_index";
$web->register($template_name);
//- pages
$query = "SELECT * FROM page ORDER BY page_id ASC";
$result = fn_query($conn_id,$query);
while($rows = fn_fetch_array($result)) {
extract($rows,EXTR_OVERWRITE);
//- content
$query2 = "
SELECT note_pangkas, category_id, note_id, note_title, note_text, note_date,
user_id, note_images
FROM note
WHERE page_id='$page_id'
ORDER BY note_date desc, note_id desc
LIMIT 0,5
";
$result2 = fn_query($conn_id,$query2);
while($rows2 = fn_fetch_array($result2)) {
$no++;
extract($rows2,EXTR_OVERWRITE);
//$judul =$note_title."<BR>(".$note_date.')';
if($note_images) $note_images = "$note_path/t-$note_images"; else
$note_images = "library/pixel.gif";
$note_date =fn_datetimeformat('d-M-Y H:i:s', $note_date);
if($note_pangkas==1) $note_text = proc_pangkas($note_text);
if(!$id) $id = $note_id;
$hide_smilies=1; $note_text = parse_message($note_text,$hide_smilies);
$web->push($template_name,"blok");
}
$web->push($template_name,"blok_page");
}
$active_page_title = "» Home";
}
else {
$template_name ="form_note";
$web->register($template_name);
//- init, no category found
if(empty($category)) {
//- get first category registered
$query = "SELECT category_id AS category FROM category WHERE page_id='$page_id'
ORDER BY category_id ASC LIMIT 0,1";
$result = fn_query($conn_id,$query);
while($rows = fn_fetch_array($result)) extract($rows,EXTR_OVERWRITE);
}
$active_category_id = $category;
$query = "SELECT category_title AS active_category_title FROM category
WHERE page_id='$page_id' AND category_id = '$active_category_id'";
$result = fn_query($conn_id,$query);
while($rows = fn_fetch_array($result)) extract($rows,EXTR_OVERWRITE);
if(isset($HTTP_GET_VARS["id"])) $q_note_detail ="page_id =
'$page_id' AND note_id = '$id'";
else $q_note_detail ="page_id = '$page_id' AND category_id = '$active_category_id'
ORDER BY note_id DESC LIMIT 0,1";
$query = "
SELECT
user_id as active_user_id,
note_images as active_note_images,
note_date as active_note_date,
note_title as active_note_title,
note_text as active_note_text
FROM note
WHERE $q_note_detail
";
$result = fn_query($conn_id,$query);
while($rows = fn_fetch_array($result)) extract($rows,EXTR_OVERWRITE);
//$note_text = nl2br($note_text);
if($active_note_images) $active_note_images = "$note_path/t-$active_note_images";
else $active_note_images = "library/pixel.gif";
$active_note_date =fn_datetimeformat('d-M-Y H:i:s', $active_note_date);
$hide_smilies=1; $active_note_text = parse_message($active_note_text,$hide_smilies);
$query = "SELECT category_id,category_title FROM category WHERE page_id
= '$page_id' ORDER BY category_id ASC";
$result = fn_query($conn_id,$query);
while($rows = fn_fetch_array($result)) {
extract($rows,EXTR_OVERWRITE);
$web->push($template_name,"blok_category");
}
$q_page ="WHERE page_id = '$page_id' AND category_id = '$active_category_id'
";
$query = "
SELECT
category_id, note_id,
note_title,note_date
FROM
note
$q_page
ORDER BY
note_date desc,
note_id desc
";
$page_count = 5;
$row_count = 7;
require_once("library/paging_script.php");
$result = fn_query($conn_id,$query);
while($rows = fn_fetch_array($result)) {
$no++;
extract($rows,EXTR_OVERWRITE);
//$judul =$note_title."<BR>(".$note_date.')';
if(!$id) $id = $note_id;
$web->push($template_name,"blok");
}
$active_page_title = "» ".$txt." » ".$active_category_title."
» ".$active_note_title;
}
$web->parse($template_name);
$web_content = $web->return_template($template_name);
disconnect($conn_id);
require_once("all_pages.php");
?>
|