Ejemplo n.º 1
0
    }
} else {
    if (count($bmlist) < 1) {
        message("No Bookmark to edit.");
    } else {
        if ($post_title == "" || $post_url == "" || $post_icon) {
            $query = sprintf("SELECT title, url, description, childof, id, favicon, public\n\t\t\t\tFROM bookmark\n\t\t\t\tWHERE id='%d'\n\t\t\t\tAND user='******'\n\t\t\t\tAND deleted != '1'", $mysql->escape($bmlist[0]), $mysql->escape($username));
            if ($mysql->query($query)) {
                if (mysql_num_rows($mysql->result) != 1) {
                    message("No Bookmark to edit");
                } else {
                    $row = mysql_fetch_object($mysql->result);
                    require_once ABSOLUTE_PATH . "folders.php";
                    $tree = new folder();
                    $query_string = "?expand=" . implode(",", $tree->get_path_to_root($row->childof)) . "&amp;folderid=" . $row->childof;
                    $path = $tree->print_path($row->childof);
                    if ($post_icon && $settings['show_bookmark_icon']) {
                        if (isset($row->favicon)) {
                            @unlink($row->favicon);
                        }
                        require_once ABSOLUTE_PATH . "favicon.php";
                        $favicon = new favicon($post_url);
                        if (isset($favicon->favicon)) {
                            $icon = '<img src="' . $favicon->favicon . '" width="16" height="16" alt="">';
                            $query = sprintf("UPDATE bookmark SET favicon='%s' WHERE user='******' AND id='%d'", $mysql->escape($favicon->favicon), $mysql->escape($username), $mysql->escape($bmlist[0]));
                            if (!$mysql->query($query)) {
                                message($mysql->error);
                            }
                        } else {
                            $icon = $bookmark_image;
                        }
Ejemplo n.º 2
0
<?php

require_once './header.php';
$get_title = set_title();
$get_url = set_url();
logged_in_only();
$post_title = set_post_title($persistent = true);
$post_url = set_post_url();
$post_description = set_post_description();
$post_childof = set_post_childof();
$post_public = set_post_bool_var("public", false);
require_once ABSOLUTE_PATH . "folders.php";
$tree = new folder();
$query_string = "?expand=" . implode(",", $tree->get_path_to_root($post_childof)) . "&amp;folderid=" . $post_childof;
if ($post_title == '' || $post_url == '') {
    $path = $tree->print_path($folderid);
    if ($post_title != '') {
        $title = $post_title;
    } else {
        $title = $get_title;
    }
    if ($post_url != '') {
        $url = $post_url;
    } else {
        if ($get_url != '') {
            $url = $get_url;
        } else {
            $url = 'http://';
        }
    }
    if (strtolower(basename($_SERVER['SCRIPT_NAME'])) == 'bookmark_add.php') {