本文整理汇总了PHP中reload函数的典型用法代码示例。如果您正苦于以下问题:PHP reload函数的具体用法?PHP reload怎么用?PHP reload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reload函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderContent
protected function renderContent()
{
/*$maxOrderNumber = Yii::app()->db->createCommand()
->select('max(id) as max')
->from('message_of_day')
->queryScalar();
$msg_id = $maxOrderNumber;*/
$criteria = new CDbCriteria();
$criteria->limit = 5;
$criteria->order = 'id desc';
$message = MessageOfDay::model()->findAll($criteria);
if (!empty($message)) {
foreach ($message as $list) {
echo CHtml::link($list['message'], array('/messageOfDay/print_message', 'id' => $list['id']), array('id' => 'stud_doc_id2'));
echo "</br></br>";
}
} else {
echo '<div "id"="stud_doc_id2">';
echo '</div>';
}
//echo CHtml::link('View All',array('/dashboard'),array('id'=>'stud_doc_id1'));
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a#stud_doc_id2', 'config' => $config));
}
示例2: zaloguj
function zaloguj($login, $haslo)
{
//zabezpiecz zmienne
$login = vText($login);
$haslo = vText($haslo);
//zaszyfruj hasło
$haslo = md5($haslo);
//pobierz dane z gabeli graczy o takim samym loginie i poprwanym haśle
$id = row("select * from tribal_gracze where login = '" . $login . "' and haslo ='" . $haslo . "' limit 1");
if (!empty($id)) {
//jeżeli coś pobrało
//jeżeli gracz jest zbanowany
if ($id['zbanowany'] == 1) {
return "administracja zbanowała tego gracza";
}
if ($id['urlop'] > time()) {
return "ten gracz jest na urlopie";
}
//jeżeli nie to zaloguj
//wyczyść sesje
$_SESSION = '';
$_SESSION = array();
//zapisz id gracza w sesji
$_SESSION['gracz'] = $id['gracz'];
//przejdź do strony konta gracza
reload("konto");
} else {
return "podano niepoprawne dane";
}
}
示例3: user
function user($lang, $arglist = false)
{
global $login_verified, $base_url;
$login = build('login', $lang);
if ($login === true) {
$r = !empty($arglist['r']) ? $arglist['r'] : false;
if ($login_verified and array_intersect($login_verified, user_profile('role'))) {
$user = $_SESSION['user'];
unset($_SESSION['user']);
if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
return run('error/unauthorized', $lang);
}
$_SESSION['unverified_user'] = $user;
$next_page = url('sslverifyclient');
if ($r) {
$next_page .= '?r=' . $r;
}
} else {
$next_page = $r ? $r : url('home', $lang);
}
return reload($base_url . $next_page);
}
$banner = build('banner', $lang);
$content = view('user', $lang, compact('login'));
head('title', translate('user:title', $lang));
head('description', false);
head('keywords', false);
head('robots', 'noindex, nofollow');
$output = layout('standard', compact('banner', 'content'));
return $output;
}
示例4: renderContent
protected function renderContent()
{
//echo 'Notice Content';
/*
$result=ImportantNotice::model()->findAll(array('limit'=>1,'order'=>'notice_id desc'));
foreach($result as $data)
*/
$notice;
$id = Yii::app()->user->getState('org_id');
if (!empty($id)) {
$maxOrderNumber = Yii::app()->db->createCommand()->select('max(notice_id) as max')->from('important_notice')->where('notice_organization_id=' . $id)->queryScalar();
if ($maxOrderNumber) {
$notice_id = $maxOrderNumber;
$notice = ImportantNotice::model()->findByPk($notice_id);
$notice = $notice->notice;
$notice = substr($notice, 0, 50) . "...";
$this->widget('ext.bbcnewsticker.EBBCNewsTicker', array('items' => array(CHtml::link($notice, array('/importantNotice/print_notice', 'id' => $notice_id), array('id' => 'hello'))), 'wrapperHtmlOptions' => array('id' => "hello")));
//$this->widget('ext.eticker.ETicker',array('data'=>array($notice, CHtml::link($notice,array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'stud_doc_id1')))));
//echo CHtml::link($notice,array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'stud_doc_id1'));
$config = array('scrolling' => 'no', 'autoDimensions' => false, 'width' => '500', 'height' => '100', 'overlayColor' => '#000', 'padding' => '0', 'showCloseButton' => true, 'onClose' => function () {
return window . location . reload();
});
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => '#hello', 'config' => $config));
//echo CHtml::link('View',array('/importantNotice/print_notice','id'=>$notice_id),array('id'=>'hello'));
}
} else {
echo '<div id="stud_doc_id1">';
echo '</div>';
}
}
示例5: perform
function perform()
{
$tree =& limb_tree::instance();
if (isset($_REQUEST['id'])) {
$node_id = (int) $_REQUEST['id'];
} else {
$node_id = get_mapped_id();
}
if (!isset($_REQUEST['direction'])) {
return false;
}
if (!($object_data = fetch_one_by_node_id($node_id))) {
debug::write_error('Node is not accessible', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('node_id' => $node_id));
return false;
}
$direction = $_REQUEST['direction'];
if (!($direction == 'up' || $direction == 'down')) {
debug::write_error('Direction is not correct', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('direction' => $direction));
return false;
}
if ($tree->change_node_order($node_id, $direction)) {
reload(PHP_SELF . '#' . $node_id);
}
return false;
}
示例6: execute
public function execute(){
$this->title = '.htaccess Setup';
$tpl = $this->getTemplate();
// Try to write the file. If I can't, display what it needs to be along with instructions.
// Check the for the presence of the .htaccess file. I always forget that bastard otherwise.
if(!file_exists(ROOT_PDIR . '.htaccess')){
$fdata = file_get_contents(ROOT_PDIR . 'htaccess.example');
$replaces = [
'@{rewritebase}@' => ROOT_WDIR,
'@{build.time}@' => date('r'),
];
$fdata = str_replace(array_keys($replaces), array_values($replaces), $fdata);
if(is_writable(ROOT_PDIR)){
// Just automatically copy it over, (with the necessary tranformations).
file_put_contents(ROOT_PDIR . '.htaccess', $fdata);
$this->setAsPassed();
reload();
// :)
}
else{
// Display the instructions to the user.
$tpl->assign('contents', $fdata);
}
}
else{
$this->setAsPassed();
reload();
}
}
示例7: parse
public function parse($orig_name)
{
global $CORE;
ob_start();
if (is_action()) {
try {
$name = post('name');
if (!$name) {
throw new FieldInputError('name', l('Please provide a map name.'));
}
if (!preg_match(MATCH_MAP_NAME, $name)) {
throw new FieldInputError('name', l('This is not a valid map name (need to match [M])', array('M' => MATCH_MAP_NAME)));
}
if (count($CORE->getAvailableMaps('/^' . $name . '$/')) > 0) {
throw new FieldInputError('name', l('A map with this name already exists.'));
}
// Read the old config
$MAPCFG = new GlobalMapCfg($orig_name);
$MAPCFG->readMapConfig();
// Create a new map config
$NEW = new GlobalMapCfg($name);
$NEW->createMapConfig();
foreach ($MAPCFG->getMapObjects() as $object_id => $cfg) {
$NEW->addElement($cfg['type'], $cfg, $perm = true, $object_id);
}
success(l('The map has been created.'));
reload(cfg('paths', 'htmlbase') . '/frontend/nagvis-js/index.php?mod=Map&show=' . $name, 1);
} catch (FieldInputError $e) {
form_error($e->field, $e->msg);
} catch (NagVisException $e) {
form_error(null, $e->message());
} catch (Exception $e) {
if (isset($e->msg)) {
form_error(null, $e->msg);
} else {
throw $e;
}
}
}
echo $this->error;
echo '<div class="simple_form">' . N;
js_form_start('to_new_map');
input('name');
submit(l('Save'));
focus('name');
// Keep the view parameters the users has set
$params = ltrim(req('view_params'), '&');
if ($params) {
$parts = explode('&', $params);
foreach ($parts as $part) {
list($key, $val) = explode('=', $part);
hidden($key, $val);
}
}
form_end();
echo '</div>' . N;
return ob_get_clean();
}
示例8: perform
function perform()
{
$object =& site_object_factory::create('user_object');
if (!$object->activate_password()) {
message_box::write_notice('Password activation failed!');
reload('/');
}
return true;
}
示例9: wyloguj
function wyloguj()
{
//wyczyść sesję
$_SESSION = array();
//zakończ sesję
session_destroy();
//przejdź do strony głównej gry
reload("start");
}
示例10: spells_end
public function spells_end($config, $player)
{
$events = get_all("select * from arena_events where e_type = 1 and e_usr_id = " . $player->usr_id . " and e_done = 0 and e_end <= unix_timestamp()");
if (is_array($events)) {
foreach ($events as $event) {
$this->spell_dispel($config, $player, $event->e_subtype);
}
reload($config, 'spells', '');
}
}
示例11: admin_action
/**
* Настройки
*/
public function admin_action()
{
$form = new Form(array('#name' => 'admin.parser', 'title' => array('label' => t('Настройки')), 'nl2br' => array('type' => 'checkbox', 'label' => t('Автоматическая обработка строк'), 'value' => config('Parser.nl2br')), 'save' => array()));
if ($result = $form->result()) {
$this->set('Parser.nl2br', $result->nl2br);
flash_success(t('Настройки сохранены!'));
reload();
}
$form->show();
}
示例12: _valid_perform
function _valid_perform()
{
$login = $this->_get('login');
$password = $this->_get('password');
$is_logged = user::login($login, $password);
if ($is_logged) {
$this->_process_logged_user();
reload('/');
} else {
$this->_process_not_logged_user();
}
return $is_logged;
}
示例13: new_town
public function new_town($config, $player)
{
if ($player->actual_town == 0) {
$is = get_one("select count(*) from towns where t_name ='" . $player->town . "'");
if ($is == 1) {
$player->town .= date("His");
}
call("\n\t\t\tinsert into towns (t_usr_id, t_name, t_nation, t_last_inc)\n\t\t\tvalue (" . $player->usr_id . ",'" . $player->town . "'," . $player->nation . ", unix_timestamp())\n\t\t\t");
$town_id = get_one("select last_insert_id()");
call("\n\t\t\tupdate map\n\t\t\tset m_t_id = {$town_id}\n\t\t\twhere m_t_id = 0\n\t\t\torder by rand() limit 1\n\t\t\t");
call("\n\t\t\tupdate users\n\t\t\tset actual_town = {$town_id}\n\t\t\twhere usr_id = " . $player->usr_id);
call("\n\t\t\tinsert into town_objects (to_t_id, to_gop_id, to_can)\n\t\t\tselect " . $town_id . ", gop_id, gop_can\n\t\t\tfrom game_objects_param\n\t\t\twhere gop_nation = " . $player->nation);
reload($config, 'town', '');
}
}
示例14: sslverifyclient
/**
*
* @copyright 2013 izend.org
* @version 1
* @link http://www.izend.org
*/
function sslverifyclient($lang, $arglist = false)
{
global $base_url;
if (empty($_SESSION['unverified_user'])) {
return run('error/badrequest', $lang);
}
$user = $_SESSION['unverified_user'];
unset($_SESSION['unverified_user']);
if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
return run('error/unauthorized', $lang);
}
$_SESSION['user'] = $user;
$next_page = !empty($arglist['r']) ? $arglist['r'] : url('home', $lang);
return reload($base_url . $next_page);
}
示例15: paypalcheckout
function paypalcheckout($lang, $amount, $currency, $tax = 0, $context = false)
{
global $base_url, $paypal_url, $sitename, $supported_languages;
if (!user_is_identified()) {
return run('error/unauthorized', $lang);
}
if (!(is_numeric($amount) and $amount > 0)) {
return run('error/badrequest', $lang);
}
$amt = paypal_amt($amount);
if (!validate_currency($currency)) {
return run('error/badrequest', $lang);
}
$currencycode = $currency;
if (!(is_numeric($tax) and $tax >= 0)) {
return run('error/badrequest', $lang);
}
$taxamt = paypal_amt($tax);
$itemamt = paypal_amt($amount - $tax);
$name = translate('donate:name', $lang);
$locale = $lang;
if (!$locale) {
$locale = user_profile('locale');
}
if (!$locale) {
$locale = $supported_languages[0];
}
$localecode = paypal_localecode($locale);
$email = user_profile('mail');
$brandname = $sitename;
$hdrimg = $base_url . '/logos/sitelogo.png';
$returnurl = $base_url . url('paypalreturn', $lang);
$cancelurl = $base_url . url('paypalcancel', $lang);
$params = array('LOCALECODE' => $localecode, 'PAYMENTREQUEST_0_PAYMENTACTION' => 'Sale', 'PAYMENTREQUEST_0_CURRENCYCODE' => $currencycode, 'PAYMENTREQUEST_0_AMT' => $amt, 'PAYMENTREQUEST_0_ITEMAMT' => $itemamt, 'PAYMENTREQUEST_0_TAXAMT' => $taxamt, 'L_PAYMENTREQUEST_0_NAME0' => $name, 'L_PAYMENTREQUEST_0_AMT0' => $itemamt, 'L_PAYMENTREQUEST_0_TAXAMT0' => $taxamt, 'L_PAYMENTREQUEST_0_QTY0' => '1', 'NOSHIPPING' => '1', 'ALLOWNOTE' => '0', 'EMAIL' => $email, 'BRANDNAME' => $sitename, 'HDRIMG' => $hdrimg, 'RETURNURL' => $returnurl, 'CANCELURL' => $cancelurl);
$r = paypal_setexpresscheckout($params);
if (!$r) {
return run('error/internalerror', $lang);
}
$token = $r['TOKEN'];
$_SESSION['paypal'] = compact('token', 'amt', 'itemamt', 'taxamt', 'currencycode', 'context');
reload($paypal_url . '/webscr&cmd=_express-checkout&token=' . $token);
}