本文整理汇总了PHP中getID函数的典型用法代码示例。如果您正苦于以下问题:PHP getID函数的具体用法?PHP getID怎么用?PHP getID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
function get($id)
{
$id = getID($id);
static $q = null;
\cf\createStaticQuery($q, "SELECT id, code, name, action, method, template FROM cf_form WHERE id=:id");
$form = \cf\query2array($q, array('id' => $id));
if ($form['template']) {
$form['template'] = \cf\query2array("\n\t\t\tSELECT name, subject, recipient, body \n\t\t\tFROM cf_mail_templates \n\t\t\tWHERE id=:id", array('id' => $form['template']));
} else {
$form['template'] = false;
}
static $qFields = null;
\cf\createStaticQuery($qFields, "\n\t\tSELECT code,type,name,fmt,descr,mandatory,max_length,min_length,value\n\t\tFROM cf_form_field\n\t\tWHERE form_id=:id\n\t\tORDER BY sort_order\n\t");
$form['fields'] = \cf\query2arrays($qFields, array('id' => $id), false, 'code');
foreach ($form['fields'] as &$f) {
$f['code'] = $form['code'] . '[' . $f['code'] . ']';
if ($f['type'] == 'radio' || $f['type'] == 'checkbox') {
$f['options'] = array();
foreach (explode(';', $f['fmt']) as $option) {
$f['options'][] = trim($option);
}
}
}
return $form;
}
示例2: getDuoshuoScript
public function getDuoshuoScript()
{
$short_name = $this->getConf('shortname');
$wiki_id = getID();
$wiki_title = tpl_pagetitle($wiki_id, true);
$host = $_SERVER['HTTPS'] ? "https" : "http";
$host = $host . "://" . $_SERVER['SERVER_NAME'];
$wiki_url = $host . wl($wiki_id);
$doc = '
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="" data-title="' . $wiki_title . '" data-url="' . $wiki_url . '"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"' . $short_name . '"};
(function() {
var ds = document.createElement("script");
ds.type = "text/javascript";ds.async = true;
ds.src = (document.location.protocol == "https:" ? "https:" : "http:") + "//static.duoshuo.com/embed.js";
ds.charset = "UTF-8";
(document.getElementsByTagName("head")[0]
|| document.getElementsByTagName("body")[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->';
return $doc;
}
示例3: Component
/**
* @param toiminto Toiminnon nimi jossa kyseinen komponentti sijaitsee.
*/
function Component($toiminto)
{
$this->ID = getID(get_class($this));
$this->TM = TranslationManager::instance();
$this->toiminto = $toiminto;
$_SESSION['IDS'][$this->ID] = 1;
}
示例4: loadService
/**
* Load the needed libraries and initialize the named oAuth service
*
* @param string $servicename
* @return null|\OAuth\Plugin\AbstractAdapter
*/
public function loadService(&$servicename)
{
$id = getID();
// $ID isn't set in trustExternal, yet
$servicename = preg_replace('/[^a-zA-Z_]+/', '', $servicename);
if (!$servicename) {
return null;
}
require_once __DIR__ . '/phpoauthlib/src/OAuth/bootstrap.php';
require_once __DIR__ . '/classes/AbstractAdapter.php';
require_once __DIR__ . '/classes/oAuthHTTPClient.php';
require_once __DIR__ . '/classes/oAuthStorage.php';
$file = __DIR__ . '/classes/' . $servicename . 'Adapter.php';
if (!file_exists($file)) {
return null;
}
require_once $file;
$class = '\\OAuth\\Plugin\\' . $servicename . 'Adapter';
/** @var \OAuth\Plugin\AbstractAdapter $service */
$service = new $class($this->redirectURI());
if (!$service->isInitialized()) {
msg("Failed to initialize {$service} authentication service. Check credentials", -1);
return null;
}
// The generic service can be externally configured
if (is_a($service->oAuth, 'OAuth\\OAuth2\\Service\\Generic')) {
$service->oAuth->setAuthorizationEndpoint($this->getAuthEndpoint($servicename));
$service->oAuth->setAccessTokenEndpoint($this->getTokenEndpoint($servicename));
}
return $service;
}
示例5: get
function get($id)
{
$id = getID($id);
static $q = null;
\cf\createStaticQuery($q, "SELECT IFNULL(code,id) AS id, file, file_name, file FROM cf_file WHERE id=:id");
return \cf\query2array($q, array('id' => $id));
}
示例6: isBlog
function isBlog()
{
if (getRootNS(getID()) == 'blog' || noNSorNS(getID()) == 'blog') {
return true;
} else {
return false;
}
}
示例7: Add
function Add($No, $isLast, $pdo)
{
$id = getID($No, $pdo);
$data = Fetch_Data($id, $pdo);
$last = $isLast;
$name = $data['Name'];
$phone = $data['phone'];
$email = $data['email'];
memberList($No, $id, $name, $phone, $email, $last);
}
示例8: checkNS
function checkNS($ns)
{
// This tests for root NS or pagename
//if ( (getRootNS(getID()) == $ns) || (noNSorNS(getID()) == $ns ) ) {
// This version just tests the namespace, not a pagename.
if (getRootNS(getID()) == $ns) {
return true;
}
return false;
}
示例9: getSearchObject
function getSearchObject()
{
list($sParamName, $sParamValue, $sParamValue1, $sParamValue2, $sParamValue3) = $this->aAddParams;
bx_import('Search', $this->oModule->_aModule);
$sClassName = $this->oConfig->getClassPrefix() . 'Search';
$oSearch = new $sClassName($sParamValue, $sParamValue1, $sParamValue2, $sParamValue3);
if (!empty($sParamValue) && !empty($sParamValue1) && isset($oSearch->aCurrent['restriction'][$sParamValue])) {
$oSearch->aCurrent['restriction'][$sParamValue]['value'] = 'owner' == $sParamValue ? getID($sParamValue1) : $sParamValue1;
}
return $oSearch;
}
示例10: determineLang
protected function determineLang()
{
/** @var helper_plugin_translation $trans */
$trans = plugin_load('helper', 'translation');
if ($trans) {
$value = $trans->getLangPart(getID());
if ($value) {
return $value;
}
}
global $conf;
return $conf['lang'];
}
示例11: onInitLangLoad
public function onInitLangLoad(Doku_Event $event, $param = null)
{
$id = getID();
if (page_exists($id)) {
return;
}
$page = $this->getActivity($id);
if ($page instanceof \SimpleXMLElement && $page->attributes()->redirect == 'true' && !empty($page->attributes()->new_id)) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . wl($page->attributes()->new_id));
die;
}
// else just notify spiders page does not exist 404, instead of 200
header("HTTP/1.1 404 Not Found");
}
示例12: handle_ajax_call_unknown
/**
* [Custom event handler which performs action]
*
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
* @return void
*/
public function handle_ajax_call_unknown(Doku_Event &$event, $param)
{
if ($event->data != 'rating') {
return;
}
$event->preventDefault();
$event->stopPropagation();
global $ID;
$ID = getID();
// let the other handler do it
$this->handle_vote($event, $param);
/** @var helper_plugin_rating $hlp */
$hlp = plugin_load('helper', 'rating');
$hlp->tpl(true);
}
示例13: test3
/**
* getID with given id in url and userewrite=2, no basedir set, dokuwiki not in document root.
*/
function test3()
{
global $conf;
$conf['basedir'] = '';
$conf['userewrite'] = '2';
$conf['baseurl'] = '';
$_SERVER['DOCUMENT_ROOT'] = '/var/www/';
$_SERVER['SCRIPT_FILENAME'] = '/usr/share/dokuwiki/doku.php';
$_SERVER['SCRIPT_NAME'] = '/dokuwiki/doku.php';
$_SERVER['REQUEST_URI'] = '/dokuwiki/doku.php/wiki:dokuwiki';
$_SERVER['PATH_INFO'] = '/wiki:dokuwiki';
$_SERVER['PATH_TRANSLATED'] = '/var/www/wiki:dokuwiki';
$_SERVER['PHP_SELF'] = '/dokuwiki/doku.php/wiki:dokuwiki';
$this->assertEqual(getID(), 'wiki:dokuwiki');
}
示例14: getUserLocation
function getUserLocation($sUser, $sPwd, $sNick)
{
if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
}
$iProfileId = getID($sNick, false);
$aLocation = BxDolService::call('wmap', 'get_location', array('profiles', $iProfileId, $iId));
if (-1 == $aLocation) {
return new xmlrpcval("-1");
}
if (!is_array($aLocation)) {
return new xmlrpcval("0");
}
return new xmlrpcval(array('lat' => new xmlrpcval($aLocation['lat']), 'lng' => new xmlrpcval($aLocation['lng']), 'zoom' => new xmlrpcval($aLocation['zoom']), 'type' => new xmlrpcval($aLocation['type']), 'address' => new xmlrpcval($aLocation['address']), 'country' => new xmlrpcval($aLocation['country'])), 'struct');
}
示例15: search
function search($term)
{
global $name, $path, $TweetsPulled, $TweetsAnalyzed, $tweets;
$name = $term;
$path = "Cache Files/cache" . $name . ".txt";
$id = getID($name);
$pic = getProfilePic($id, $name);
$max_id = getNextID($path);
//gets next tweet to cache, creates file if new cache to be made
$tweets = getTweets($name, $id, $TweetsPulled, $max_id);
if (!isset($tweets) || count($tweets) < 1) {
echo "<script> alert('Bad Twitter Handle'); </script>";
return;
}
$res = parseData($tweets, $TweetsAnalyzed);
}