Exemplo n.º 1
0
        unset($_SESSION["jumblies"]);
    }
} elseif (isset($_SESSION["sessionid"])) {
    $_SESSION["sessionid"] = 0;
    $myid = 0;
    $myname = "signin";
} else {
    $_SESSION["sessionid"] = 0;
    $_GET["p"] = "about";
    $myid = 0;
    $myname = "signin";
}
//---input---//
if (isset($_GET["p"])) {
    include "pagetype.php";
    $arrayinfo = pagetype($_GET["p"]);
    $pagetype = $arrayinfo[0];
    $p = $arrayinfo[1];
} elseif ($myid > 0) {
    $p = "welcome";
    $pagetype = "special";
} else {
    $p = "about";
    $pagetype = "special";
}
//---output---//
if (isset($p)) {
    //---sharewaves---//
    if (strpos($p, "share-waves.com") !== FALSE) {
        header("Location: https://google.com/search?q=recursion");
    } elseif (strpos($p, "chrome://") !== FALSE) {
Exemplo n.º 2
0
        $_POST["p"] = str_replace("http://share-waves.com/index.php", "", $_POST["p"]);
        $_POST["p"] = str_replace("share-waves.com/index.php", "", $_POST["p"]);
        $_POST["p"] = str_replace("http://share-waves.com/", "", $_POST["p"]);
        $_POST["p"] = str_replace("share-waves.com/", "", $_POST["p"]);
    }
    if (strpos($_POST["p"], "localhost/sharewaves") !== FALSE) {
        $_POST["p"] = str_replace("http://localhost/sharewaves/index.php?p=", "", $_POST["p"]);
        $_POST["p"] = str_replace("localhost/sharewaves/index.php?p=", "", $_POST["p"]);
        $_POST["p"] = str_replace("http://localhost/sharewaves/?p=", "", $_POST["p"]);
        $_POST["p"] = str_replace("localhost/sharewaves/?p=", "", $_POST["p"]);
        $_POST["p"] = str_replace("http://localhost/sharewaves/index.php", "", $_POST["p"]);
        $_POST["p"] = str_replace("localhost/sharewaves/index.php", "", $_POST["p"]);
        $_POST["p"] = str_replace("http://localhost/sharewaves/", "", $_POST["p"]);
        $_POST["p"] = str_replace("localhost/sharewaves/", "", $_POST["p"]);
    }
    $arrayinfo = pagetype($_POST["p"]);
    $pagetype = $arrayinfo[0];
    $p = $arrayinfo[1];
} else {
    header("Location: index.php");
}
//---logged out---//
if ($myid == 0) {
    $topleftbutton = "aboutbutton";
    $searchbar = "search";
} elseif ($pagetype == "special") {
    $topleftbutton = "aboutbutton";
    $searchbar = "search";
} elseif ($pagetype == "search") {
    $topleftbutton = "aboutbutton";
    $searchbar = "search";
Exemplo n.º 3
0
function m2mButtons ($pagename) {
	global $M2MUrl;
	$url = FmtPageName('$PageUrl', $pagename) . "?action=m2m-publish";
	$ret = '';
	$ret = <<<content
		<script language='JavaScript'>
			function selectFormat() {
				format = document.m2mform.targetformat.value;
				document.m2mform.options.disabled = (format == 'zip');
				setCookie('m2m-format', format);
			}

			function getCookie (name) {  
				var arg = name + "=";  
				var alen = arg.length;  
				var clen = document.cookie.length;  
				var i = 0;  
				while (i < clen) {
					var j = i + alen;    
					if (document.cookie.substring(i, j) == arg)      
						return getCookieVal (j);    
					i = document.cookie.indexOf(" ", i) + 1;    
					if (i == 0) break;   
				}  
				return null;
			}
			
			function setCookie (name, value) {  
				var argv = setCookie.arguments;  
				var argc = setCookie.arguments.length;  
				var expires = (argc > 2) ? argv[2] : null;  
				var path = (argc > 3) ? argv[3] : null;  
				var domain = (argc > 4) ? argv[4] : null;  
				var secure = (argc > 5) ? argv[5] : false;  
				document.cookie = name + "=" + escape (value) + 
					((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
					((path == null) ? "" : ("; path=" + path)) +  
					((domain == null) ? "" : ("; domain=" + domain)) +    
					((secure == true) ? "; secure" : "");
			}
		</script>
		<form class='publish' name='m2mform' target='_blank' action='$url' method='post'>
content;

	$formats = WikiConverterFactory::availableTargetFormats();
	if (count($formats) > 1) {
		$ret.= '$[Target Format]:'; 
		$ret.= "<select name='targetformat' class='inputbox' onChange='selectFormat()'>";
		foreach ($formats as $f=>$d) {		
			$ret .= "<option value='$f'";		
			if ($f == $_COOKIE['m2m-format'])
				$ret .= " selected='selected'";
			$ret .= ">$d</option>";
		}
		$ret .= "</select>\n";
	}
	else {
		$keys = array_keys($formats);
		$ret .= "<input type='hidden' name='targetformat' value='$keys[0]'/>";
	}
	$ret .= <<<content
		<input type='hidden' value='$pagename' name='pagename'>
		<input type='submit' value='$[Options]' name='m2m-options' class='inputbutton'/>
		<input type='submit' value='$[Publish Page]' name='publishpage' class='inputbutton'/>
content;
	$pagetype = pagetype($pagename);
	if ($pagetype == 'trail' || $pagetype == 'collection') {
		$typestr = strtoupper($pagetype{0}).substr($pagetype, 1);
		$ret.= " <input type='submit' value='$[Publish $typestr]' name='publish$pagetype' class='inputbutton'/> ";
	}
	$ret.= "</form>";
	return Keep(FmtPageName($ret, $pagename));
}