function get_lastmodified()
{
    global $conn_id;
    $query = "select note_date from note order by note_date desc LIMIT 0,1";
    $result = fn_query($conn_id, $query);
    while ($rows = fn_fetch_array($result)) {
        extract($rows, EXTR_OVERWRITE);
    }
    return $note_date;
}
Exemplo n.º 2
0
}
parse_str(decode($coded));
$page_id = $pg;
$template_path = "./";
$web = new speed_template($template_path);
$web->register($template_name);
$category_id = $category;
$query = "SELECT category_title FROM category WHERE page_id = '" . $page_id . "' AND category_id = '{$category_id}'";
$result = fn_query($conn_id, $query);
while ($rows = fn_fetch_array($result)) {
    extract($rows, EXTR_OVERWRITE);
}
$query = "\r\nSELECT \r\n\tnote_pangkas, note_id, note_images,\r\n\tnote_date,\r\n\tnote_title,\r\n\tnote_description,\r\n\tcase \r\n\t\twhen note_special = 'true' then 'Yes'\r\n\t\telse 'No' \r\n\tend as popup_status,\r\n\tcase \r\n\t\twhen note_user != 0 then 'Member'\r\n\t\telse 'Public' \r\n\tend as note_reader\r\nFROM \r\n\tnote \r\nWHERE\r\n\tcategory_id = '{$category_id}' \r\nORDER BY \r\n\tnote_date desc,\r\n\tnote_id desc\r\n";
//$row_count = 5;
require_once "../library/paging_script.php";
$result = fn_query($conn_id, $query);
if (!$result) {
    die("Err :<br>" . mysql_error());
}
while ($rows = fn_fetch_array($result)) {
    $no++;
    extract($rows, EXTR_OVERWRITE);
    if ($note_pangkas == 1) {
        $note_text = proc_pangkastext($note_text, 250);
    }
    if ($note_images) {
        $note_images = "../{$note_path}/t-{$note_images}";
    } else {
        $note_images = "../library/pixel.gif";
    }
    $hide_smilies = 1;
    $text_login = "******";
} else {
    $location_login = "******";
    $text_login = "******";
}
$conn_id = connect();
$temp_folder = @explode("/", dirname($HTTP_SERVER_VARS[PHP_SELF]));
$thisfolder = $temp_folder[@count($temp_folder) - 1];
$template_name = "form_all_pages";
$web = new speed_template($template_path);
$web->register($template_name);
/* #begin category */
//$query = "SELECT * from category where page='".$$admin_key."'"; //echo $query; exit;
//- 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);
    $query2 = "SELECT * from category where page_id = '{$page_id}' ORDER BY category_id ASC";
    //echo $query; exit;
    $result2 = fn_query($conn_id, $query2);
    while ($rows2 = fn_fetch_array($result2)) {
        extract($rows2, EXTR_OVERWRITE);
        $category_url = "note.php?page_id={$page_id}&category=" . $category_id;
        $web->push($template_name, "blok_category");
    }
    $web->push($template_name, "blok_page");
}
/* #end category */
$web->parse($template_name);
$web->print_template($template_name);
unset($temp[count($temp) - 1]);
$template_name = @implode("_", $temp);
$note_images = "../library/pixel.gif";
$checked_pembaca_0 = "checked";
$checked_pangkas_1 = "checked";
$template_path = "./";
$web = new speed_template($template_path);
$web->register($template_name);
$m_value = $note_text;
$note_text = '<form method="post" action=""><textarea name="elm1" style="width:100%" rows="15">';
$note_text .= $m_value;
$note_text .= '</textarea>';
//$webpg_content.='<br /><input type="button" name="save" value="save" onclick="tinyMCE.triggerSave();" />';
$note_text .= '</form>';
if (!$page_id) {
    $result = fn_query($conn_id, "select page_id from page limit 0,1");
    while ($row = fn_fetch_array($result)) {
        extract($row, EXTR_OVERWRITE);
    }
}
//- dropdown category
unset($option_category);
$drop = new drop_down();
$drop->select = "category_id, category_title";
$drop->from = "category";
$drop->where = "page_id='{$page_id}'";
$drop->order_by = "category_title";
$option_category .= $drop->build($category);
if (!$category) {
    $category = $drop->first_value;
}
 function build($match_value)
 {
     global $conn_id;
     $query = "select " . $this->select;
     $query .= " from " . $this->from;
     if ($this->where) {
         $query .= " where " . $this->where;
     }
     if ($this->group_by) {
         $query .= " group by " . $this->group_by;
     }
     if ($this->having) {
         $query .= " having " . $this->having;
     }
     if ($this->order_by) {
         $query .= " order by " . $this->order_by;
     }
     if ($this->show_query) {
         echo $query, "<br>";
     }
     $result = fn_query($conn_id, $query);
     while ($rows = fn_fetch_row($result)) {
         if (!$this->first_value) {
             $this->first_value = $rows[0];
         }
         $temp .= "<option value=\"" . $rows[0] . "\"";
         if ($this->select_all) {
             $temp .= " selected";
         } elseif ($this->as_template) {
             $temp .= " \$selected_" . $rows[0];
         } elseif (!is_array($match_value) and $rows[0] == $match_value) {
             $temp .= " selected";
         } elseif (is_array($match_value) and in_array($rows[0], $match_value)) {
             $temp .= " selected";
         }
         $temp .= ">" . $rows[1] . "</option>\r\n";
     }
     fn_free_result($result);
     return $temp;
 }