本文整理汇总了PHP中JUri::Root方法的典型用法代码示例。如果您正苦于以下问题:PHP JUri::Root方法的具体用法?PHP JUri::Root怎么用?PHP JUri::Root使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUri
的用法示例。
在下文中一共展示了JUri::Root方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
/*layout for img ads only (ie. images only) */
$ht = '';
if ($addata->ignore != '') {
$ht .= '<span class="ad_ignore_button_span" style="display:none;"><img title="' . JText::_('CLK_ING') . '" class="ad_ignore_button layout5_ad_ignore_button" src="' . JUri::Root() . 'components/com_socialads/images/fbcross.gif" alt="" onClick="' . $addata->ignore . '" /></span>';
}
$ht .= '<div class="ad_prev_wrap layout5_ad_prev_wrap well well-small">';
/*Ad image starts here...*/
$ht .= '<!--div for preview ad-image-->
<div class="layout5_ad_prev_second">';
$ht .= '<a ' . $upload_area . ' href="' . $addata->link . ' " target="_blank">';
//$ht.= '<img class="layout5_ad_prev_img" alt="" src="'.JUri::Root().$addata->ad_image.'" border="0" />';
//changed in 2.7.5 beta 2
$ht .= $adHtmlTyped;
$ht .= '</a>';
$ht .= '</div>';
/*Ad image ends here*/
$ht .= '</div>';
echo $ht;
示例2: defined
* @package Kunena.Framework
*
* @copyright (C) 2008 - 2013 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
defined('_JEXEC') or die;
if (defined('KUNENA_LOADED')) {
return;
}
// Manually enable code profiling by setting value to 1
define('KUNENA_PROFILER', 0);
// Component name amd database prefix
define('KUNENA_COMPONENT_NAME', 'com_kunena');
define('KUNENA_COMPONENT_LOCATION', 'components');
define('KUNENA_NAME', substr(KUNENA_COMPONENT_NAME, 4));
// Component paths
define('KPATH_COMPONENT_RELATIVE', KUNENA_COMPONENT_LOCATION . '/' . KUNENA_COMPONENT_NAME);
define('KPATH_SITE', JPATH_ROOT . '/' . KPATH_COMPONENT_RELATIVE);
define('KPATH_ADMIN', JPATH_ADMINISTRATOR . '/' . KPATH_COMPONENT_RELATIVE);
define('KPATH_MEDIA', JPATH_ROOT . '/media/' . KUNENA_NAME);
// URLs
define('KURL_COMPONENT', 'index.php?option=' . KUNENA_COMPONENT_NAME);
define('KURL_SITE', JUri::Root() . KPATH_COMPONENT_RELATIVE . '/');
define('KURL_MEDIA', JUri::Root() . 'media/' . KUNENA_NAME . '/');
$libraryFile = JPATH_PLATFORM . '/kunena/bootstrap.php';
if (file_exists($libraryFile)) {
require_once $libraryFile;
}
// Kunena has been initialized
define('KUNENA_LOADED', 1);
示例3: getList
function getList()
{
$input = JFactory::getApplication()->input;
$addtype = $input->get('addtype');
//echo "1-----".
$zonlay = $input->get('zonelayout', '');
//echo "2-----".
$selected_layout1 = array();
if ($zonlay) {
JRequest::setVar('layout', $zonlay);
$selected_layout_arr = explode('|', $zonlay);
$i = 0;
foreach ($selected_layout_arr as $selected_layout) {
$selected_layout1[$i] = $selected_layout;
$i++;
}
}
if ($addtype == 'text') {
$layout_type = "Text";
} else {
if ($addtype == 'img') {
$layout_type = "Image";
} else {
if ($addtype == 'text_img') {
$layout_type = "Text And Image";
} else {
$layout_type = "";
$add_type[] = JHtml::_('select.option', '0', 'select');
JHtml::_('select.genericlist', $add_type, 'layout_select', 'class="inputbox" size=1', 'value', '');
exit;
}
}
}
$add_type = '';
//'<table><tbody><tr>';
$newvar = JPluginHelper::getPlugin('socialadslayout');
$sel_layout1 = array_values($selected_layout1);
foreach ($newvar as $k => $v) {
$params = explode("\n", $v->params);
foreach ($params as $pa => $p) {
if (JVERSION >= '1.6') {
$lay = json_decode($p);
if (isset($lay->layout_type)) {
if ($layout_type == $lay->layout_type) {
$chk = '';
$nam = substr($v->name, 5);
if (in_array($nam, $sel_layout1)) {
$chk = 'checked="yes"';
} else {
if ($layout_type == 'Image') {
$chk = 'checked="yes"';
}
}
$add_type .= '<span style = "vertical-align:text-top;">
<input type="checkbox" ' . $chk . ' name="layout_select" class="inputbox" value="' . $nam . '" />
<img src="' . JUri::root() . 'plugins/socialadslayout/plug_' . $nam . '/plug_' . $nam . '/layout.png" >
</span> ';
//JHtml::_('select.option', $nam , '<div class ="optimg" >'.$nam.'</div>' );
}
}
} else {
$lay = explode("=", $p);
if ($lay[0] == 'layout_type') {
if ($layout_type == $lay[1]) {
$chk = '';
$nam = substr($v->name, 5);
if (in_array($nam, $sel_layout1)) {
$chk = 'checked="yes"';
} else {
if ($layout_type == 'Image') {
$chk = 'checked="yes"';
}
}
$add_type .= '<span style = "vertical-align:text-top;">
<input type="checkbox" ' . $chk . ' name="layout_select" class="inputbox" value="' . $nam . '" />
<img src="' . JUri::Root() . 'plugins/socialadslayout/plug_' . $nam . '/layout.png" ></span> ';
//JHtml::_('select.option', $nam , '<div class ="optimg" >'.$nam.'</div>' );
}
}
}
}
}
//$add_type .='</tr></tbody></table>' ;
if ($add_type == '') {
echo JText::_('NO_LAY');
} else {
echo $add_type;
}
exit;
}
示例4: getAdPreview
function getAdPreview($adid, $showlink = 0)
{
require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
$document = JFactory::getDocument();
$document->addStyleSheet(JUri::base() . 'components/com_socialads/css/helper.css');
$document->addScript(JUri::base() . 'components/com_socialads/js/helper.js');
$user = JFactory::getUser();
if ($adid == 0) {
//Still unable to get the title and body. Check if it is stored in the following variables or not.
$buildadsession = JFactory::getSession();
$addata = $buildadsession->get('ad_data');
$pluginlist = $buildadsession->get('addatapluginlist');
$upimg = $buildadsession->get('upimg');
//by madhura
/*if($pluginlist != ''){
$img = $buildadsession->get('pluginimg');
}
else
{
$img = $buildadsession->get('upimg');
}
else
{
$img = $buildadsession->get('upimgcopy');
}*/
if ($buildadsession->get('upimg') != '') {
$img = $buildadsession->get('upimg');
} else {
if ($buildadsession->get('ad_image') != '') {
$img = $buildadsession->get('ad_image');
} else {
$img = $buildadsession->get('upimgcopy');
}
}
$title = $addata[2]['ad_title'];
$body = $addata[3]['ad_body'];
$link = "#";
} else {
$db = JFactory::getDBO();
$query = "SELECT * FROM #__ad_data WHERE ad_id =" . $adid;
$db->setQuery($query);
$addata = $db->loadObject();
$link = JUri::base() . "index.php?option=com_socialads&view=redirector&adid=" . $addata->ad_id;
$title = $addata->ad_title;
$img = $addata->ad_image;
$body = $addata->ad_body;
}
if ($socialads_config['ignore'] == 0 || $user->id == 0) {
$showlink = 2;
}
$html = '<div class="ad_prev_main">
<div class="ad_prev_wrap">';
if ($showlink == 0) {
$html .= '<img class="ad_ignore_button" src="' . JUri::Root() . 'components/com_socialads/images/fbcross.gif" onClick="ignore_ads(this,' . $adid . ',' . $socialads_config["feedback"] . ');" />
<div class="ad_prev_first">';
if ($link == '#') {
$html .= '<a class="ad_prev_anchor" href="' . $link . '">' . $title . '</a>';
} else {
$html .= '<a class="ad_prev_anchor" href="' . $link . '" target="_blank">' . $title . '</a>';
}
$html .= '</div>';
if ($img != '') {
$html .= '
<div class="ad_prev_second">
<a href="' . $link . ' " target="_blank">
<img class="ad_prev_img" width="' . $socialads_config['image_dimensions'] . '" "src="' . JUri::Root() . $img . '" border="0" />
</a>
</div>';
}
} else {
if ($showlink == 2) {
$html .= '<div class="ad_prev_first">';
if ($link == '#') {
$html .= '<a class="ad_prev_anchor" href="' . $link . '">' . $title . '</a>';
} else {
$html .= '<a class="ad_prev_anchor" href="' . $link . '" target="_blank">' . $title . '</a>';
}
$str = JUri::base();
$img = str_replace($str, '', $img);
$html .= '</div>';
if ($img != '') {
$html .= '
<div class="ad_prev_second">
<a href="' . $link . ' " target="_blank">
<img class="ad_prev_img" width="' . $socialads_config['image_dimensions'] . '" src="' . JUri::Root() . $img . '" border="0" />
</a>
</div>';
}
} else {
$html .= '<div class="ad_prev_first">';
$html .= $title;
$html .= '</div>';
if ($img != '') {
$html .= '
<div class="ad_prev_second">';
$str = JUri::base();
$img = str_replace($str, '', $img);
$html .= '<img class="ad_prev_img" width="' . $socialads_config['image_dimensions'] . '" src="' . JUri::Root() . $img . '" border="0" />
</div>';
}
//.........这里部分代码省略.........
示例5: getAdHTML
//.........这里部分代码省略.........
}
$addata->ignore = "";
$upload_area = '';
$left_class = ' row-fluid ';
if ($zone_data[0]->zone_type == 1 && $adseen == 0) {
$left_class = " pull-left ";
}
//For the orientation of the Ad ie Horizontal or Vertical
//$style = 'style="'.$float_style.'"';
$saad_entry_number = 0;
if ($adrotation == 1) {
$saad_entry_number = self::$ad_entry_number;
++self::$ad_entry_number;
}
@($html = '<div class = " ad_prev_main' . $mod_sfx . $left_class . ' " preview_for= "' . $addata->ad_id . '" ad_entry_number="' . $saad_entry_number . '" >');
if ($adseen == 0) {
if ($this->_my->id == 1) {
//$widget='';
if (!empty($_SERVER['HTTP_REFERER'])) {
$parse = parse_url($_SERVER['HTTP_REFERER']);
if ($widget != "") {
$widget = '&widget=' . $parse['host'] . '|' . $widget;
}
}
} else {
$widget = '&widget=' . $widget;
}
$addata->link = JUri::root() . substr(JRoute::_("index.php?option=com_socialads&task=adredirector&adid=" . $addata->ad_id . "&caltype=1" . $widget), strlen(JUri::base(true)) + 1);
if ($socialads_config['ignore'] != 0 && $this->_my->id != 0 && $this->_fromemail == 0) {
if ($this->_my->id != 1) {
$addata->ignore = "ignore_ads(this," . $addata->ad_id . "," . $socialads_config['feedback'] . ");";
}
//$html .= '<img class="ad_ignore_button" src="'.JUri::Root().'components/com_socialads/images/fbcross.gif" onClick="ignore_ads(this,'.$addata->ad_id.','.$socialads_config["feedback"].');" />';
}
}
$plugin = 'plug_' . $addata->layout;
$document->addStyleSheet(JUri::root() . 'components/com_socialads/css/helper.css');
$document->addScript(JUri::root() . 'components/com_socialads/js/helper.js');
$adRetriever = new adRetriever();
//START changed by manoj 2.7.5b2
//no passing zone id all time changed in 2.7.5 stable
if (!$adseen) {
$adHtmlTyped = $adRetriever->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $addata->layout, $track = 1, $adzone, $addata->ad_id);
} else {
if (!$addata) {
$adHtmlTyped = $adRetriever->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $addata->layout, $track = 0, $adzone);
} else {
$adHtmlTyped = $adRetriever->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $addata->layout, $track = 0, $adzone);
}
}
//END changed by manoj 2.7.5b2
if (JVERSION >= '1.6.0') {
$layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . $plugin . DS . 'layout.php';
} else {
$layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . 'layout.php';
}
if (JFile::exists($layout)) {
if (JVERSION >= '1.6.0') {
$document->addStyleSheet(JUri::root() . 'plugins/socialadslayout/' . $plugin . '/' . $plugin . '/layout.css', 'text/css', '', array("id" => $addata->layout . 'css'));
} else {
$document->addStyleSheet(JUri::root() . 'plugins/socialadslayout/' . $plugin . '/layout.css', 'text/css', '', array("id" => $addata->layout . 'css'));
}
ob_start();
include $layout;
$html .= ob_get_contents();
ob_end_clean();
} else {
/*Ad title starts here...*/
$html .= '<!--div for preview ad-title-->
<div class="ad_prev_first">';
if ($adseen == 0) {
$html .= '<a class="ad_prev_anchor" href="' . $addata->link . '" target="_blank">' . $addata->ad_title . '</a>';
} else {
$html .= $addata->ad_title;
}
$html .= '</div>';
/*Ad title ends here*/
/*Ad image starts here...*/
if ($addata->ad_image != '') {
//check it image exists
$html .= '<!--div for preview ad-image-->
<div class="ad_prev_second">';
if ($adseen == 0) {
$html .= '<a href="' . $addata->link . ' " target="_blank">';
}
$html .= '<img class="ad_prev_img" src="' . JUri::Root() . $addata->ad_image . '" border="0" />';
if ($adseen == 0) {
$html .= '</a>';
}
$html .= '</div>';
}
/*Ad image ends here*/
/*Ad description starts here...*/
$html .= '<!--div for preview ad-descrip-->
<div class="ad_prev_third">' . $addata->ad_body . '</div>';
/*Ad description ends here*/
}
$html .= '</div>';
return $html;
}
示例6: changelayout
function changelayout()
{
require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
$adseen = 2;
$document = JFactory::getDocument();
$input = JFactory::getApplication()->input;
//$post=$input->post;
//$input->get
$layout = $input->get('layout');
$addata = new stdClass();
$addata->ad_title = $input->get('title', '', 'STRING');
if ($addata->ad_title == '') {
$addata->ad_title = JText::_("EXAMPLEAD");
}
$addata->ad_body = $input->get('body', '', 'STRING');
if ($addata->ad_body == '') {
$addata->ad_body = JText::_('SAMPLEAD');
}
//START changed by manoj 2.7.5b2
$addata->link = '#';
$addata->ignore = "";
$upload_area = 'id="upload_area"';
$plugin = 'plug_' . $layout;
$addata->ad_adtype_selected = $input->get('adtype');
$addata->adzone = $input->get('adzone');
/*added by manoj 2.7.5 stable*/
$addata->ad_image = '';
$adHtmlTyped = '';
if ($addata->ad_adtype_selected == 'text') {
//$adHtmlTyped='<div class="preview-bodytext '.$layout.'_ad_prev_third">';
$adHtmlTyped .= $addata->ad_body;
//$adHtmlTyped.='</div>';
} else {
$addata->ad_image = $input->get('img', '', 'STRING');
$addata->ad_image = str_replace(JUri::base(), '', $addata->ad_image);
if ($addata->ad_image == '') {
$addata->ad_image = 'components/com_socialads/images/adimage.jpg';
}
}
require_once JPATH_SITE . DS . 'components' . DS . 'com_socialads' . DS . 'adshelper.php';
$adshelper = new adRetriever();
$adHtmlTyped = $adshelper->getAdHTMLByMedia($upload_area, $addata->ad_image, $addata->ad_body, $addata->link, $layout, $track = 0, $addata->adzone);
//END changed by manoj 2.7.5b2
//$document->addStyleSheet(JUri::base().'components/com_socialads/css/helper.css');
//added by sagar
if (JVERSION >= '1.6.0') {
$layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . $plugin . DS . 'layout.php';
$document->addStyleSheet(JUri::base() . 'plugins/socialadslayout/' . $plugin . '/' . $plugin . '/layout.css');
$css = JUri::base() . 'plugins/socialadslayout/' . $plugin . '/' . $plugin . '/layout.css';
} else {
$layout = JPATH_SITE . DS . 'plugins' . DS . 'socialadslayout' . DS . $plugin . DS . 'layout.php';
$document->addStyleSheet(JUri::base() . 'plugins/socialadslayout/' . $plugin . '/layout.css');
$css = JUri::base() . 'plugins/socialadslayout/' . $plugin . '/layout.css';
}
//added by sagar
$document->addScript(JUri::base() . 'components/com_socialads/js/helper.js');
if (JFile::exists($layout)) {
ob_start();
include $layout;
$html = ob_get_contents();
ob_end_clean();
} else {
$html = '<!--div for preview ad-image-->
<div><a id="preview-title" class="preview-title-lnk" href="#">';
if ($addata->ad_title != '') {
$html .= '' . $addata->ad_title;
} else {
$html .= '' . JText::_("EXAMPLEAD");
}
$html .= '</a>
</div>
<!--div for preview ad-image-->
<div id="upload_area" >';
if ($addata->ad_image != '') {
$html .= '<img src="' . $addata->ad_image . '">';
} else {
$html .= '<img src="' . JUri::Root() . 'components/com_socialads/images/adimage.jpg">';
}
$html .= '
</div>
<!--div for preview ad-bodytext-->
<div id="preview-bodytext">';
if ($addata->ad_body != '') {
$html .= '' . $addata->ad_body;
} else {
$html .= '' . JText::_('SAMPLEAD');
}
$html .= '</div>';
}
//@TODO
//$js should be sent out only for video ads and flash ads
$js = '
flowplayer("div.vid_ad_preview",
{
src:"' . JUri::root() . 'components' . DS . 'com_socialads' . DS . 'js' . DS . 'flowplayer-3.2.10.swf",
wmode:"opaque"
},
{
canvas: {
backgroundColor:"#000000",
//.........这里部分代码省略.........