本文整理汇总了PHP中is_id函数的典型用法代码示例。如果您正苦于以下问题:PHP is_id函数的具体用法?PHP is_id怎么用?PHP is_id使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
$page = Request::get(0, VAR_URI);
if (preg_match('/^(\\d+)-/', $page, $matches) > 0 && !empty($matches[1])) {
$airlineData = new CustomData($this->airlinePage->getPosition());
if ($airlineData->load($matches[1])) {
$uri = AirlineTools::buildUri($airlineData->getId(), $airlineData->getData('name'), true);
$this->flightPage->setBaseUri($uri);
$this->breadcrumb->add($airlineData->getData('name'), URI::build($uri));
$flight = Request::get(1, VAR_INT);
if (is_id($flight)) {
$this->flight($flight);
} else {
$this->airline($matches[1]);
}
} else {
$this->header();
$this->notFoundError();
$this->footer();
}
} else {
$this->header();
$this->airlinePage->overview('/Airlines/categories');
$this->footer();
}
}
示例2: setPerPage
public function setPerPage($pp)
{
if (is_id($pp)) {
$this->perPage = $pp;
} else {
$this->perPage = 10;
}
}
示例3: patch
public function patch()
{
$this->model->id = (int) $this->app->request->uri->segment(1);
$this->model->name = trim($this->app->request->params->post['name']);
$this->model->price = trim($this->app->request->params->post['price']);
if (!is_id($this->model->id) || $this->model->name == '' || $this->model->price == '') {
$this->app->response->setStatus(Status::BAD_REQUEST);
return;
}
if (!$this->model->find()) {
$this->app->response->setStatus(Status::NOT_FOUND);
return;
}
$result = $this->model->save();
if (is_int($result)) {
return ['ok' => true, 'id' => $this->model->id];
}
return ['ok' => false, 'id' => null];
}
示例4: initAdmin
function initAdmin($dir = null)
{
global $admconfig, $my;
if (!empty($my->settings['default_language'])) {
$dir = $my->settings['default_language'];
} elseif (is_id($admconfig['default_language'])) {
$dir = $admconfig['default_language'];
}
if ($dir != null) {
$this->setdir($dir);
}
$this->group('settings');
$this->group('admin/global');
$this->group('modules');
$this->group('custom');
@ini_set('default_charset', '');
if (!headers_sent()) {
viscacha_header('Content-type: text/html; charset=' . $this->charset());
}
}
示例5: get_remote
function get_remote($file)
{
if (!class_exists('Snoopy')) {
include 'classes/class.snoopy.php';
}
if (!preg_match('/^(http:\\/\\/)([\\wäöüÄÖÜ@\\-_\\.]+)\\:?([0-9]*)\\/(.*)$/', $file, $url_ary)) {
return REMOTE_INVALID_URL;
}
$snoopy = new Snoopy();
if (is_id($url_ary[3])) {
$snoopy->port = $url_ary[3];
} else {
$snoopy->port = null;
}
$status = $snoopy->fetch($file);
if ($status == true) {
return $snoopy->results;
} else {
return REMOTE_CLIENT_ERROR;
}
}
示例6: load
function load()
{
global $db, $gpc;
if ($this->exists() == true) {
$this->import();
} else {
$this->data = array();
$result = $db->query("SELECT id, name FROM {$db->pre}user", __LINE__, __FILE__);
while ($row = $db->fetch_assoc($result)) {
$this->data[$row['id']] = $gpc->prepare($row['name']);
}
$olduserdata = file('data/deleteduser.php');
foreach ($olduserdata as $row) {
$row = trim($row);
if (!empty($row)) {
$row = explode("\t", $row);
if (is_id($row[0])) {
$this->data[$row[0]] = $row[1];
}
}
}
$this->export();
}
}
示例7: error
$error[] = $lang->phrase('editprofile_fullname_incorrect');
}
if (count($error) > 0) {
error($error, "editprofile.php?action=profile" . SID2URL_x);
} else {
// Now we create the birthday...
if (!$_POST['birthmonth'] && !$_POST['birthday'] && !$_POST['birthyear']) {
$bday = '0000-00-00';
} else {
$_POST['birthmonth'] = leading_zero($_POST['birthmonth']);
$_POST['birthday'] = leading_zero($_POST['birthday']);
$_POST['birthyear'] = leading_zero($_POST['birthyear'], 4);
$bday = $_POST['birthyear'] . '-' . $_POST['birthmonth'] . '-' . $_POST['birthday'];
}
$_POST['icq'] = str_replace('-', '', $_POST['icq']);
if (!is_id($_POST['icq'])) {
$_POST['icq'] = 0;
}
if ($config['changename_allowed'] == 1) {
$changename = ", name = '{$_POST['name']}'";
} else {
$changename = '';
}
$db->query("UPDATE {$db->pre}user SET icq = '{$_POST['icq']}', yahoo = '{$_POST['yahoo']}', aol = '{$_POST['aol']}', msn = '{$_POST['msn']}', jabber = '{$_POST['jabber']}', birthday = '{$bday}', gender = '{$_POST['gender']}', hp = '{$_POST['hp']}', signature = '{$_POST['signature']}', location = '{$_POST['location']}', fullname = '{$_POST['fullname']}', mail = '{$_POST['email']}'{$changename} WHERE id = '{$my->id}' LIMIT 1", __LINE__, __FILE__);
ok($lang->phrase('data_success'), "editprofile.php?action=profile" . SID2URL_x);
}
} elseif ($_GET['action'] == "settings") {
$breadcrumb->Add($lang->phrase('editprofile_settings'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
$design = cache_loaddesign();
示例8: array
if ($vword->check_session($_POST['captcha'], $_POST['letter']) == FALSE) {
$error[] = $lang->phrase('veriword_mistake');
} else {
$human = array('captcha' => $_POST['captcha'], 'letter' => $_POST['letter']);
}
} else {
$error[] = $lang->phrase('veriword_failed');
}
}
if (!check_mail($_POST['email']) && ($config['guest_email_optional'] == 0 || !empty($_POST['email']))) {
$error[] = $lang->phrase('illegal_mail');
}
if (double_udata('name', $_POST['name']) == false) {
$error[] = $lang->phrase('username_registered');
}
if (is_id($_POST['name'])) {
$error[] = $lang->phrase('username_registered');
}
if (strxlen($_POST['name']) > $config['maxnamelength']) {
$error[] = $lang->phrase('name_too_long');
}
if (strxlen($_POST['name']) < $config['minnamelength']) {
$error[] = $lang->phrase('name_too_short');
}
if (strxlen($_POST['email']) > 200) {
$error[] = $lang->phrase('email_too_long');
}
$pname = $_POST['name'];
$pnameid = $_POST['name'];
$pid = 0;
} else {
示例9: updatelogged
/**
* Function that updates the user and session data after the script finished.
*/
function updatelogged () {
global $my, $db, $gpc, $plugins;
if (!isset($my->pwfaccess) || !is_array($my->pwfaccess)) {
$my->pwfaccess = array();
}
if (!isset($my->settings) || !is_array($my->settings)) {
$my->settings = array();
}
if (!isset($my->mark) || !is_array($my->mark)) {
$my->mark = array();
}
$serialized = $db->escape_string(serialize($my->mark));
$serializedpwf = $db->escape_string(serialize($my->pwfaccess));
$serializedstg = $db->escape_string(serialize($my->settings));
$sqlwhere = $sqlset = array();
if ($my->id > 0 && !is_id($this->change_mid)) {
$sqlwhere[] = "mid = '{$my->id}'";
}
else {
$sqlwhere[] = "sid = '{$this->sid}'";
}
$action = $gpc->get('action', str);
$qid = $gpc->get('id', int);
if (is_id($this->change_mid)) {
$sqlset[] = "mid = '{$this->change_mid}'";
}
($code = $plugins->load('permissions_updatelogged_query')) ? eval($code) : null;
$sqlset = iif(count($sqlset) > 0, ', ').implode(', ', $sqlset);
$sqlwhere2 = implode(', ', $sqlwhere);
if (count($sqlwhere) > 0) {
$db->query ("
UPDATE {$db->pre}session
SET mark = '{$serialized}', wiw_script = '".SCRIPTNAME."', wiw_action = '{$action}', wiw_id = '{$qid}', active = '".time()."',
pwfaccess = '{$serializedpwf}', settings = '{$serializedstg}', lastvisit = '{$my->clv}' {$sqlset}
WHERE {$sqlwhere2}
LIMIT 1
");
}
if ($my->vlogin) {
// Eigentlich könnten wir uns das Updaten der User-Lastvisit-Spalte sparen, für alle User die Cookies nutzen. Einmal, am Anfang der Session würde dann reichen
$db->query("UPDATE {$db->pre}user SET lastvisit = '".time()."' WHERE id = '{$my->id}'");
}
}
示例10: array
if (!isset($ratings[$row->id])) {
$ratings[$row->id] = array();
}
if ($my->vlogin && $my->id != $row->mid && !isset($ratings[$row->id][$my->id])) {
$showrating = true;
}
$ratingcounter = count($ratings[$row->id]);
if (count($ratings[$row->id]) > 0) {
$row->rating = round(array_sum($ratings[$row->id]) / $ratingcounter * 50) + 50;
}
}
($code = $plugins->load('showtopic_entry_prepared')) ? eval($code) : null;
$inner['index_bit'][] = $tpl->parse("showtopic/index_bit");
($code = $plugins->load('showtopic_entry_added')) ? eval($code) : null;
}
if ($my->vlogin && is_id($info['id'])) {
$result = $db->query("SELECT id, type FROM {$db->pre}abos WHERE mid = '{$my->id}' AND tid = '{$info['id']}'");
$abox = $db->fetch_assoc($result);
} else {
$abox = array('id' => null, 'type' => null);
}
$inner['index_bit'] = implode('', $inner['index_bit']);
($code = $plugins->load('showtopic_prepared')) ? eval($code) : null;
echo $tpl->parse("showtopic/index");
$slog->setTopicRead($info['id'], $topforums);
($code = $plugins->load('showtopic_end')) ? eval($code) : null;
$slog->updatelogged();
$zeitmessung = t2();
echo $tpl->parse("footer");
$phpdoc->Out();
$db->close();
示例11: while
while ($row = $gpc->prepare($db->fetch_object($result))) {
$pref = '';
$showprefix = false;
if (isset($prefix_arr[$row->prefix]) && $row->prefix > 0) {
$prefix = $prefix_arr[$row->prefix]['value'];
$showprefix = true;
} else {
$prefix = '';
}
if (is_id($row->name) && isset($memberdata[$row->name])) {
$row->mid = $row->name;
$row->name = $memberdata[$row->name];
} else {
$row->mid = FALSE;
}
if (is_id($row->last_name) && isset($memberdata[$row->last_name])) {
$row->last_name = $memberdata[$row->last_name];
}
$rstart = str_date('d.m.Y H:i', times($row->date));
$rlast = str_date('d.m.Y H:i', times($row->last));
if ($row->status == '2') {
$pref .= $lang->phrase('forum_moved');
} else {
if (empty($row->mark) && !empty($info['auto_status'])) {
$row->mark = $info['auto_status'];
}
if ($row->mark == 'n') {
$pref .= 'News: ';
} elseif ($row->mark == 'a') {
$pref .= 'Artcle: ';
} elseif ($row->mark == 'b') {
示例12: manageconfig
}
echo "- Database class loaded and initialized.<br />";
// Config
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->savedata();
echo "- Configuration updated.<br />";
// Languages
$ini = array('settings' => array('language_de' => array('compatible_version' => VISCACHA_VERSION), 'language' => array('compatible_version' => VISCACHA_VERSION)), 'admin/frames' => array('language_de' => array('admin_scheduler_log' => 'Protokoll der geplanten Aufgaben')), 'classes' => array('language_de' => array('mailer_encoding' => 'Unbekanntes Encoding-Format: ', 'mailer_execute' => 'Konnte folgenden Befehl nicht ausführen: ', 'mailer_file_access' => 'Zugriff auf folgende Datei fehlgeschlagen: ', 'mailer_file_open' => 'Datei Fehler: Konnte folgende Datei nicht öffnen: ', 'mailer_from_failed' => 'Die folgende Absenderadresse ist nicht korrekt: ', 'mailer_recipients_failed' => 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ', 'mailer_signing' => 'Fehler beim Signieren: ', 'mailer_empty_message' => 'E-Mail Inhalt ist leer.', 'mailer_invalid_address' => 'E-Mail wird nicht gesendet, die Adresse ist ungültig.', 'mailer_smtp_connect_failed' => 'Verbindung zu SMTP Server fehlgeschlagen.', 'mailer_smtp_error' => 'Fehler vom SMTP Server: ', 'mailer_variable_set' => 'Kann Variable nicht setzen oder zurücksetzen: '), 'language' => array('mailer_authenticate' => 'SMTP Error: Could not authenticate.', 'mailer_connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'mailer_data_not_accepted' => 'SMTP Error: Data not accepted.', 'mailer_encoding' => 'Unknown encoding: ', 'mailer_execute' => 'Could not execute: ', 'mailer_file_access' => 'Could not access file: ', 'mailer_file_open' => 'File Error: Could not open file: ', 'mailer_from_failed' => 'The following From address failed: ', 'mailer_instantiate' => 'Could not instantiate mail function.', 'mailer_mailer_not_supported' => ' mailer is not supported.', 'mailer_provide_address' => 'You must provide at least one recipient email address.', 'mailer_recipients_failed' => 'SMTP Error: The following recipients failed: ', 'mailer_empty_message' => 'Message body empty', 'mailer_invalid_address' => 'Invalid address', 'mailer_smtp_connect_failed' => 'SMTP Connect() failed.', 'mailer_smtp_error' => 'SMTP server error: ', 'mailer_variable_set' => 'Cannot set or reset variable: ')), 'global' => array('language_de' => array('digest_d' => 'Tägliche E-Mail-Benachrichtigung', 'digest_none' => 'Keine Benachrichtigung', 'img_captcha_session_expired_error' => 'Seite aktualisieren', 'digest_f' => 'Nur Favorit'), 'language' => array('digest_none' => 'No notification', 'img_captcha_session_expired_error' => 'Refresh page', 'digest_f' => 'Favorite only')));
updateLanguageFiles($ini);
echo "- Language files updated.<br />";
$newCss = file_get_contents('temp/standard.css');
$dir = dir('designs');
while (false !== ($entry = $dir->read())) {
if (is_id($entry)) {
$path = "{$dir->path}/{$entry}/standard.css";
$css = file_get_contents($path);
if (!empty($css)) {
$css .= $newCss;
if (!$filesystem->file_put_contents($path, $css)) {
$css = null;
}
}
if (empty($css)) {
echo "<br />!!! <strong>Warning:</strong> Updating {$path} failed. Plase add the following CSS code to your main css file in designs/{$entry}:<br /><code>";
echo htmlentities($newCss);
echo "</code><br /><br />";
}
}
}
示例13: BoardSelect
function BoardSelect($board = 0)
{
global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins, $slog;
$found = false;
$sub_cache = $forum_cache = $last_cache = $forums = $cat = array();
$categories_obj = $scache->load('categories');
$cat_cache = $categories_obj->get();
$memberdata_obj = $scache->load('memberdata');
$memberdata = $memberdata_obj->get();
$index_moderators = $scache->load('index_moderators');
$mod_cache = $index_moderators->get();
$prefix_obj = $scache->load('prefix');
$prefix = $prefix_obj->get();
($code = $plugins->load('forums_query')) ? eval($code) : null;
// Fetch Forums
$result = $db->query("\n\tSELECT\n\t\tf.id, f.name, f.description, f.opt, f.optvalue, f.parent, f.topics, f.replies, f.last_topic, f.invisible,\n\t\tt.topic as l_topic, t.prefix AS l_prefix, t.id as l_tid, t.last as l_date, u.name AS l_uname, t.last_name AS l_name, f.id AS l_bid\n\tFROM {$db->pre}forums AS f\n\t\tLEFT JOIN {$db->pre}topics AS t ON f.last_topic=t.id\n\t\tLEFT JOIN {$db->pre}user AS u ON t.last_name=u.id\n\tORDER BY f.parent, f.position\n\t");
$keys = array('l_prefix' => null, 'l_topic_full' => null, 'l_topic' => null, 'l_tid' => null, 'l_date' => null, 'l_uname' => null, 'l_name' => null, 'l_bid' => null);
while ($row = $db->fetch_assoc($result)) {
$row['name'] = $gpc->prepare($row['name']);
$row['l_uname'] = $gpc->prepare($row['l_uname']);
$row['l_name'] = $gpc->prepare($row['l_name']);
$row['bid'] = $cat_cache[$row['parent']]['parent'];
// Caching for Subforums
if (!empty($row['bid'])) {
$sub_cache[$row['bid']][] = $row;
}
// Caching the Forums
if ($row['bid'] == $board) {
$forum_cache[$row['parent']][] = $row;
}
$last_cache[$row['id']] = $row;
($code = $plugins->load('forums_caching')) ? eval($code) : null;
}
$cats = array();
$hidden = 0;
// Work with the chached data!
foreach ($cat_cache as $cat) {
$cat['forums'] = array();
if (isset($forum_cache[$cat['id']]) == false) {
continue;
}
foreach ($forum_cache[$cat['id']] as $forum) {
$found = true;
$forum['new'] = false;
$forum['show'] = true;
// Subforendaten vererben (Letzter Beitrag, Markierung)
if (isset($sub_cache[$forum['id']])) {
$substats = SubStats($forum['topics'], $forum['replies'], $forum['id'], $sub_cache);
$forum['topics'] = $substats[0];
$forum['replies'] = $substats[1];
}
// Letzter Beitrag
$last = $last_cache[$forum['id']];
if (isset($sub_cache[$forum['id']])) {
foreach ($substats[2] as $last_bid) {
$sub = $last_cache[$last_bid];
if ($last['l_date'] < $sub['l_date'] && check_forumperm($sub)) {
$last = $sub;
}
}
}
$forum = array_merge($forum, array_intersect_key($last, $keys));
if (is_id($forum['l_name']) && isset($memberdata[$forum['l_name']])) {
$forum['l_name'] = array($forum['l_uname'], $forum['l_name']);
} else {
$forum['l_name'] = array($forum['l_name'], 0);
}
// Rechte und Gelesensystem
if ($forum['opt'] != 're') {
if (!check_forumperm($forum)) {
if ($forum['invisible'] != 0) {
$forum['show'] = false;
}
$forum['foldimg'] = $tpl->img('cat_locked');
$forum['state'] = BOARD_STATE_LOCKED;
$forum['topics'] = '-';
$forum['replies'] = '-';
$forum['l_topic'] = false;
$forum['l_topic_full'] = '';
} else {
if ($slog->isForumRead($forum['id'], $forum['l_date']) || $forum['topics'] < 1) {
$forum['foldimg'] = $tpl->img('cat_open');
$forum['state'] = BOARD_STATE_OLD;
} else {
$forum['foldimg'] = $tpl->img('cat_red');
$forum['state'] = BOARD_STATE_NEW;
$forum['new'] = true;
}
if (!empty($forum['l_topic'])) {
if (isset($prefix[$forum['id']][$forum['l_prefix']]) && $forum['l_prefix'] > 0) {
$lang->assign('prefix', $prefix[$forum['id']][$forum['l_prefix']]['value']);
$forum['l_prefix'] = $lang->phrase('showtopic_prefix_title');
} else {
$forum['l_prefix'] = '';
}
if (strxlen($forum['l_topic']) > $config['lasttopic_chars']) {
$forum['l_topic_full'] = $forum['l_prefix'] . $forum['l_topic'];
$forum['l_topic'] = subxstr($forum['l_topic'], 0, $config['lasttopic_chars']);
$forum['l_topic'] .= "...";
} else {
//.........这里部分代码省略.........
示例14: foot
echo $lang->phrase('admin_cms_form_edit');
?>
"></td>
</tr>
</table>
</form>
<?php
echo foot();
} elseif ($job == 'feed_edit2') {
echo head();
$title = $gpc->get('temp1', str);
$file = $gpc->get('temp2', db_esc);
$entries = $gpc->get('value', int);
$id = $gpc->get('id', int);
$max_age = $gpc->get('max_age', int);
if (!is_id($id)) {
error('admin.php?action=cms&job=feed', $lang->phrase('admin_cms_invalid_id_given'));
}
if (empty($title)) {
error('admin.php?action=cms&job=feed_edit&id=' . $id, $lang->phrase('admin_cms_no_title_specified'));
}
if (empty($file)) {
error('admin.php?action=cms&job=feed_edit&id=' . $id, $lang->phrase('admin_cms_no_url_specified'));
}
if (empty($entries)) {
$entries = 0;
}
if (empty($max_age)) {
$max_age = 60 * 12;
}
$db->query("UPDATE {$db->pre}grab SET file = '{$file}', title = '{$title}', entries = '{$entries}', max_age = '{$max_age}' WHERE id = '{$id}'");
示例15: getDocLangID
function getDocLangID($data)
{
global $my, $config;
if (isset($my->language) && is_id($my->language) && isset($data[$my->language])) {
return $my->language;
// Best case: Language specified by the user
} elseif (is_id($config['doclang']) && isset($data[$config['doclang']])) {
return $config['doclang'];
// Normal Case: Standard language specified for documents
} elseif (is_id($config['langdir']) && isset($data[$config['langdir']])) {
return $config['langdir'];
// Worse Case: Standard language of the page
} else {
reset($data);
return key($data);
// Worst Case: Take another language... let's say just the first in the list?!
}
}