本文整理汇总了PHP中get函数的典型用法代码示例。如果您正苦于以下问题:PHP get函数的具体用法?PHP get怎么用?PHP get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: findUser
/**
* @param $id
* @return \Delivery\Entity\User
*/
public function findUser($id)
{
if ($this->cache->has($id)) {
$entity = $this->cache->get($id);
} else {
$entity = $this->repository->find($id);
}
return $entity;
}
开发者ID:thibault-lenestour,项目名称:continuousdelivery,代码行数:13,代码来源:User.php
示例2: EditCSV
function EditCSV()
{
$period = get('period', 'all');
$date_state = "";
if ($period != 'all') {
$from = get('from_date', '');
$to = get('to_date', '');
if ($from && $to) {
$from = explode('-', $from);
$to = explode('-', $to);
if (count($to) > 2 && count($from) > 2) {
$from_date = mktime(0, 0, 0, $from[1], $from[2], $from[0]);
$to_date = mktime(23, 59, 59, $to[1], $to[2], $to[0]);
}
}
$date_state = " AND (o.order_date BETWEEN '" . $from_date . "' AND '" . $to_date . "')";
}
$filename = $this->name . '_' . date('Y-m-d') . '.csv';
$data = $this->str('art') . ';' . $this->str('art2') . ';' . $this->str('name') . ';' . $this->str('manufacturer') . ';' . $this->str('catalog') . ';' . $this->str('order_id') . ';' . $this->str('order_date') . ';' . $this->str('quantity') . ';' . $this->str('price') . ';' . $this->str('customer_price') . "\n";
$client_id = get('client_id', NULL);
if (isset($client_id)) {
$rows = $this->getRows("SELECT p.art, p.art2, p.name, m.name as manufacturer, t.name as catalog, o.id as order_id, DATE_FORMAT(FROM_UNIXTIME(o.order_date),'%Y-%m-%d') as order_date, c.quantity, c.price, c.customer_price\n FROM orders AS o, cart AS c, elem_product AS ep\n LEFT JOIN products AS p ON c.product_id = p.id\n LEFT JOIN manufacturers AS m ON m.id = p.manufacturer_id\n LEFT JOIN tree AS t ON ep.pid = t.id\n LEFT JOIN auth_users AS c1 ON o.client_id=c1.id\n WHERE c.order_id=o.id AND ep.id=p.id AND o.status IN ('Delivered', 'ReadyPaid') " . $date_state . " AND o.client_id=" . $client_id . " ORDER BY o.order_date");
} else {
$sql = "SELECT p.art, p.art2, p.name, m.name as manufacturer, t.name as catalog, o.id as order_id, DATE_FORMAT(FROM_UNIXTIME(o.order_date),'%Y-%m-%d') as order_date, c.quantity, c.price, c.customer_price\n FROM orders AS o, cart AS c, elem_product AS ep\n LEFT JOIN products AS p ON c.product_id = p.id\n LEFT JOIN manufacturers AS m ON m.id = p.manufacturer_id\n LEFT JOIN tree AS t ON ep.pid = t.id\n WHERE c.order_id = o.id AND ep.id=p.id AND o.status IN ('Delivered', 'ReadyPaid') " . $date_state . " ORDER BY o.order_date";
$rows = $this->getRows($sql);
}
if ($rows) {
foreach ($rows as $i => $row) {
$data .= $row['art'] . ';' . $row['art2'] . ';' . $row['name'] . ';' . $row['manufacturer'] . ';' . $row['catalog'] . ';' . $row['order_id'] . ';' . $row['order_date'] . ';' . $row['quantity'] . ';' . $row['price'] . ';' . $row['customer_price'] . "\n";
}
}
$zip = new ss_zip('', 6);
$zip->add_data($filename, $data);
$zip->save($filename . ".zip", 'd');
}
开发者ID:romlg,项目名称:cms36,代码行数:35,代码来源:cart.php
示例3: ElemInit
function ElemInit()
{
$columns = sql_getRows("SHOW COLUMNS FROM " . $this->elem_table . "", true);
if (!isset($columns['footer_text_radio'])) {
sql_query("ALTER TABLE " . $this->elem_table . " ADD footer_text_radio TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0 - редактор текста; 1 - html-код баннера'");
}
if (!isset($columns['footer_title'])) {
sql_query("ALTER TABLE {$this->elem_table} ADD footer_title VARCHAR( 255 ) NOT NULL COMMENT 'Название кнопки Подробнее';");
}
if (!isset($columns['footer_title_link'])) {
sql_query("ALTER TABLE {$this->elem_table} ADD footer_title_link VARCHAR( 255 ) NOT NULL COMMENT 'Ссылка на кнопке Подробнее';");
}
$id = (int) get('id');
if ($id) {
$infoblock_end = sql_getRow("SELECT * FROM " . $this->elem_table . " WHERE id = " . $id);
if ($infoblock_end['footer_text_radio']) {
$this->elem_fields['columns']['footer_text']['value'] = htmlspecialchars($infoblock_end['footer_text']);
$this->elem_fields['columns']['footer_text_area']['value'] = $infoblock_end['footer_text'];
} else {
$this->elem_fields['columns']['footer_text_fck']['value'] = $infoblock_end['footer_text'];
}
}
$this->script .= "\n\n function elem1(name) {\n return \$('#tr_fld\\\\[" . $this->tabname . "\\\\]\\\\[' + name + '\\\\]');\n }\n\n function elemName1(name) {\n return 'fld[" . $this->tabname . "][' + name + ']';\n };\n\n function getFck1(name) {\n name = elemName1(name);\n for(nameFck in CKEDITOR.instances) {\n if(name == nameFck) {\n return CKEDITOR.instances[name];\n }\n }\n }\n\n function open_fck_footer(name_fck, name_area) {\n var fck = getFck1(name_fck);\n var footer_text_fck = \$(elem1(name_fck));\n var footer_text_area = \$(elem1(name_area));\n\n footer_text_fck.children('span').show();\n footer_text_area.hide();\n\n var data = footer_text_area.children('textarea').val();\n if (data.length) fck.setData(data);\n\n fck.container.show();\n fck.updateElement();\n }\n\n function close_fck_footer(name_fck, name_area) {\n var fck = getFck1(name_fck);\n var footer_text_fck = \$(elem1(name_fck));\n var footer_text_area = \$(elem1(name_area));\n fck.container.hide();\n fck.updateElement();\n\n footer_text_fck.children('span').hide();\n footer_text_area.show();\n footer_text_area.children('textarea').css({\n 'width' : '98%',\n 'height' : fck.config.height\n });\n\n var data = fck.getData();\n if (data.length) footer_text_area.children('textarea').val(data);\n }\n\n \$(function () {\n var footer_text_radio = \$(elem1('footer_text_radio')).children('input');\n \$(footer_text_radio).click(function() {\n if(\$(this).val() == 1) {\n close_fck_footer('footer_text_fck', 'footer_text_area');\n } else {\n open_fck_footer('footer_text_fck', 'footer_text_area');\n }\n });\n\n CKEDITOR.on( 'instanceReady', function( ev )\n {\n " . (isset($infoblock_end) && $infoblock_end['footer_text_radio'] ? "close_fck_footer" : "open_fck_footer") . "('footer_text_fck', 'footer_text_area');\n });\n });\n ";
TElems::ElemInit();
}
开发者ID:romlg,项目名称:cms36,代码行数:25,代码来源:elem_blockend_base.php
示例4: GetTable
function GetTable()
{
global $limit;
$offset = (int) get('offset');
$limit = (int) get('limit', $this->Param('limit', $limit));
$search = get('find', '');
$search_state = '';
if (!empty($search)) {
$search_state = ' AND (pag.uri LIKE "' . $search . '" OR pag.host LIKE "' . $search . '")';
}
// create temp table
sql_query("\n\t\t\tCREATE TEMPORARY TABLE tmp_stat_popular\n\t\t\tSELECT\n\t\t\t\tlog.page_id AS page_id,\n\t\t\t\tpag.uri AS page,\n\t\t\t\tpag.host AS host\n\t\t\tFROM " . $this->log_table . " AS log\n\t\t\t\tLEFT JOIN " . $this->sess_table . " AS sess USING (sess_id)\n\t\t\t\tLEFT JOIN " . STAT_PAGES_TABLE . " AS pag ON pag.id=log.page_id\n\t\t\tWHERE log.status=200 AND sess.robot=0 {$search_state}");
$count = sql_getValue("SELECT COUNT(DISTINCT(page_id)) FROM tmp_stat_popular");
$total_value = sql_getValue("SELECT COUNT(*) FROM " . $this->log_table . " AS log\n LEFT JOIN " . $this->sess_table . " AS sess USING (sess_id)\n LEFT JOIN " . STAT_PAGES_TABLE . " AS pag ON pag.id=log.page_id\n WHERE log.status=200 AND sess.robot=0");
$data = sql_getRows("SELECT page, COUNT(*) AS kol, COUNT(*)/" . $total_value . "*100 AS proc, host, page_id FROM tmp_stat_popular GROUP BY page_id ORDER BY kol DESC LIMIT " . $offset . ", " . $limit);
//$uri="http://doki/sell";
// Добавление последнего слэша если он отсутствует в uri.
//if((substr($uri,0,-1)!='/') && (stristr($uri,'.') || stristr($uri,'?'))) {
// $uri .= '/';
//} else {
//if()
//}
//if (substr($uri,-1,1) != '/' && !stristr($uri,'.') && !stristr($uri,'?')){
// $uri .= '/';
//}
//pr($uri);
$total_head = array('', $this->_str('viewed'));
$total[] = array($this->str('total_period'), $total_value);
// Main Table
$ret['table'] = $this->stat_table(array('columns' => array(array('header' => 'page', 'nowrap' => 1, 'type' => 'page'), array('header' => 'viewed', 'align' => 'right', 'width' => '20%'), array('header' => 'percent', 'align' => 'right', 'width' => '50%', 'type' => 'graph')), 'data' => $data, 'total' => $total, 'total_head' => $total_head, 'count' => $count, 'offset' => $offset, 'limit' => $limit));
return $ret;
}
开发者ID:romlg,项目名称:cms36,代码行数:32,代码来源:stat_popular.php
示例5: Process
function Process()
{
$this->CheckAdminPrivs('refund');
$id = get('id', 'number');
$order = logic('order')->GetOne($id);
if (!$order)
{
$this->Messager(__('找不到相关订单!'), '?mod=order');
}
$user = user($order['userid'])->get();
$payment = logic('pay')->SrcOne($order['paytype']);
$paylog = logic('pay')->GetLog($order['orderid'], $order['userid']);
$coupons = logic('coupon')->SrcList($order['userid'], $order['orderid'], TICK_STA_ANY);
$express = logic('express')->SrcOne($order['expresstype']);
$address = logic('address')->GetOne($order['addressid']);
$refund = logic('refund')->GetOne($order['orderid']);
$order['ypaymoney'] = ($order['totalprice'] > $order['paymoney']) ? number_format(($order['totalprice'] - $order['paymoney']),2) : 0;
$order['tpaymoney'] = $order['totalprice'];
if($order['product']['type'] == 'ticket'){
$coupo = logic('coupon')->SrcList($order['userid'], $id);
if($order['productnum'] != count($coupo) && $coupo[0]['mutis'] == 1){
$order['tpaymoney'] = count($coupo)*$order['productprice'];
$order['tmsg'] = array(
'money' => $order['paymoney'],
'tnum' => $order['productnum'],
'num' => $order['productnum']-count($coupo)
);
}
}
include handler('template')->file('@admin/refund_process');
}
开发者ID:pf5512,项目名称:phpstudy,代码行数:31,代码来源:refund.mod.php
示例6: raspberrypi_controller
function raspberrypi_controller()
{
global $mysqli, $session, $route, $user;
include "Modules/raspberrypi/raspberrypi_model.php";
$raspberrypi = new RaspberryPI($mysqli);
$result = false;
// html views
if ($route->format == 'html') {
if ($route->action == "config" && $session['write']) {
$result = view("Modules/raspberrypi/raspberrypi_view.php", array('settings' => $raspberrypi->get()));
}
if ($route->action == "api" && $session['write']) {
$result = view("Modules/raspberrypi/raspberrypi_apipage.php", array());
}
}
// JSON api
if ($route->format == 'json') {
if ($route->action == "set" && $session['write']) {
$result = $raspberrypi->set($session['userid'], $user->get_apikey_write($session['userid']), get('fields'));
}
if ($route->action == "get" && ($session['read'] || $_SERVER['REMOTE_ADDR'] == $_SERVER['SERVER_ADDR'])) {
$result = $raspberrypi->get();
}
if ($route->action == "setrunning" && ($session['write'] || $_SERVER['REMOTE_ADDR'] == $_SERVER['SERVER_ADDR'])) {
$result = $raspberrypi->set_running();
}
if ($route->action == "getrunning" && $session['read']) {
$result = $raspberrypi->get_running();
}
}
return array('content' => $result);
}
开发者ID:kenpi2b,项目名称:pkg-emoncms-module-rfm12pi,代码行数:32,代码来源:raspberrypi_controller.php
示例7: doTransaction
function doTransaction($url, $api, $trans_id_post, $id_get_post)
{
$trans_id = $trans_id_post;
$id_get = $id_get_post;
$result = get($url, $api, $trans_id, $id_get);
return $result;
}
开发者ID:VSG24,项目名称:ccms,代码行数:7,代码来源:payline_ir.php
示例8: output
function output()
{
global $db, $geoimage;
$a_node = $db->get('latitude, longitude, elevation', 'nodes', "id = '" . get('a_node') . "'");
$b_node = $db->get('latitude, longitude, elevation', 'nodes', "id = '" . get('b_node') . "'");
$width = (int) $_GET['width'];
$height = (int) $_GET['height'];
if ($width == 0) {
$width = 600;
}
if ($height == 0) {
$height = 300;
}
$point_a = new coordinate($a_node[0]['latitude'], $a_node[0]['longitude']);
$point_b = new coordinate($b_node[0]['latitude'], $b_node[0]['longitude']);
if (!isset($_GET['frequency'])) {
//Get the AP frequency and use that
$a_link_data = $db->get('frequency,type', 'links', "node_id = '" . get('a_node') . "' and frequency > 0");
$b_link_data = $db->get('frequency,type', 'links', "node_id = '" . get('b_node') . "' and frequency > 0");
$apFreq = $a_link_data[0]['type'] == 'ap' ? $a_link_data[0]['frequency'] : ($b_link_data[0]['type'] == 'ap' ? $b_link_data[0]['frequency'] : '');
if ($apFreq > 0) {
$point_a->freq = (int) $apFreq;
}
}
$image = $geoimage->plotlink($width, $height, $point_a, $point_b, (int) $a_node[0]['elevation'], (int) $b_node[0]['elevation']);
header('Content-type: image/png');
imagepng($image);
exit;
}
开发者ID:southern-wind,项目名称:wind,代码行数:29,代码来源:nodes_plot.php
示例9: parse_images
function parse_images($str)
{
$link = isset($str[2]) ? $str[2] : "";
if (strpos($str[1], "document.") !== false) {
return "";
}
// bugfix for javascript bs
$url = preg_replace("/.*src\\s*=\\s*[\"']?\\s*(\\S+?)(?:[\\1\\s>]|\$).*/i", "\\1", $str[1]);
$part = preg_match("/(?:https?|ftp):\\/\\/(.+?)(?:\\/|\$).*/i", $url, $matches);
$extra = " ondblclick=\"if(this.parentNode.tagName != 'A') window.open(this.alt)\"";
if (!$part) {
return $str[0];
}
$hide = session('hidemedia') ? true : false;
if (get('media') && session('hidemedia')) {
$hide = false;
}
if (get('media') && !session('hidemedia')) {
$hide = true;
}
if ($hide) {
return "<a href=\"{$url}\">IMAGE REMOVED CLICK TO VIEW</a> [{$matches['1']}]";
} else {
return "<img src=\"{$url}\" alt=\"{$url}\"{$extra}/>";
}
}
开发者ID:jmichaelward,项目名称:pgBoard,代码行数:26,代码来源:legacy.php
示例10: OneQuery
function OneQuery($query_key, $text, $limit = 1, $properties = null)
{
$url = 'http://gni.globalnames.org/name_strings.json?search_term=' . rawurlencode($text);
$limit = 5;
if (0) {
file_put_contents('tmp/r.txt', "URL = {$url}\n", FILE_APPEND);
}
$json = get($url);
if (0) {
file_put_contents('tmp/r.txt', $json . "\n", FILE_APPEND);
}
$obj = json_decode($json);
if (0) {
file_put_contents('tmp/r.txt', print_r($obj, true), FILE_APPEND);
}
$n = min($limit, $obj->name_strings_total);
for ($i = 0; $i < $n; $i++) {
$hit = new stdclass();
$hit->match = $obj->name_strings_total == 1;
$hit->name = $obj->name_strings[$i]->name;
$hit->id = $obj->name_strings[$i]->id;
similar_text($text, $hit->name, $hit->score);
$this->StoreHit($query_key, $hit);
}
}
开发者ID:rdmpage,项目名称:phyloinformatics,代码行数:25,代码来源:reconciliation_globalnames.php
示例11: add
public function add()
{
$self = $this;
$model = $this->model();
$structure = $this->structure($model);
$modalsize = $this->field()->modalsize();
$fieldsetName = get("fieldset");
$fieldsetStructure = $this->fieldsetStructure($fieldsetName);
if (!$fieldsetStructure) {
return $this->modal('error', array('text' => 'No fieldset with name "' . $fieldsetName . '" found.'));
}
$form = $this->form('add', array($model, $fieldsetStructure), function ($form) use($model, $structure, $self, $fieldsetName) {
$form->validate();
if (!$form->isValid()) {
return false;
}
$data = $form->serialize();
$data["_fieldset"] = $fieldsetName;
$structure->add($data);
$self->notify(':)');
$self->redirect($model);
});
$form->attr('action', panel()->urls()->current() . "?fieldset=" . get("fieldset"));
return $this->modal('add', compact('form', 'modalsize'));
}
开发者ID:TimOetting,项目名称:kirby-builder,代码行数:25,代码来源:controller.php
示例12: bhl_fetch_ocr_text
/**
* @brief Fetch BHL OCR text
*
* Fetch OCT text from BHL pagesummaryservice.aspx service, clean it, then store in local
* database. If we have already stored text for this page we retrieve local copy.
*
* @param PageID BHL PageID of page
*
* @return Cleaned text
*
*/
function bhl_fetch_ocr_text($PageID)
{
global $db;
//$refresh = true;
$refresh = false;
$text = '';
// Do we have this already in database?
$sql = 'SELECT * FROM rdmp_text
WHERE (PageID=' . $PageID . ') LIMIT 1';
$result = $db->Execute($sql);
if ($result == false) {
die("failed {$sql}");
}
if ($result->NumRows() == 1 && !$refresh) {
$text = $result->fields['ocr_text'];
} else {
$url = 'http://www.biodiversitylibrary.org/services/pagesummaryservice.ashx?op=FetchPageUrl&pageID=' . $PageID;
$url = 'http://www.biodiversitylibrary.org/api2/httpquery.ashx?op=GetPageOcrText&pageid=' . $PageID . '&apikey=' . '0d4f0303-712e-49e0-92c5-2113a5959159' . '&format=json';
$json = get($url);
if ($json != '') {
$j = json_decode($json);
//$text = $j[4];
$text = $j->Result;
//$text = utf8_decode($text);
$text = bhl_clean_ocr_text($text);
bhl_store_ocr_text($PageID, $text);
}
}
return $text;
}
开发者ID:rdmpage,项目名称:bioguid,代码行数:41,代码来源:bhl_text.php
示例13: OneQuery
function OneQuery($query_key, $text, $limit = 1, $properties = null)
{
$url = 'http://viaf.org/viaf/search?query=' . urlencode('local.personalNames all "' . $text . '"') . '&httpAccept=' . urlencode('application/rss+xml');
//echo $url . "\n";
$xml = get($url);
//echo $xml;
if ($xml != '') {
$dom = new DOMDocument();
$dom->loadXML($xml);
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('opensearch', 'http://a9.com/-/spec/opensearch/1.1/');
$xpath_query = "//opensearch:totalResults";
$count = 0;
$nodeCollection = $xpath->query($xpath_query);
foreach ($nodeCollection as $node) {
$count = $node->firstChild->nodeValue;
}
if ($count > 0) {
$xpath_query = "//item/title";
$nodeCollection = $xpath->query($xpath_query);
foreach ($nodeCollection as $node) {
$hit = new stdclass();
$hit->score = 1;
$hit->match = $count == 1;
$hit->name = $node->firstChild->nodeValue;
$nc = $xpath->query('../guid', $node);
foreach ($nc as $n) {
$hit->id = str_replace('http://viaf.org/viaf/', '', $n->firstChild->nodeValue);
}
$this->StoreHit($query_key, $hit);
}
}
}
}
开发者ID:rdmpage,项目名称:phyloinformatics,代码行数:34,代码来源:reconciliation_viaf.php
示例14: ElemEdit
function ElemEdit($id, $row)
{
$fld = get('fld', array(), 'p');
$row = $fld['genform'];
$error = '';
sql_query('BEGIN');
if (!$id) {
//добавляем форму
$form_id = $this->updateForm($row);
if (is_int($form_id)) {
} else {
$error = $form_id;
}
} else {
// редактируем форму
$form_id = $this->updateForm($row, $id);
if ($form_id == $id) {
} else {
$error = $form_id;
}
}
if (!$error) {
$_id = $this->updateFormElements($form_id, $row);
if ($_id !== true) {
$error = $_id;
}
}
if ($error) {
sql_query('ROLLBACK');
return $error;
} else {
sql_query('COMMIT');
return 1;
}
}
开发者ID:romlg,项目名称:cms36,代码行数:35,代码来源:elem_main.php
示例15: show_help
function show_help($module = '')
{
global $system;
$result = '';
if (empty($module)) {
$module = get('module', 'index');
}
$lang = curlang();
$help_dir = DATA_PATH . 'help/' . $lang . '/';
if (LOGGED_IN) {
if ($system->checkForRight('HELP')) {
$admin_link = '
<a href="' . RCMS_ROOT_PATH . '?module=help&edit=' . $module . '"><img title="' . __('Edit') . '" src="' . IMAGES_PATH . 'skins/edit_small.gif"></a>
<a href="#" onClick="if(confirm(\'' . __('Delete') . ': \\n' . str_replace('"', '″', $module) . '?\\n\')) document.location.href = \'' . RCMS_ROOT_PATH . '?module=help&delete=' . $module . '\'">
<img title="' . __('Delete') . '" src="' . IMAGES_PATH . 'skins/trash_small.gif">
</a><br/>
';
$add_link = '<a href="' . RCMS_ROOT_PATH . '?module=help&edit=' . $module . '"><img src="' . IMAGES_PATH . 'skins/add_help.png" title="' . __('Add') . ' ' . __('Help') . '" alt="' . __('Add') . ' ' . __('Help') . '" /></a> ';
} else {
$admin_link = '';
$add_link = '';
}
$modulename = $help_dir . make_safe_filename($module);
if (file_exists($modulename)) {
$help_chapter = file_get_contents($modulename);
$result = wf_modal(wf_img(IMAGES_PATH . 'skins/help.png', __('Context help')), __('Context help'), $admin_link . $help_chapter, '', '600', '300', 'accesskey="h"');
} else {
$result = $add_link;
}
}
return $result;
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:32,代码来源:api.astral.php
示例16: get_formatted_reference
function get_formatted_reference($ipni_id)
{
global $db;
$citation = '';
$sql = 'SELECT * FROM names WHERE Id="' . $ipni_id . '" LIMIT 1';
$result = $db->Execute($sql);
if ($result == false) {
die("failed [" . __FILE__ . ":" . __LINE__ . "]: " . $sql);
}
if ($result->NumRows() == 1) {
$identifier = '';
$guid = '';
if ($result->fields['doi'] != '') {
$guid = $result->fields['doi'];
}
if ($guid == '') {
if ($result->fields['jstor'] != '') {
$guid = 'http://www.jstor.org/stable/' . $result->fields['jstor'];
}
}
if ($guid != '') {
$url = 'http://localhost/~rpage/microcitation/www/darwincore.php?guid=' . $guid;
$json = get($url);
//echo $json;
$obj = json_decode($json);
$citation = $obj->html;
}
}
return $citation;
}
开发者ID:rdmpage,项目名称:the-plant-list-1-1,代码行数:30,代码来源:dump_references.php
示例17: pickup
function pickup()
{
if (get('subpage') != '') {
$p = "pickup_" . get('subpage');
$this->page = new $p();
}
}
开发者ID:southern-wind,项目名称:wind,代码行数:7,代码来源:pickup.php
示例18: __construct
public function __construct($data)
{
$this->keyboard = get($data, 'keyboard', []);
$this->resize_keyboard = get($data, 'resize_keyboard', true);
$this->one_time_keyboard = get($data, 'one_time_keyboard', true);
$this->selective = get($data, 'selective', false);
}
开发者ID:korchasa,项目名称:telegram-php,代码行数:7,代码来源:ReplyKeyboard.php
示例19: __construct
public function __construct()
{
if (!template_session::is_admin() and !template_session::is_editor()) {
if (get('ajax')) {
exit(RUDE_AJAX_ACCESS_VIOLATION);
}
return false;
}
switch (get('task')) {
case 'remove':
$status = departments::remove(get('id'));
break;
case 'add':
$status = departments::add(get('name'));
break;
case 'edit':
$status = departments::edit(get('id'), get('name'));
break;
default:
$status = false;
break;
}
if (get('ajax')) {
if ($status) {
exit(RUDE_AJAX_OK);
} else {
exit(RUDE_AJAX_ERROR);
}
}
return true;
}
开发者ID:ThisNameWasFree,项目名称:rude-univ,代码行数:31,代码来源:rude-template-departments.php
示例20: login
public static function login($redirect = '/')
{
if (self::user()) {
go(url($redirect));
}
self::kill();
$password = get('password');
$username = get('username');
if (empty($username) || empty($password)) {
return false;
}
// try to find the user
$account = self::load($username);
if (!$account) {
return array('status' => 'error', 'msg' => l::get('auth.error', 'Invalid username or password'));
}
// check for matching usernames
if (str::lower($account->username()) != str::lower($username)) {
return array('status' => 'error', 'msg' => l::get('auth.error', 'Invalid username or password'));
}
// check for a matching password
if (!self::checkPassword($account, $password)) {
return array('status' => 'error', 'msg' => l::get('auth.error', 'Invalid username or password'));
}
// generate a random token
$token = str::random();
// add the username.
$account->token = $token;
// store the token in the cookie
// and the user data in the session
cookie::set('authFrontend', $token, 60 * 60 * 24);
s::set('authFrontend.' . $token, $account->username());
go(url($redirect));
}
开发者ID:scheibome,项目名称:kirbycms-extensions,代码行数:34,代码来源:auth.php
注:本文中的get函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论