本文整理汇总了PHP中spUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP spUrl函数的具体用法?PHP spUrl怎么用?PHP spUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spUrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: step4
public function step4()
{
$this->front_page = host_url(spUrl('welcome', 'index'));
$this->admin_page = host_url(spUrl('admin', 'login'));
fopen('data/install.lock', 'w');
$this->display("install/step4.php");
}
示例2: deleteselect
function deleteselect()
{
$i_order = spClass("i_pay");
$param = $this->spArgs();
if (sizeof($param['chk_list']) > 0) {
foreach ($param['chk_list'] as $id) {
$i_order->deleteByPk($id);
}
}
$this->results = spUrl("i_pay_action", "index");
$this->display("ok.htm");
// 显示模板
}
示例3: buy
public function buy()
{
$item_id = $this->spArgs("mid");
if ($item_id && is_numeric($item_id)) {
$ptx_item = spClass('ptx_item');
$item = $ptx_item->get_item_by_id($item_id, ' ptx_item.promotion_url ');
if ($item['promotion_url']) {
$this->jump(str_ireplace('+', '%2B', $item['promotion_url']));
return;
}
}
$this->jump(spUrl('welcome', 'index'), 2, T('page_404_redirecting'));
}
示例4: __template_spUrl
public function __template_spUrl($params)
{
$geturl = basename(__FILE__);
$controller = $GLOBALS['G_DY']["default_controller"];
$action = $GLOBALS['G_DY']["default_action"];
$args = array();
$anchor = null;
foreach ($params as $key => $param) {
if ($key == $GLOBALS['G_DY']["url_controller"]) {
$controller = $param;
} elseif ($key == $GLOBALS['G_DY']["url_action"]) {
$action = $param;
} elseif ($key == 'anchor') {
$anchor = $param;
} else {
$args[$key] = $param;
}
}
return spUrl($geturl, $controller, $action, $args, $anchor);
}
示例5: make
/**
* 生成单个静态页面
*
* @param spurl spUrl的参数
* @param alias_url 生成HTML文件的名称,如果不设置alias_url,将使用年月日生成目录及随机数为文件名的形式生成HTML文件。
* @param update_mode 更新模式,默认2为同时更新列表及文件
* 0是仅更新列表
* 1是仅更新文件
*/
public function make($spurl, $alias_url = null, $update_mode = 2)
{
if (1 == spAccess('r', 'sp_html_making')) {
$this->spurls[] = array($spurl, $alias_url);
return;
}
@(list($controller, $action, $args, $anchor) = $spurl);
if ($url_item = spHtml::getUrl($controller, $action, $args, $anchor, TRUE)) {
@(list($baseuri, $realfile) = $url_item);
$update_mode = 1;
} else {
$file_root_name = '' == $GLOBALS['G_SP']['html']['file_root_name'] ? '' : $GLOBALS['G_SP']['html']['file_root_name'] . '/';
if (null == $alias_url) {
$filedir = $file_root_name . date('Y/n/d') . '/';
$filename = substr(time(), 3, 10) . substr(mt_rand(100000, substr(time(), 3, 10)), 4) . ".html";
} else {
$filedir = $file_root_name . dirname($alias_url) . '/';
$filename = basename($alias_url);
}
$baseuri = rtrim(dirname($GLOBALS['G_SP']['url']["url_path_base"]), '/\\') . "/" . $filedir . $filename;
$realfile = APP_PATH . "/" . $filedir . $filename;
}
if (0 == $update_mode or 2 == $update_mode) {
spHtml::setUrl($spurl, $baseuri, $realfile);
}
if (1 == $update_mode or 2 == $update_mode) {
$remoteurl = 'http://' . $_SERVER["SERVER_NAME"] . ':' . $_SERVER['SERVER_PORT'] . '/' . ltrim(spUrl($controller, $action, $args, $anchor, TRUE), '/\\');
$cachedata = file_get_contents($remoteurl);
if (FALSE === $cachedata) {
$cachedata = $this->curl_get_file_contents($remoteurl);
if (FALSE === $cachedata) {
spError("无法从网络获取页面数据,请检查:<br />1. spUrl生成地址是否正确!<a href='{$remoteurl}' target='_blank'>点击这里测试</a>。<br />2. 设置php.ini的allow_url_fopen为On。<br />3. 检查是否防火墙阻止了APACHE/PHP访问网络。<br />4. 建议安装CURL函数库。");
}
}
__mkdirs(dirname($realfile));
file_put_contents($realfile, $cachedata);
}
}
示例6: updatesave
function updatesave()
{
//更新o_order表
$o_order = spClass("o_order");
$row = $this->spArgs();
$order_id = $row['id'];
$orderTime = $row['orderTime'];
$row["username"] = $_SESSION["username"];
$conditions = array('id' => $row['id']);
$o_order->update($conditions, $row);
// echo $o_order->dumpSql();
//删除o_order_detail表中的有关$order_id记录
$o_order_detail = spClass("o_order_detail");
$o_order_detail->delete(array('orderId' => $order_id));
//插入o_order_detail表
$o_order_detail = spClass("o_order_detail");
if (strlen(trim($row['detail'])) > 0) {
$records = explode("@@@", $row['detail']);
for ($i = 0; $i < sizeOf($records); $i++) {
$single = $records[$i];
$arr = explode("___", $single);
$conditions = array("orderId" => $order_id, "productId" => $arr[0], "price" => $arr[1], "amount" => $arr[2]);
$o_order_detail->create($conditions);
}
}
$this->results = spUrl("o_order_action", "index");
$this->display("ok.htm");
// 显示模板
}
示例7: check_channel_item
public function check_channel_item()
{
if ($this->check_admin()) {
$act = $this->spArgs("act");
$channel_name = $this->spArgs("channel", 'taobao');
$channel = spClass("Channel");
$number = 50;
$page = $this->spArgs("page", 1);
$ptx_item = spClass('ptx_item');
$condition['reference_channel'] = 'taobao';
$items = $ptx_item->search(null, $page, $number, " ptx_item.reference_itemid,ptx_item.promotion_url,ptx_item.item_id ", NULL);
$pid = $this->settings['api_setting']['Taobao']['PID'];
foreach ($items as $item) {
if (!strpos($item['promotion_url'], $pid) && $item['reference_itemid']) {
$promotion = $channel->get_promotion_url($channel_name, $item['reference_itemid']);
sleep(1);
if ($promotion) {
$scon['item_id'] = $item['item_id'];
$ptx_item->updateField($scon, 'promotion_url', $promotion['promotion_url']);
}
}
}
if (array_length($items) > 0) {
$start = ($page - 1) * $number;
$end = $start + $number;
$str = T('processing_data') . "{$start}----{$end}";
$url = spUrl('admin', 'check_channel_item', array('page' => $page + 1));
admin_show_message($str, $this, $url, 1500);
return;
} else {
$str = T('processing_data_success');
$url = spUrl('admin', 'update_cache');
admin_show_message($str, $this, $url, 1500);
}
}
}
示例8: logout
/**
* logout page
*/
public function logout()
{
unset($_SESSION['codeBuilder_admin']);
$this->jump(spUrl('CodeBuilder', 'login'));
}
示例9: foreach
<?php
foreach ($comments as $comment) {
?>
<div class="comment">
<div class="shareface"><a class="trans07" href="<?php
echo spUrl('pub', 'index', array('uid' => $comment['user_id']));
?>
" data-user-id="<?php
echo $comment['user_id'];
?>
" data-user-profile="1"><img src="<?php
echo useravatar($comment['user_id'], 'middle');
?>
" class="avatar" width="30" height="30"></a></div>
<div class="shareinfo"><a href="<?php
echo spUrl('pub', 'index', array('uid' => $comment['user_id']));
?>
" data-user-id="<?php
echo $comment['user_id'];
?>
" data-user-profile="1"><?php
echo $comment['nickname'];
?>
</a><p><?php
echo parse_message(sysSubStr($comment['comment_txt'], 50, true));
?>
</p></div>
</div>
<?php
}
?>
示例10: spUrl
<script id="tags_pop_tpl" type="text/template">
<b class="arrow_t"><i class="arrow_inner_t"></i></b>
{{#data}}
<div class="tag_title">
<a href="<?php
echo spUrl("pin", "tgroup", array('tg' => '{{tag_id}}'));
?>
"><strong>{{tag_group_name_en}}</strong></a></div>
<ul class="taglist">
{{#tags}}
<li><a href="<?php
echo spUrl("pin", "index", array("tag" => '{{.}}'));
?>
">{{.}}</a></li>
{{/tags}}
</ul>
{{/data}}
<b class="arrow_b"><i class="arrow_inner_b"></i></b>
</script>
示例11: bind
public function bind()
{
$ptx_connector = spClass("ptx_connector");
$ptx_user = spClass("ptx_user");
if ($this->social_info) {
$social_user_info = $this->social_info;
} else {
$social_user_info = $this->session->get_data('social_info');
}
$vendor = $social_user_info['vendor'];
if (!$vendor) {
$this->error(T('your_social_info_invalid'), spUrl('pin', 'index'));
}
if ($nickname = $this->spArgs("nickname")) {
if ($this->check_nickname($nickname)) {
$data['email'] = md5(random_string('alnum', 5)) . '@' . T('domain.com');
$data['nickname'] = $nickname;
$data['avatar_remote'] = $social_user_info['avatar'];
$data['gender'] = $social_user_info['gender'];
$data['location'] = $social_user_info['location'];
$data['bio'] = $social_user_info['description'];
$data['passwd'] = md5(random_string('alnum', 8));
$data['create_time'] = time();
$data['is_active'] = 1;
$data['is_social'] = 1;
$uid = $ptx_user->add_one($data);
$connector_data['user_id'] = $uid;
$connector_data['social_userid'] = $social_user_info['uid'];
$connector_data['vendor'] = $vendor;
$connector_data['vendor_info'] = serialize($this->session->get_data('social_' . $vendor . '_info'));
$connector_data['username'] = $social_user_info['screen_name'];
$connector_data['name'] = $social_user_info['name'];
$connector_data['description'] = $social_user_info['description'];
$connector_data['homepage'] = $social_user_info['url'];
$connector_data['avatar'] = $social_user_info['avatar'];
$connector_data['email'] = $social_user_info['email'];
$connector_data['gender'] = $social_user_info['gender'];
$connector_data['location'] = $social_user_info['location'];
$ptx_connector->create($connector_data);
$this->save_remote_avatar($social_user_info['avatar'], $uid);
$user = $ptx_user->getuser_byid($uid);
$this->user_lib->set_session($user);
$this->clear_socialinfo($vendor);
$this->ajax_success_response(null, T('login_succeed'));
return;
} else {
$this->ajax_failed_response(T('nick_already_existed'));
}
} else {
$social_connector = $ptx_connector->get_bind_by_vendor_and_suid($vendor, $social_user_info['uid']);
if ($social_connector) {
if ($this->current_user['user_id'] && $social_connector['user_id'] != $this->current_user['user_id']) {
$this->error(T('social_account_already_bind'), spUrl('pin', 'index'));
} else {
$update_connect_data['avatar'] = $social_user_info['avatar'];
//$update_local_data['avatar_remote'] = $social_user_info['avatar'];
//need update remote avatar
$ptx_connector->update(array('connect_id' => $social_connector['connect_id']), $update_connect_data);
//$this->user_model->edit_user($social_connector['user_id'],$update_local_data);
$local_user = $ptx_user->getuser_byid($social_connector['user_id']);
$this->user_lib->set_session($local_user);
$this->clear_socialinfo($vendor);
$this->jump(spUrl('pin', 'index'));
}
} else {
if ($this->current_user['user_id']) {
$connector_data['user_id'] = $this->current_user['user_id'];
$connector_data['social_userid'] = $social_user_info['uid'];
$connector_data['vendor'] = $vendor;
$connector_data['vendor_info'] = serialize($this->session->get_data('social_' . $vendor . '_info'));
$connector_data['username'] = $social_user_info['screen_name'];
$connector_data['name'] = $social_user_info['name'];
$connector_data['description'] = $social_user_info['description'];
$connector_data['homepage'] = $social_user_info['url'];
$connector_data['avatar'] = $social_user_info['avatar'];
$connector_data['email'] = $social_user_info['email'];
$connector_data['gender'] = $social_user_info['gender'];
$connector_data['location'] = $social_user_info['location'];
$ptx_connector->create($connector_data);
$this->jump(spUrl('pin', 'index'));
} else {
$this->social_user_info = $social_user_info;
$this->output("social/index");
}
}
}
}
示例12: updatesave
function updatesave()
{
$model = spClass("user");
$param = $this->spArgs();
$conditions = array('id' => $param['id']);
$model->update($conditions, $param);
// echo($model->dumpSql());
$this->results = spUrl("user_action", "index");
$this->display("ok.htm");
// 显示模板
}
示例13: def_prompt
/**
* 默认的无权限提示跳转
*/
public function def_prompt()
{
$url = spUrl();
// 跳转到首页,在强制权限的情况下,请将该页面设置成可以进入。
echo "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><script>function sptips(){alert(\"Access Failed!\");location.href=\"{$url}\";}</script></head><body onload=\"sptips()\"></body></html>";
exit;
}
示例14: base_url
if ($permission['other_permission']['allow_video']) {
?>
<li><a href="#website_fetch" data-toggle="tab" class="video_share" data-action="switchPublish" data-params="video_share"><img alt="{lang video_share}" class="fig" src="<?php
echo base_url("assets/img/publish-video.png");
?>
">{lang video_share}</a></li>
<?php
}
?>
<li><a href="#article_share" data-toggle="tab" class="article_share" data-action="switchPublish" data-params="article_share"><img alt="{lang article_share}" class="fig" src="<?php
echo base_url("assets/img/publish-text.png");
?>
">{lang article_share}</a></li>
</ul>
<form id="save_share_form" data-url="" next-url="<?php
echo spUrl('pin', 'index');
?>
" method="post">
<input type="hidden" name="cover_filename" id="cover_filename">
<input type="hidden" name="item_id" id="item_id">
<input type="hidden" name="channel" id="channel">
<input type="hidden" name="share_type" id="share_type">
<input type="hidden" name="reference_url" id="reference_url">
<input type="hidden" name="all_files" id="all_files">
<input type="hidden" name="flv" id="flv">
<input type="hidden" name="groupid" id="groupid">
<input type="hidden" name="topicid" id="topicid">
<div class="tab-content" id="category_select_div">
<div class="well form-inline tab-pane" id="website_fetch">
<div class="input-prepend tab-pane">
<span class="add-on"><i class="icon-globe"></i></span><input type="text" name="remote_url" class="input-medium" id="remote_url" placeholder="{lang type_address_fetch}"/>
示例15: foreach
</div>
</fieldset>
</form>
</div>
<div class="span2 ml0">
<ul class="unstyled">
<li><strong>{lang already_register}?<a href="javascript:void(0);" data-action="openLoginDialog">{lang direct_login}</a></strong></li>
<?php
foreach ($vendors as $vendor) {
$lowerkey = strtolower($vendor);
?>
<?php
if ($settings['api_setting'][$vendor]['OPEN']) {
?>
<li><a href="<?php
echo spUrl('social', 'go', array('vendor' => $vendor));
?>
"><i class="loginico-<?php
echo $lowerkey;
?>
"></i></a></li>
<?php
}
?>
<?php
}
?>
</ul>
</div>
</div>
</div>