public function setUpload() { $size = (int) $_REQUEST['size']; $str = "<?php\n ini_set('post_max_size', '" . $size . "M');\n ini_set('upload_max_filesize','" . ($size + 3) . "M');\n ini_set('memory_limit','" . ($size + 3) . "M');\n ?>"; file_put_contents(CONFIG_PATH . 'upload.php', $str); echo Response::json(SUCC, array(tip('设置成功'))); }
/** * Generate form row using dl>dt,dd html tags. Useful for user profle and other simple table-like content */ function form_dd_row($content, $extra = [], $replace = [], $form) { $dd_class = $form->_params['dd_class'] ?: 'span6'; $class_wrapper = $extra['class_wrapper'] ?: 'dl-horizontal'; if ($extra['class_add_wrapper']) { $class_wrapper .= ' ' . $extra['class_add_wrapper']; } $class_dd = $extra['class_dd'] ?: ''; if ($extra['class_add_dd']) { $class_dd .= ' ' . $extra['class_add_dd']; } $row_start = !$extra['wide'] ? '<dl class="' . $class_wrapper . '">' . PHP_EOL . '<dt>' . t($extra['desc']) . '</dt>' . PHP_EOL : ''; $before_content_html = '<dd' . ($class_dd ? ' class="' . $class_dd . '"' : '') . '>'; $after_content_html = '</dd>'; $row_end = '</dl>' . PHP_EOL; if ($extra['edit_link']) { if (MAIN_TYPE_ADMIN && main()->ADMIN_GROUP != 1 && !_class('admin_methods')->_admin_link_is_allowed($extra['edit_link'])) { $extra['edit_link'] = ''; } } $edit_link_html = $extra['edit_link'] ? ' <a href="' . $extra['edit_link'] . '" class="' . $this->CLASS_EDIT_LINK . '"><i class="' . $this->CLASS_EDIT_ICON . '"></i> ' . t('Edit') . '</a>' . PHP_EOL : ''; $link_name_html = $extra['link_url'] && $extra['link_name'] ? ' <a href="' . $extra['link_url'] . '" class="' . $this->CLASS_LINK_URL . '">' . t($extra['link_name']) . '</a>' . PHP_EOL : ''; $inline_tip_html = $extra['tip'] ? ' ' . tip($extra['tip'], $replace) : ''; if ($extra['only_row_start']) { return $row_start . $before_content_html; } elseif ($extra['only_row_end']) { return $after_content_html . $row_end; } elseif ($extra['stacked']) { return $inline_help_before . $content . PHP_EOL . $edit_link_html . $link_name_html . $inline_tip_html . $inline_help_after; } else { // Full variant return $row_start . $before_content_html . $inline_help_before . $content . PHP_EOL . $edit_link_html . $link_name_html . $inline_tip_html . $inline_help_after . $after_content_html . $this->_add_rich_editor($extra, $replace, $form) . $row_end; } }
public function pwd() { $mapId = (int) $_REQUEST['mapId']; $pwd = $_REQUEST['pwd']; if (!$mapId || !$pwd) { echo Response::json(LACK, array(tip('参数不全'))); exit; } if (strlen($pwd) > 8) { echo Response::json(FAIL, array(tip('密码不能超过8位'))); exit; } $res = Factory::getInstance()->pwd($mapId, $pwd); if ($res) { $_SESSION['share'][self::getClientIp() . ':' . $mapId] = 1; echo Response::json(SUCC, array('urlkey' => base_convert($mapId, 10, 36))); } else { echo Response::json(FAIL, array(tip('验证失败'))); } }
if ($view[$j] == 0) { continue; } $tmin0 = $tip = ''; $key = $keys[$j][$ii[$j]]; if (abs($key - $itime) < 2 * $inter) { if ($ii[$j] < $nmesures[$j] - 1) { ++$ii[$j]; } if ($T1) { $tmin0 = degree2($mesure[$j][$key][1]); } else { $tmin0 = $mesure[$j][$key][1]; } if ($HTime) { $tip = tip($tmin0, $mesure[$j][$key][3]); } else { $tip = $tmin0; } //tip($tmin0,$itime); } echo ",{$tmin0},'{$tip}'"; } echo ",0]);\n"; $itime += $inter; if ($itime >= $date_end) { $break = 1; } ++$i; } while (!$break); echo "data1.removeColumn(1+2*{$numview});\n";
function tip() { return tip('This is custom text to be displayed inside tooltip, also you can use tip short names, editable from admin panel'); }
public function quota() { $uid = (int) $_REQUEST['uid']; $quota = (int) $_REQUEST['quota']; if (!$uid) { echo Response::json(LACK, array(tip('用户ID不能为空'))); exit; } $res = Factory::getInstance('user')->quota($uid, $quota); if ($res) { echo Response::json(SUCC, array(tip('分配成功'))); } else { echo Response::json(FAIL, array(tip('分配失败'))); } }
} if (!empty($_POST['pretraga'])) { $upit = "SELECT * FROM rute"; $podaci = $baza->selectUpit($upit); $tmp = array(); while ($l = $podaci->fetch_array()) { if ($_POST['idmjesta1'] == polaziste($l['idrute']) && $_POST['idmjesta2'] == odrediste($l['idrute'])) { $tmp[] = array($_POST['idmjesta1'], $_POST['idmjesta2'], $l['idrute'], $l['vrijeme_trajanja'], $l['kilometraza'], $l['idkurirske_sluzbe'], $l['tip_dostave']); } } $ispis = ""; if (count($tmp) > 0) { $ispis = '<table id="popis" class="table table-responsive"><thead id="zaglavlje">'; $ispis .= "<tr><th>ID rute</th><th>Polaziste</th><th>Odrediste</th><th>Vrijeme trajanja</th><th>KM</th><th>Kurirska sluzba</th><th>Tip dostave</th><th>Cijena</th></tr></thead><tbody>"; foreach ($tmp as $t) { $ispis .= "<tr><td>" . $t[2] . '</td><td>' . naziv_mjesta($t[0]) . '</td><td>' . naziv_mjesta($t[1]) . '</td><td>' . $t[3] . '</td><td>' . $t[4] . '</td><td>' . ks($t[5]) . '</td><td>' . tip($t[6]) . '</td><td>' . cijena($t[6]) . '</td></tr>'; } $ispis .= "</body></table>"; } } ?> <div class="container" style="margin-top:30px;"> <form method="POST"> Kriteriji pretrage: <hr/> <div class="container"> <div class="col-sm-14" style="height:75px;"> <div class='col-md-3'> <div class="form-group"> Polazna adresa:
rawoutput("<input name='DB_HOST' value=\"" . htmlentities($session['dbinfo']['DB_HOST'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">"); tip("If you are running LoGD from the same server as your database, use 'localhost' here. Otherwise, you will have to find out what the address is of your database server. Your server's ISP might be able to provide this information."); output("`nWhat is the username you use to connect to the database server?`n"); rawoutput("<input name='DB_USER' value=\"" . htmlentities($session['dbinfo']['DB_USER'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">"); tip("This username does not have to be the same one you use to connect to the database server for administrative reasons. However, in order to use this installer, and to install some of the modules, the account you provide here must have the ability to create, modify, and drop tables. If you want the installer to create a new database for LoGD, the account will also have to have the ability to create databases. Finally, to run the game, this account must at a minimum be able to select, insert, update, and delete records, and be able to lock tables. If you're uncertain, grant the account the following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, and ALTER."); output("`nWhat is the password for this username?`n"); rawoutput("<input name='DB_PASS' value=\"" . htmlentities($session['dbinfo']['DB_PASS'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">"); tip("The password is necessary here in order for the game to successfully connect to the database server. This information is not shared with anyone, it is simply used to configure the game."); output("`nWhat is the name of the database you wish to install LoGD in?`n"); rawoutput("<input name='DB_NAME' value=\"" . htmlentities($session['dbinfo']['DB_NAME'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">"); tip("Database servers such as MySQL can control many different databases. This is very useful if you have many different programs each needing their own database. Each database has a unique name. Provide the name you wish to use for LoGD in this field."); output("`nDo you want to use datacaching (high load optimization)?`n"); rawoutput("<select name='DB_USEDATACACHE'>"); rawoutput("<option value=\"1\" " . ($session['dbinfo']['DB_USEDATACACHE'] ? 'selected=\\"selected\\"' : '') . ">" . translate_inline("Yes") . "</option>"); rawoutput("<option value=\"0\" " . (!$session['dbinfo']['DB_USEDATACACHE'] ? 'selected=\\"selected\\"' : '') . ">" . translate_inline("No") . "</option>"); rawoutput("</select>"); tip("Do you want to use a datacache for the sql queries? Many internal queries produce the same results and can be cached. This feature is *highly* recommended to use as the MySQL server is usually high frequented. When using in an environment where Safe Mode is enabled; this needs to be a path that has the same UID as the web server runs."); output("`nIf yes, what is the path to the datacache directory?`n"); rawoutput("<input name='DB_DATACACHEPATH' value=\"" . htmlentities($session['dbinfo']['DB_DATACACHEPATH'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "\">"); tip("If you have chosen to use the datacache function, you have to enter a path here to where temporary files may be stored. Verify that you have the proper permission (777) set to this folder, else you will have lots of errors. Do NOT end with a slash / ... just enter the dir"); /* $yes = translate_inline("Yes"); $no = translate_inline("No"); output("`nShould I attempt to create this database if it does not exist?`n"); rawoutput("<select name='DB_CREATE'><option value='1'>$yes</option><option value='0'>$no</option></select>"); tip("If this database doesn't exist, I'll try to create it for you if you like."); */ $submit = "Test this connection information."; output_notl("`n`n<input type='submit' value='{$submit}' class='button'>", true); } rawoutput("</form>");
public function setUser() { $uid = (int) $_REQUEST['uid']; if (!$uid) { echo Response::json(LACK, array(tip('用户ID不能为空'))); exit; } $email = self::trimSpace(rawurldecode($_REQUEST['email'])); $pwd = self::trimSpace(rawurldecode($_REQUEST['pwd'])); $npwd = self::trimSpace(rawurldecode($_REQUEST['npwd'])); $nrpwd = self::trimSpace(rawurldecode($_REQUEST['nrpwd'])); if ($email && !$npwd) { $ret = Factory::getInstance('user')->setUserEmail($uid, $email); } if ($npwd) { $check = Factory::getInstance('user')->checkPwd($uid, $pwd); if (!$check) { echo Response::json(LACK, array(tip('原密码错误'))); exit; } if ($npwd != $nrpwd) { echo Response::json(LACK, array(tip('两次输入的新密码不一致'))); exit; } if ($pwd == $npwd) { echo Response::json(LACK, array(tip('密码未修改'))); exit; } $ret = Factory::getInstance('user')->setUser($uid, $npwd, $email); } if ($ret) { echo Response::json(SUCC, array(tip('操作成功'))); } else { echo Response::json(FAIL, array(tip('操作失败'))); } }
/** */ function _show_tip($value = '', $name = '', $row = []) { $tip = ''; if (is_string($value)) { $tip = $value; } elseif (is_array($value)) { if (!empty($row) && isset($row[$name])) { $tip = $value[$row[$name]]; } elseif (isset($value[$name])) { $tip = $value[$name]; } } elseif (is_callable($value)) { $tip = $value($name, $row); } return strlen($tip) ? tip($tip) : ''; }
public function unCollectAll() { $uid = (int) $_REQUEST['uid']; if (!$uid) { echo Response::json(LACK, array(tip('参数不全'))); exit; } $res = Factory::getInstance()->unCollectAll($uid); if ($res) { echo Response::json(SUCC, array(tip('操作成功'))); } else { echo Response::json(FAIL, array(tip('操作失败'))); } }
/** */ function _show_tip($value = '', $extra = [], $replace = []) { return tip($value, $replace); }