本文整理汇总了PHP中getId函数的典型用法代码示例。如果您正苦于以下问题:PHP getId函数的具体用法?PHP getId怎么用?PHP getId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit()
{
if (getId() == '') {
Router::redirect('/');
}
if ($_POST) {
if (!isset($_POST['back'])) {
$id = isset($_POST['id']) ? (int) $_POST['id'] : null;
$res_post = $_POST;
$result = $this->model->save($res_post, $id);
if ($result) {
Session::setFlash(__('page_was_saved', 'Page was saved'));
} else {
Session::setFlash(__('page_was_not_saved', 'Page was not saved'));
}
}
Router::redirect('/pages/profileview/' . getId());
}
if (isset($this->params[0])) {
$this->data['pages'] = $this->model->getById($this->params[0]);
} else {
Session::setFlash(__('Wrong_page_id', 'Wrong page id'));
Router::redirect('/pages/');
}
}
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:25,代码来源:pages.controller.php
示例2: delete
function delete()
{
$id = getId();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
mysql_query("DELETE FROM list WHERE id='{$id}'") or mysql_error();
}
}
开发者ID:jonycodes,项目名称:Blog,代码行数:7,代码来源:delete_post.php
示例3: convertStr
public function convertStr($stringFrom)
{
if (preg_match("/[а-яА-Я]+/u", $stringFrom)) {
$name = explode('.', $stringFrom);
return getId() . '-' . time() . '.' . $name[1];
}
return $stringFrom;
}
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:8,代码来源:model.class.php
示例4: funcTest
public function funcTest()
{
function getId($self)
{
return $self->getPrivateId();
}
return getId($this);
}
开发者ID:masa69,项目名称:php-sample,代码行数:8,代码来源:class.php
示例5: BxWallPage
function BxWallPage($sOwner, &$oWall)
{
$this->_sOwner = $sOwner;
$this->_oWall =& $oWall;
$this->oProfileGen = new BxBaseProfileGenerator(getId($sOwner, 0));
$this->aConfSite = $GLOBALS['site'];
$this->aConfDir = $GLOBALS['dir'];
parent::BxDolPageView('wall');
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:9,代码来源:index.php
示例6: getIdByNameArr
public function getIdByNameArr($_arrName)
{
$retArr = [];
foreach ($_arrName as $item) {
$id = getId($item);
array_push($retArr, $id);
}
return $retArr;
}
开发者ID:okagen,项目名称:fjn,代码行数:9,代码来源:Owner.php
示例7: admin_back
public function admin_back()
{
if (getId() == null) {
Router::redirect('/');
}
if ($_POST['back']) {
Router::redirect('/admin/contacts/');
}
}
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:9,代码来源:contacts.controller.php
示例8: __construct
function __construct($sOwner, &$oWall)
{
$this->_sOwner = $sOwner;
$this->_oWall =& $oWall;
$this->oProfileGen = new BxBaseProfileGenerator(getId($sOwner, 0));
$this->aConfSite = $GLOBALS['site'];
$this->aConfDir = $GLOBALS['dir'];
parent::__construct('wall');
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:9,代码来源:index.php
示例9: getRecentProducts
public function getRecentProducts()
{
// call model to fetch data
$arr_products = array();
$products = Mage::getModel("orderedproducts/orderedproducts")->getOrderedProducts();
foreach ($products as $product) {
$arr_products[] = array('id' => $product - > getId(), 'name' => $product->getName(), 'url' => $product->getProductUrl());
}
return $arr_products;
}
开发者ID:prancius,项目名称:customer-products,代码行数:10,代码来源:OrderedProducts.php
示例10: getRecord
function getRecord($id, $useUuid = false)
{
$therecord = parent::getRecord($id, $useUuid);
/**
* If type is credit, get the receipt id
* else get the invoice id
*/
if ($therecord["type"] == "credit") {
$therecord["editrelatedid"] = getId($this->db, "tbld:43678406-be25-909b-c715-7e2afc7db601", $therecord["relatedid"]);
} else {
$therecord["editrelatedid"] = getId($this->db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883", $therecord["relatedid"]);
}
return $therecord;
}
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:14,代码来源:aritems.php
示例11: __construct
public function __construct($rows, $cols = null, $opts = array())
{
// Make sure rows are all arrays
foreach ($rows as $k => $row) {
if (!is_array($row)) {
$rows[$k] = (array) $rows[$k];
}
}
if (!isset($cols)) {
$cols = array();
if (count($rows) > 0) {
$row = $rows[0];
foreach ($row as $k => $v) {
if ($k === '__meta__') {
continue;
}
$cols[] = array('label' => $k, 'name' => $k);
}
}
}
$flds = array('table', 'cssClass', 'canEdit', 'canAdd', 'canDelete', 'rowActions', 'newParams', 'params', 'addButtonLabel');
foreach ($flds as $fld) {
if (isset($opts[$fld])) {
$this->{$fld} = $opts[$fld];
}
}
$this->cssClass .= ' xf-portlet';
$decorateRow = null;
if (isset($opts['decorateRow']) and is_callable($opts['decorateRow'])) {
$decorateRow = $opts['decorateRow'];
}
foreach ($rows as $k => $row) {
if (!isset($rows[$k]['__meta__'])) {
$rows[$k]['__meta__'] = array();
}
$dfRec = new \Dataface_Record($this->table, array());
if (!@$rows[$k]['__meta__']['recordId']) {
$dfRec->setValues($row);
$rows[$k]['__meta__']['recordId'] = $dfRec - getId();
}
$rows[$k]['__meta__']['record'] = $dfRec;
if (isset($decorateRow)) {
$decorateRow($rows[$k]);
}
}
$this->cols = $cols;
$this->rows = $rows;
$this->opts = $opts;
}
开发者ID:Zunair,项目名称:xataface,代码行数:49,代码来源:Portlet.php
示例12: display_posts
function display_posts($name)
{
include 'html/showposts.php';
$conn = connect();
$id = getId($name);
mysql_select_db("unihub", $conn);
$query = "SELECT * FROM posts WHERE `id` = '{$id}'";
$result = mysql_query($query, $conn) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
// output data of each row
while ($row = mysql_fetch_array($result)) {
show_posts($row['title'], $row['thumb-desc'], $row['published'], $row['avatar'], $row['feature'], $row['main-desc'], $row['likes'], $row['comments']);
}
}
}
开发者ID:SignalFire123,项目名称:PHP-Site,代码行数:15,代码来源:main.php
示例13: CreateOperator
function CreateOperator($_loginId, $_fullName, $_email, $_permissions, $_webspace, $_passwordMD5, $_administrator, $_groups, $_language)
{
$operator = new Operator(getId(USER_ID_LENGTH), $_loginId);
$operator->Load();
$operator->Fullname = $_fullName;
$operator->Email = $_email;
$operator->PermissionSet = $_permissions;
$operator->Webspace = $_webspace;
$operator->Password = $_passwordMD5;
$operator->Level = $_administrator ? 1 : 0;
$operator->Groups = $_groups;
$operator->Language = $_language;
$operator->Save(true);
return $operator;
}
开发者ID:bgabor,项目名称:RenaniaOpencart,代码行数:15,代码来源:api.php
示例14: _t_err
}
if (!$sMessageBody) {
$sErrorMessage = '_Mailbox description empty';
}
if (!$vRecipientID) {
$sErrorMessage = '_Mailbox recipient empty';
}
$sOutputHtml = !$sErrorMessage ? $oMailBox->sendMessage($sMessageSubject, $sMessageBody, $vRecipientID, $aComposeSettings) : _t_err($sErrorMessage);
break;
case 'auto_complete':
if ($sAutoCompleteQ) {
$sOutputHtml = $oMailBox->getAutoCompleteList($sAutoCompleteQ);
}
break;
case 'get_thumbnail':
$iRecipientID = getId($vRecipientID);
if ($iRecipientID) {
$sOutputHtml = get_member_thumbnail($iRecipientID, 'none');
}
break;
}
// try to define the callback function name ;
if (isset($_GET['callback_function']) and in_array($_GET['callback_function'], $aCallbackFunctions)) {
if (method_exists($oMailBox, $_GET['callback_function'])) {
$sOutputHtml = $oMailBox->{$_GET['callback_function']}();
}
}
header('Content-Type: text/html; charset=utf-8');
echo $sOutputHtml;
exit;
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:31,代码来源:mail.php
示例15: selectCommenti
function selectCommenti($scout_idscout)
{
$database = connect();
$res = $database->select("commenti", ['[>]utenti' => ['idutenti' => 'id']], ['commenti.id', 'commenti.idutenti', 'utenti.utente(username)', 'utenti.photo', 'commenti.data', 'commenti.titolo', 'commenti.testo'], ['commenti.scout_idscout[=]' => $scout_idscout]);
$id = getId();
foreach ($res as &$r) {
if ($r['idutenti'] == $id) {
$r['owner'] = True;
} else {
$r['owner'] = False;
}
}
return $res;
}
开发者ID:edotassi,项目名称:advanced-ppu,代码行数:14,代码来源:query.php
示例16: strip_dir
function strip_dir($dir, $fn)
{
global $conf;
return end(explode($dir . '/', $fn, 2));
}
switch ($argv[1]) {
case 'cleanID':
echo cleanID($argv[2]);
break;
case 'wikiFN':
if ($argc > 3 && $argv[3]) {
echo strip_dir($conf['olddir'], wikiFN($argv[2], $argv[3]));
} else {
echo strip_dir($conf['datadir'], wikiFN($argv[2]));
}
break;
case 'mediaFN':
echo strip_dir($conf['mediadir'], mediaFN($argv[2]));
break;
case 'metaFN':
echo strip_dir($conf['metadir'], metaFN($argv[2], $argv[3]));
break;
case 'getNS':
echo getNS($argv[2]);
break;
case 'getId':
echo getId();
break;
default:
die("Unknown knob: {$argv[1]}");
}
开发者ID:mir3k,项目名称:moin2doku,代码行数:31,代码来源:doku.php
示例17: getSessionId
function getSessionId()
{
global $CONFIG;
if (!isnull(getCookieValue("userid"))) {
$session = getCookieValue("userid");
} else {
setCookieValue("userid", $session = getId(USER_ID_LENGTH));
}
return $session;
}
开发者ID:beardon,项目名称:stillwaterlife-web,代码行数:10,代码来源:functions.external.inc.php
示例18: ProcessPosts
function ProcessPosts()
{
global $USER;
$pc = 0;
if (!empty($USER->Browsers[0]->QueuedPosts)) {
if (!$USER->Browsers[0]->Waiting) {
while (!empty($_GET["mi" . $pc])) {
$pc++;
}
foreach ($USER->Browsers[0]->QueuedPosts as $id => $postar) {
$_GET["mp" . $pc] = $postar[0];
$_GET["mrid" . $pc] = $_GET["mi" . $pc] = Encoding::Base64UrlEncode($id);
$_GET["mc" . $pc++] = Encoding::Base64UrlEncode($postar[1]);
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_POSTS . "` WHERE `id`='" . DBManager::RealEscape($id) . "' LIMIT 1;");
}
$pc = 0;
$USER->Browsers[0]->QueuedPosts = array();
}
}
$this->OverlayHTML = "";
if (!empty($_GET["mi" . $pc]) || $USER->Browsers[0]->Waiting || !empty($USER->Browsers[0]->InitChatWith) || !empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
if ($USER->Browsers[0]->Waiting && $this->Botmode && !empty($USER->Browsers[0]->QueuedPosts)) {
$USER->Browsers[0]->QueuedPosts = array();
} else {
if (!Visitor::$OpenChatExternal) {
$this->Init();
}
}
if (!empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
$USER->Browsers[0]->Forward->Save(true, true);
Visitor::$IsActiveOverlayChat = !$USER->Browsers[0]->Declined;
}
}
if (!empty($USER->Browsers[0]->ChatId)) {
$USER->AddFunctionCall("lz_chat_id='" . $USER->Browsers[0]->ChatId . "';", false);
}
$USER->Browsers[0]->VisitId = $USER->VisitId;
while (!empty($_GET["mi" . $pc])) {
$id = Communication::ReadParameter("mrid" . $pc, md5($USER->Browsers[0]->SystemId . $USER->Browsers[0]->ChatId . $_GET["mi" . $pc]));
$senderName = !empty($USER->Browsers[0]->UserData->Fullname) ? $USER->Browsers[0]->UserData->Fullname : LocalizationManager::$TranslationStrings["client_guest"] . " " . Visitor::GetNoName($USER->UserId . Communication::GetIP());
$post = new Post($id, $USER->Browsers[0]->SystemId, "", Encoding::Base64UrlDecode($_GET["mp" . $pc]), Communication::ReadParameter("mc" . $pc, time()), $USER->Browsers[0]->ChatId, $senderName);
$post->BrowserId = VisitorMonitoring::$Browser->BrowserId;
if (!empty($_GET["mpti" . $pc])) {
$post->Translation = Encoding::Base64UrlDecode($_GET["mpt" . $pc]);
$post->TranslationISO = Encoding::Base64UrlDecode($_GET["mpti" . $pc]);
}
$saved = false;
if (!$USER->Browsers[0]->Waiting) {
foreach (Server::$Groups as $groupid => $group) {
if ($group->IsDynamic && $USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE && isset($group->Members[$USER->Browsers[0]->SystemId])) {
foreach ($group->Members as $member => $persistent) {
if ($member != $USER->Browsers[0]->SystemId) {
if (!empty(Server::$Operators[$member])) {
processPost($id, $post, $member, $pc, $groupid, $USER->Browsers[0]->ChatId);
} else {
processPost($id, $post, $member, $pc, $groupid, CacheManager::GetValueBySystemId($member, "chat_id", ""));
}
$saved = true;
}
}
$pGroup = $group;
}
}
foreach ($USER->Browsers[0]->Members as $systemid => $member) {
if (!empty($member->Declined)) {
continue;
}
if (!empty(Server::$Operators[$systemid]) && !empty($pGroup) && isset($pGroup->Members[$systemid])) {
continue;
}
if (!(!empty($pGroup) && !empty(Server::$Operators[$systemid]))) {
$saved = processPost($id, $post, $systemid, $pc, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->ChatId, Server::$Operators[$systemid]->IsBot);
}
}
if (!empty($USER->Browsers[0]->OperatorId) && (Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot || $USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE)) {
$rpost = new Post($id = getId(32), Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId, $USER->Browsers[0]->SystemId, $answer = Server::$Operators[$USER->Browsers[0]->OperatorId]->GetAutoReplies($post->Text . " " . $post->Translation, $USER->Browsers[0]), time(), $USER->Browsers[0]->ChatId, Server::$Operators[$USER->Browsers[0]->OperatorId]->Fullname);
if (!empty($answer)) {
if (Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
sleep(1);
$USER->AddFunctionCall("lz_chat_input_bot_state(true,false);", false);
}
$rpost->ReceiverOriginal = $rpost->ReceiverGroup = $USER->Browsers[0]->SystemId;
$rpost->Save();
$saved = true;
foreach ($USER->Browsers[0]->Members as $opsysid => $member) {
if ($opsysid != Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId || !Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
$rpost = new Post($id, Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId, $opsysid, $answer, time(), $USER->Browsers[0]->ChatId, Server::$Operators[$opsysid]->Fullname);
$rpost->ReceiverOriginal = $rpost->ReceiverGroup = $USER->Browsers[0]->SystemId;
$rpost->Save();
}
}
}
}
if ($saved) {
$USER->AddFunctionCall("lz_chat_release_post('" . Encoding::Base64UrlDecode($_GET["mi" . $pc]) . "');", false);
}
} else {
processPost($id, $post, "", $pc, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->ChatId, false);
$USER->Browsers[0]->QueuedPosts[$id] = array(0 => $_GET["mp" . $pc], 1 => time(), 2 => VisitorMonitoring::$Browser->BrowserId);
$USER->AddFunctionCall("lz_chat_release_post('" . Encoding::Base64UrlDecode($_GET["mi" . $pc]) . "');", false);
//.........这里部分代码省略.........
开发者ID:sgh1986915,项目名称:laravel-eyerideonline,代码行数:101,代码来源:functions.external.inc.php
示例19: deleteId
deleteId($id['id'], 'ccities', 'Id_Country', 'i');
deleteId($id['id'], 'countries', 'Id', 'i');
return $response->withJson(array('status' => 1, 'message' => "Country deleted sucsesfully"));
} else {
return $response->withJson(array('status' => 0, 'message' => "Country ID {$args['id']} does not exists"));
}
});
/* Delete city by Id */
$app->delete("/city/{id}/", function ($request, $response, $args) use($link) {
$id = getId($args['id'], 'cities');
if ($id) {
deleteId($id['id'], 'ccities', 'Id_City', 'i');
deleteId($id['id'], 'clanguages', 'Id_City', 'i');
deleteId($id['id'], 'cities', 'Id', 'i');
return $response->withJson(array('status' => 1, 'message' => "City deleted sucsesfully"));
} else {
return $response->withJson(array('status' => 0, 'message' => "City ID {$args['id']} does not exists"));
}
});
/* Delete language by Id */
$app->delete("/city/{idCity}/language/{id}/", function ($request, $response, $args) use($link) {
$id = getId($args['id'], 'languages');
$idCity = getId($args['idCity'], 'cities');
if ($id && $idCity) {
deleteId($id['id'], 'clanguages', 'Id_Language', 'ii', 'Id_City', $idCity['id']);
return $response->withJson(array('status' => 1, 'message' => "Language deleted sucsesfully"));
} else {
return $response->withJson(array('status' => 0, 'message' => "Language ID {$args['id']} does not exists"));
}
});
$app->run();
开发者ID:ncasich,项目名称:MathTest,代码行数:31,代码来源:index.php
示例20: wl
if (empty($lang["btn_unsubscribe"])) {
if (actionOK("subscribe")) {
//check if action is disabled
$_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
$_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"];
//language comes from DokuWiki core
}
//2009-12-25 "Lemming" and older ones. See the following for information:
//<http://www.freelists.org/post/dokuwiki/Question-about-tpl-buttonsubscribe>
} else {
if (empty($INFO["subscribed"]) && actionOK("subscribe")) {
//check if action is disabled
$_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
$_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"];
//language comes from DokuWiki core
} elseif (actionOK("unsubscribe")) {
//check if action is disabled
$_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "unsubscribe"), false, "&");
$_vector_tabs_right["ca-watch"]["text"] = $lang["btn_unsubscribe"];
//language comes from DokuWiki core
}
}
}
}
/******************************************************************************
******************************** ATTENTION *********************************
DO NOT MODIFY THIS FILE, IT WILL NOT BE PRESERVED ON UPDATES!
******************************************************************************
If you want to add some own tabs, have a look at the README of this template
and "/user/tabs.php". You have been warned!
*****************************************************************************/
开发者ID:houshuang,项目名称:folders2web,代码行数:31,代码来源:tabs.php
注:本文中的getId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论