本文整理汇总了PHP中get_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_id函数的具体用法?PHP get_id怎么用?PHP get_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _setView
<?php
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email [email protected]
// +----------------------------------------------------------------------
_setView(__FILE__);
$itemID = get_id(2);
$itemsClass = new items();
$item = $itemsClass->get($itemID);
if (!is_array($item) || check_login_bool() && $item['status'] == 'unapproved' && $item['user_id'] != $_SESSION['user']['user_id'] || $item['status'] == 'queue' || $item['status'] == 'extended_buy') {
header("HTTP/1.0 404 Not Found");
header("Location: http://" . DOMAIN . "/" . $languageURL . "error");
}
abr('item', $item);
开发者ID:yunsite,项目名称:demila,代码行数:20,代码来源:preview.php
示例2: print_highlighted
function print_highlighted($lang)
{
//The GeSHI syntax highlighter is included.
include_once 'geshi/geshi.php';
//The string returned is stored in a variable.
$filename = get_id($_SERVER['REQUEST_URI']);
//If file does not exist then it redirects the user to the home page.
$file = fopen("data/{$filename}", "r") or header("Location: /");
$source = '';
while (!feof($file)) {
$source = $source . fgets($file);
}
//The object created is passed two arguments for syntax highlighting.
$geshi = new GeSHi($source, $lang);
$geshi->set_overall_style('background-color: #f2f2f2; margin: 0px 35px; border: 1px dotted;', true);
//$geshi->set_header_type(GESHI_HEADER_PRE_VALID);
$geshi->set_header_type(GESHI_HEADER_DIV);
//The flag below shows the line numbers. See GeSHI docs for more options.
$flag = GESHI_FANCY_LINE_NUMBERS;
$geshi->enable_line_numbers($flag);
$geshi->set_line_style(' padding: 0px 15px;');
//The <pre> tags are included for maintaining the indentation.
// echo "<pre>";
echo $geshi->parse_code();
// echo "</pre></div>";
return 0;
}
开发者ID:vrnkalra,项目名称:glupaste,代码行数:27,代码来源:libpaste1.php
示例3: update_category
/**
* Show and process config category form
*
* @param void
* @return null
*/
function update_category()
{
$category = ConfigCategories::findById(get_id());
if (!$category instanceof ConfigCategory) {
flash_error(lang('config category dnx'));
$this->redirectToReferer(get_url('administration'));
}
// if
if ($category->isEmpty()) {
flash_error(lang('config category is empty'));
$this->redirectToReferer(get_url('administration'));
}
// if
$options = $category->getOptions(false);
$categories = ConfigCategories::getAll(false);
tpl_assign('category', $category);
tpl_assign('options', $options);
tpl_assign('config_categories', $categories);
$submitted_values = array_var($_POST, 'options');
if (is_array($submitted_values)) {
foreach ($options as $option) {
$new_value = array_var($submitted_values, $option->getName());
if (is_null($new_value) || $new_value == $option->getValue()) {
continue;
}
$option->setValue($new_value);
$option->save();
}
// foreach
flash_success(lang('success update config category', $category->getDisplayName()));
$this->redirectTo('administration', 'configuration');
}
// if
$this->setSidebar(get_template_path('update_category_sidebar', 'config'));
}
开发者ID:469306621,项目名称:Languages,代码行数:41,代码来源:ConfigController.class.php
示例4: auth_id
function auth_id()
{
global $torque_id, $torque_id_hash;
// Prepare authentification of Torque Instance that uploads data to this server
// If $torque_id is defined, this will overwrite $torque_id_hash from creds.php
$session_id = get_id();
// Parse IDs from "creds.php", if IDs are defined these will overrule HASHES
$auth_by_hash_possible = false;
if (isset($torque_id) && !empty($torque_id)) {
if (!is_array($torque_id)) {
$torque_id = array($torque_id);
}
$torque_id_hash = array_map(md5, $torque_id);
$auth_by_hash_possible = true;
} elseif (isset($torque_id_hash) && !empty($torque_id_hash)) {
if (!is_array($torque_id_hash)) {
$torque_id_hash = array($torque_id_hash);
}
$auth_by_hash_possible = true;
}
// Authenticate torque instance: Check if we know its HASH
if ($auth_by_hash_possible) {
if (in_array($session_id, $torque_id_hash)) {
return true;
}
} else {
return true;
}
return false;
}
开发者ID:lanejo01,项目名称:torque,代码行数:30,代码来源:auth_functions.php
示例5: login
function login($username, $password)
{
$id = get_id($username);
$username = validate($username);
$password = md5($password);
$sql = mysql_query("SELECT COUNT(`UserID`) FROM `user` WHERE `Username` = '{$username}' AND `Password` = '{$password}'");
return mysql_result($sql, 0) == 1 ? $id : false;
}
开发者ID:alexandrastoica,项目名称:soundmood-database-app,代码行数:8,代码来源:functions.php
示例6: sel_file
function sel_file($val)
{
$return = get_id('goods', 'goo_img', $val);
if (!$return) {
$return = get_id('goods', 'goo_x_img', $val);
}
if (!$return) {
$return = get_id('picture', 'pic_path', $val);
}
return $return;
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:11,代码来源:pic_list.php
示例7: recive_formular
function recive_formular()
{
//um einwenig weniger tipp arbeit zu haben und zukünftige erweiterungen schneller einfließen zu lassen
//werden einfach nur alle tabellen felder durch gegangen und ggf berichtigt
//konfiguration über config.php: $anmeldung_fields
/*liest die bei der Anmeldung abgeschickten Daten aus, prüft sie und packt sie in einen Hash*/
$daten = array();
foreach ($GLOBALS["anmeldung_fields"] as $key) {
switch ($key) {
case 'idx':
$daten[$key] = get_id();
break;
case 'ew_count':
if (!is_numeric($_POST[$key]) or $_POST[$key] > 99) {
array_push($GLOBALS["error_msgs"], MSG_NUMBER_UNREAL);
$GLOBALS["error"] += 1;
}
$daten[$key] = abs($_POST[$key]);
break;
case 'ki_count':
if (!is_numeric($_POST[$key]) or $_POST[$key] > 99) {
array_push($GLOBALS["error_msgs"], MSG_NUMBER_UNREAL);
$GLOBALS["error"] += 1;
}
$daten[$key] = abs($_POST[$key]);
break;
case 'ba_count':
if (!is_numeric($_POST[$key]) or $_POST[$key] > 99) {
array_push($GLOBALS["error_msgs"], MSG_NUMBER_UNREAL);
$GLOBALS["error"] += 1;
}
$daten[$key] = abs($_POST[$key]);
break;
case 'newsletter':
if (isset($_POST[$key])) {
$daten[$key] = "1";
} else {
$daten[$key] = "0";
}
break;
case 'timestamp':
$daten[$key] = date("d.m.Y \\u\\m H:i:s");
break;
default:
if (isset($_POST[$key])) {
$daten[$key] = $_POST[$key];
} else {
$daten[$key] = "";
}
}
}
//gibt die Formular daten zurück
return $daten;
}
开发者ID:k4r573n,项目名称:ConScr,代码行数:54,代码来源:formmail.lib.php
示例8: delete
/**
* Delete specific user
*
* @access public
* @param void
* @return null
*/
function delete()
{
$this->setTemplate('del_user');
$user = Users::findById(get_id());
if (!$user instanceof User) {
flash_error(lang('user dnx'));
$this->redirectTo('administration');
}
// if
if (!$user->canDelete(logged_user())) {
flash_error(lang('no access permissions'));
$this->redirectToReferer(get_url('dashboard'));
}
// if
$delete_data = array_var($_POST, 'deleteUser');
tpl_assign('user', $user);
tpl_assign('delete_data', $delete_data);
if (!is_array($delete_data)) {
$delete_data = array('really' => 0, 'password' => '');
// array
tpl_assign('delete_data', $delete_data);
} else {
if ($delete_data['really'] == 1) {
$password = $delete_data['password'];
if (trim($password) == '') {
tpl_assign('error', new Error(lang('password value missing')));
return $this->render();
}
if (!logged_user()->isValidPassword($password)) {
tpl_assign('error', new Error(lang('invalid login data')));
return $this->render();
}
try {
DB::beginWork();
$user->delete();
ApplicationLogs::createLog($user, null, ApplicationLogs::ACTION_DELETE);
DB::commit();
flash_success(lang('success delete user', $user->getDisplayName()));
} catch (Exception $e) {
DB::rollback();
flash_error(lang('error delete user'));
}
// try
$this->redirectToUrl($user->getCompany()->getViewUrl());
} else {
flash_error(lang('error delete user'));
$this->redirectToUrl($user->getCompany()->getViewUrl());
}
}
}
开发者ID:bklein01,项目名称:Project-Pier,代码行数:57,代码来源:UserController.class.php
示例9: module_comment
function module_comment()
{
global $global, $smarty;
if ($global['id']) {
$obj = new comment();
$obj->set_where('com_channel_id = ' . get_id('channel', 'cha_code', $global['channel']));
$obj->set_where('com_page_id = ' . $global['id']);
$obj->set_page_size(5);
$obj->set_page_num($global['page']);
$sheet = $obj->get_sheet();
set_link($obj->get_page_sum());
$smarty->assign('comment', $sheet);
}
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:14,代码来源:comment.php
示例10: uninstall
function uninstall($id = null) {
ajx_current("empty");
if (!$id) {
$id=get_id();
}
if ( $plg = Plugins::instance()->findById($id)) {
if (!$plg->isInstalled()) return ;
$plg->setIsInstalled(0);
$plg->save();
$name= $plg->getSystemName();
$path = ROOT . "/plugins/$name/uninstall.php";
if (file_exists($path)){
include_once $path;
}
}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:16,代码来源:PluginController.class.php
示例11: set_more_global
function set_more_global()
{
global $global;
$global['channel'] = get_global('channel', 'index');
$global['cat'] = get_global('cat', 0);
$global['page'] = get_global('page', 1);
$global['id'] = get_global('id', 0);
$global['original'] = $global['channel'];
$global['channel_id'] = get_id('channel', 'cha_code', $global['channel']);
if ($global['channel_id']) {
$original_id = get_data('channel', $global['channel_id'], 'cha_original');
if ($original_id) {
$global['original'] = get_data('channel', $original_id, 'cha_code');
}
}
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:16,代码来源:basic.func.php
示例12: post_request
/**
* This function call when a post request send .If that request is a valid addTicket request, new ticket will added,
* Else redirect user to not found page or echo error message;
* @param WP_USER $user
* @return string
*/
function post_request($user)
{
if (!isset($_POST["requestType"]) || $_POST["requestType"] != "addTicket" && $_POST["requestType"] != "addTicketAnswer") {
header("Location: " . NOT_FOUND_URL);
exit;
}
$const_array = array("applicant_id" => $user->ID, "status" => 0, "attachments" => $_POST["upfile"], "title" => $_POST["title"], "content" => $_POST["message"], "department" => $_POST["department"], "other" => "priority:" . $_POST["priority"] . "|", "related_order" => get_id($_POST["order"]));
if (isset($_POST['relatedTicket'])) {
$related_ticket = $_POST['relatedTicket'];
$const_array = array_merge($const_array, array("related_ticket" => get_id($related_ticket)));
}
if ($_POST["requestType"] == "addTicket") {
foreach ($const_array as $key => $value) {
if (empty($value) && $value !== 0 && $key !== "attachments" && $key !== "order" && $key !== "related_ticket") {
return "لطفا متنی تایپ کنید!" . "<br>";
}
}
} else {
if (empty($_POST["message"])) {
return "متن پاسخ نیم تواند خالی باشد";
}
}
$ticket = new Ticket($const_array);
if ($ticket->create()) {
if ($_POST["requestType"] == "addTicket") {
echo "1|ticket.php?iti=" . $ticket->get_fake_id();
exit;
} else {
if (get_user_level($user->ID) == 10) {
Ticket::change_ticket_status($ticket->get_related_ticket_id(), 1);
} else {
Ticket::change_ticket_status($ticket->get_related_ticket_id(), 0);
}
echo "پاسخ شما افزوده شد";
}
} else {
return "مشکلی در ایجاد تیکت وجود دارد.لطفا مجددا تلاش کنید";
}
}
开发者ID:alihoseiny,项目名称:Shek,代码行数:45,代码来源:ticket.php
示例13: add_comment
function add_comment()
{
safe('comment');
global $global, $smarty, $lang;
$channel = post('channel');
$com_page_id = post('page_id');
$com_username = post('username');
$com_email = post('email');
$com_rank = post('rank');
$com_text = post('text');
if ($channel == '' || $com_page_id == '' || $com_username == '' || $com_email == '' || $com_rank == '' || $com_text == '') {
$info_text = $lang['submit_error_info'];
} else {
$com_channel_id = get_id('channel', 'cha_code', $channel);
$com_add_time = time();
$obj = new comment();
$obj->set_value('com_channel_id', $com_channel_id);
$obj->set_value('com_page_id', $com_page_id);
$obj->set_value('com_username', $com_username);
$obj->set_value('com_email', $com_email);
$obj->set_value('com_rank', $com_rank);
$obj->set_value('com_text', $com_text);
$obj->set_value('com_add_time', $com_add_time);
$obj->set_value('com_show', 0);
$obj->set_value('com_lang', S_LANG);
$obj->add();
if (intval(get_varia('sentmail'))) {
$email_title = '您的网站有了新的评论';
$str = get_data($channel, $com_page_id, substr($channel, 0, 3) . '_title');
$email_text = '评论:《' . $str . '》<br />' . $com_text;
call_send_email($email_title, $email_text, $com_username, $com_email);
}
$info_text = $lang['submit_comment'];
}
$smarty->assign('info_text', $info_text);
$smarty->assign('link_text', $lang['go_back']);
$smarty->assign('link_href', url(array('channel' => $channel, 'id' => $com_page_id)));
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:38,代码来源:info_main.php
示例14: delete
function delete()
{
ajx_current("empty");
$billingCategory = BillingCategories::findById(get_id());
if (!$billingCategory instanceof BillingCategory) {
flash_error(lang('billing category dnx'));
return;
}
// if
if (!$billingCategory->canDelete(logged_user())) {
flash_error(lang('no access permissions'));
return;
}
// if
try {
DB::beginWork();
$billingCategory->delete();
DB::commit();
flash_success(lang('success delete billing category', $billingCategory->getName()));
ajx_current("reload");
} catch (Exception $e) {
DB::rollback();
flash_error($e->getMessage());
}
// try
}
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:26,代码来源:BillingController.class.php
示例15: view
function view()
{
$comment = Comments::findById(get_id());
if (!$comment instanceof Comment) {
flash_error(lang('comment dnx'));
ajx_current("empty");
return;
}
if (!$comment->canView(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
$object = $comment->getRelObject();
if (!$object instanceof ContentDataObject) {
flash_error(lang('object dnx'));
ajx_current("empty");
return;
}
redirect_to($object->getViewUrl());
}
开发者ID:rorteg,项目名称:fengoffice,代码行数:21,代码来源:CommentController.class.php
示例16: delete_logo
/**
* Delete company logo
*
* @param void
* @return null
*/
function delete_logo() {
if(!logged_user()->isAdministrator()) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
} // if
$company = Contacts::findById(get_id());
if(!($company instanceof Contact)) {
flash_error(lang('company dnx'));
ajx_current("empty");
return;
} // if
try {
DB::beginWork();
$company->deleteLogo();
$company->save();
ApplicationLogs::createLog($company, ApplicationLogs::ACTION_EDIT);
DB::commit();
flash_success(lang('success delete company logo'));
ajx_current("back");
} catch(Exception $e) {
DB::rollback();
flash_error(lang('error delete company logo'));
ajx_current("empty");
} // try
} // delete_logo
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:35,代码来源:ContactController.class.php
示例17: unarchive
function unarchive()
{
if (!can_manage_dimension_members(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
$member = Members::findById(get_id());
if (!$member instanceof Member) {
flash_error(lang('member dnx'));
ajx_current("empty");
return;
}
if (get_id('user')) {
$user = Contacts::findById($get_id('user'));
} else {
$user = logged_user();
}
if (!$user instanceof Contact) {
ajx_current("empty");
return;
}
try {
DB::beginWork();
set_time_limit(0);
$count = $member->unarchive($user);
evt_add("reload dimension tree", $member->getDimensionId());
ajx_current("back");
flash_success(lang('success unarchive member', $member->getName(), $count));
DB::commit();
} catch (Exception $e) {
DB::rollback();
flash_error($e->getMessage());
ajx_current("empty");
}
}
开发者ID:rorteg,项目名称:fengoffice,代码行数:36,代码来源:MemberController.class.php
示例18: _setView
<?php
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email [email protected]
// +----------------------------------------------------------------------
_setView(__FILE__);
$itemID = get_id(1);
$itemsClass = new items();
//获取预览图
$previewFile = $itemsClass->get_theme_preview($itemID);
$previewFiles = array();
for ($i = 0; $i < count($previewFile); $i++) {
$previewFiles[] = $previewFile[$i]["dir"];
}
abr('previewFiles', $previewFiles);
//作品详情
$item = $itemsClass->get($itemID);
if (!is_array($item) || $item['status'] == 'deleted') {
header("HTTP/1.0 404 Not Found");
header("Location: http://" . DOMAIN . "/" . $languageURL . "error");
} elseif (!is_array($item) || check_login_bool() && $item['status'] == 'unapproved' && $item['user_id'] != $_SESSION['user']['user_id'] || $item['status'] == 'queue' || $item['status'] == 'extended_buy') {
}
_setTitle($item['name']);
abr('meta_description', substr(strip_tags($item['description']), 0, 255));
require_once ROOT_PATH . '/apps/users/models/users.class.php';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:index.php
示例19: header
header("Location: " . NOT_FOUND_URL);
exit;
}
if (get_user_level($user->ID) == 10) {
if (!isset($_GET["ticketType"])) {
$tickets = get_all_tickets();
} elseif (isset($_GET["user_id"])) {
switch ($_GET["ticketType"]) {
case "pending":
$tickets = get_user_pending_tickets(get_id($_GET["user_id"]));
break;
case "answered":
$tickets = get_user_answered_tickets(get_id($_GET["user_id"]));
break;
case "closed":
$tickets = get_user_closed_tickets(get_id($_GET["user_id"]));
break;
default:
header("Location:" . NOT_FOUND_URL);
exit;
}
}
} else {
if (!isset($_GET["ticketType"])) {
$tickets = get_user_tickets($user->ID);
} else {
switch ($_GET["ticketType"]) {
case "pending":
$tickets = get_user_pending_tickets($user->ID);
break;
case "answered":
开发者ID:alihoseiny,项目名称:Shek,代码行数:31,代码来源:tickets.php
示例20: _setView
<?php
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email [email protected]
// +----------------------------------------------------------------------
_setView(__FILE__);
$collectionID = get_id(2);
$collectionsClass = new collections();
$collection = $collectionsClass->get($collectionID);
if (!is_array($collection) || $collection['public'] == 'false' && check_login_bool() && $collection['user_id'] != $_SESSION['user']['user_id']) {
refresh('/' . $languageURL . 'collections/', $langArray['wrong_collection'], 'error');
}
if (isset($_POST['rating'])) {
$_GET['rating'] = $_POST['rating'];
}
if (!isset($_GET['rating']) || !is_numeric($_GET['rating']) || $_GET['rating'] > 5) {
$_GET['rating'] = 5;
} elseif ($_GET['rating'] < 1) {
$_GET['rating'] = 1;
}
$collection = $collectionsClass->rate($collectionID, $_GET['rating']);
$stars = '';
for ($i = 1; $i < 6; $i++) {
if ($collection['rating'] >= $i) {
$stars .= '<img src="{$template_data}img/star-on.png" alt="" class="left" />';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:rate.php
注:本文中的get_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论