本文整理汇总了PHP中IUrl::creatUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP IUrl::creatUrl方法的具体用法?PHP IUrl::creatUrl怎么用?PHP IUrl::creatUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUrl
的用法示例。
在下文中一共展示了IUrl::creatUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submenu
public static function submenu($limitright)
{
$controllerObj = Mysite::$app->getController();
$controller = $controllerObj->getcontroller();
$action = $controllerObj->getaction();
$currentlink = '/' . $controller . '/' . $action;
$vcurrent = '/' . $controller . '/';
$link = IUrl::creatUrl('/other/ucenter');
$linkarray = array();
$is_find = false;
$alllimit = self::$limitmenu;
$doarray = array_keys($alllimit);
//所有限制权限
$limitarray = explode(',', $limitright);
//拥有权限
foreach (self::$menu as $key => $value) {
$temsublink = array();
$defalturl = '';
$i = 0;
foreach ($value as $linkurl => $linkname) {
//panduan linkurl 是否存在 limitright;
//不存在continue;
$checkrightname = explode('/', $linkurl);
if (in_array($checkrightname[2], $doarray)) {
if (!in_array($checkrightname[2], $limitarray)) {
continue;
}
}
$tempone = array();
$tempone['is_curent'] = false;
if ($currentlink == $linkurl) {
$tempone['is_curent'] = true;
$is_find = true;
}
$linkurl = substr($linkurl, 1, strlen($linkurl));
$tempone['urls'] = IUrl::creatUrl($linkurl);
$tempone['name'] = $linkname;
$temsublink[] = $tempone;
if ($i == 0) {
$defalturl = $tempone['urls'];
}
$i++;
}
if (empty($defalturl)) {
continue;
}
$tempuplink = array();
$tempuolink['is_curent'] = false;
if ($is_find == true) {
$tempuolink['is_curent'] = true;
}
//continue;
$tempuolink['urls'] = $defalturl;
$tempuolink['name'] = $key;
$tempuolink['det'] = $temsublink;
$linkarray[] = $tempuolink;
$is_find = false;
}
return $linkarray;
}
示例2: savesingle
function savesingle()
{
$id = IReq::get('uid');
$data['addtime'] = strtotime(IReq::get('addtime') . ' 00:00:00');
$data['title'] = IReq::get('title');
$data['content'] = IReq::get('content');
$data['code'] = IReq::get('code');
$data['seo_key'] = IFilter::act(IReq::get('seo_key'));
$data['seo_content'] = IFilter::act(IReq::get('seo_content'));
if (empty($id)) {
$link = IUrl::creatUrl('adminpage/single/module/addsingle');
if (empty($data['content'])) {
$this->message('单页内容不能为空', $link);
}
if (empty($data['title'])) {
$this->message('单页标题不能为空', $link);
}
$this->mysql->insert(Mysite::$app->config['tablepre'] . 'single', $data);
} else {
$link = IUrl::creatUrl('single/addsingle/id/' . $id);
if (empty($data['content'])) {
$this->message('单页内容不能为空', $link);
}
if (empty($data['title'])) {
$this->message('单页标题不能为空', $link);
}
$this->mysql->update(Mysite::$app->config['tablepre'] . 'single', $data, "id='" . $id . "'");
}
$link = IUrl::creatUrl('adminpage/single/module/singlelist');
$this->success('操作成功', $link);
}
示例3: __construct
/**
* @brief 构造函数
* @param $payment_id 支付方式ID
*/
public function __construct($payment_id)
{
//回调函数地址
$this->callbackUrl = IUrl::getHost() . IUrl::creatUrl("/block/callback/_id/" . $payment_id);
//回调业务处理地址
$this->serverCallbackUrl = IUrl::getHost() . IUrl::creatUrl("/block/server_callback/_id/" . $payment_id);
}
示例4: user_ico_upload
function user_ico_upload()
{
$result = array('isError' => true);
if (isset($_FILES['attach']['name']) && $_FILES['attach']['name'] != '') {
$photoObj = new PhotoUpload();
$photo = $photoObj->run();
if ($photo['attach']['img']) {
$user_id = $this->user['user_id'];
$user_obj = new IModel('user');
$dataArray = array('head_ico' => $photo['attach']['img']);
$user_obj->setData($dataArray);
$where = 'id = ' . $user_id;
$isSuss = $user_obj->update($where);
if ($isSuss !== false) {
$result['isError'] = false;
$result['data'] = IUrl::creatUrl() . $photo['attach']['img'];
ISafe::set('head_ico', $dataArray['head_ico']);
} else {
$result['message'] = '上传失败';
}
} else {
$result['message'] = '上传失败';
}
} else {
$result['message'] = '请选择图片';
}
echo '<script type="text/javascript">parent.callback_user_ico(' . JSON::encode($result) . ');</script>';
}
示例5: goods_img_upload
/**
* @brief 商品添加中图片上传的方法
*/
static function goods_img_upload()
{
//获得配置文件中的数据
$config = new Config("site_config");
$config_info = $config->getInfo();
$list_thumb_width = isset($config_info['list_thumb_width']) ? $config_info['list_thumb_width'] : 175;
$list_thumb_height = isset($config_info['list_thumb_height']) ? $config_info['list_thumb_height'] : 175;
$show_thumb_width = isset($config_info['show_thumb_width']) ? $config_info['show_thumb_width'] : 85;
$show_thumb_height = isset($config_info['show_thumb_height']) ? $config_info['show_thumb_height'] : 85;
//调用文件上传类
$photoObj = new PhotoUpload();
$photoObj->setThumb($show_thumb_width, $show_thumb_height, 'show');
$photoObj->setThumb($list_thumb_width, $list_thumb_height, 'list');
$photo = $photoObj->run();
//判断上传是否成功,如果float=1则成功
if ($photo['Filedata']['flag'] == 1) {
$list = $photo['Filedata']['thumb']['list'];
$list = strrchr($list, '/');
$id = substr($list, 1, strpos($list, '_') - 1);
$show = $photo['Filedata']['thumb']['show'];
$img = $photo['Filedata']['img'];
echo IUrl::creatUrl() . $show . '|' . $show . '|' . $img . '|' . $id . '|' . $photo['Filedata']['thumb']['list'] . '|' . '_' . $show_thumb_width . '_' . $show_thumb_height;
exit;
} else {
echo '0';
exit;
}
}
示例6: __construct
/**
* 构造函数
* @param string $style 风格
*/
public function __construct($style = 'red')
{
$this->path = IUrl::creatUrl() . 'plugins/sonline/';
echo <<<OEF
\t<link rel="stylesheet" href="{$this->path}style/{$style}.css" />
\t<script type="text/javascript" src="{$this->path}js/jquery.Sonline.js"></script>
OEF;
}
示例7: get
public static function get($image_url, $width = 100, $height = 100)
{
$ext = strrchr($image_url, '.');
$end = intval("-" . strlen($ext));
$real_url = substr($image_url, 0, $end) . "_{$width}_{$height}" . $ext;
if (file_exists($real_url)) {
return IUrl::creatUrl("") . $real_url;
}
return IUrl::creatUrl("") . PhotoUpload::thumb($image_url, $width, $height, "_{$width}_{$height}");
}
示例8: checkshoplogin
public function checkshoplogin()
{
$link = IUrl::creatUrl('member/shoplogin');
if ($this->member['uid'] == 0 && $this->admin['uid'] == 0) {
$this->message('未登陆', $link);
}
$shopid = ICookie::get('adminshopid');
if (empty($shopid)) {
$this->message('未登陆', $link);
}
}
示例9: __construct
/**
* @brief 构造函数
*/
public function __construct()
{
$payName = str_replace('pay_', '', get_class($this));
//获取域名地址
$sUrl = IUrl::getHost() . IUrl::creatUrl();
$sUrl = str_replace('plugins/', '', $sUrl);
//回调函数地址
$this->callbackUrl = str_replace('plugins/', '', IUrl::getHost() . IUrl::creatUrl("/block/callback/payment_name/{$payName}"));
//回调业务处理地址
$this->serverCallbackUrl = str_replace('plugins/', '', IUrl::getHost() . IUrl::creatUrl("/block/server_callback/payment_name/{$payName}"));
}
示例10: wxmenu
function wxmenu()
{
//构造微信 menu
$wxtoken = Mysite::$app->config['wxtoken'];
$errorlink = IUrl::creatUrl('adminpage/weixin/module/wxset');
if (empty($wxtoken)) {
$this->message('未设置微信基本信息', $errorlink);
}
$data['wxmenu'] = $this->mysql->getarr("select * from " . Mysite::$app->config['tablepre'] . "wxmenu order by sort desc");
Mysite::$app->setdata($data);
}
示例11: show
/**
* @brief 展示插件
* @param string $name 用户名
* @param string $pwd 密码
*/
public function show($name = '', $pwd = '')
{
$sessionName = ISafe::name();
$sessionId = ISafe::id();
$uploadUrl = IUrl::creatUrl($this->submit);
$admin_name = $name == '' ? ISafe::get('admin_name') : $name;
$admin_pwd = $pwd == '' ? ISafe::get('admin_pwd') : $pwd;
echo <<<OEF
\t\t<script type="text/javascript">
\t\twindow.onload = function()
\t\t{
\t\t\tnew SWFUpload({
\t\t\t\t// Backend Settings
\t\t\t\tupload_url: "{$uploadUrl}",
\t\t\t\tpost_params: {"{$sessionName}": "{$sessionId}","admin_name":"{$admin_name}","admin_pwd":"{$admin_pwd}"},
\t\t\t\t// File Upload Settings
\t\t\t\tfile_types : "*.jpg;*.jpge;*.png;*.gif",
\t\t\t\t// Event Handler Settings - these functions as defined in Handlers.js
\t\t\t\t// The handlers are not part of SWFUpload but are part of my website and control how
\t\t\t\t// my website reacts to the SWFUpload events.
\t\t\t\tswfupload_preload_handler : preLoad,
\t\t\t\tswfupload_load_failed_handler : loadFailed,
\t\t\t\tfile_queue_error_handler : fileQueueError,
\t\t\t\tfile_dialog_complete_handler : fileDialogComplete,
\t\t\t\tupload_progress_handler : uploadProgress,
\t\t\t\tupload_error_handler : uploadError,
\t\t\t\tupload_success_handler : uploadSuccess,
\t\t\t\tupload_complete_handler : uploadComplete,
\t\t\t\t// Button Settings
\t\t\t\tbutton_placeholder_id : "uploadButton",
\t\t\t\tbutton_width: 50,
\t\t\t\tbutton_height: 21,
\t\t\t\tbutton_text : '选择...',
\t\t\t\tbutton_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
\t\t\t\tbutton_cursor: SWFUpload.CURSOR.HAND,
\t\t\t\t// Flash Settings
\t\t\t\tflash_url : "{$this->path}swfupload.swf",
\t\t\t\tcustom_settings : {
\t\t\t\t\tupload_target : "divFileProgressContainer"
\t\t\t\t},
\t\t\t\t// Debug Settings
\t\t\t\tdebug: false
\t\t\t});
\t\t};
\t\t</script>
OEF;
}
示例12: savearea
function savearea()
{
$checinfo = Mysite::$app->config['psset'];
if (empty($checinfo)) {
$link = IUrl::creatUrl('area/adminpsset');
$this->message('请进行网站配送设置', $link);
}
$id = intval(IReq::get('uid'));
$data['name'] = IReq::get('name');
$data['orderid'] = intval(IReq::get('orderid'));
$data['pin'] = IReq::get('pin');
$data['parent_id'] = intval(IReq::get('parent_id'));
$data['imgurl'] = IReq::get('imgurl');
$data['is_com'] = intval(IReq::get('is_com'));
if (empty($id)) {
$data['lng'] = 0;
$data['lat'] = 0;
$link = IUrl::creatUrl('area/adminarealist');
if (empty($data['name'])) {
$this->message('地区名称不能为空', $link);
}
if (empty($data['pin'])) {
$this->message('拼音字母不能为空', $link);
}
if ($data['parent_id'] == 0 && empty($data['imgurl'])) {
$this->message('地址图标不能为空', $link);
}
$this->mysql->insert(Mysite::$app->config['tablepre'] . 'area', $data);
$areatempid = $this->mysql->insertid();
$tempdata['areaid'] = $areatempid;
$tempdata['shopid'] = 0;
$tempdata['cost'] = 0;
$this->mysql->insert(Mysite::$app->config['tablepre'] . "areatoadd", $tempdata);
$tempdata2['areaid'] = $areatempid;
$tempdata2['shopid'] = 0;
$this->mysql->insert(Mysite::$app->config['tablepre'] . "areashop", $tempdata2);
} else {
$link = IUrl::creatUrl('area/adminarealist/id/' . $id);
if (empty($data['name'])) {
$this->message('地区名称不能为空', $link);
}
if (empty($data['pin'])) {
$this->message('拼音字母不能为空', $link);
}
if ($data['parent_id'] == 0 && empty($data['imgurl'])) {
$this->message('地址图标不能为空', $link);
}
$this->mysql->update(Mysite::$app->config['tablepre'] . 'area', $data, "id='" . $id . "'");
}
$link = IUrl::creatUrl('area/adminarealist');
$this->success('操作成功!', $link);
}
示例13: wxmenu
public function wxmenu()
{
$this->checkshoplogin();
$shopid = ICookie::get('adminshopid');
if ($shopid > 0) {
//构造微信 menu
$wechat = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "shop_wechat where shopid={$shopid}");
$errorlink = IUrl::creatUrl('weixin/wxset');
if (empty($wechat)) {
$this->message('未设置微信基本信息', $errorlink);
}
$data['wxmenu'] = $this->mysql->getarr("select * from " . Mysite::$app->config['tablepre'] . "shop_wxmenu where shopid={$shopid} order by sort desc");
}
Mysite::$app->setdata($data);
}
示例14: notify_send
/**
* @brief 发送到货通知邮件
*/
function notify_send()
{
$smtp = new SendMail();
$error = $smtp->getError();
if ($error) {
$return = array('isError' => true, 'message' => $error);
echo JSON::encode($return);
exit;
}
$notify_ids = IFilter::act(IReq::get('notifyid'));
$message = '';
if ($notify_ids && is_array($notify_ids)) {
$ids = join(',', $notify_ids);
$query = new IQuery("notify_registry as notify");
$query->join = "right join goods as goods on notify.goods_id=goods.id left join user as u on notify.user_id = u.id";
$query->fields = "notify.*,u.username,goods.name as goods_name,goods.store_nums";
$query->where = "notify.id in(" . $ids . ")";
$items = $query->find();
//库存大于0,且处于未发送状态的 发送通知
$succeed = 0;
$failed = 0;
$tb_notify_registry = new IModel('notify_registry');
foreach ($items as $value) {
$body = mailTemplate::notify(array('{goodsName}' => $value['goods_name'], '{url}' => IUrl::getHost() . IUrl::creatUrl('/site/products/id/' . $value['goods_id'])));
$status = $smtp->send($value['email'], "到货通知", $body);
if ($status) {
//发送成功
$succeed++;
$data = array('notify_time' => ITime::getDateTime(), 'notify_status' => '1');
$tb_notify_registry->setData($data);
$tb_notify_registry->update('id=' . $value['id']);
} else {
//发送失败
$failed++;
}
}
}
$return = array('isError' => false, 'count' => count($items), 'succeed' => $succeed, 'failed' => $failed);
echo JSON::encode($return);
}
示例15: goodsupload
function goodsupload()
{
$link = IUrl::creatUrl('member/login');
if ($this->member['uid'] == 0 && $this->admin['uid'] == 0) {
$this->message('未登陆', $link);
}
$type = IReq::get('type');
$goodsid = intval(IReq::get('goodsid'));
$shopid = ICookie::get('adminshopid');
if ($shopid < 0) {
echo '无权限操作';
exit;
}
if (is_array($_FILES) && isset($_FILES['imgFile'])) {
$json = new Services_JSON();
$uploadpath = 'upload/shop/';
$filepath = '/upload/shop/';
$upload = new upload($uploadpath, array('gif', 'jpg', 'jpge', 'doc', 'png'));
//upload
$file = $upload->getfile();
if ($upload->errno != 15 && $upload->errno != 0) {
echo "<script>parent.uploaderror('" . json_encode($upload->errmsg()) . "');</script>";
} else {
if ($goodsid > 0 && $shopid > 0) {
$data['img'] = $filepath . $file[0]['saveName'];
$this->mysql->update(Mysite::$app->config['tablepre'] . 'goods', $data, "id='" . $goodsid . "' and shopid='" . $shopid . "'");
}
echo "<script>parent.uploadsucess('" . $filepath . $file[0]['saveName'] . "');</script>";
}
exit;
}
$imgurl = '';
if ($goodsid > 0 && $type == 'goods') {
$temp = $this->mysql->select_one("select img from " . Mysite::$app->config['tablepre'] . "goods where id='" . $goodsid . "' and shopid='" . $shopid . "'");
$imgurl = $temp['img'];
}
Mysite::$app->setdata(array('type' => $type, 'goodsid' => $goodsid, 'imgurl' => $imgurl));
}