break; case "resend": resend($_POST['smslog_id'], true); header("Location: {$selfurl}&err=" . urlencode("Message has been queued for resending.")); break; case "export": makeExportForm($selfurl, false); break; case "get_status": default: if ($showall) { $getuid = 0; } else { $getuid = $uid; } print makeList($getuid, $selfurl, $_GET[offset]); break; } return; function makeList($uid, $selfurl, $offset = 0, $numShow = 75) { $db = DB_DataObject::factory('playsms_tblSMSOutgoing'); if (!$offset) { $offset = 0; } $db->limit($offset, $numShow); $db->orderBy("smslog_id DESC"); $pagetitle = "Delivery report"; if (isadmin() && !$uid) { $pagetitle .= " (All)"; } else {
if ($ui->editcount > 300000) { $ttl = 86400; } if (!$cnt->error && is_array($items)) { $redis->setex($hash, $ttl, serialize($cnt)); $redis->setex($hash2, $ttl, serialize($items)); } } else { $cnt = unserialize($lc); $items = unserialize($lc2); unset($lc, $lc2); $perflog->add('Pages', 0, 'from Redis'); } #$perflog->add('items', 0, $items ); //Construct output $result = makeList($items, $wt->namespaces, xGraph::GetColorList(), $wi, $ui, $namespace, $redirects, $limit); //Output stuff $filtertextNS = $namespace == "all" ? $I18N->msg('all') : @$wt->namespaces["names"][$namespace] . " ({$namespace})"; $wt->content = getPageTemplate('result'); $wt->assign('username', $ui->user); $wt->assign('lang', $lang); $wt->assign('wiki', $wiki); $wt->assign('usernameurl', $ui->userUrl); $wt->assign('userprefix', $wt->namespaces["names"][2]); $wt->assign('xtoolsbase', XTOOLS_BASE_WEB_DIR); $wt->assign('domain', $wi->domain); $wt->assign("redirFilter", $I18N->msg('redirfilter_' . $redirects)); $wt->assign("nsFilter", $filtertextNS); $wt->assign("namespace_overview", $result->listnamespaces); $wt->assign("nschart", $result->nschart); $wt->assign("resultDetails", $result->list);
if (isset($_GET['dosxfort'])) { $tipos = especial($db, $tipo_doc_especial); $especial = "aceptar"; } else { $tipos = etiqueta($db, $tipo_doc_especial); } $result = descrip($db); $descrip = array(); $i = 1; while (!$result->EOF) { $SGD_PQR_DESCRIP = $result->fields["SGD_PQR_DESCRIP"]; $descrip[$i] = ucfirst(htmlentities(StrValido($SGD_PQR_DESCRIP))); $i++; $result->MoveNext(); } $result = makeList($db); $mis_ciudades = array(); while (!$result->EOF) { $dpto_codi = $result->fields["dpto_codi"]; $dpto_nomb = $result->fields["dpto_nomb"]; $mis_ciudades[$dpto_codi] = ucwords(htmlentities(StrValido($dpto_nomb))); $result->MoveNext(); } $result = makeListMun($db); while (!$result->EOF) { $DPTO_CODI = $result->fields["DPTO_CODI"]; $MUNI_CODI = $result->fields["MUNI_CODI"]; $MUNI_NOMB = $result->fields["MUNI_NOMB"]; $mis_municipios[] = array('DPTO_CODI' => $DPTO_CODI, 'MUNI_CODI' => $MUNI_CODI, 'MUNI_NOMB' => ucwords(htmlentities(StrValido($MUNI_NOMB)))); $result->MoveNext(); }
if (preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $name)) { $wt->error = "User cannot be an IP."; $wt->showPage(); } $rfa['en'] = 'Requests_for_adminship'; $rfa['de'] = 'Adminkandidaturen'; $rfb['en'] = 'Requests_for_bureaucratship'; $rfb['de'] = 'Bürokratenkandidaturen'; // Calculate all the things $dbr = $wt->loadDatabase($lang, 'wikipedia'); $pgVerbose = array(); $site = Peachy::newWiki(null, null, null, "http://{$wi->domain}/w/api.php"); $votes = get_rfap($dbr, $site, $domain, $user, $rfa[$lang]); $listAdmin = makeList($votes, $rfa[$lang]); $votes = get_rfap($dbr, $site, $domain, $user, $rfb[$lang]); $listBureaucrat = makeList($votes, $rfb[$lang]); $wt->content = getPageTemplate('result'); $wt->assign('listadmin', $listAdmin); $wt->assign('listbureaucrat', $listBureaucrat); $wt->assign('rfa', str_replace('_', ' ', $rfa[$lang])); $wt->assign('rfb', str_replace('_', ' ', $rfb[$lang])); $wt->assign('username', $user); $wt->assign('usernameurl', rawurlencode($user)); $wt->assign('domain', $domain); $wt->assign('wiki', $lang); $wt->assign('lang', $wiki); unset($output, $site, $votes); $wt->showPage(); // Generate the output function makeList($votes, $aorb) {
public function returnConfig() { $output = sprintfn($this->scheme, makeList($this->params)); return array('output' => rtrim($output) . ';', 'scope' => $this->scope, 'level' => $this->level); }
$limitEnd = $limitHead + 10; if ($limitEnd >= $numoflist) { $limitEnd = $numoflist; $limitEndmore = $limitHead; } else { $limitEndmore = $limitEnd + 1; } //若大于总数则归为总数,再传递值仍然为前10位,否则下一页值加1(无限循环末尾) $limitEndless = $limitEndmore - 11; if ($limitEndless < 0) { $limitEndless = 0; } //如果上一页的初始化值小于0则归为0 $get_data_limit = mysql_query("select * from tiaozao_items where openid like %{$openid}% ORDER BY id DESC limit {$limitHead},{$limitEnd}"); //查询 makeList($get_data_limit); if ($limitHead !== 0) { echo ' <li class="only4"> <a href="list_admin.php?limit=' . $limitEndless . '"><h2>上一页</h2></a> </li> '; } if ($limitEnd !== $numoflist) { echo ' <li class="only4"> <a href="list_admin.php?limit=' . $limitEndmore . '"><h2>下一页</h2></a> </li>'; } } function makeList($data)
if ($limitEnd >= $numoflist) { $limitEnd = $numoflist; $limitEndmore = $limitHead; } else { $limitEndmore = $limitEnd; } //若大于总数则归为总数,再传递值仍然为前10位,否则下一页值加1(无限循环末尾) $limitEndless = $limitEndmore - 11; if ($limitEndless < 0) { $limitEndless = 0; } //如果上一页的初始化值小于0则归为0 $get_data_limit_str = $get_data_str . " limit " . $limitHead . "," . $limitEnd; $get_data_limit = mysql_query($get_data_limit_str); //查询 makeList($get_data_limit, $_GET["class"]); //打印出列表 if ($limitHead !== 0) { if ($_GET['class'] == "sell") { echo ' <li class="only4"> <a href="index.php?class=sell&limit=' . $limitEndless . '&openid=' . $openid . '"><h2>上一页</h2></a> </li> '; } else { if ($_GET['class'] == "buy") { echo ' <li class="only4"> <a href="index.php?class=buy&limit=' . $limitEndless . '&openid=' . $openid . '"><h2>上一页</h2></a> </li> ';
$count = 0; $tocs = array(); foreach ($structures as $structure) { $tocs[$facets[$count]] = makeToC($structure); $count++; } if ($tocs) { echo 'Inhaltsverzeichnisse erstellt.<br/>'; } // Für jede Struktur wird jetzt eine HTML-Datei berechnet und gespeichert. $count = 0; foreach ($structures as $structure) { $facet = $facets[$count]; $navigation = makeNavigation($catalogue->fileName, $tocs, $facet); $content = makeHead($catalogue, $navigation, $facet); $content .= makeList($structure, $catalogue, $_SESSION['folderName']); $content .= $foot; $fileName = fileNameTrans($_SESSION['folderName'] . '/' . $catalogue->fileName) . '-' . $facet . '.html'; if ($count == 0) { $firstFileName = $fileName; } $datei = fopen($fileName, "w"); fwrite($datei, $content, 3000000); fclose($datei); $count++; if (file_exists($fileName)) { echo 'Datei ' . $fileName . ' wurde erstellt.<br/>'; } } unset($structures); //Anlegen der Datei index.php mit Weiterleitung auf die Startseite
function PageCompPageMainCode() { global $sex_sel; global $country_sel; global $age_start_sel; global $age_end_sel; global $onl_only; global $pic_only; global $site; global $p_num; global $page; global $pages_num; global $p_per_page; global $page_first_p; global $pages_num; global $search_start_age; global $search_end_age; global $max_thumb_width; global $max_thumb_height; $query = "SELECT * FROM ProfilesDesc WHERE `name` IN ( 'Sex', 'Country')"; $res = db_res($query); while ($arr = mysql_fetch_array($res)) { switch ($arr['name']) { case 'Sex': $sex_sel = $sex_sel ? $sex_sel : 'male,female'; $sex_options = makeCheckbox('sex', $arr['extra'], $sex_sel); break; case 'Country': $country_sel = $country_sel ? $country_sel : 'all'; //getParam('default_country'); $country_options = makeList('country', '', $arr['extra'], $country_sel, 'onchange="javascript: flagImage = document.getElementById(\'flagImageId\'); if (this.value == \'all\') {flagImage.src = \'' . $site['images'] . 'spacer.gif\';} else {flagImage.src = \'' . $site['flags'] . '\' + this.value.toLowerCase() + \'.gif\';}"'); break; default: break; } } $age_start_sel = $age_start_sel ? $age_start_sel : $search_start_age; $age_end_sel = $age_end_sel ? $age_end_sel : $search_end_age; $age_option_start = makeList('age_start', "{$search_start_age}-{$search_end_age}", '', $age_start_sel); $age_option_end = makeList('age_end', "{$search_start_age}-{$search_end_age}", '', $age_end_sel); $photo_only_check = '<input type="checkbox" name="photo_only" id="photo_only_id" ' . ($pic_only ? 'checked="checked"' : '') . ' /><label for="photo_only_id"><b>' . _t('_With photos only') . '</b></label>'; $online_only_check = '<input type="checkbox" name="online_only" id="online_only_id" ' . ($onl_only ? 'checked="checked"' : '') . ' /><label for="online_only_id"><b>' . _t('_online only') . '</b></label>'; $country_def_flag = $country_sel == 'all' ? $site['images'] . 'spacer.gif' : $site['flags'] . strtolower($country_sel) . '.gif'; $ret = ' <form id="browse_form" action="' . $_SERVER['PHP_SELF'] . '" method="get"> <div class="browse_form_wrapper"> <div class="browse_form_row"> <div class="clear_both"></div> <div class="label">' . _t('_Sex') . ':</div> <div class="value">' . $sex_options . '</div> <div class="clear_both"></div> </div> <div class="browse_form_row"> <div class="clear_both"></div> <div class="label">' . _t('_DateOfBirth') . ':</div> <div class="value">' . _t("from") . ' ' . $age_option_start . ' ' . _t("to") . ' ' . $age_option_end . '</div> <div class="clear_both"></div> </div> <div class="browse_form_row"> <div class="clear_both"></div> <div class="label">' . _t('_Country') . ':</div>' . '<div class="value">' . $country_options . ' <img id="flagImageId" src="' . $country_def_flag . '" alt="flag" /> </div> <div class="clear_both"></div> </div> <div class="only"> ' . $photo_only_check . ' ' . $online_only_check . ' </div> <div class="submit"> <input id="search" name="search" type="submit" value="' . _t('_Show') . '" /> </div> </div> </form> '; //==================================================================================================== //----------------------- search results ------------------------------------------------- //==================================================================================================== $page = (int) $_GET[page]; $p_per_page = (int) $_GET[p_per_page]; $aVar = array(30, 60, 90); if (!$page) { $page = 1; } if (!$p_per_page) { $p_per_page = 30; } $real_first_p = (int) ($page - 1) * $p_per_page; $page_first_p = $real_first_p + 1; $temp_arr = explode(',', $sex_sel); foreach ($temp_arr as $value) { if ($value) { $sex_add .= " `Sex` = '{$value}' OR "; } } if ($country_sel && 'all' != $country_sel) { $country_add = " `Country` = '{$country_sel}' AND "; } if ($age_start_sel) { $age_add .= " ( (YEAR(NOW()) - {$age_start_sel}) >= YEAR(`DateofBirth`) ) AND "; } if ($age_end_sel) { $age_add .= " ( (YEAR(NOW()) - {$age_end_sel}) <= YEAR(`DateofBirth`) ) AND "; } if ($pic_only) { $pic_add = " AND `Picture` = '1' "; } if ($onl_only) { $onl_add = " AND (LastNavTime > SUBDATE(NOW(), INTERVAL " . getParam("member_online_time") . " MINUTE)) "; } $sex_add = $sex_add ? '(' . $sex_add . ' 1=0 ) AND ' : ''; $age_add = $age_add ? '(' . $age_add . ' 1=1 )' : ''; $sql_add = $sex_add . $country_add . $age_add . $pic_add . $onl_add; $p_num = db_arr("SELECT COUNT(*) FROM Profiles WHERE {$sql_add} AND `Status` = 'Active'"); $p_num = $p_num[0]; $pages_num = ceil($p_num / $p_per_page); $profiles_list_query = "SELECT `ID`, `NickName`, `Sex`, `DateOfBirth` FROM Profiles WHERE {$sql_add} AND `status`='Active' ORDER BY `Picture` DESC LIMIT {$real_first_p}, {$p_per_page};"; $function = ' $ret = \'?\'; foreach ( $_GET as $key => $value ) if ( $value ) $ret .= $key . \'=\' . $value . \'&\'; return $ret; '; $ret .= '<div id="container_result" style="border: 0px solid #000000">'; $ret .= '<div style="margin-bottom:10px;"><center>' . ResNavigationRet('ProfilesUpper', 0, $function, $aVar) . '</center></div>'; if ($p_num > 0) { $res = db_res($profiles_list_query); $iI = 1; while ($arr = mysql_fetch_array($res)) { $user_is_online = get_user_online_status($arr['ID']); if ($iI == 6) { $cont = '<div class="browse_thumb_thin">'; } else { $cont = '<div class="browse_thumb">'; } $cont .= getProfileOnlineStatus($user_is_online) . get_member_thumbnail($arr['ID'], 'none') . '<div class="browse_nick"><a href="' . getProfileLink($arr['ID']) . '">' . $arr['NickName'] . '</a></div></div>'; $ret .= $cont; $iI++; if ($iI > 6) { $iI = 1; } } } else { $ret .= '<div class="no_result">'; $ret .= '<div>' . _t('_No results found') . '</div>'; $ret .= '</div>'; } $ret .= '<div style="clear:both;margin-top:10px;"><center>' . ResNavigationRet('ProfilesLower', 0, $function, $aVar) . '</center></div>'; $ret .= '</div>'; return $ret; }
function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = '', $ordered = false, $tablevel = 0) { $this->loadExtension('DeprecatedAPI'); return makeList($array, $ulroot, $ulprefix, $type, $ordered, $tablevel); }
function whos_here($locationids, $characterrole = 'phaos_npc') { global $PHP_PHAOS_CHARID; if (is_array($locationids)) { $locationset = makeList($locationids); $locwhere = "location IN {$locationset}"; } else { $locationid = intval($locationids); $locwhere = "location={$locationid}"; } $order = 'ORDER by id ASC'; $query = "SELECT id FROM players WHERE {$locwhere} AND user LIKE '{$characterrole}' {$order}"; $list = project(fetch_all($query), 'id'); return $list; }
{ return file_put_contents('projects.simm', "\n" . $_projectName, FILE_APPEND | LOCK_EX); } if (IS_AJAX) { $post['mode'] = isset($post['mode']) ? $post['mode'] : ''; $get['mode'] = isset($get['mode']) ? $get['mode'] : ''; if (trim($post['mode']) === 'backup') { //backup $filename = createSimmFile($post['simm-note'], $post['simm-proj'], $post['simm-time']); file_put_contents($filename, $post['simm-note']); echo $filename; } else { if (trim($get['mode']) === 'list') { //show list header('Content-type: application/json'); echo makeList(); exit; } else { if (trim($get['mode']) === 'get') { // get simm echo file_get_contents($dir . trim($get['file'])); } else { if (trim($get['mode']) === 'delete') { // delete simm echo deleteSimmFile($dir . trim($get['file'])); } else { if (trim($post['mode']) === 'save') { //save simm echo saveSimmFile($dir . trim($post['file']), $post['simm-note']) . ''; } else { if (trim($get['mode']) === 'get-fav-list') {
<?php $serverUrl = "http://www.google.cn/music/"; $hashKey = "c51181b7f9bfce1ac742ed8b4a1ae4ed"; $op = $_REQUEST[op]; $id = $_REQUEST[id]; if ($op == "src") { makeSrc($id); } elseif ($op == "lrc") { makeLrc($id); } else { makeList(); } function makeList() { global $serverUrl; $rn = chr(13) . chr(10); $list = '<list>' . $rn; $cats = array("chartlisting", "topiclisting"); foreach ($cats as $cat) { $c_url = $serverUrl . $cat . "dir?cat=song&output=xml"; $c_str = getContents($c_url); $c_doc = new DOMDocument(); @$c_doc->loadXML($c_str); $nodes = $c_doc->getElementsByTagName("node"); if ($nodes->length == 0) { continue; } foreach ($nodes as $node) { $c_name = getNodeValue($node, "name"); $list .= '<m label="' . htmlspecialchars($c_name) . '">' . $rn; $c_id = getNodeValue($node, "id");
$showall = $_GET[showall]; switch ($op) { case "del": delete($_POST['id'], $uid, $selfurl); break; case "export": makeExportForm($selfurl, true); break; case "user_inbox": default: if ($showall) { $getuid = 0; } else { $getuid = $uid; } echo makeList($getuid, $selfurl, $_GET['offset']); break; } function delete($id, $uid, $selfurl) { if (!$id) { return; } $db = DB_DataObject::factory('playsms_tblUserInbox'); $db->in_id = $id; // non-admins can only delete their own logs if (!isadmin()) { $db->uid = $uid; } $db->limit(1); if ($db->delete()) {
function displayList($entry, $handle, $type = "bulleted", $id = "NULL", $localid = "NULL") { $values = display($entry, $handle, $id, $localid); if (is_array($values)) { foreach ($values as $value) { $list[] = makeList($value, $type); } } else { $list = makeList($values, $type); } return $list; }
} } // Zu jeder Struktur wird eine Liste mit Kategorien für das Inhaltsverzeichnis berechnet. $count = 0; $tocs = array(); foreach ($structures as $structure) { $tocs[$facets[$count]] = makeToC($structure); $count++; } // Für jede Struktur wird jetzt eine HTML-Datei berechnet und gespeichert. $count = 0; foreach ($structures as $structure) { $facet = $facets[$count]; $navigation = makeNavigation($thisCatalogue->heading, $tocs, $facet); $content = makeHead($thisCatalogue, $navigation, $facet); $content .= makeList($structure, $thisCatalogue); $content .= $foot; $fileName = fileNameTrans($folderName . '/' . $thisCatalogue->heading) . '-' . $facet . '.html'; $datei = fopen($fileName, "w"); fwrite($datei, $content, 3000000); fclose($datei); $count++; } unset($structures); // Erzeugen der Seite mit den Word Clouds $navigation = makeNavigation($thisCatalogue->heading, $tocs, 'jqcloud'); $content = makeHead($thisCatalogue, $navigation, 'jqcloud'); $content .= makeCloudPageContent($data, $facets, $folderName); $content .= $foot; $fileName = fileNameTrans($folderName . '/' . $thisCatalogue->heading) . '-wordCloud.html'; $datei = fopen($fileName, "w");
} print "</span>"; if ($ranked['img']) { print "<img src='" . $ranked['img'] . "' />"; } print "</a></li>"; } } print "</ul>"; } } makeList($out, $show, "graphics", "Graphics & Charting", "mainlist"); makeList($out, $show, "mobile", "Mobile", "mainlist"); makeList($out, $show, "rich", "Rich WebApps", "mainlist"); makeList($out, $show, "external", "3rd Party Demos", "mainlist"); makeList($out, $show, "exp", "Incomplete / Partial Demos:", "explist"); ?> <!-- basic page onload script after dojo.js [if available] - degrades gracefullly though none of the demos will "work" without JavaScript enabled / dojo.js --> <!-- begin footer --> </div> </div> <div id="main"> <div id="content" class="innerBox"> <div id="foot"> <div class="innerBox"> <span class="redundant">©</span> <a href="http://www.dojofoundation.org">The Dojo Foundation</a>, All Rights Reserved. </div> </div>
function fix_ground() { //bad locations - be careful, missing braces mean trouble $where = "( id IS NULL or id=0 or (special<>1 AND NOT (pass LIKE 'y') ) )"; $noks = fetch_all("select {$where} as ok, count(*) as n from phaos_ground LEFT JOIN phaos_locations on (phaos_ground.location=phaos_locations.id) GROUP BY ok"); $ok = 0; $nok = 0; foreach ($noks as $k) { if (!$k['ok']) { $ok = $k['n']; } else { $nok = $k['n']; } } DEBUG and $GLOBALS['debugmsgs'][] = __FUNCTION__ . ". inaccessible items: " . $nok . "/" . ($ok + $nok); if ($nok > $ok) { print __FUNCTION__ . ': The number of items in inaccessible locations is unusally high, not executing automatic cleanup - please inform a wizard.'; } else { if ($nok > 0) { //this does a similar query as above, so if it happens regularly that $nok>0, it is extra work $query = "select location from phaos_ground LEFT JOIN phaos_locations on (phaos_ground.location=phaos_locations.id) WHERE {$where}"; $noks = fetch_all($query); $locations = makeList(project($noks, 'location')); $query = "delete from phaos_ground where location in {$locations}"; DEBUG and $GLOBALS['debugmsgs'][] = ' sql for cleaning: ' . $query; $req = mysql_query($query); if (!$req) { showError(__FILE__, __LINE__, __FUNCTION__); exit; } } } }
function whos_here($locationids, $characterrole = 'phaos_npc') { global $PHP_PHAOS_CHARID; if (is_array($locationids)) { $locationset = makeList($locationids); $locwhere = "location IN {$locationset}"; } else { $locationid = intval($locationids); $locwhere = "location={$locationid}"; } $order = 'ORDER by wisdom ASC, gold/(strength+dexterity+hit_points) ASC'; $query = "SELECT id FROM phaos_characters WHERE {$locwhere} AND username LIKE '{$characterrole}' {$order}"; $list = project(fetch_all($query), 'id'); return $list; }
if (!defined("_SECURE_")) { die("Intruder: IP " . $_SERVER['REMOTE_ADDR']); } // print any errors from a // previous load of this page // if ($err) { echo "<p><font color=red>{$err}</font><p>\n"; } require_once 'DB/DataObject.php'; require_once 'DB/DataObject/FormBuilder.php'; error_log(print_r($_GET, true)); error_log(print_r($_POST, true)); switch ($op) { case "list": echo makeList($selfurl); break; case "add": echo makeEditForm($selfurl); break; case "edit": echo makeEditForm($selfurl, $_GET[id]); break; case "del": doDelete($selfurl, $_POST[id]); break; } function makeList($selfurl) { $html = "\n\t\t\t<h2>List/Manage/Delete SMS autosend</h2>\n\t\t\t<p/>\n\t\t\t<a href=\"{$selfurl}&op=add\">[ Add ]</a>\n\t\t\t<p/>"; // create hidden form with the