本文整理汇总了PHP中JUri::Base方法的典型用法代码示例。如果您正苦于以下问题:PHP JUri::Base方法的具体用法?PHP JUri::Base怎么用?PHP JUri::Base使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUri
的用法示例。
在下文中一共展示了JUri::Base方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Tips
if (title) {
var parts = title.split('::', 2);
el.store('tip:title', parts[0]);
el.store('tip:text', parts[1]);
}
jQuery('body > .tip-wrap').remove();
JTooltips = new Tips($$(el), {maxTitleChars: 50, fixed: false});
jQuery(self).parent().html(el);
});
}
function changePriorityDirection(self, id, value) {
jQuery.ajax({
type: "POST",
url : "<?php
echo JUri::Base() . 'index.php?option=com_judownload&tmpl=component&task=fields.changePriorityDirection';
?>
",
data: "id=" + id + "&value=" + value + "&<?php
echo JSession::getFormToken();
?>
=1"
})
.done(function (msg) {
el = jQuery(msg)[0];
var title = el.get('title');
if (title) {
var parts = title.split('::', 2);
el.store('tip:title', parts[0]);
el.store('tip:text', parts[1]);
}
示例2: getCategoryDTree
public static function getCategoryDTree($cat_id = null)
{
JLoader::register('JUDirectoryHelperRoute', JPATH_SITE . '/components/com_judirectory/helpers/route.php');
$document = JFactory::getDocument();
$document->addStyleSheet(JUri::root() . "components/com_judirectory/assets/dtree/css/dtree.css");
$document->addScript(JUri::root() . "components/com_judirectory/assets/dtree/js/dtree.js");
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id, title, parent_id, level, config_params');
$query->from('#__judirectory_categories');
$query->order('title ASC, id ASC');
$db->setQuery($query);
$categories = $db->loadObjectList();
$script = "<script type=\"text/javascript\">\r\n";
$iconFolder = JUri::root() . 'components/com_judirectory/assets/dtree/img';
$script .= "tree_cat = new dTree('tree_cat');\r\n";
$script .= "tree_cat.icon.root = '{$iconFolder}/base.gif';\r\n\n\t\t\t\t\ttree_cat.icon.folder = '{$iconFolder}/folder.gif';\r\n\n\t\t\t\t\ttree_cat.icon.folderOpen = '{$iconFolder}/folderopen.gif';\r\n\n\t\t\t\t\ttree_cat.icon.node = '{$iconFolder}/folder.gif';\r\n\n\t\t\t\t\ttree_cat.icon.empty = '{$iconFolder}/empty.gif';\r\n\n\t\t\t\t\ttree_cat.icon.line = '{$iconFolder}/line.gif';\r\n\n\t\t\t\t\ttree_cat.icon.join = '{$iconFolder}/join.gif';\r\n\n\t\t\t\t\ttree_cat.icon.joinBottom = '{$iconFolder}/joinbottom.gif';\r\n\n\t\t\t\t\ttree_cat.icon.plus = '{$iconFolder}/plus.gif';\r\n\n\t\t\t\t\ttree_cat.icon.plusBottom = '{$iconFolder}/plusbottom.gif';\r\n\n\t\t\t\t\ttree_cat.icon.minus = '{$iconFolder}/minus.gif';\r\n\n\t\t\t\t\ttree_cat.icon.minusBottom = '{$iconFolder}/minusbottom.gif';\r\n\n\t\t\t\t\ttree_cat.icon.nlPlus = '{$iconFolder}/nolines_plus.gif';\r\n\n\t\t\t\t\ttree_cat.icon.nlMinus = '{$iconFolder}/nolines_minus.gif';\r\n";
foreach ($categories as $category) {
$cat_title = addslashes(htmlspecialchars($category->title, ENT_QUOTES));
if ($category->level == 1 && $category->config_params) {
$cat_title .= " <i class=\"icon-cog disabled hasTooltip\" title=\"" . JText::_('COM_JUDIRECTORY_OVERRIDE_CONFIG') . "\"></i>";
}
if ($category->level == 1 && JUDirectoryHelperRoute::findItemId(array('tree' => array($category->id)))) {
$script .= "tree_cat.add({$category->id}, {$category->parent_id}, '{$cat_title}', '" . JUri::Base() . "index.php?option=com_judirectory&view=listcats&cat_id={$category->id}', '', '', tree_cat.icon.root);\r\n";
} else {
$script .= "tree_cat.add({$category->id}, {$category->parent_id}, '{$cat_title}', '" . JUri::Base() . "index.php?option=com_judirectory&view=listcats&cat_id={$category->id}');\r\n";
}
}
$script .= "tree_cat.config.useCookies=false;\r\n";
$script .= "tree_cat.config.closeSameLevel=true;\r\n";
$script .= "document.write(tree_cat);\r\n";
if ($cat_id) {
$script .= "tree_cat.openTo({$cat_id}, true);";
}
$script .= "</script>";
return $script;
}
示例3:
" ></i><!--img src="<?php
echo JUri::Base() . 'components/com_socialads/images/pending.png';
?>
"--> = <?php
echo JText::_('SA_PENDIN');
?>
, </span>
<span style="padding-left:5px;"><i class="icon-ok"></i><!--img src="<?php
echo JUri::Base() . 'components/com_socialads/images/confirm.png';
?>
"--> = <?php
echo JText::_('SA_CONFIRM') . "/" . JText::_('SA_APPROVE');
?>
, </span>
<span style="padding-left:5px;"><i class="icon-remove"></i><!--img src="<?php
echo JUri::Base() . 'components/com_socialads/images/refund.png';
?>
"--> = <?php
echo JText::_('SA_REFUND') . "/" . JText::_('SA_REJEC');
?>
</span>
</td>
</tr>
</tfoot>
</table>
</div>
<input type="hidden" name="option" value="com_socialads" />
<input type="hidden" name="view" value="managead" />
<input type="hidden" name="task" value="" />
示例4: getLineUps
function getLineUps($match)
{
$query = "SELECT p.*,CONCAT(p.first_name,' ',p.last_name) as name,p.def_img" . " FROM #__bl_players as p, #__bl_squard as s" . " WHERE p.id=s.player_id AND s.match_id=" . $this->m_id . " AND s.team_id=" . intval($match->hm_id) . " AND s.mainsquard = '1'" . " ORDER BY p.first_name,p.last_name";
$this->db->setQuery($query);
$this->_lists['squard1'] = $this->db->loadObjectList();
$error = $this->db->getErrorMsg();
if ($error) {
return JError::raiseError(500, $error);
}
///---> 1
$query = "SELECT md.s_id FROM #__bl_matchday as md, #__bl_match as m WHERE m.id = '" . $this->m_id . "' AND md.id = m.m_id";
$this->db->setQuery($query);
$s_id = $this->db->loadResult();
$query = "SELECT c.cfg_value FROM #__bl_config as c WHERE c.cfg_name = 'pllist_order_se'";
//id extra
$this->db->setQuery($query);
$etra_id = $this->db->loadResult();
$etra_id_exp = $etra_id ? explode("_", $etra_id) : '';
$rel = '';
if (isset($etra_id_exp[0])) {
$query = "SELECT ef.season_related FROM #__bl_extra_filds as ef WHERE ef.id = '" . $etra_id_exp[0] . "'";
$this->db->setQuery($query);
$rel = $this->db->loadResult();
}
///////////
function mySort($f1, $f2)
{
if (isset($f1->eorder) || isset($f2->eorder)) {
if ($f1->eorder == '') {
return 1;
}
if ($f2->eorder == '') {
return -1;
}
if ($f1->eorder < $f2->eorder) {
return -1;
} else {
if ($f1->eorder > $f2->eorder) {
return 1;
} else {
return 0;
}
}
//return strcasecmp($f1->eorder, $f2->eorder);
}
}
if (count($this->_lists['squard1'])) {
for ($i = 0; $i < count($this->_lists['squard1']); $i++) {
$this->_lists['squard1'][$i]->name = $this->selectPlayerName($this->_lists['squard1'][$i]);
$def_img2 = '';
$query = "SELECT p.ph_name as name,p.id as id,p.ph_filename as filename FROM #__bl_assign_photos as ap, #__bl_photos as p WHERE ap.photo_id = p.id AND cat_type = 1 AND cat_id = " . $this->_lists['squard1'][$i]->id;
$this->db->setQuery($query);
$photos2 = $this->db->loadObjectList();
if ($this->_lists['squard1'][$i]->def_img) {
$query = "SELECT ph_filename FROM #__bl_photos as p WHERE p.id = " . $this->_lists['squard1'][$i]->def_img;
$this->db->setQuery($query);
$def_img2 = $this->db->loadResult();
} else {
if (isset($photos2[0])) {
$def_img2 = $photos2[0]->filename;
}
}
$img = '';
if ($def_img2 && is_file('media/bearleague/' . $def_img2)) {
$img = "<div class='team-embl' style='margin-right:8px;'><img class='team-embl player-ico' " . getImgPop($def_img2, 1) . " /></div><span style='width:7px;display:table-cell'></span>";
} else {
$img = "<img class='player-ico' src='" . JUri::Base() . "components/com_joomsport/img/ico/season-list-player-ico.gif' width='30' height='30' alt='' />";
}
$this->_lists['squard1'][$i]->photo = $img;
///get extra
$this->_lists['squard1'][$i]->extra_val = '';
//initialisation
$this->_lists['squard1'][$i]->eorder = '';
if ($rel) {
$query = "SELECT es.sel_value, es.eordering FROM #__bl_extra_select as es, #__bl_extra_values as ev WHERE ev.f_id = '" . $etra_id_exp[0] . "' AND ev.uid = '" . $this->_lists['squard1'][$i]->id . "' AND ev.fvalue = es.id AND ev.season_id = " . $s_id . "";
$this->db->setQuery($query);
$etra_val = $this->db->loadRow();
$this->_lists['squard1'][$i]->extra_val = $etra_val[0];
$this->_lists['squard1'][$i]->eorder = $etra_val[1];
} else {
if (isset($etra_id_exp[0])) {
$query = "SELECT es.sel_value, ev.season_id, es.eordering FROM #__bl_extra_select as es, #__bl_extra_values as ev WHERE ev.f_id = '" . $etra_id_exp[0] . "' AND ev.uid = '" . $this->_lists['squard1'][$i]->id . "' AND ev.fvalue = es.id";
$this->db->setQuery($query);
$etra_val = $this->db->loadRow();
$this->_lists['squard1'][$i]->extra_val = $etra_val[0];
$this->_lists['squard1'][$i]->eorder = $etra_val[2];
}
}
}
/////////
usort($this->_lists['squard1'], 'mySort');
/////////
}
$query = "SELECT p.*,CONCAT(p.first_name,' ',p.last_name) as name,p.def_img" . " FROM #__bl_players as p, #__bl_squard as s" . " WHERE p.id=s.player_id AND s.match_id=" . $this->m_id . " AND s.team_id=" . intval($match->aw_id) . " AND s.mainsquard = '1'" . " ORDER BY p.first_name,p.last_name";
$this->db->setQuery($query);
$this->_lists['squard2'] = $this->db->loadObjectList();
$error = $this->db->getErrorMsg();
if ($error) {
return JError::raiseError(500, $error);
}
//.........这里部分代码省略.........
示例5: getPreviewData
function getPreviewData()
{
/*
URL format
yourjoomla/index.php?option=com_socialads&controller=buildad&task=getPreviewData&id=plug_promote_jsevents|10&lang=en
testjugad.com/~dipti/shine17/index.php?option=com_socialads&controller=buildad&task=getPreviewData&title=test title&body=test body&image=http://testjugad.com/~dipti/shine17/components/com_community/assets/event.png&url=http://testjugad.com/~dipti/shine17/index.php?option=com_community&view=events&task=viewevent&eventid=10&lang=en&caller=raw&lang=en
*/
require JPATH_SITE . DS . "administrator" . DS . "components" . DS . "com_socialads" . DS . "config" . DS . "config.php";
$input = JFactory::getApplication()->input;
//$post=$input->post;
//$input->get
if ($input->get('caller', '', 'STRING') == 'raw') {
$previewdata[0]->title = $input->get('title', '', 'STRING');
$previewdata[0]->bodytext = $input->get('body', '', 'STRING');
$previewdata[0]->image = $input->get('image', '', 'STRING');
$url = $input->get('url', '', 'get', 'PATH', JREQUEST_ALLOWRAW);
$previewdata[0]->url = urldecode($url);
} else {
$previewdata = $this->promotedatafetch();
}
$filename = JPATH_SITE . DS . 'images' . DS . 'socialads' . DS . basename(JPATH_SITE . $previewdata[0]->image);
$mystring = $previewdata[0]->image;
$findifurl = 'http';
$ifurl = strpos($mystring, $findifurl);
if ($ifurl === false) {
$source1 = JPATH_SITE . DS . $previewdata[0]->image;
} else {
$source1 = $previewdata[0]->image;
$content = file_get_contents($previewdata[0]->image);
//Store in the filesystem.
$fp = fopen($filename, "w");
fwrite($fp, $content);
fclose($fp);
}
if (!JFile::exists($filename)) {
JFile::copy($source1, $filename);
}
// $previewdata[0]->image = 'images'.DS .'socialads'.DS.basename(JPATH_SITE.$previewdata[0]->image);
$previewdata[0]->imagesrc = JUri::Base() . 'images/socialads/' . basename(JPATH_SITE . $previewdata[0]->image);
$previewdata[0]->image = '<img width="100" src="' . JUri::Base() . 'images/socialads/' . basename(JPATH_SITE . $previewdata[0]->image) . '" />';
$url = explode("://", $previewdata[0]->url);
$previewdata[0]->url1 = $url[0];
$previewdata[0]->url2 = $url[1];
/*data populate part*/
if (!$input->get('caller')) {
//caller not set
header('Content-type: application/json');
//pass array in json format
echo json_encode(array("url1" => $previewdata[0]->url1, "url2" => $previewdata[0]->url2, "title" => $previewdata[0]->title, "imagesrc" => $previewdata[0]->imagesrc, "image" => $previewdata[0]->image, "bodytext" => $previewdata[0]->bodytext));
jexit();
} else {
$buildadsession = JFactory::getSession();
$ad_data = array();
$ad_data[0]['ad_url1'] = $previewdata[0]->url1;
$ad_data[1]['ad_url2'] = $previewdata[0]->url2;
$ad_data[2]['ad_title'] = $previewdata[0]->title;
$ad_data[3]['ad_body'] = $previewdata[0]->bodytext;
$buildadsession->set('ad_data', $ad_data);
$buildadsession->set('ad_image', $previewdata[0]->imagesrc);
$link = JRoute::_('index.php?option=com_socialads&view=buildad&Itemid=' . $Itemid . '&frm=directad', false);
$this->setRedirect($link);
}
/*data populate part*/
}
示例6: _formatTimelineEvent
function _formatTimelineEvent($matchEvent, $event, $firstname, $nickname, $lastname, $picture, $two_events_per_minute = 0)
{
$result = '';
if (empty($event->icon)) {
$event->icon = JUri::Base() . "media/com_joomleague/jl_images/same.png";
}
$tiptext = JText::_($event->name) . ' ' . JText::_('COM_JOOMLEAGUE_MATCHREPORT_MINUTE_SHORT') . ' ' . $matchEvent->event_time;
$tiptext .= ' ::';
if (file_exists($picture)) {
$tiptext .= JoomleagueViewMatchReport::getHtmlImageForTips($picture, $this->config['player_picture_width'], $this->config['player_picture_height']);
}
$tiptext .= '<br />' . JoomleagueHelper::formatName(null, $firstname, $nickname, $lastname, $this->config["name_format"]);
$time = $matchEvent->event_time / $this->getTimelineMatchTime() * 100;
if ($two_events_per_minute == 1) {
$result .= "\n" . '<img class="hasTip" style="position: absolute;left: ' . $time . '%; top: -25px;" src="' . $event->icon . '" alt="' . $tiptext . '" title="' . $tiptext;
} elseif ($two_events_per_minute == 2) {
$result .= "\n" . '<img class="hasTip" style="position: absolute;left: ' . $time . '%; top: 25px;" src="' . $event->icon . '" alt="' . $tiptext . '" title="' . $tiptext;
} else {
$result .= "\n" . '<img class="hasTip" style="position: absolute;left: ' . $time . '%;" src="' . $event->icon . '" alt="' . $tiptext . '" title="' . $tiptext;
}
if ($this->config['use_tabs_events'] == 2) {
$result .= '" onclick="gotoevent(' . $matchEvent->event_id . ')';
}
$result .= '" />';
return $result;
}
示例7: function
</div>
<?php
}
?>
<?php
}
?>
<?php
if ($lists['t_type'] && $this->acl == 1) {
if ($lists['t_type'] == 1) {
$javascript = 'jQuery.post( \'' . JUri::Base() . 'index.php?tmpl=component&option=com_joomsport&task=get_format&no_html=1&sid=' . $s_id . '&t_single=' . $lists['t_single'] . '&fr_id=\'+jQuery(\'#format_post\').val(), function( data ) {jQuery(\'#mapformat\').html( data );});';
} else {
if ($lists['t_type'] == 2) {
$javascript = 'jQuery.post( \'' . JUri::Base() . 'index.php?tmpl=component&option=com_joomsport&task=get_formatkn&no_html=1&sid=' . $s_id . '&t_single=' . $lists['t_single'] . '&fr_id=\'+jQuery(\'#format_post\').val(), function( data ) {jQuery(\'#mapformat\').html( data );});';
}
}
?>
<div class="form-group">
<label for="inputMatchDay" class="col-sm-2 control-label"><?php
echo $lists['t_type'] == 1 ? JText::_('BLFA_KNOCK') : JText::_('BLFA_DOUBLE');
?>
</label>
<div class="col-sm-2">
<?php
echo $lists['format'];
?>
</div>
示例8: count
$how_rows = count($this->lists['squard1_res']) > count($this->lists['squard2_res']) ? count($this->lists['squard1_res']) : count($this->lists['squard2_res']);
if ($how_rows) {
echo "<h3 class='solid'>" . JText::_('BLFA_SUBSTITUTES') . "</h3>";
echo '<table class="season-list" cellpadding="0" cellspacing="0" border="0">';
for ($p = 0; $p < $how_rows; $p++) {
echo "<tr class='" . ($p % 2 ? "" : "gray") . "'>";
echo "<td width='50%'>" . (isset($this->lists['squard1_res'][$p]->name) && $this->lists['squard1_res'][$p]->name ? $this->lists['squard1_res'][$p]->photo . "<p class='player-name'>" . $this->lists['squard1_res'][$p]->name . "</p>" : " ") . "</td>";
echo "<td width='50%'>" . (isset($this->lists['squard2_res'][$p]->name) && $this->lists['squard2_res'][$p]->name ? $this->lists['squard2_res'][$p]->photo . "<p class='player-name'>" . $this->lists['squard2_res'][$p]->name . "</p>" : " ") . "</td>";
echo "</tr>";
}
echo '</table>';
}
//subs in
$how_rows = count($this->lists['subsin1']) > count($this->lists['subsin2']) ? count($this->lists['subsin1']) : count($this->lists['subsin2']);
$arrow_in = '<img src="' . JUri::Base() . 'components/com_joomsport/img/ico/old-edit-redo.png" class="sub-player-ico" title="" alt="" />';
$arrow_out = '<img src="' . JUri::Base() . 'components/com_joomsport/img/ico/old-edit-undo.png" class="sub-player-ico" title="" alt="" />';
if ($how_rows) {
echo "<h3 class='solid'>" . JText::_('BLFA_SUBSIN') . "</h3>";
echo '<table class="season-list" cellpadding="0" cellspacing="0" border="0">';
for ($p = 0; $p < $how_rows; $p++) {
echo "<tr class='" . ($p % 2 ? "" : "gray") . "'>";
echo "<td width='50%' align='right' style='padding-right:20px;'>";
echo "<table width='100%' cellpadding='2' border='0' class='season-list'>";
echo '<tr>';
echo '<td>';
echo isset($this->lists['subsin1'][$p]->plin) && $this->lists['subsin1'][$p]->plin ? $arrow_in . "<p class='sub-player-name'>" . $this->lists['subsin1'][$p]->plin . "</p><br />" : " ";
echo isset($this->lists['subsin1'][$p]->plout) && $this->lists['subsin1'][$p]->plout ? $arrow_out . "<p class='sub-player-name'>" . $this->lists['subsin1'][$p]->plout . "</p>" : " ";
echo '</td>';
echo '<td width="50" valign="middle">';
echo isset($this->lists['subsin1'][$p]->minutes) && $this->lists['subsin1'][$p]->minutes ? $this->lists['subsin1'][$p]->minutes . "'" : " ";
echo '</td>';