Пример #1
0
function moveLink($link_id, $direction)
{
    $objResponse = new xajaxResponse();
    $direction = $direction == 'up' ? '<' : '>';
    $orderby = $direction == '<' ? 'desc' : 'asc';
    $project7 = new editsee_App();
    if ($project7->loggedIn()) {
        //get the stuff
        $query = $project7->db->_query("select link_order from " . $project7->db->get_table_prefix() . "links where link_id='" . $link_id . "'");
        $link_order_orginal = $query->_result(0);
        $query2 = $project7->db->_query("select link_id,link_order from " . $project7->db->get_table_prefix() . "links \r\n\t\t\t\t\t\t\t\t\t\twhere link_order " . $direction . " '" . $link_order_orginal . "' and deleted=0\r\n\t\t\t\t\t\t\t\t\t\torder by link_order " . $orderby . " limit 1");
        $link_order_cutoff = $query2->_fetch_assoc();
        //fix the stuff
        $project7->db->_query("update " . $project7->db->get_table_prefix() . "links set link_order='" . $link_order_cutoff['link_order'] . "' where link_id='" . $link_id . "'");
        $project7->db->_query("update " . $project7->db->get_table_prefix() . "links set link_order='" . $link_order_orginal . "' where link_id='" . $link_order_cutoff['link_id'] . "'");
        ob_start();
        $project7->display('sidebar-only');
        $new_sidebar = ob_get_contents();
        ob_end_clean();
        $objResponse->assign('sidebar', 'innerHTML', $new_sidebar);
    } else {
        $objResponse->alert($project7->notLoggedIn());
    }
    return $objResponse;
}
Пример #2
0
<?php

/* editsee index.php */
require_once "includes/editsee_App.class.php";
$project7 = new editsee_App();
$project7->display('first-load');