<?php include_once "header.php"; include_once 'includes/website.php'; include_once 'includes/library.php'; session_start(); $_SESSION['websiteid'] = 1; $websiteid = $_SESSION['websiteid']; if (isset($_GET['pageurlid'])) { $pageid = Mod_addslashes($_GET['pageurlid']); $websiteid = $_SESSION['websiteid']; $viewpage = new Website(); /******* fetching website information ***************/ $webres = $viewpage->fetchewebsiteinfo($websiteid); $db = new DBConnection(); $webrow = $db->fetch_assoc($webres); //print_r($pagerow); $webid = $webrow[website_id]; $webname = $webrow[website_name]; $webusr = $webrow[user_id]; $webkeyword = $webrow[keyword]; $websitetitle = $webrow[site_title]; $webdescription = $webrow[meta_description]; /***********for fetching particular page information *************/ $res = $viewpage->fetchpage($websiteid, $pageid); $db = new DBConnection(); $pagerow = $db->fetch_assoc($res); //print_r($pagerow); $pageid = $pagerow[page_id]; $pagename = $pagerow[page_name]; $pagecontent = $pagerow[page_content];
$theme = $row["theme"] != "" ? $row["theme"] : ""; $transparency = $row["transparency"] != "" ? $row["transparency"] : false; $wallpaper = $row["wallpaper"]; $wallpaperposition = $row["wallpaperposition"] != "" ? $row["wallpaperposition"] : 'center'; // get member preferences, if any if (mysql_num_rows($result) > 1) { $row = mysql_fetch_assoc($result); $autorun = $row["autorun"] != "" ? $row["autorun"] : $autorun; $backgroundcolor = $row["backgroundcolor"] != "" ? $row["backgroundcolor"] : $backgroundcolor; $quickstart = $row["quickstart"] != "" ? $row["quickstart"] : $quickstart; $theme = $row["theme"] != "" ? $row["theme"] : $theme; $transparency = $row["transparency"] != "" ? $row["transparency"] : $transparency; $wallpaper = $row["wallpaper"] != "" ? $row["wallpaper"] : $wallpaper; $wallpaperposition = $row["wallpaperposition"] != "" ? $row["wallpaperposition"] : $wallpaperposition; } $json = "{\r\n\t\t\t\t'success': true,\r\n\t\t\t\t'config': {\r\n\t\t\t\t 'autorun': " . $autorun . ",\r\n\t\t\t\t\t'desktopcontextmenu': " . $desktopcontextmenu . ",\r\n\t\t\t\t\t'quickstart': " . $quickstart . ",\r\n\t\t\t\t\t'startmenu': " . $startmenu . ",\r\n\t\t\t\t\t'styles': {\r\n\t\t\t\t\t\t'backgroundcolor': '" . $backgroundcolor . "',\r\n\t\t\t\t\t\t'theme': { \r\n\t\t\t\t\t\t\t'id': '" . $theme . "',\r\n\t\t\t\t\t\t\t'path': '" . Mod_addslashes(get_path('themes', $theme)) . "'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t'transparency': " . $transparency . ",\r\n\t\t\t\t\t\t'wallpaper': {\r\n\t\t\t\t\t\t\t'id': '" . $wallpaper . "',\r\n\t\t\t\t\t\t\t'path': '" . Mod_addslashes(get_path('wallpapers', $wallpaper)) . "'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t'wallpaperposition': '" . $wallpaperposition . "'\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}"; } } } print $json; // helper functions function Mod_addslashes($string) { if (get_magic_quotes_gpc() == 1) { return $string; } else { return addslashes($string); } } function get_path($what, $id) {
echo "<script>window.location='../viewpages.php'</script>"; } else { echo "<script>alert('page info not updated.');<script>"; echo "<script>window.location='../viewpages.php'</script>"; } } if (isset($_POST['addcontents'])) { $pageid = Mod_addslashes($_POST['pageid']); $pagecontent = Mod_addslashes(trim($_POST['pagecontent'])); $pagemenu = Mod_addslashes($_POST['pagemenu']); $website = new Website(); $res = $website->addpage($pageid, $pagecontent, $pagemenu); if ($res > 0) { if ($pagemenu == 'Yes' && !empty($_POST['checksubmenu'])) { if ($chksubmenu == 'Yes') { $chksubmenu = Mod_addslashes($_POST['checksubmenu']); $presubmenu = ''; $submenupages = $_POST['submenu']; $res = $website->addsubmenu($pageid, $submenupages, $presubmenu); if ($res > 0) { // echo "submenu pages added successfully"; } } } echo "<script>alert('page info is updated successfuly')</script>"; echo "<script>window.location='../createpage.php'</script>"; } else { echo "<script>alert('page info not updated.');<script>"; echo "<script>window.location='../createpage.php'</script>"; } }
<?php session_start(); include_once 'website.php'; include_once 'library.php'; if (empty($_POST['pagename'])) { $error .= "you have not entered page name<br>"; } if (!empty($error)) { } else { echo " " . $error; } $pagename = Mod_addslashes($_POST['pagename']); $userid = $_SESSION['userid']; $websiteid = $_SESSION['websiteid']; $menus = 1; if ($_POST['pagewithmenu']) { $webpage = new Website(); $webpageres = $webpage->addwebsitepagetitle($pagename, $userid, $website_id, $menus); if ($webpageres > 0) { echo "<script>alert('page info is updated successfuly')</script>"; echo "<script>window.location='../public/viewpages.php'</script>"; } else { echo "<script>alert('page info not updated.');<script>"; echo "<script>window.location='../public/viewpages.php'</script>"; } }