<?php // AcmlmBoard XD - Private message sending/previewing page // Access: user $title = __("Private messages"); $crumbs = new PipeMenu(); $crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist")); $crumbs->add(new PipeMenuHtmlEntry(userLink($loguser))); $crumbs->add(new PipeMenuLinkEntry(__("Private messages"), "private")); $crumbs->add(new PipeMenuLinkEntry(__("New PM"), "sendprivate")); makeBreadcrumbs($crumbs); AssertForbidden("sendPM"); if (!$loguserid) { //Not logged in? Kill(__("You must be logged in to send private messages.")); } $pid = (int) $_GET['pid']; if ($pid) { $rPM = Query("select * from {pmsgs} p left join {pmsgs_text} t on t.pid = p.id where p.userto = {0} and p.id = {1}", $loguserid, $pid); if (NumRows($rPM)) { $sauce = Fetch($rPM); $rUser = Query("select * from {users} where id = {0}", (int) $sauce['userfrom']); if (NumRows($rUser)) { $user = Fetch($rUser); } else { Kill(__("Unknown user.")); } $prefill = "[reply=\"" . $user['name'] . "\"]" . htmlspecialchars($sauce['text']) . "[/reply]"; if (strpos($sauce['title'], "Re: Re: Re: ") !== false) { $trefill = str_replace("Re: Re: Re: ", "Re*4: ", $sauce['title']); } else {
function process($text, $wiki) { global $dataSource; global $_EXTRAS; global $_CONFIG; $text = $text . "\n\n"; if ($_CONFIG['oneWiki']) { $base = $_CONFIG['base']; } else { $base = $_CONFIG['base'] . "/" . $wiki; } function stripSpaces($text) { return ereg_replace("/[:space:]/", "", $text); } /*// Conditional includes preg_match_all("/\[\[IFEDIT\|(.*?)\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ $result = $matches[1][$index]; if (checkAuth("edit")){ $text = preg_replace("#".preg_quote($match,"#")."#",$result,$text); } else { $text = preg_replace("#".preg_quote($match,"#")."#","Can't Edit",$text); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\[\[IfLoggedIn\|(.*?)\|(.*?)\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ $result = $matches[1][$index]; if (isset($_EXTRAS['me'])){ $text = preg_replace("#".preg_quote($match,"#")."#",$matches[1][$index],$text); } else { $text = preg_replace("#".preg_quote($match,"#")."#",$matches[2][$index],$text); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\[\[IFEDIT\|(.*?)\|(.*?)\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ if (checkAuth("edit")){ $text = preg_replace("#".preg_quote($match,"#")."#", $matches[1][$index],$text); } else { $text = preg_replace("#".preg_quote($match,"#")."#", $matches[2][$index],$text); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; }*/ preg_match_all("/\\[\\[INCLUDE\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $include = $dataSource->getContent($matches[1][$index]); $text = preg_replace("#" . preg_quote($match, "#") . "#", $include, $text); } // Set Variables preg_match_all("/\\[\\[SETVAR\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); // [[CALC|var|value]] foreach ($matches[0] as $index => $match) { $text = preg_replace("#" . preg_quote($match, "#") . "#", "", $text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\\[\\[CALC\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); // [[CALC|var|opp]] foreach ($matches[0] as $index => $match) { $text = preg_replace("#" . preg_quote($match, "#") . "#", "<!-- Calculate functions removed -->", $text); #$eval = "\$_EXTRAS[".$matches[1][$index]."] = \$_EXTRAS[".$matches[1][$index]."] ".$matches[2][$index].";"; #eval($eval); #$_EXTRAS[$matches[1][$index]] = eval($eval); } preg_match_all("/\\[\\[RCALC\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); // [[RCALC|ropp|var]] foreach ($matches[0] as $index => $match) { $text = preg_replace("#" . preg_quote($match, "#") . "#", "<!-- Calculate functions removed -->", $text); #$eval = "\$_EXTRAS[".$matches[2][$index]."] = ".$matches[1][$index]." \$_EXTRAS[".$matches[2][$index]."];"; #eval($eval); #$_EXTRAS[$matches[1][$index]] = eval($eval); } preg_match_all("/\\[\\[VAR\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $var = $_EXTRAS[$matches[1][$index]]; $text = preg_replace("#" . preg_quote($match, "#") . "#", $var, $text); } #$text = preg_replace("/\[\[SEARCH\|(.*?)\]\]/",searchFor($wiki,'\1'), $text); #$text = preg_replace("/\[\[ALLBY\|(.*?)\]\]/",searchAuthor($wiki,'\1'), $text); if (preg_match("#\\[\\[RECENT\\]\\]#", $text)) { $text = str_replace("[[RECENT]]", recent($wiki), $text); } if (preg_match("/\\[\\[INDEX\\]\\]/", $text)) { $text = str_replace("[[INDEX]]", index(), $text); } preg_match_all("/\\[\\[LOCKED\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $users = $matches[1][$index]; doAuth($users, "view this"); $users_array = explode(',', $users); if (count($users_array) == 1) { $users_text = $users; } else { $last = array_pop($users_array); $users_text = implode(", ", $users_array) . ' & ' . $last; } $text = preg_replace("#" . preg_quote($match, "#") . "#", '<div class="locked">Page is locked to ' . $users_text . ' </div>', $text); } // Search for User preg_match_all("/\\[\\[ALLBY\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $result = author($matches[1][$index]); $text = preg_replace("#" . preg_quote($match, "#") . "#", $result, $text); #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } // Search for Arbitaty preg_match_all("/\\[\\[SEARCH\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $datum = $matches[1][$index]; $result = $dataSource->search($datum); $text = preg_replace("#" . preg_quote($match, "#") . "#", $result, $text); #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } /*// [[MACRO|macroname|arguments]] preg_match_all("/\[\[MACRO\|(.*?)\|(.*?)\\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ #print_r($matches); if (file_exists("macros/".$matches[1][$index].".inc")){ ob_start(); $var = $matches[2][$index]; include("macros/".$matches[1][$index].".inc"); $return = ob_get_contents(); ob_end_clean(); } else { $return = "Macro ".$matches[1][$index]." not defined"; } $text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } // [[MACRO|macroname]] preg_match_all("/\[\[MACRO\|(.*?)\\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ #print_r($matches); if (file_exists("macros/".$matches[1][$index].".inc")){ ob_start(); include("macros/".$matches[1][$index].".inc"); $return = ob_get_contents(); ob_end_clean(); } else { $return = "Macro ".$matches[1][$index]." not defined"; } $text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } */ //New Macros code $macros = array(); // [[MACRO|macroname|arguments]] preg_match_all("/\\[\\[MACRO\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { #print_r($matches); $return = ""; $macro = $matches[1][$index]; $command = $matches[2][$index]; $params = false; if ($pos = strpos($command, '|')) { $params = explode(',', substr($command, $pos + 1)); $command = substr($command, 0, $pos); } debug("Macro: {$macro}: {$command}"); if (!isset($macros[$macro])) { if (file_exists("macros/" . $matches[1][$index] . ".inc")) { include "macros/" . $matches[1][$index] . ".inc"; $macros[$macro] = new $macro($dataSource, $_EXTRAS); } } if (!isset($macros[$macro])) { // Macro load failed. $return = "*!!Macro " . $matches[1][$index] . " not defined!!*"; } elseif ($command == "INIT") { // Explicit INIT disabled //if (file_exists("macros/".$matches[1][$index].".inc")){ // include("macros/".$matches[1][$index].".inc"); // $macros[$macro] = new $macro($dataSource, $_EXTRAS); //} else { // $return = "Macro ".$matches[1][$index]." not defined"; //} } elseif ($command == "LIST") { $dir = opendir("macros"); while ($line = readdir($dir)) { if (substr($line, -4) != ".inc") { continue; } $return .= "* {$line}\n"; } } elseif (!isset($macros[$macro])) { $return = "Macro {$macro} used before defined!"; } elseif (!in_array($command, get_class_methods($macro))) { $return = "Macro {$macro} cannot execute {$command}"; } else { #$return = call_user_func(array($macro, $command)); if ($params) { $return = $macros[$macro]->{$command}($params); } else { $return = $macros[$macro]->{$command}(); } } #$text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text); $text = str_replace($matches[0][$index], $return, $text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } // [[MACRO|macroname]] // [[CAL|year-mm-dd|Event]] preg_match_all("/\\[\\[CAL\\|(....)\\-(..)\\-(..)\\|(.*?)\\]\\]/", $text, $matches); $i = 0; $calendar = array(); $caltext = ""; foreach ($matches[0] as $index => $match) { $link = preg_replace("/(\\W)/", "", $matches[4][$index]); $text = str_replace($matches[0][$index], "<a name=\"" . $link . "\"></a>", $text); $calendar[$matches[1][$index]][$matches[2][$index]][$matches[3][$index]] = $matches[4][$index]; } preg_match_all("/\\[\\[VAR\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { if (isset($_EXTRAS[$matches[1][$index]])) { $var = $_EXTRAS[$matches[1][$index]]; } else { $var = '[ERR: ' . $matches[1][$index] . ' Undefined]'; } #$text = preg_replace("#".preg_quote($match,"#")."#",$var, $text); $text = str_replace($match, $var, $text); } foreach ($calendar as $year => $ydata) { #ksort($ydata); $months = array_keys($ydata); foreach (range(min($months), max($months)) as $month) { if ($month < 10) { $month = "0" . $month; } #foreach($ydata as $month => $mdata){ $mdata = $ydata[$month]; $caltext .= calendar($mdata, $month, $year); } } $links = array(); /*preg_match_all("/\(\(([.|\|]*?)\)\)/", $text, $matches); foreach($matches[1] as $index => $title){ $link = preg_replace("/(\W)/", "", ucwords($matches[2][$index])); $links[] = array($matches[0][$index], $link, $title); }*/ preg_match_all("/\\(\\((.*?)\\)\\)/", "\n" . $text . "\n", $matches); foreach ($matches[1] as $index => $title) { if (!strpos($matches[1][$index], "|")) { $link = preg_replace("/(\\W)/", "", $title); #$links[] = array($matches[0][$index],$link, $title); } else { $bang = explode("|", $matches[1][$index]); $link = preg_replace("/(\\W)/", "", $bang[1]); $title = $bang[0]; } if ($title[0] == '~') { $link = '~' . $link; } $links[] = array($matches[0][$index], $link, $title); } foreach ($links as $index => $matches) { $replace = preg_quote($matches[0], '/'); $stripped = $matches[1]; $title = $matches[2]; if ($title[0] == '~') { $title = substr($title, 1); #$link = "%(uncreated)".$title."\"?\":".$base."/".$stripped."?action=edit%"; #$link = "\"".$title."\":".$base."/".$stripped; $link = userLink($title); } elseif (!$dataSource->pageExists($stripped)) { #$link = "%(uncreated)".$title."\"?\":".$base."/".$stripped."?action=edit%"; #$link = "\"".$title."\":".$base."/".$stripped; $link = '<a href="' . $base . "/" . $stripped . '" class="uncreated wiki" title="Uncreated article ' . $title . '">' . $title . '</a>'; } else { #$link = "\"".$title."\":".$base."/".$stripped; $link = '<a href="' . $base . "/" . $stripped . '" class="wiki" title="Internal link to article ' . $title . '">' . $title . '</a>'; } #$link = "\"".$match."\":".$base."/".$stripped; #echo $replace; $text = preg_replace("/(\\W|^)" . $replace . "(\\W)/", "\$1{$link}\$2", $text); #$text = preg_replace("/(\W|^)".$replace."(\W)/","$1|$replace|$2", $text); } //preg_match_all("/<aqWikiNoProcess>(.*?)<\/aqwikiNoProcess>/m",$text, $matches); $text = str_replace("\n", '[[BR]]', $text); $text = str_replace("\r", '', $text); preg_match_all("/<aqWikiNoProcess>(.*?)<\\/aqWikiNoProcess>/", $text, $matches); foreach ($matches[0] as $index => $match) { $id = uniqid(); $EXTRAS['noProcess'][$id] = $matches[1][$index]; #$text = preg_replace("#".preg_quote($match,"#")."#",'[[NOPROCESS|'.$id.']]',$text); $text = str_replace($match, '[[NOPROCESS|' . $id . ']]', $text); } $text = str_replace("[[BR]]", "\n", $text); $text = textile($text); #$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]\"/]", "<a href=\"\\0\">\\0</a>", $text); #$text = preg_replace("#<a href=\"<a href=\"(.*)\">(.*)\"</a>>(.*)</a>#","<a href=\"$1\">$3</a>",$text); $text = preg_replace("/\\[CC\\](.*?)\\[CC\\]/", "((\$1))", $text); $text = preg_replace("/\\[CMD\\](.*?)\\[CMD\\]/", "[[\$1]]", $text); $text = str_replace('[[CAL]]', "<div class=\"calendar\">" . $caltext . "</div>", $text); if (!isset($_EXTRAS['textarea'])) { $_EXTRAS['textarea'] = ""; } $text = preg_replace("/\\[\\[TEXTAREA\\]\\]/", $_EXTRAS['textarea'], $text); $text = str_replace('[[TEXTAREA]]', $_EXTRAS['textarea'], $text); preg_match_all("/\\[\\[RAWVAR\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { if (isset($_EXTRAS[$matches[1][$index]])) { $var = $_EXTRAS[$matches[1][$index]]; } else { $var = '[ERR: ' . $matches[1][$index] . ' Undefined]'; } $text = str_replace($match, $var, $text); } preg_match_all("/\\[\\[NOPROCESS\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $id = $matches[1][$index]; $text = str_replace($match, $EXTRAS['noProcess'][$id], $text); } $text = str_replace("[[BR]]", "\n", $text); return $text; }
If you are in the orange part, you should really improve the quality of your posts.<br> If you are in the red part, you are walking on thin ice, and should think twice before posting again.<br> <br> </td> </tr> <tr class="header1"> <th>User</th> <th>Posts</th> <th>Deleted</th> <th>Ratio</th> <th style="width:120px;"> </th> </tr>'; $c = 1; while ($user = Fetch($stuff)) { $udata = getDataPrefix($user, 'u_'); $ulink = userLink($udata); $total = $user['totalposts']; $del = $user['deletedposts']; $ratio = $del * 100 / $total; //if ($ratio <= 1) break; if ($ratio > 25) { $color = '#f00'; } else { if ($ratio > 10) { $color = '#f80'; } else { $color = '#0f0'; } } $lol1 = '<span style="color:' . $color . ';">'; $lol2 = '</span>';
<?php // AcmlmBoard XD - Frequently Asked Questions page // Access: all if (!defined('BLARG')) { die; } $title = __("FAQ"); $links = array(); if (HasPermission('admin.editsettings')) { $links[] = actionLinkTag(__("Edit the FAQ"), "editsettings", '', 'field=faqText'); } MakeCrumbs(array(actionLink("faq") => __("FAQ")), $links); makeThemeArrays(); $admin = Fetch(Query("select u.(_userfields) from {users} u where u.primarygroup={0}", Settings::get('rootGroup'))); $admin = userLink(getDataPrefix($admin, 'u_')); $sexes = array(0 => __("Male"), 1 => __("Female"), 2 => __("N/A")); $scolors = array(0 => 'color_male', 1 => 'color_female', 2 => 'color_unspec'); $gcolors = array(); $g = Query("SELECT title, color_male, color_female, color_unspec FROM {usergroups} WHERE type=0 ORDER BY rank"); while ($group = Fetch($g)) { $gcolors[] = $group; } $headers = ""; $colors = ""; foreach ($sexes as $ss) { $headers .= format("\n\t<th>\n\t\t{0}\n\t</th>\n", $ss); } foreach ($gcolors as $g) { $cellClass = ($cellClass + 1) % 2; $items = "";
<?php $c = 1; $ulcache = array(); foreach ($passmatches as $uid => $match) { if (!$ulcache[$uid]) { $userdata = Fetch(Query("SELECT u.(_userfields) FROM {users} u WHERE u.id={0}", $uid)); $userdata = getDataPrefix($userdata, 'u_'); $ulcache[$uid] = $userdata; } $ul1 = userLink($ulcache[$uid]); $date = formatdate($match['m_date']); $users = explode(',', $match['m_matches']); $userlist = ''; foreach ($users as $u) { if (!$ulcache[$u]) { $userdata = Fetch(Query("SELECT u.(_userfields) FROM {users} u WHERE u.id={0}", $u)); $userdata = getDataPrefix($userdata, 'u_'); $ulcache[$u] = $userdata; } $userlist .= userLink($ulcache[$u]) . ', '; } $userlist = substr($userlist, 0, -2); echo ' <tr class="cell' . $c . '"> <td class="center">' . $date . '</td> <td>' . $ul1 . ', ' . $userlist . '</td> </tr>'; $c = $c == 1 ? 2 : 1; } ?> </table>
if ($page['flags'] & WIKI_PFLAG_DELETED) { echo '<h1>' . $nicetitle . '</h1>This page has been deleted.'; } else { if ($page['new']) { echo '<h1>' . $nicetitle . '</h1>This page does not exist.'; if ($page['canedit']) { echo '<br><br>' . actionLinkTag('Create it now', 'wikiedit', $urltitle); } } else { $revInfo = ''; $revList = ''; if ($rev > 0) { $revs = Query("SELECT pt.revision r FROM {wiki_pages_text} pt WHERE pt.id={0} ORDER BY r ASC", $urltitle); while ($therev = Fetch($revs)) { if ($therev['r'] == $rev) { $revList .= ' ' . $therev['r'] . ' '; } else { $revList .= ' ' . actionLinkTag($therev['r'], 'wiki', $urltitle, 'rev=' . $therev['r']) . ' '; } } $user = Fetch(Query("SELECT u.(_userfields) FROM {users} u WHERE u.id={0}", $page['user'])); $user = getDataPrefix($user, 'u_'); $revInfo = 'Viewing revision ' . $rev . ' (by ' . userLink($user) . ' on ' . formatdate($page['date']) . ')<br>(revisions: ' . $revList . ')<br><br>'; } echo '<h1>' . $nicetitle . '</h1>' . $revInfo . wikiFilter($page['text'], $page['flags'] & WIKI_PFLAG_NOCONTBOX); } } echo ' </td> </tr> </table>';
if ($ts == $today) { $ts = 'Today'; } else { if ($ts == $yesterday) { $ts = 'Yesterday'; } } if ($ts != $lastts) { $lastts = $ts; echo ' <tr class="header0"> <th colspan="2">' . $ts . '</th> </tr>'; } $user = getDataPrefix($change, 'u_'); $userlink = userLink($user); $date = formatdate($date); $links = actionLinkTagItem('View page', 'wiki', $change['id'], 'rev=' . $change['revision']); $changetext = 'Page ' . actionLinkTag(htmlspecialchars(url2title($change['id'])), 'wiki', $change['id']); if ($change['revision'] > 1) { $changetext .= ' edited by ' . $userlink . ' on ' . $date . ' (revision ' . $change['revision'] . ')'; $links .= actionLinkTagItem('Diff', 'wikidiff', $change['id'], 'rev=' . $change['revision']); } else { $changetext .= ' created by ' . $userlink . ' on ' . $date; } echo ' <tr class="cell' . $c . '"> <td>' . $changetext . '</td> <td><ul class="pipemenu">' . $links . '</ul></td> </tr>'; $c = $c == 1 ? 2 : 1;
<?php $userMenu = new PipeMenu(); if ($loguserid) { $userMenu->add(new PipeMenuHtmlEntry(userLink($loguser))); if (isAllowed("editProfile")) { $userMenu->add(new PipeMenuLinkEntry(__("Edit profile"), "editprofile", "", "", "pencil")); } if (isAllowed("viewPM")) { $userMenu->add(new PipeMenuLinkEntry(__("Private messages"), "private", "", "", "envelope")); } if (isAllowed("editMoods")) { $userMenu->add(new PipeMenuLinkEntry(__("Mood avatars"), "editavatars", "", "", "picture")); } $bucket = "bottomMenu"; include "./lib/pluginloader.php"; if (!isset($_POST['id']) && isset($_GET['id'])) { $_POST['id'] = (int) $_GET['id']; } if (isset($user_panel)) { echo $user_panel; } $userMenu->add(new PipeMenuLinkEntry(__("Log out"), "", "", "", "signout", "document.forms[0].submit(); return false;")); } else { $userMenu->add(new PipeMenuLinkEntry(__("Register"), "register", "", "", "user")); $userMenu->add(new PipeMenuLinkEntry(__("Log in"), "login", "", "", "signin")); } $layout_userpanel = $userMenu;
} } if (isset($_GET['unban'])) { $title = __('Unban user'); MakeCrumbs(array(actionLink("profile", $id, '', $user['u_name']) => htmlspecialchars($user['u_displayname'] ? $user['u_displayname'] : $user['u_name']), actionLink('banhammer', $id, 'unban=1') => __('Unban user'))); $userlink = userLink(getDataPrefix($user, 'u_')); $fields = array('target' => $userlink, 'btnUnbanUser' => '<input type="submit" name="unban" value="Unban user">'); $template = 'form_unbanuser'; } else { $title = __('Ban user'); MakeCrumbs(array(actionLink("profile", $id, '', $user['u_name']) => htmlspecialchars($user['u_displayname'] ? $user['u_displayname'] : $user['u_name']), actionLink('banhammer', $id) => __('Ban user'))); $duration = ' <label><input type="radio" name="permanent" value="0"> For: </label> <input type="text" name="time" size="4" maxlength="2"> <select name="timemult"> <option value="3600">hours</option> <option value="86400">days</option> <option value="604800">weeks</option> </select> <br> <label><input type="radio" name="permanent" value="1" checked="checked"> Permanent</label>'; $userlink = userLink(getDataPrefix($user, 'u_')); $fields = array('target' => $userlink, 'duration' => $duration, 'reason' => '<input type="text" name="reason" size=80 maxlength=200>', 'btnBanUser' => '<input type="submit" name="ban" value="Ban user">'); $template = 'form_banuser'; } echo ' <form action="" method="POST">'; RenderTemplate($template, array('fields' => $fields)); echo ' <input type="hidden" name="token" value="' . $loguser['token'] . '"> </form>';
function makePost($post, $type, $params = array()) { global $loguser, $loguserid, $blocklayouts, $dataDir, $dataUrl, $mobileLayout; $sideBarStuff = ""; $poster = getDataPrefix($post, "u_"); LoadBlockLayouts(); $isBlocked = $poster['globalblock'] || $loguser['blocklayouts'] || $post['options'] & 1 || isset($blocklayouts[$poster['id']]); $links = makePostLinks($post, $type, $params); if ($post['deleted'] && $type == POST_NORMAL) { $meta = format(__("Posted on {0}"), formatdate($post['date'])); $meta .= __(', deleted'); if ($post['deletedby']) { $db_link = UserLink(getDataPrefix($post, "du_")); $meta .= __(' by ') . $db_link; if ($post['reason']) { $meta .= ': ' . htmlspecialchars($post['reason']); } } if ($mobileLayout) { $links->setClass("toolbarMenu"); echo "\n\t\t\t\t<table class=\"outline margin mobile-postBox\" id=\"post{$post['id']}\">\n\t\t\t\t\t<tr class=\"header0 mobile-postHeader\">\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t{$anchor}\n\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<div class=\"mobile-userAvatarBox\">\n\t\t\t\t\t\t\t\t\t\t\t{$picture}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td class=\"mobile-postInfoCell\" style=\"width: 99%; overflow: hidden;\">\n\t\t\t\t\t\t\t\t\t\t<div style=\"position: relative; height: 40px; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t<div style=\"position: absolute; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t\t" . userLink($poster) . "<br />\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"date\">{$meta}</span>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<span style=\"text-align:left; display: none;\" id=\"dyna_{$post['id']}\">\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t" . $links->build(2) . "\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t"; } else { echo "\n\t\t\t\t<table class=\"post margin deletedpost\" id=\"post{$post['id']}\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"side userlink\">\n\t\t\t\t\t\t\t" . userLink($poster) . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"smallFonts meta right\">\n\t\t\t\t\t\t\t<div style=\"float:left\">\n\t\t\t\t\t\t\t\t{$meta}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t" . $links->build() . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>"; } return; } if ($type == POST_SAMPLE) { $meta = $params['metatext'] ? $params['metatext'] : __("Sample post"); } else { $forum = $params['fid']; $thread = $params['tid']; $canMod = CanMod($loguserid, $forum); $canReply = ($canMod || !$post['closed'] && $loguser['powerlevel'] > -1) && $loguserid; if ($type == POST_PM) { $message = __("Sent on {0}"); } else { $message = __("Posted on {0}"); } $meta = format($message, formatdate($post['date'])); //Threadlinks for listpost.php if ($params['threadlink']) { $thread = array(); $thread["id"] = $post["thread"]; $thread["title"] = $post["threadname"]; $meta .= " " . __("in") . " " . makeThreadLink($thread); } //Revisions if ($post['revision']) { if ($post['revuser']) { $ru_link = UserLink(getDataPrefix($post, "ru_")); $revdetail = " " . format(__("by {0} on {1}"), $ru_link, formatdate($post['revdate'])); } else { $revdetail = ''; } if ($canMod) { $meta .= " (<a href=\"javascript:void(0);\" onclick=\"showRevisions(" . $post['id'] . ")\">" . format(__("rev. {0}"), $post['revision']) . "</a>" . $revdetail . ")"; } else { $meta .= " (" . format(__("rev. {0}"), $post['revision']) . $revdetail . ")"; } } //</revisions> } // POST SIDEBAR $sideBarStuff .= GetRank($poster["rankset"], $poster["posts"]); if ($sideBarStuff) { $sideBarStuff .= "<br />"; } if ($poster['title']) { $sideBarStuff .= strip_tags(CleanUpPost($poster['title'], "", true), "<b><strong><i><em><span><s><del><img><a><br/><br><small>") . "<br />"; } else { $levelRanks = array(-1 => __("Banned"), 0 => "", 1 => __("Local mod"), 2 => __("Full mod"), 3 => __("Administrator")); $sideBarStuff .= $levelRanks[$poster['powerlevel']] . "<br />"; } $sideBarStuff .= GetSyndrome(getActivity($poster["id"])); $pictureUrl = ""; if ($post['mood'] > 0) { if (file_exists("{$dataDir}avatars/" . $poster['id'] . "_" . $post['mood'])) { $pictureUrl = "{$dataUrl}avatars/" . $poster['id'] . "_" . $post['mood']; } } else { if ($poster["picture"] == "#INTERNAL#") { $pictureUrl = "{$dataUrl}avatars/" . $poster['id']; } else { if ($poster["picture"]) { $pictureUrl = $poster["picture"]; } } } if ($pictureUrl) { $sideBarStuff .= "<img src=\"" . htmlspecialchars($pictureUrl) . "\" alt=\"\" />"; } $lastpost = $poster['lastposttime'] ? timeunits(time() - $poster['lastposttime']) : "none"; $lastview = timeunits(time() - $poster['lastactivity']); $sideBarStuff .= "<br />\n" . __("Karma:") . " " . $poster['karma']; if (!$params['forcepostnum'] && ($type == POST_PM || $type == POST_SAMPLE)) { $sideBarStuff .= "<br />\n" . __("Posts:") . " " . $poster['posts']; } else { $sideBarStuff .= "<br />\n" . __("Posts:") . " " . $post['num'] . "/" . $poster['posts']; } $sideBarStuff .= "<br />\n" . __("Since:") . " " . cdate($loguser['dateformat'], $poster['regdate']) . "<br />"; $bucket = "sidebar"; include "./lib/pluginloader.php"; if (Settings::get("showExtraSidebar")) { $sideBarStuff .= "<br />\n" . __("Last post:") . " " . $lastpost; $sideBarStuff .= "<br />\n" . __("Last view:") . " " . $lastview; if ($poster['lastactivity'] > time() - 300) { $sideBarStuff .= "<br />\n" . __("User is <strong>online</strong>"); } } // OTHER STUFF if ($type == POST_NORMAL) { $anchor = "<a name=\"" . $post['id'] . "\"></a>"; } if (!$isBlocked) { $pTable = "table" . $poster['id']; $row1 = "row" . $poster['id'] . "_1"; $row2 = "row" . $poster['id'] . "_2"; $topBar1 = "topbar" . $poster['id'] . "_1"; $topBar2 = "topbar" . $poster['id'] . "_2"; $sideBar = "sidebar" . $poster['id']; $mainBar = "mainbar" . $poster['id']; } $postText = makePostText($post); //PRINT THE POST! if ($mobileLayout) { $links->setClass("toolbarMenu"); if ($pictureUrl) { $picture = "<img src=\"" . htmlspecialchars($pictureUrl) . "\" alt=\"\" style=\"max-width: 40px; max-height: 40px;\"/>"; } else { $picture = ""; } echo "\n\t\t\t\t<table class=\"outline margin mobile-postBox\" id=\"post{$post['id']}\">\n\t\t\t\t<tr class=\"header0 mobile-postHeader\">\n\t\t\t\t\t<th>\n\t\t\t\t\t\t{$anchor}\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<div class=\"mobile-userAvatarBox\">\n\t\t\t\t\t\t\t\t\t\t{$picture}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"mobile-postInfoCell\" style=\"width: 99%; overflow: hidden;\">\n\t\t\t\t\t\t\t\t\t<div style=\"position: relative; height: 40px; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t<div style=\"position: absolute; top: 0; left: 0;\">\n\t\t\t\t\t\t\t\t\t\t\t" . userLink($poster) . "<br />\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"date\">{$meta}</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span style=\"text-align:left; display: none;\" id=\"dyna_{$post['id']}\">\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t" . $links->build(2) . "\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"3\" class=\"cell0 mobile-postBox\">\n\t\t\t\t\t\t{$postText}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t"; } else { echo "\n\t\t\t<table class=\"post margin {$pTable}\" id=\"post{$post['id']}\">\n\t\t\t\t<tr class=\"{$row1}\">\n\t\t\t\t\t<td class=\"side userlink {$topBar1}\">\n\t\t\t\t\t\t{$anchor}\n\t\t\t\t\t\t" . UserLink($poster) . "\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"meta right {$topBar2}\">\n\t\t\t\t\t\t<div style=\"float: left;\" id=\"meta_{$post['id']}\">\n\t\t\t\t\t\t\t{$meta}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"float: left; text-align:left; display: none;\" id=\"dyna_{$post['id']}\">\n\t\t\t\t\t\t\tHi.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t" . $links->build() . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"" . $row2 . "\">\n\t\t\t\t\t<td class=\"side {$sideBar}\">\n\t\t\t\t\t\t<div class=\"smallFonts\">\n\t\t\t\t\t\t\t{$sideBarStuff}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"post {$mainBar}\" id=\"post_{$post['id']}\">\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{$postText}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>"; } }
function page($content) { global $_EXTRAS; global $_CONFIG; global $dataSource; if ($_CONFIG['oneWiki']) { $base = $_CONFIG['base']; } else { $base = $_CONFIG['base'] . "/" . $_EXTRAS['wiki']; } /* $content is an array containing: [0] Name of Wiki template [1] Title of page [2] Content of page [3] Author of page [4] Date of modification */ $output = isset($_GET['output']) ? $_GET['output'] : "html"; switch ($output) { case "rss": header("Content-Type: text/xml"); $out = buildRSS($content); break; case "fragment": if (isset($_EXTRAS['mimetype'])) { $mime = $_EXTRAS['mimetype']; } else { $mime = 'text/html'; } header("Content-Type: " . $mime); $out = process($content[2], $content[0]); break; case "source": if (isset($_EXTRAS['mimetype'])) { $mime = $_EXTRAS['mimetype']; } else { $mime = 'text/plain'; } header("Content-Type: " . $mime); $out = $content[2]; break; default: if (file_exists("etc/" . $content[0] . ".tpl")) { $file = "etc/" . $content[0] . ".tpl"; $template = implode("", file($file)); debug("Using template " . $file); } elseif (file_exists("etc/default.tpl")) { $template = implode("", file("etc/default.tpl")); debug("Using default template"); } else { debug("No default template found, using basic"); $template = "<html>\n<head>\n<title>[[WIKI]] - [[TITLE]]</title>\n</head>\n<body>\n<h1>[[TITLE]]</h1>\n[[CONTENT]]\n<a href=\"[[URL]]?action=edit\">Edit This Page</a>\n[[VERSIONS]]<hr>\n[[AUTHOR]] @ [[DATE]]<br>You Are: [[USER]] Identified by [[AUTH]] [ <a href=\"[[URL]]?action=login\">Login</a> | <a href=\"[[URL]]?action=newUser\">New User</a> ]<br>Generated by [[AQWIKI]]</body>\n</html>"; } $text = process($content[2], $content[0]); $out = $template; $nearby = isset($_EXTRAS['nearby']) ? $_EXTRAS['nearby'] : ''; $versions = isset($_EXTRAS['versions']) ? $_EXTRAS['versions'] : ''; $out = preg_replace("/\\[\\[CONTENT\\]\\]/", $text, $out); $out = preg_replace("/\\[\\[AQWIKI\\]\\]/", $_EXTRAS['versionString'], $out); $out = preg_replace("/\\[\\[WIKI\\]\\]/", $content[0], $out); $out = preg_replace("/\\[\\[TITLE\\]\\]/", $content[1], $out); $out = preg_replace("/\\[\\[PAGE\\]\\]/", $_EXTRAS['argv'][1], $out); $out = preg_replace("/\\[\\[AUTHOR\\]\\]/", userLink($content[3]), $out); $out = preg_replace("/\\[\\[DATE\\]\\]/", $content[4], $out); $out = preg_replace("/\\[\\[URL\\]\\]/", $_CONFIG['host'] . "/" . $base . $_EXTRAS['current'], $out); $out = preg_replace("/\\[\\[BASE\\]\\]/", $base, $out); $out = preg_replace("/\\[\\[USER\\]\\]/", userLink($_EXTRAS['me']), $out); $out = preg_replace("/\\[\\[AUTH\\]\\]/", $_EXTRAS['auth'], $out); $out = preg_replace("/\\[\\[NEARBY\\]\\]/", textile(menu($nearby, "nearby")), $out); $out = preg_replace("/\\[\\[VERSIONCOUNT\\]\\]/", count($dataSource->getPage($content[1])), $out); $out = preg_replace("/\\[\\[VERSIONS\\]\\]/", textile($versions), $out); // Conditional includes preg_match_all("/\\[\\[IFEDIT\\|(.*?)\\|(.*?)\\]\\]/", $out, $matches); foreach ($matches[0] as $index => $match) { if (checkAuth("edit")) { $out = preg_replace("#" . preg_quote($match, "#") . "#", stripslashes($matches[1][$index]), $out); } else { $out = preg_replace("#" . preg_quote($match, "#") . "#", stripslashes($matches[2][$index]), $out); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\\[\\[IFEDIT\\|(.*?)\\]\\]/", $out, $matches); foreach ($matches[0] as $index => $match) { $result = stripslashes($matches[1][$index]); if (checkAuth("edit")) { $out = preg_replace("#" . preg_quote($match, "#") . "#", $result, $out); } else { $out = preg_replace("#" . preg_quote($match, "#") . "#", "", $out); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\\[\\[IfLoggedIn\\|(.*?)\\|(.*?)\\]\\]/", $out, $matches); foreach ($matches[0] as $index => $match) { $result = $matches[1][$index]; if ($_EXTRAS['auth'] !== 'host') { $out = preg_replace("#" . preg_quote($match, "#") . "#", $matches[1][$index], $out); } else { $out = preg_replace("#" . preg_quote($match, "#") . "#", $matches[2][$index], $out); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\\[\\[PLURAL\\|(.*?)\\]\\]/", $out, $matches); foreach ($matches[0] as $index => $match) { if (intval($matches[1][$index]) != 1) { $plural = 's'; } else { $plural = ''; } $out = preg_replace("#" . preg_quote($match, "#") . "#", $plural, $out); #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } if ($_CONFIG['debug']) { global $DEBUG; $out .= "<p>" . implode("<br>\n", $DEBUG) . "</p>"; } preg_match_all("/\\[\\[RAWVAR\\|(.*?)\\]\\]/", $out, $matches); foreach ($matches[0] as $index => $match) { if (isset($_EXTRAS[$matches[1][$index]])) { $var = $_EXTRAS[$matches[1][$index]]; } else { $var = ''; } $out = preg_replace("#" . preg_quote($match, "#") . "#", $var, $out); } } return $out; }
function formatUser($userdata, $data, $option) { global $me, $lastuser; $id = $userdata["id"]; $possessive = $option == "s"; if ($id == $me) { return $possessive ? "your" : "you"; } if ($id == $lastuser) { if ($userdata["sex"] == 1) { return $possessive ? "her" : "her"; } else { return $possessive ? "his" : "him"; } } else { $lastuser = $id; } if ($id == 0) { $res = "A guest from " . htmlspecialchars($data["ip"]); } else { $res = userLink($userdata); } if ($possessive) { $res .= "'s"; } return $res; }
$received = $user["postplusones"]; if ($user["postplusones"]) { $received .= " [" . actionLinkTag("View...", "listplusones", $user["id"]) . "]"; } $res = query("select count(*) as ct, u.(_userfields)\nfrom postplusones l\nleft join posts p on l.post=p.id\nleft join users u on u.id = l.user\nwhere p.user={0}\ngroup by l.user\norder by count(*) desc\nlimit 6", $user["id"]); $plusoners = array(); while ($row = fetch($res)) { if (count($plusoners) == 5) { $plusoners[] = "more..."; } else { $plusoners[] = userLink(getDataPrefix($row, "u_")) . " (" . $row["ct"] . ")"; } } if (count($plusoners)) { $received .= "<br/>" . __("From:") . " " . implode(", ", $plusoners); } $profileParts[__("General information")][__("Total +1s received")] = $received; $given = $user["postplusonesgiven"]; $res = query("select count(*) as ct, u.(_userfields)\nfrom postplusones l\nleft join posts p on l.post=p.id\nleft join users u on u.id = p.user\nwhere l.user={0}\ngroup by p.user\norder by count(*) desc\nlimit 6", $user["id"]); $plusoners = array(); while ($row = fetch($res)) { if (count($plusoners) == 5) { $plusoners[] = "more..."; } else { $plusoners[] = userLink(getDataPrefix($row, "u_")) . " (" . $row["ct"] . ")"; } } if (count($plusoners)) { $given .= "<br/>" . __("To:") . " " . implode(", ", $plusoners); } $profileParts[__("General information")][__("Total +1s given")] = $given;
<?php print $layout_pora; ?> </td> <?php } ?> </tr> </table> </td> </tr> <tr class="cell1 mainMenuContainer"> <td> <div class="userDropdownContainer"> <?php print userLink($loguser, true); if ($loguserid) { $layout_userpanel->shift(); $layout_userpanel->setClass("userMenu"); } print $layout_userpanel->build(); $layout_navigation->setClass("mainMenu"); ?> </div> <?php print $layout_navigation->build(); ?> </td> </tr> </table> </div>