本文整理汇总了PHP中menu_url函数的典型用法代码示例。如果您正苦于以下问题:PHP menu_url函数的具体用法?PHP menu_url怎么用?PHP menu_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了menu_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPageURL
public function getPageURL($gid)
{
$rows = $this->retrievePage(array('campaign_page.GID' => addslashes($gid)), array('orderby' => 'campaign_page.page_title', 'order' => 'ASC'));
$url = array();
foreach ($rows as $row) {
$url[$row['page_id']] = menu_url('page/' . $row['page_id']);
}
return $url;
}
示例2: registerRequire
public function registerRequire()
{
$this->load->model('setting_m');
$this->load->library('facebook');
if ($this->facebook->getUser() && isExtPermsAllowed()) {
if (!$this->isRegistered()) {
$ssl = $this->setting_m->get('SITE_URL') . 'index.php/' . menu_url('register', true);
header("Location: " . $ssl);
//redirect($ssl);
exit;
}
}
}
示例3: appAuth
function appAuth()
{
$CI =& get_instance();
$arg = array('appId' => $CI->config->item('APP_APPLICATION_ID'), 'secret' => $CI->config->item('APP_SECRET_KEY'));
//SETUP FACEBOOK API !!!IMPORTANT!!!
$CI->load->library('facebook', $arg);
//GETTING AUTHORIZED FACEBOOK USER
/* TODO : user re-Auth condition
if(!$CI->session->userdata('user')){
$CI->session->set_userdata('user',getAuthorizedUser(true));
}
*/
//HANDLING FACEBOOK REQUEST_IDS
if ($request_ids = fetchRequests()) {
$CI->session->set_userdata('user_request_ids', $request_ids);
deleteRequests();
}
//GET FACEBOOK SIGNED REQUEST
$signed_request = $CI->facebook->getSignedRequest();
//SETUP SIGNED REQUEST COOKIE FOR NEXT REQUEST
if (isset($_REQUEST['signed_request'])) {
@setcookie("fbsr_{$rows['APP_APPLICATION_ID']}", $_REQUEST['signed_request']);
}
//EXTRACT APP_DATA QUERY STRING FOR FACEBOOK PAGE URL REDIRECTION
if (isset($signed_request['app_data']) && $signed_request['app_data']) {
list($mode, $value) = explode("|", $signed_request['app_data']);
switch ($mode) {
case 'redirect':
redirect($value);
break;
case 'redirect_media':
redirect(menu_url('media') . '?m=' . $value);
break;
}
}
}
示例4: getPlugin
function getPlugin($media, array $switch)
{
$switch = $switch ? $switch : array('vote', 'fblike', 'fbcomment');
$url = menu_url('media') . '/?m=' . $media['media_id'];
$plugins = array('fblike' => '', 'fbcomment' => '', 'votebutton' => '');
if (in_array('fblike', $switch)) {
$plugins['fblike'] = $this->fblike($url);
} else {
$plugins['fblike'] = "";
}
if (in_array('vote', $switch)) {
$plugins['votebutton'] = $this->showVote($media);
$plugins['votebutton_mobile'] = $this->showMobileVote($media);
} else {
$plugins['votebutton'] = "";
$plugins['votebutton_mobile'] = "";
}
if (in_array('fbcomment', $switch)) {
$plugins['fbcomment'] = $this->fbcomment($url);
} else {
$plugins['fbcomment'] = "";
}
return $plugins;
}
示例5: while
</a>
<?php
if (has_menu_items()) {
?>
<nav id="main" role="navigation">
<ul>
<?php
while (menu_items()) {
?>
<li <?php
echo menu_active() ? 'class="active"' : '';
?>
>
<a href="<?php
echo menu_url();
?>
" title="<?php
echo menu_title();
?>
">
<?php
echo menu_name();
?>
</a>
</li>
<?php
}
?>
</ul>
</nav>
示例6: customer_register
function customer_register($action = null)
{
$campaign = $this->campaign_m->getActiveCampaign();
$this->load->library('facebook');
$action = $action ? $action : menu_url('register');
$form = new HTMLQuickForm2('customer_register', 'POST', 'data-ajax="false"');
$form->setAttribute('action', $action);
$user = getAuthorizedUser();
$form->addDataSource(new HTML_QuickForm2_DataSource_Array(array('FIRSTNAME' => isset($user['first_name']) ? $user['first_name'] : "", 'LASTNAME' => isset($user['last_name']) ? $user['last_name'] : "", 'EMAIL' => isset($user['email']) ? $user['email'] : "")));
//$form->addElement('static','','',array('content'=>'Your Firstname :'));
$firstname = $form->addElement('text', 'FIRSTNAME', '');
$firstname->setLabel('First Name');
$firstname->addRule('required', 'Firstname is required', null, HTML_QuickForm2_Rule::SERVER);
//$form->addElement('static','','',array('content'=>'Your Lastname :'));
$lastname = $form->addElement('text', 'LASTNAME', '');
$lastname->setLabel('Last Name');
$lastname->addRule('required', 'Lastname is required', null, HTML_QuickForm2_Rule::SERVER);
//$form->addElement('static','','',array('content'=>'Email :'));
$email = $form->addElement('text', 'EMAIL', '');
$email->setLabel('Email');
$email->addRule('required', 'Email is required', null, HTML_QuickForm2_Rule::SERVER);
//$form->addElement('static','','',array('content'=>'Phone no :'));
$areacode = $this->config->item('PHONE_INTL_CODE');
$form->addElement('static', '', '', array('content' => 'Phone prefixed with country (' . $areacode . ') & area code: ex. ' . $areacode . '21... ,' . $areacode . '812...'));
$mobile = $form->addElement('text', 'MOBILE', '');
$mobile->setLabel('Phone');
$mobile->addRule('required', 'Phone no. is required', null, HTML_QuickForm2_Rule::SERVER);
$mobile->addRule('regex', 'Phone number does not Valid', '/^' . $areacode . '[0-9]+$/', HTML_QuickForm2_Rule::SERVER);
$address = $form->addElement('textarea', 'ADDRESS', '');
$address->setLabel('Address');
$address->addRule('required', 'Address is required', null, HTML_QuickForm2_Rule::SERVER);
$terms = $form->addElement('group')->setLabel(" ");
$terms->addElement('checkbox', 'TERMS')->setContent('I accept Terms & Conditions');
$terms->addRule('required', 'Please Agreed The Terms and Condition', 1);
$SUBSCRIPTION = $form->addElement('group')->setLabel(" ");
$SUBSCRIPTION->addElement('checkbox', 'SUBSCRIPTIONID1', array('value' => $this->config->item('APP_APPLICATION_ID') . '|S"'))->setContent('Please send me news & updates');
$button = $form->addElement('submit', 'submit', 'data-role="none" value="Register"');
$button->setLabel(' ');
if ($form->validate()) {
$form->toggleFrozen(true);
$data = $form->getValue();
unset($data['submit'], $data['_qf__customer_register'], $data['TERMS']);
$data['GID'] = $campaign['GID'] . "_" . $this->config->item('APP_APPLICATION_ID');
if ($registered = $this->customer_m->add($data)) {
return "success";
} else {
return "error";
}
unset($data['submit'], $data['_qf__customer_register']);
$form->removeChild($button);
}
$renderer = HTML_QuickForm2_Renderer::factory('default');
$form_layout = $form->render($renderer);
return $form_layout;
}
示例7: media
public function media($media_id = null)
{
$this->load->library('facebook');
/** BEGIN REQUIRED VALIDATION **/
if (!$media_id) {
if (!($media_id = addslashes($this->input->get('m', TRUE)))) {
show_404();
}
}
$sr = $this->facebook->getSignedRequest();
$redirect_url = isset($sr['page']) ? $this->config->item('APP_FANPAGE') . "&app_data=redirect|" . current_url() : "http://apps.facebook.com/" . $this->config->item('APP_APPLICATION_ID') . "/media?m={$media_id}";
if (!($user = getAuthorizedUser(true))) {
redirect(mobile_menu_url('authorize') . '?ref=' . $redirect_url);
}
/** END REQUIRED VALIDATION **/
$this->load->model('setting_m');
if ($rowMedia = $this->media->detailMedia($media_id)) {
$campaign = $this->campaign->detailCampaign($rowMedia['GID']);
//if campaign out of date
$campaign_status = $this->campaign->getStatus($campaign);
if ($campaign_status['is_off'] || $rowMedia['media_status'] == 'pending' || $rowMedia['media_status'] == 'banned') {
$rowMedia['media_container'] = $this->media->showMedia($rowMedia, false);
$campaign['media_preview'] = true;
$this->load->view('mobile/mobile_media_preview', array('campaign' => $campaign, 'media' => $rowMedia));
} else {
$fblike_href = $this->setting_m->get('APP_CANVAS_PAGE') . menu_url('media', true) . '/?m=' . $rowMedia['media_id'];
$plugin_switch = array();
$plugin_switch[] = $campaign['media_has_vote'] && $campaign_status['on_vote'] ? 'vote' : null;
$plugin_switch[] = $campaign['media_has_fblike'] ? 'fblike' : null;
$plugin_switch[] = $campaign['media_has_fbcomment'] ? 'fbcomment' : null;
$plugin = $this->media->getPlugin($rowMedia, $plugin_switch);
$rowMedia['media_container'] = $this->media->showMedia($rowMedia, false);
$meta = $this->media->setOpenGraphMeta(array('title' => 'Photo Contest Beta', 'type' => 'activity', 'image' => $rowMedia['media_thumb_url'], 'url' => $fblike_href, 'site_name' => 'Photo Contest'));
registerMetaTags($meta);
$this->load->view('mobile/mobile_media', array('campaign' => $campaign, 'plugin' => $plugin, 'media' => $rowMedia));
}
} else {
show_404();
}
}
示例8: while
?>
">
<div class="body">
<!--[if lt IE 9]>
<div class="iemessage">
You are using an outdated browser. I recommend you upgrade
to <a href="http://chrome.google.com">Google Chrome</a>.
</div>
<![endif]-->
<nav>
<ul>
<?php
while (menu_items()) {
$classes = "";
$name = menu_name();
$href = menu_url();
if (menu_active()) {
$classes .= " active";
}
if ($name == "Posts") {
$classes .= " home";
$name = "N";
}
$classes = trim($classes);
?>
<li class="<?php
echo $classes;
?>
"><a href="<?php
echo $href;
?>
示例9: menu_url
<div class="main" id="success">
<div class="box box-m">
<div class="inner">
<h2 class="title"><?php
echo $message_title;
?>
</h2>
<p class="center" id="success-text">
<?php
echo $message_text;
?>
</p>
<div class="center">
<a href="<?php
echo menu_url('gallery');
?>
" class="button gold big">View Gallery</a>
</div>
</div>
</div>
</div>
<?php
echo isset($facebook_share_dialog) ? $facebook_share_dialog : "";
?>
<?php
echo $this->load->view('site/footer', $campaign, true);
示例10: foreach
?>
<div class="main">
<div class="box box-l">
<div class="inner">
<h2>THE WINNERS</h2>
<?php
if (isset($media) && !empty($media)) {
?>
<ul class="gallery-list center">
<?php
foreach ($media as $m) {
?>
<li>
<div class="thumbnail">
<a href="<?php
echo menu_url('media') . '/?m=' . $m['media_id'];
?>
" title="See detail">
<?php
echo $CI->media_m->showMedia($m);
?>
<span class="see-more"><i class="button">See detail</i></span>
</a>
</div>
<div class="owner"><fb:name uid="<?php
echo $m['uid'];
?>
" firstnameonly="true" /></div>
</li>
<?php
}
示例11: rules
public function rules()
{
$this->load->library('facebook');
/** BEGIN REQUIRED VALIDATION **/
if (!($campaign = $this->campaign->getActiveCampaign())) {
show_404();
}
$sr = $this->facebook->getSignedRequest();
$redirect_url = isset($sr['page']) ? $this->config->item('APP_FANPAGE') . "&app_data=redirect|" . current_url() : "http://apps.facebook.com/" . $this->config->item('APP_APPLICATION_ID') . "/rules";
if (!($user = getAuthorizedUser(true))) {
redirect(menu_url('authorize') . '?ref=' . $redirect_url);
}
/** END REQUIRED VALIDATION **/
$this->load->view('site/rules', array('campaign' => $campaign, 'rules' => $campaign['campaign_rules']));
}
示例12: getPages
public function getPages($GID)
{
$this->load->model('page_m', 'page');
$data = array();
if ($pages = $this->page->retrievePage(array('campaign_page.GID' => $GID))) {
foreach ($pages as $page) {
$data['pages'][] = array('id' => $page['page_id'], 'facebook' => $page['page_facebook'], 'mobile' => $page['page_mobile'], 'name' => $page['page_short_name'], 'url' => menu_url('page/' . $page['page_id']));
}
}
return $data;
}
示例13: appAuth
function appAuth()
{
$CI =& get_instance();
$CI->load->model('app_m');
$CI->load->model('setting_m', 'settings');
if ($CI->uri->segment(1) == 'campaign' || $CI->uri->segment(1) == 'mobile') {
if (preg_match('/^[0-9]+$/', $CI->uri->segment(2), $matches)) {
$APP_APPLICATION_ID = $matches[0];
if ($rows = $CI->app_m->detailApp($APP_APPLICATION_ID)) {
foreach ($rows as $k => $v) {
$CI->settings->set($k, $v);
}
if ($url = parse_url($rows['APP_FANPAGE'])) {
$new_url = $url['scheme'] . "://" . $url['host'] . $url['path'] . "?sk=app_" . $rows['APP_APPLICATION_ID'];
$CI->settings->set('APP_FANPAGE', $new_url);
}
$app_accesstoken = getAppAccessToken(array('app_id' => $rows['APP_APPLICATION_ID'], 'app_secret' => $rows['APP_SECRET_KEY']));
if ($app_accesstoken) {
if ($approw = getAppDetail($APP_APPLICATION_ID, $app_accesstoken)) {
$CI->settings->set('APP_CANVAS_PAGE', 'https://apps.facebook.com/' . $approw['namespace']);
$CI->settings->set('APP_CANVAS_URL', $approw['canvas_url']);
$CI->settings->set('APP_SECURE_CANVAS_URL', $approw['secure_canvas_url']);
$CI->settings->set('APP_PAGE_TAB_URL', $approw['page_tab_url']);
$CI->settings->set('APP_SECURE_PAGE_TAB_URL', $approw['secure_page_tab_url']);
$CI->settings->set('APP_LINK', $approw['link']);
$CI->settings->set('APP_LOGO_URL', $approw['logo_url']);
$CI->settings->set('APP_ACCESS_TOKEN', $app_accesstoken);
} else {
show_404();
}
} else {
show_404();
}
} else {
show_404();
}
//SETUP FACEBOOK API !!!IMPORTANT!!!
$CI->load->library('facebook', array('appId' => $rows['APP_APPLICATION_ID'], 'secret' => $rows['APP_SECRET_KEY']));
//GETTING AUTHORIZED FACEBOOK USER
/* TODO : user re-Auth condition
if(!$CI->session->userdata('user')){
$CI->session->set_userdata('user',getAuthorizedUser(true));
}
*/
//HANDLING FACEBOOK REQUEST_IDS
if ($request_ids = fetchRequests()) {
$CI->session->set_userdata('user_request_ids', $request_ids);
deleteRequests();
}
//GET FACEBOOK SIGNED REQUEST
$signed_request = $CI->facebook->getSignedRequest();
//SETUP SIGNED REQUEST COOKIE FOR NEXT REQUEST
if (isset($_REQUEST['signed_request'])) {
@setcookie("fbsr_{$rows['APP_APPLICATION_ID']}", $_REQUEST['signed_request']);
}
//EXTRACT APP_DATA QUERY STRING FOR FACEBOOK PAGE URL REDIRECTION
if (isset($signed_request['app_data']) && $signed_request['app_data']) {
list($mode, $value) = explode("|", $signed_request['app_data']);
switch ($mode) {
case 'redirect':
redirect($value);
break;
case 'redirect_media':
redirect(menu_url('media') . '?m=' . $value);
break;
}
}
} else {
show_404();
}
}
}
示例14: menu_url
?>
<div id="header">
<ul id="main-nav">
<li><a href="<?php
echo menu_url();
?>
">Home</a></li>
<li><a href="<?php
echo menu_url('gallery');
?>
">Gallery</a></li>
<?php
if ($campaign['on_judging'] && $campaign['winner_announced']) {
?>
<li><a href="<?php
echo menu_url('winner');
?>
">The Winner</a></li>
<?php
}
?>
<?php
if (isset($campaign['pages'])) {
foreach ($campaign['pages'] as $page) {
if ($page['facebook']) {
?>
<li><a href="<?php
echo $page['url'];
?>
"><?php
echo $page['name'];
示例15: while
<?php
if (has_menu_items()) {
while (menu_items()) {
?>
<li <?php
echo menu_active() ? 'class="active"' : '';
?>
>
<a href="<?php
echo menu_url();
?>
" title="<?php
echo menu_title();
?>
" <?php
echo substr(menu_url(), 0, 5) == '/ext-' ? 'target="_blank"' : '';
?>
>
<?php
echo menu_name();
?>
</a>
</li>
<?php
}
}
?>
<li>
<a href="<?php
echo rss_url();
?>