當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XWB_plugin::siteUrl方法代碼示例

本文整理匯總了PHP中XWB_plugin::siteUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP XWB_plugin::siteUrl方法的具體用法?PHP XWB_plugin::siteUrl怎麽用?PHP XWB_plugin::siteUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XWB_plugin的用法示例。


在下文中一共展示了XWB_plugin::siteUrl方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getPluginUrl

 /**
  * 獲取插件目錄所在的完整URL訪問地址
  * @param string $path 附加URL字符串,前麵不能加/
  * @return string
  */
 function getPluginUrl($path = '')
 {
     return XWB_plugin::siteUrl() . XWB_P_DIR_NAME . "/" . $path;
 }
開發者ID:chibimiku,項目名稱:xweibo_for_discuz_x2_php7,代碼行數:9,代碼來源:core.class.php

示例2: array

                    </div>
                </div>

            </form>
        </div>
        <div id="apihd_nv">
            <ul>
                <?php 
$tmp = array('navname' => '微博', 'filename' => 'xweibo.php', 'available' => 1, 'nav' => 'id="mn_xweibo" ><a href="xweibo.php" hidefocus="true" title="Xweibo" class="current">微博<span>Xweibo</span></a', 'navid' => 'mn_xweibo', 'level' => 0);
array_splice($_G['setting']['navs'], 1, 0, array($tmp));
?>
                <?php 
foreach ($_G['setting']['navs'] as $nav) {
    ?>
                <?php 
    $nav['nav'] = preg_replace('#href="(?!http)(.*?)"#', 'href="' . dirname(XWB_plugin::siteUrl()) . '/$1"', $nav['nav']);
    ?>
                <?php 
    if ($nav['available'] && (!$nav['level'] || $nav['level'] == 1 && $_G['uid'] || $nav['level'] == 2 && $_G['adminid'] > 0 || $nav['level'] == 3 && $_G['adminid'] == 1)) {
        ?>
                <?php 
        echo "<li {$nav['nav']}/li>";
        ?>
                <?php 
    }
    ?>
                <?php 
}
?>
            </ul>
        </div>
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:31,代碼來源:xwb_apihd.tpl.php

示例3: forShare

 /**
  * 獲取轉發主題信息 For DiscuzX1.5
  * @param $tid int 論壇thread id
  * @return array
  */
 function forShare($tid)
 {
     /* 主題URL */
     $baseurl = XWB_plugin::siteUrl();
     $topic_url = $baseurl . 'index.php?mod=topic&code=' . $tid;
     if (function_exists('get_full_url')) {
         $topic_url = get_full_url($baseurl, 'index.php?mod=topic&code=' . $tid);
     }
     $url = ' ' . $topic_url;
     /* 獲取微博信息 */
     $db = XWB_plugin::getDB();
     $topic = $db->fetch_first("SELECT `tid`,`content`,`imageid` FROM " . XWB_S_TBPRE . "topic WHERE tid='{$tid}'");
     if (empty($topic)) {
         return FALSE;
     }
     /* 轉碼 */
     $message = $this->_convert(trim($topic['content']));
     /* 過濾UBB與表情 */
     $message = $this->_filter($message);
     $message = strip_tags($message);
     /* 將最後附帶的url給刪除 */
     $message = preg_replace("|\\s*http:/" . "/[a-z0-9-\\.\\?\\=&_@/%#]*\$|sim", "", $message);
     /* 合並標題和鏈接 */
     $message = $message . $url;
     // 取出所有圖片
     $img_urls = array();
     if ($topic['imageid'] && XWB_plugin::pCfg('is_upload_image')) {
         $image_file = "/images/topic/" . jsg_face_path($topic['imageid']) . $topic['imageid'] . "_o.jpg";
         if (is_file(XWB_S_ROOT . $image_file)) {
             $img_urls[] = $baseurl . $image_file;
         }
     }
     return array('url' => $topic_url, 'message' => $message, 'pics' => array_map('trim', $img_urls));
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:39,代碼來源:xwb_plugins_publish.class.php

示例4:

echo XWB_plugin::getPluginUrl('images/xwb_' . XWB_S_VERSION . '.css');
?>
" />
</head>

<body>
<div class="bind-setting xwb-plugin">
	<p class="alert-tips">出錯啦!</p>
	<div class="bing-text">
		<p><?php 
echo $info;
?>
</p>
    </div>
    
    <div class="setting-box">
		<p><a href="<?php 
echo XWB_plugin::siteUrl();
?>
">返回首頁</a></p>
		<p><a href="http://bbs.x.weibo.com/" target="_blank">我是站長,尋求幫助</a></p>
    </div>
    
    
</div>



</body>
</html>
開發者ID:chibimiku,項目名稱:xweibo_for_discuz_x2_php7,代碼行數:30,代碼來源:xwb_show_error.tpl.php

示例5: _getSiteSpaceUrl

 /**
  * 獲取site的個人頁麵鏈接
  * @param int $uid
  * @param string
  */
 function _getSiteSpaceUrl($uid)
 {
     if (defined('XWB_S_SITEURL')) {
         return XWB_S_SITEURL . "/home.php?mod=space&uid=" . $uid;
     } else {
         return dirname(XWB_plugin::siteUrl()) . "/home.php?mod=space&uid=" . $uid;
     }
 }
開發者ID:chibimiku,項目名稱:xweibo_for_discuz_x2_php7,代碼行數:13,代碼來源:apiUser.xapi.php

示例6: _showBinging

 /**
  * 根據在首頁中顯示的浮層顯示對應的操作(內部函數,被authCallback最後調用)
  * 所有跟站點相關的對接,必須放到_showBinging
  * @param string $tipsType 類型
  * @uses showmessage(dz函數)
  */
 function _showBinging($tipsType)
 {
     global $_G;
     $sess = XWB_plugin::getUser();
     $referer = $sess->getInfo('referer');
     if (empty($referer)) {
         $referer = 'index.php';
     }
     //用於啟動浮層
     $GLOBALS['xwb_tips_type'] = $tipsType;
     //不完美解決方案
     if (0 != $_G['config']['output']['forceheader'] && 'UTF8' != XWB_S_CHARSET) {
         @header("Content-type: text/html; charset=" . $_G['config']['output']['charset']);
     }
     if ('autoLogin' == $tipsType) {
         $_G['cookie'][$this->_getBindCookiesName((int) $_G['uid'])] = 99999;
         //僅為了不顯示綁定按鈕
         $_G['username'] = empty($_G['username']) ? 'SinaAPIUser' : $_G['username'];
         if ($_G['setting']['allowsynlogin'] && 0 < $_G['uid']) {
             loaducenter();
             $ucsynlogin = $_G['setting']['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
             $param = array('username' => $_G['username'], 'uid' => $_G['uid'], 'usergroup' => '');
             showmessage('login_succeed', $referer, $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin));
         } else {
             showmessage('login_succeed', $referer, array('username' => $_G['username'], 'uid' => 0, 'usergroup' => ''));
         }
     } elseif ('siteuserNotExist' == $tipsType) {
         showmessage(XWB_plugin::L('xwb_site_user_not_exist'), '', array(), array(), 1);
     } elseif ('reg' == $tipsType) {
         showmessage(XWB_plugin::L('xwb_process_binding', 'openReg4dx'), null, array(), array(), 1);
     } elseif ('hasBinded' == $tipsType) {
         showmessage(XWB_plugin::L('xwb_process_binding', 'hasBind'), null, array(), array(), 1);
         //直接跳轉到bind頁麵
     } else {
         if (version_compare(XWB_S_VERSION, '2', '>=')) {
             $pluginid = 'sina_xweibo_x2';
         } else {
             $pluginid = 'sina_xweibo';
         }
         XWB_plugin::redirect(XWB_plugin::siteUrl(0) . 'home.php?mod=spacecp&ac=plugin&id=' . $pluginid . ':home_binding', 3);
     }
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:48,代碼來源:xwbAuth.mod.php

示例7: _getImage

 /**
  * 取得指定帖子圖片的數組
  * For DiscuzX1.5 增加去掉網絡圖片寬高值功能
  * @param $pid int 論壇posts id
  * @param $msg string 發布內容
  * @param $num int 需要返回的圖片數,默認為1張
  * @return array
  */
 function _getImage($pid, $msg, $num = 1)
 {
     global $_G;
     require_once XWB_S_ROOT . '/source/function/function_attachment.php';
     $db = XWB_plugin::getDB();
     $attachfind = $attachreplace = $attachments = array();
     //X2開始attachment才分表,摘抄getattachtablebypid函數
     if (version_compare(XWB_S_VERSION, '2', '>=')) {
         $tableid = DB::result_first("SELECT tableid FROM " . DB::table('forum_attachment') . " WHERE pid='{$pid}' LIMIT 1");
         $attachmentTableName = 'forum_attachment_' . ($tableid >= 0 && $tableid < 10 ? intval($tableid) : 'unused');
     } else {
         $attachmentTableName = 'forum_attachment';
     }
     $query = $db->query("SELECT * FROM " . DB::table($attachmentTableName) . " WHERE pid='{$pid}'");
     while ($attach = $db->fetch_array($query)) {
         // 隻使用附件為圖片、沒有閱讀權限和金錢權限、並且大小小於1M的發送到微博
         if ($attach['isimage'] && $attach['price'] == 0 && $attach['readperm'] == 0 && $attach['filesize'] <= 1024 * 1024) {
             if (!isset($_G['xwb_ftp_remote_url'])) {
                 $_G['xwb_ftp_remote_url'] = isset($_G['setting']['ftp']['attachurl']) ? $_G['setting']['ftp']['attachurl'] : '';
             }
             $attach['url'] = ($attach['remote'] ? $_G['xwb_ftp_remote_url'] : $_G['setting']['attachurl']) . 'forum/';
             $attachfind[] = "/\\[attach\\]{$attach['aid']}\\[\\/attach\\]/i";
             if (strpos($attach['url'], "://") != false) {
                 $attachreplace[] = '[attachimg]' . $attach['url'] . '/' . $attach['attachment'] . '[/attachimg]';
             } else {
                 $attachreplace[] = '[attachimg]' . XWB_plugin::siteUrl() . $attach['url'] . '/' . $attach['attachment'] . '[/attachimg]';
             }
         }
         $attachments[] = $attach;
     }
     if ($attachfind) {
         $msg = preg_replace($attachfind, $attachreplace, $msg);
     }
     /* 去掉網絡圖片寬高值 For DiscuzX1.5 2010-09-25 */
     $msg = preg_replace('|\\[img=\\d+,\\d+](.*?)\\[/img\\]|', '[img]\\1[/img]', $msg);
     // 還原<img>為[img]
     $msg = preg_replace('/<img[^>]+src="([^\'"]+)"[^>]+>/', "[img]\\1[/img]", $msg);
     $image_list = array();
     if (preg_match_all('!\\[(attachimg|img)\\]([^\\[]+)\\[/(attachimg|img)\\]!', $msg, $match, PREG_PATTERN_ORDER)) {
         if (count($match[2]) > $num) {
             $image_list = array_slice($match[2], 0, $num);
         } else {
             $image_list = $match[2];
         }
     }
     return $image_list;
 }
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:55,代碼來源:xwb_plugins_publish.class.php

示例8: _showBinging

 /**
  * 根據在首頁中顯示的浮層顯示對應的操作(內部函數,被authCallback最後調用)
  * 所有跟站點相關的對接,必須放到_showBinging
  * @param string $tipsType 類型
  * @uses showmessage(dz函數)
  */
 function _showBinging($tipsType)
 {
     //用於啟動浮層
     $GLOBALS['xwb_tips_type'] = $tipsType;
     //不完美解決方案
     if ('UTF-8' != strtoupper($GLOBALS['_J']['config']['charset'])) {
         @header("Content-type: text/html; charset=utf-8");
     }
     if ('autoLogin' == $tipsType) {
         $synlogin_result = '';
         if (true === UCENTER) {
             //加載Ucenter客戶端文件
             include_once ROOT_PATH . './api/uc_client/client.php';
             $ucuid = (int) $GLOBALS['_J']['config']['login_user']['ucuid'];
             if ($ucuid > 0) {
                 $synlogin_result = uc_user_synlogin($ucuid);
             }
         }
         //直接跳轉到首頁
         jsg_showmessage("登錄成功{$synlogin_result}", $this->redirect_to, 5);
     } elseif ('siteuserNotExist' == $tipsType) {
         jsg_showmessage(XWB_plugin::L('xwb_site_user_not_exist'));
     } elseif ('reg' == $tipsType) {
         jsg_showmessage(XWB_plugin::L('xwb_process_binding', 'openReg4jsg'));
     } elseif ('hasBinded' == $tipsType) {
         jsg_showmessage(XWB_plugin::L('xwb_process_binding', 'hasBind'));
         //直接跳轉到bind頁麵
     } else {
         XWB_plugin::redirect(XWB_plugin::siteUrl(0) . 'index.php?mod=account&code=sina', 3);
     }
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:37,代碼來源:xwbAuth.mod.php


注:本文中的XWB_plugin::siteUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。