Пример #1
0
function delete_chapter($id)
{
    global $connection;
    // First, delete the options that are connected to the chapter
    delete_options($id);
    // Then delete rows from chapter_option that include this chapter
    delete_from_chapter_option($id);
    // Then nullify the child_chapter row in options table
    nullify_child_chapter($id);
    // Delete rows in story_chapter that include this chapter
    delete_from_story_chapter($id);
    // Then delete chapter
    $query = "DELETE FROM chapters WHERE id = {$id} LIMIT 1";
    $result_set = mysql_query($query, $connection);
    confirm_query($result_set);
}
Пример #2
0
include_once 'ressources/class.ini.inc';
include_once 'ressources/class.squid.inc';
include_once 'ressources/class.system.network.inc';
$user = new usersMenus();
if ($user->AsSquidAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["edit-proxy-parent-options"])) {
    parent_options_popup();
    exit;
}
if (isset($_POST["DeleteSquidOption"])) {
    delete_options();
    exit;
}
if (isset($_POST["AddSquidParentOptionOrginal"])) {
    construct_options();
    exit;
}
if (isset($_GET["popup"])) {
    website_table();
    exit;
}
if (isset($_GET["SquidActHasReverse"])) {
    Save();
    exit;
}
if (isset($_GET["website"])) {
Пример #3
0
            $errors[] = mysql_error();
        } else {
            // SUCCESS
            // Get a reference to the option_id just created
            $option_id = mysql_insert_id();
            // Now create the option link in join table
            $query = "INSERT INTO chapter_option (chapter_id, option_id)\n\t\t\t\t\t\tVALUES (\t{$chapter_id}, {$option_id} )";
            $result = mysql_query($query, $connection);
            if (!$result) {
                $errors[] = "problem with first insert. Story id: " . $chapter_id . " and option id: " . $option1ID . mysql_error();
            }
        }
    } else {
        // There is an option 1, so UPDATE
        // OPTIONS TABLE UPDATE
        $option_id = $option['id'];
        if ($endpoint == 1) {
            // End the story here, so remove the options.
            // (Keep child chapters since we may still want to use them);
            delete_options($chapter_id);
            delete_from_chapter_option($chapter_id);
        } else {
            // It's not the end, so keep options
            $query = "UPDATE \t\toptions\n\t\t\t\t\t\tSET \t\tcontent\t\t= \t'{$content}'\n\t\t\t\t\t\tWHERE\t\tid\t=\t{$option_id}";
            $result = mysql_query($query, $connection);
            if (!$result) {
                $errors[] = mysql_error();
            }
        }
    }
}
		die();exit();
	}	
	
	
	if(isset($_GET["js"])){js();exit;}
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["edit-proxy-parent-js"])){parent_config_js();exit;}
	if(isset($_GET["edit-proxy-parent"])){parent_config();exit;}
	if(isset($_GET["edit-proxy-parent-tab"])){parent_tab();exit;}
	if(isset($_GET["edit-proxy-parent-table"])){parent_options_table();exit;}
	if(isset($_GET["SaveParentProxy"])){parent_save();exit;}
	if(isset($_GET["edit-proxy-parent-options"])){parent_options_popup();exit;}
	if(isset($_GET["edit-proxy-parent-options-explain"])){parent_options_explain();exit;}
	if(isset($_GET["extract-options"])){extract_options();exit;}
	if(isset($_POST["AddSquidParentOptionOrginal"])){construct_options();exit;}
	if(isset($_POST["DeleteSquidOption"])){delete_options();exit;}
	if(isset($_GET["parent-list"])){popup_list();exit;}
	if(isset($_GET["DeleteSquidParent"])){parent_delete();exit;}
	if(isset($_GET["EnableParentProxy"])){EnableParentProxy();exit;}
	if(isset($_GET["prefer_direct"])){prefer_direct();exit;}
	if(isset($_GET["nonhierarchical_direct"])){nonhierarchical_direct();exit;}
	if(isset($_GET["parent-list-options"])){extract_options();exit;}
	if(isset($_GET["ActionRun"])){ActionRun();exit;}
	if(isset($_GET["peer_infos"])){$GLOBALS["VERBOSE"]=true;peer_infos();exit;}
popup();
	
function js(){
	$t=time();
	$tpl=new templates();
	$page=CurrentPageName();
	$title=$tpl->_ENGINE_parse_body("{squid_parent_proxy}");