function getPage() { $page = checkPage(); $db = new db(); $db->connect(); $pageData = getPageData($page); if (count($pageData) <= 1) { $pageData = getPageData("404"); header("HTTP/1.1 404 Not Found"); } sendPage($pageData); }
<!DOCTYPE html> <?php require 'utilities/utils.php'; if (array_key_exists('page', $_GET)) { $askedPage = $_GET['page']; } else { $askedPage = "accueil"; } $authorized = checkPage($askedPage); if ($authorized) { $pageTitle = getPageTitle($askedPage); } else { $pageTitle = "Cette page n'est pas accessible"; $askedPage = "erreur"; } generateHTMLHeader($pageTitle); ?> <div class="container"> <?php generateMenu($askedPage); ?> <div class="jumbotron"> <?php echo "<h1>{$pageTitle}</h1>"; ?> <p>Ceci est le site du binet photo</p> </div> <div id="content"> <?php if ($authorized) {
<?php if (isset($_POST['submit'])) { $url = isset($_POST['url']) ? $_POST['url'] : ''; if (!(strpos($url, 'http://') === 0)) { $url = 'http://' . $url; } ?> <table width="100%"> <?php $txt = getPage($url); $linkArray = checkPage($txt); foreach ($linkArray as $value) { if (pingLink($value) <= 0) { $status = "INVALID"; } else { $status = "OK"; } echo "<tr><td align='center'>{$value}</td><td>{$status}</td></tr>"; sleep(2); @ob_flush(); flush(); } ?> </table> <?php
$spcname = ""; if ($row['subitem'] == "1" && $parent > 0) { if ($orderf) { $res3 = getDetailByCode($parentfinea); $pname = pg_result($res3, 0, 1); $name = "{$name} {$pname}"; } $spcname = " "; } echo $spcname . $ahref . $name . "{$aterm}</td>"; $amount1 = fmoney($row['amount1']); $amount2 = fmoney($row['amount2']); $amount3 = fmoney($row['amount3']); $id0 = $row['id']; $img = "edit_empty.png"; if (checkPage("ID_{$id0}")) { $img = "edit_filled.png"; } echo "<td bgcolor={$col}> <a href=index.php?id={$id0}><img src='img/{$img}' border='0'></a> </td>"; if ($totalp) { $percent = $row['amount1'] / $totaluf * 100; $js .= "\$(\"#pbar{$cnt}\").progressbar({\n\t\t\tvalue: {$percent}\n\t\t});\n \$(\"#pbar{$cnt}\").height(20);\n "; echo "{$vline}<td bgcolor={$col}><div id='pbar{$cnt}'></div>" . number_format($percent, 2) . "</td>"; } echo "{$vline}<td align='right' bgcolor={$col}> " . $amount1 . " </td>"; echo "{$vline}<td align='right' bgcolor={$col}> " . $amount2 . " </td>"; echo "{$vline}<td align='right' bgcolor={$col}> " . $amount3 . " </td>"; echo "</tr>"; } echo "</table>"; if ($id && $mediawiki) {
<?php ini_set('display_errors', true); echo "yo bitch"; error_reporting(E_ALL); include_once "includes/functions.php"; render("header", $data = array("title" => "PizzaBay")); if (isset($_GET['tname'])) { $type = checkPage($_GET['tname']); } else { $type = NULL; render("shoppingcart"); } if (isset($_GET['sub_type'])) { $sub_type = $_GET['sub_type']; } else { $sub_type = NULL; } getHeader("category" . $type, $sub_type); ?> <?php render("footer");
function EditSubpages($title, $user, $action, $result) { global $evEditSubpagesCache; $pagename = $title->getText(); //name of page w/ spaces, not underscores if (!array_key_exists('pagename', $evEditSubpagesCache) || $pagename != $evEditSubpagesCache['pagename']) { $ns = $title->getNsText(); //namespace if ($title->isTalkPage()) { $ns = $title->getTalkNsText(); $nstalk = ''; } else { $nstalk = $title->getTalkNsText(); } if ($ns == '') { $text = $pagename; } else { $text = $ns . ":" . $pagename; } if ($nstalk != '') { $talktext = $nstalk . ":" . $pagename; } else { $talktext = $pagename; } //underscores -> spaces $ns = str_replace('_', ' ', $ns); $nstalk = str_replace('_', ' ', $nstalk); $pages = explode("\n", wfMsg('unlockedpages')); //grabs MediaWiki:Unlockedpages //cache the values so future checks on the same page take less time $evEditSubpagesCache = array('pagename' => $pagename, 'ns' => $ns, 'nstalk' => $nstalk, 'text' => $text, 'talktext' => $talktext, 'pages' => $pages, 'loggedin' => $user->isLoggedIn()); } if ($action == 'edit' || $action == 'submit') { foreach ($evEditSubpagesCache['pages'] as $value) { if (strpos($value, '*') === false || strpos($value, '*') !== 0) { continue; } // "*" doesn't start the line, so treat it as a comment (aka skip over it) $flags = array('s' => 1, 'c' => 1, 't' => 1, 'e' => 1, 'b' => 0, 'u' => 0, 'i' => 0, 'n' => 0, 'r' => 0, 'w' => 0); //default flags $value = trim(trim(trim(trim($value), "*[]")), "*[]"); /* flags * s = unlock subpages * c = allow page creation * t = unlock talk pages * e = allow editing existing pages * b = unlock base pages * u = apply restrictions to users as well * i = case insensitive * n = namespace inspecific * r = regex fragment * w = wildcard matching */ $pieces = explode('|', $value, 3); if (isset($pieces[1]) && strpos($pieces[1], '+') === 0) { //flag parsing $flaglist1 = explode('+', $pieces[1], 2); if (isset($flaglist1[1])) { $flaglist2 = explode('-', $flaglist1[1], 2); } else { $flaglist2 = explode('-', $pieces[1], 2); } $flagpos = str_split($flaglist2[0]); if (isset($flaglist2[1])) { $flagneg = str_split($flaglist2[1]); } else { $flagneg = array(''); } foreach ($flagpos as $flag) { $flags[$flag] = 1; } foreach ($flagneg as $flag) { $flags[$flag] = 0; } } $found = checkPage($pieces[0], $evEditSubpagesCache['text'], $flags); if (!$found && $flags['n']) { $found = checkPage($pieces[0], $evEditSubpagesCache['pagename'], $flags); } if (!$found && $flags['t']) { $newtitle = Title::newFromText($pieces[0]); //make sure that it's a valid title if ($newtitle instanceof Title && !$newtitle->isTalkPage()) { $talk = $newtitle->getTalkPage(); $talkpage = $talk->getPrefixedText(); $found = checkPage($talkpage, $evEditSubpagesCache['talktext'], $flags); if (!$found) { $found = checkPage($talkpage, $evEditSubpagesCache['text'], $flags); } } } if (!$found) { continue; } if (!$flags['u'] && $evEditSubpagesCache['loggedin']) { return true; } //the page matches, now process it and let the software know whether or not to allow the user to do this action if (!$flags['c'] && !$newtitle->exists()) { $result = false; return false; } if (!$flags['e'] && $newtitle->exists()) { $result = false; return false; } $result = true; return false; } if (!$evEditSubpagesCache['loggedin']) { $result = false; return false; } } return true; }
<?php //$base_uri = "http://" . $_SERVER['HTTP_HOST'] . '/yourlogicalfallacyis.com/'; $base_uri = "http://" . $_SERVER['HTTP_HOST']; $i_f = ''; //$base_uri = "http://" . $_SERVER['HTTP_HOST']; if (!isset($_GET['page'])) { $_GET['page'] = 'home'; } if (isset($_GET['page'])) { $page = strtolower($_GET['page']); if ($page != 'missing') { $file = "data.json"; $data = file_get_contents($file); $json = json_decode($data, true); checkPage(); $json['current'] = 0; $json['order'] = array(); foreach ($json['fallacies'] as $key => $value) { $json['order'][] = $key; $json['fallacies'][$key]['order'] = count($json['order']) - 1; $json['fallacies'][$key]['description'] = addPars($json['fallacies'][$key]['description']); if ($page == 'fallacy' && $key == $type) { $json['current'] = $json['fallacies'][$key]['order']; } } $json['home']['description'] = addPars($json['home']['description']); $json['poster']['description'] = addPars($json['poster']['description']); $json['pages'] = array(); $json['pages']['home'] = get_page('pages/home.php'); $json['pages']['fallacy'] = get_page('pages/fallacy.php');