function updateDocumentForm($list, $links, $paths, $data) { $action = _taskLink('doc_update_process', $data->id); ob_start(); ?> <form action="<?php echo sefRelToAbs($action); ?> " method="post" enctype="multipart/form-data" id="dm_frmupdate" class="dm_form" > <fieldset class="input"> <p> <label for="upload"><?php echo _DML_SELECTFILE; ?> </label><br /> <input id="upload" name="upload" type="file" /> </p> </fieldset> <fieldset class="dm_button"> <p> <input name="submit" class="button" value="<?php echo _DML_UPLOAD; ?> " type="submit" /> </p> </fieldset> <?php echo DOCMAN_token::render(); ?> </form> <?php $html = ob_get_contents(); ob_end_clean(); return $html; }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $row = null; if (JCOMMENTS_JVERSION == '1.0') { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT id, ad_headline, userid, category FROM #__adsmanager_ads WHERE id = ' . $id); $db->loadObject($row); } else { $db = JFactory::getDBO(); $db->setQuery('SELECT id, ad_headline, userid, category FROM #__adsmanager_ads WHERE id = ' . $id); $row = $db->loadObject(); } if (!empty($row)) { $info->title = $row->ad_headline; $info->userid = $row->userid; if (JCOMMENTS_JVERSION == '1.0') { $Itemid = self::getItemid('com_adsmanager'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->link = sefRelToAbs("index.php?option=com_adsmanager&page=show_ad&adid=" . $id . $Itemid); } else { $Itemid = self::getItemid('com_adsmanager', 'index.php?option=com_adsmanager&view=front'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->link = JRoute::_("index.php?option=com_adsmanager&view=details&id=" . $row->id . "&catid=" . $row->category . $Itemid); } } return $info; }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $row = null; if (JCOMMENTS_JVERSION == '1.0') { $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT link_id, link_name, user_id FROM #__mt_links WHERE link_id = ' . $id); $db->loadObject($row); } else { $db = JFactory::getDBO(); $db->setQuery('SELECT link_id, link_name, user_id FROM #__mt_links WHERE link_id = ' . $id); $row = $db->loadObject(); } if (!empty($row)) { $Itemid = self::getItemid('com_mtree'); $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->title = $row->link_name; $info->userid = $row->user_id; if (JCOMMENTS_JVERSION == '1.0') { $info->link = sefRelToAbs('index.php?option=com_mtree&task=viewlink&link_id=' . $id . $Itemid); } else { $info->link = JRoute::_('index.php?option=com_mtree&task=viewlink&link_id=' . $id . $Itemid); } } return $info; }
function getObjectLink($id) { global $Itemid; $_Itemid = $Itemid; $db = JCommentsFactory::getDBO(); $query = "SELECT m.id as category_itemid, v.itemid as vendor_itemid, m1.itemid as model_itemid" . "\n FROM #__menu as m" . "\n LEFT JOIN #__categories as c ON m.params LIKE CONCAT('%category_id=',c.id,'%')" . "\n LEFT JOIN #__autobb_messages as a ON c.id=a.category" . "\n LEFT JOIN #__autobb_vendors as v ON a.vendor=v.id" . "\n LEFT JOIN #__autobb_models as m1 ON a.model=m1.id" . "\n WHERE m.type='components' AND m.link='index.php?option=com_autobb' AND c.section='com_autobb' and m.published=1 and a.id={$id}" . "\n GROUP BY a.id" . "\n LIMIT 1"; $db->setQuery($query); $result = null; if (JCOMMENTS_JVERSION == '1.5') { $config = JFactory::getConfig(); if ($config->getValue('config.legacy')) { $db->loadObject($result); } else { $result = $db->loadObject(); } } else { $db->loadObject($result); } if ($result != null) { if ($result->model_itemid) { $_Itemid = $result->model_itemid; } else { if ($result->model_itemid) { $_Itemid = $result->vendor_itemid; } else { if ($result->category_itemid) { $_Itemid = $result->category_itemid; } } } } $link = sefRelToAbs("index.php?option=com_autobb&Itemid={$_Itemid}&task=show&id={$id}"); return $link; }
function show_checkout($option, $subscription, $item_id, $proc) { global $Itemid, $JLMS_CONFIG, $my; $params = new JLMSParameters($proc->params); if (!$params->get('inst_id')) { $redirect_task = 'subscription'; if ($subscription->payment_type == 2) { $redirect_task = 'show_cart'; } JLMSredirect(sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task={$redirect_task}"), "This payment method is not available at the moment.<br /> Ask site administrator to check payment method settings."); } setcookie('joomlalms_cart_contents', '', time() - 3600, '/'); // generating sites string; $prod_descr = $params->get('prod_descr'); ?> <html> <body onLoad="document.forms.ms_checkout_form.submit();"> <form action="https://select.worldpay.com/wcc/purchase" method="post" name="ms_checkout_form" id="ms_checkout_form"> <input type="hidden" name="instId" value="<?php echo $params->get('inst_id'); ?> " /> <input type="hidden" name="cartId" value="<?php echo $item_id; ?> " /> <input type="hidden" name="amount" value="<?php echo number_format($subscription->price + $subscription->tax_amount, 2, '.', ''); ?> " /> <input type="hidden" name="currency" value="<?php echo $JLMS_CONFIG->get('jlms_cur_code'); ?> " /> <input type="hidden" name="desc" value="<?php echo $subscription->name; ?> " /> <input type="hidden" name="testMode" value="<?php echo $params->get('test_mode'); ?> " /> <input type="hidden" name="MC_order" value="<?php echo $item_id; ?> " /> <input type="hidden" name="MC_tax" value="<?php echo $subscription->tax_amount; ?> " /> <input type="hidden" name="MC_user" value="<?php echo $my->id; ?> " /> </form> </body> </html> <?php die; }
function getObjectInfo($id, $language = null) { if (JCOMMENTS_JVERSION == '1.0') { $query = "SELECT id, title, '' as alias, access FROM #__polls WHERE id = " . $id; } else { $query = "SELECT id, title, alias, access FROM #__polls WHERE id = " . $id; } $db = JCommentsFactory::getDBO(); $db->setQuery($query); $row = $db->loadObject(); $info = new JCommentsObjectInfo(); if (!empty($row)) { $_Itemid = self::getItemid('com_poll'); $info->title = $row->title; $info->access = $row->access; if (JCOMMENTS_JVERSION == '1.0') { $link = sefRelToAbs('index.php?option=com_poll&task=results&id=' . $id . '&Itemid=' . $_Itemid); } else { $_Itemid = $_Itemid > 0 ? '&Itemid=' . $_Itemid : ''; $link = JRoute::_('index.php?option=com_poll&id=' . $id . ':' . $row->alias . $_Itemid); } $info->link = $link; } return $info; }
function licenseDocumentForm(&$links, &$paths, &$data, $inline = 0) { $action = _taskLink('license_result', mosGetParam($_REQUEST, 'gid', 0), array('bid' => $data->id)); ob_start(); ?> <form action="<?php echo sefRelToAbs($action); ?> " method="POST" enctype="multipart/form-data"> <input type="hidden" name="inline" value="<?php echo $inline; ?> " /> <input type="radio" name="agree" value="0" checked /><?php echo _DML_DONT_AGREE; ?> <input type="radio" name="agree" value="1" /><?php echo _DML_AGREE; ?> <input name="submit" value="<?php echo _DML_PROCEED; ?> " type="submit" /> </form> <?php $html = ob_get_contents(); ob_end_clean(); return $html; }
/** * Replaces the matched tags * @param array An array of matches (see preg_match_all) * @return string */ function textBibleReferencesToLinks_replacer(&$matches) { global $database, $mosConfig_live_site; static $bookCodes = array("Gn" => 1, "Êx" => 2, "Lv" => 3, "Nm" => 4, "Dt" => 5, "Js" => 6, "Jz" => 7, "Rt" => 8, "1Sm" => 9, "1 Sm" => 9, "ISm" => 9, "I Sm" => 9, "2Sm" => 10, "2 Sm" => 10, "IISm" => 10, "II Sm" => 10, "1Rs" => 11, "1 Rs" => 11, "IRs" => 11, "I Rs" => 11, "2Rs" => 12, "2 Rs" => 12, "IIRs" => 12, "II Rs" => 12, "1Cr" => 13, "1 Cr" => 13, "ICr" => 13, "I Cr" => 13, "2Cr" => 14, "2 Cr" => 14, "IICr" => 14, "II Cr" => 14, "Ed" => 15, "Ne" => 16, "Et" => 17, "Jó" => 18, "Sl" => 19, "Pv" => 20, "Ec" => 21, "Ct" => 22, "Is" => 23, "Jr" => 24, "Lm" => 25, "Ez" => 26, "Dn" => 27, "Os" => 28, "Jl" => 29, "Am" => 30, "Ob" => 31, "Jn" => 32, "Mq" => 33, "Na" => 34, "He" => 35, "Sf" => 36, "Ag" => 37, "Zc" => 38, "Ml" => 39, "Mt" => 40, "Mc" => 41, "Lc" => 42, "Jo" => 43, "At" => 44, "Rm" => 45, "1Co" => 46, "1 Co" => 46, "ICo" => 46, "I Co" => 46, "2Co" => 47, "2 Co" => 47, "IICo" => 47, "II Co" => 47, "Gl" => 48, "Ef" => 49, "Fp" => 50, "Cl" => 51, "1Ts" => 52, "1 Ts" => 52, "ITs" => 52, "I Ts" => 52, "2Ts" => 53, "2 Ts" => 53, "IITs" => 53, "II Ts" => 53, "1Tm" => 54, "1 Tm" => 54, "ITm" => 54, "I Tm" => 54, "2Tm" => 55, "2 Tm" => 55, "IITm" => 55, "II Tm" => 55, "Tt" => 56, "Fm" => 57, "Hb" => 58, "Tg" => 59, "1Pe" => 60, "1 Pe" => 60, "IPe" => 60, "I Pe" => 60, "2Pe" => 61, "2 Pe" => 61, "IIPe" => 61, "II Pe" => 61, "1Jo" => 62, "1 Jo" => 62, "IJo" => 62, "I Jo" => 62, "2Jo" => 63, "2 Jo" => 63, "IIJo" => 63, "II Jo" => 63, "3Jo" => 64, "3 Jo" => 64, "IIIJo" => 64, "III Jo" => 64, "Jd" => 65, "Ap" => 66); if ($bookCodes[$matches[2]]) { $database->setQuery("SELECT bookId, ordering, bookName, location, qtdChapters " . "\nFROM #__bible_book" . "\nwhere ordering = '{$bookCodes[$matches[2]]}'"); $database->loadObject($book); $capitulo = trim($matches[3]); $versiculo = trim($matches[6]); $final = trim($matches[7]); $windowTitle = "{$book->bookName} {$capitulo}"; if ($final == "") { $final = $versiculo; } if (preg_match("/\\-[1-9]*/", $final)) { $final = substr($final, 1); } if (is_numeric($capitulo) && is_numeric($versiculo) && is_numeric($final)) { $database->setQuery("SELECT verse, verseText " . "\nFROM #__bible" . "\nwhere bookOrdering = '{$bookCodes[$matches[2]]}'" . "\nand chapter = {$capitulo}" . "\nand verse between {$versiculo} and {$final}" . "\norder by verse"); $verses = $database->loadObjectList(); $windowTitle .= ":{$versiculo}" . ($versiculo == $final ? "" : "-{$final}"); foreach ($verses as $verse) { $bibleHTMLText .= ($bibleHTMLText == "" ? "" : "<br>") . ($versiculo == $final ? "" : "<sup>({$verse->verse})</sup>") . "{$verse->verseText}"; } } if ($bibleHTMLText == "") { $bibleHTMLText = "Clique para consultar"; } $url = sefRelToAbs("{$mosConfig_live_site}/index2.php?option=bible&Itemid=71&task=viewBook&id={$bookCodes[$matches[2]]}&limitstart=" . ($matches[3] - 1) . "#{$matches[6]}"); $bibleHTMLText = addslashes($bibleHTMLText); return "<a onMouseOver=\"return overlib('{$bibleHTMLText}', CAPTION, '{$windowTitle}', WIDTH, 350, BELOW, RIGHT);\" onMouseOut=\"return nd();\" href=\"{$url}\" target=biblia>{$matches[0]}</a>"; } else { return $matches[0]; } }
function getObjectLink($id) { $_Itemid = self::getItemid('com_events'); $db = JCommentsFactory::getDBO(); $db->setQuery("SELECT id, publish_up FROM #__events WHERE id={$id}"); $event = null; if (JCOMMENTS_JVERSION == '1.5') { $event = $db->loadObject(); } else { $db->loadObject($event); } $dates = ''; if ($event != null) { $regs = array(); if (preg_match("#([0-9]{4})-([0-9]{2})-([0-9]{2})[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})#", $event->publish_up, $regs)) { $y = $regs[1]; $m = min(12, max(1, $regs[2])); $d = $regs[3]; $d = max(1, $d); $dates = '&year=' . $y . '&month=' . $m . '&day=' . $d; } } $link = sefRelToAbs("index.php?option=com_events&task=view_detail&agid=" . $id . $dates . "&Itemid=" . $_Itemid); return $link; }
function viewbanner() { global $database, $mosConfig_live_site; $query = "SELECT COUNT(*) AS numrows" . "\n FROM #__banner" . "\n WHERE showBanner = 1"; $database->setQuery($query); $numrows = $database->loadResult(); if ($numrows === null) { echo $database->stderr(true); return; } if ($numrows > 1) { mt_srand((double) microtime() * 1000000); $bannum = mt_rand(0, --$numrows); } else { $bannum = 0; } $banner = null; $query = "SELECT *" . "\n FROM #__banner" . "\n WHERE showBanner = 1"; $database->setQuery($query, $bannum, 1); if ($database->loadObject($banner)) { $query = "UPDATE #__banner" . "\n SET impmade = impmade + 1" . "\n WHERE bid = " . (int) $banner->bid; $database->setQuery($query); if (!$database->query()) { echo $database->stderr(true); return; } $banner->impmade++; if ($numrows > 0) { // Check if this impression is the last one and print the banner if ($banner->imptotal == $banner->impmade) { $query = "INSERT INTO #__bannerfinish" . "\n ( cid, type, name, impressions, clicks, imageurl, datestart, dateend )" . "\n VALUES ( " . (int) $banner->cid . ", " . $database->Quote($banner->type) . ", " . $database->Quote($banner->name) . ", " . (int) $banner->impmade . ", " . (int) $banner->clicks . ", " . $database->Quote($banner->imageurl) . ", " . $database->Quote($banner->date) . ", 'now()' )"; $database->setQuery($query); if (!$database->query()) { die($database->stderr(true)); } $query = "DELETE FROM #__banner" . "\n WHERE bid = " . (int) $banner->bid; $database->setQuery($query); if (!$database->query()) { die($database->stderr(true)); } } if (trim($banner->custombannercode)) { echo $banner->custombannercode; } else { if (eregi("(\\.bmp|\\.gif|\\.jpg|\\.jpeg|\\.png)\$", $banner->imageurl)) { $imageurl = "{$mosConfig_live_site}/images/banners/{$banner->imageurl}"; echo "<a href=\"" . sefRelToAbs("index.php?option=com_banners&task=click&bid={$banner->bid}") . "\" target=\"_blank\"><img src=\"{$imageurl}\" border=\"0\" alt=\"Advertisement\" /></a>"; } else { if (eregi("\\.swf\$", $banner->imageurl)) { $imageurl = "{$mosConfig_live_site}/images/banners/" . $banner->imageurl; echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" border=\"5\">\n\t\t\t\t\t\t<param name=\"movie\" value=\"{$imageurl}\"><embed src=\"{$imageurl}\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"></embed></object>"; } } } } } else { echo " "; } }
/** * modify the value * * @access public * @param string value * @return string modified value */ function modify($value, $params = array()) { if (function_exists('sefRelToAbs')) { return sefRelToAbs($value); } else { return $value; } }
function getObjectLink($id) { $_Itemid = self::getItemid('com_jportfolio'); $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT catid FROM #__jportfolio_projects WHERE id = ' . $id); $catid = $db->loadResult(); $link = sefRelToAbs('index.php?option=com_jportfolio&catid=' . $catid . '&project=' . $id . '&Itemid=' . $_Itemid); return $link; }
function getObjectLink($id) { $_Itemid = JCommentsPlugin::getItemid('com_afm'); $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT cat_id FROM #__afm_files WHERE file_id = ' . $id); $catid = $db->loadResult(); $link = sefRelToAbs('index.php?option=com_afm&task=answer&catid=' . $catid . '&aid=' . $id . '&Itemid=' . $_Itemid); return $link; }
function getObjectLink($id) { $_Itemid = JCommentsPlugin::getItemid('com_yellowpages'); $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT catid FROM #__jyp_entries WHERE id = ' . $id); $catid = $db->loadResult(); $link = sefRelToAbs('index.php?option=com_yellowpages&Itemid=' . $_Itemid . '&task=view&catid=' . $catid . '&id=' . $id); return $link; }
/** * call the function * * @access public * @param array parameters of the function (= attributes of the tag) * @param string content of the tag * @return string content to insert into the template */ function call($params, $content) { /* if( !isset( $params['macro'] ) ) { return false; } */ return sefRelToAbs($content); }
function getObjectLink($id) { $_Itemid = self::getItemid('com_musicbox'); $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT catid FROM #__musicboxalbum WHERE id = ' . $id); $catid = $db->loadResult(); $link = sefRelToAbs("index.php?option=com_musicbox&task=view&catid=" . $catid . "&id=" . $id . "&Itemid=" . $_Itemid); return $link; }
/** * Replaces the matched tags * @param array An array of matches (see preg_match_all) * @return string */ function botMosSef_replacer(&$matches) { if (substr($matches[1], 0, 1) == "#") { // anchor $temp = split("index.php", $_SERVER['REQUEST_URI']); return "href=\"" . sefRelToAbs("index.php" . @$temp[1]) . $matches[1] . "\""; } else { return "href=\"" . sefRelToAbs($matches[1]) . "\""; } }
function sendmail() { global $mosConfig_usecaptcha; $captcha_success = 0; if ($mosConfig_usecaptcha == '1') { session_name('mos_captcha'); session_start(); $spamstop = mosGetParam($_POST, 'spamstop', ''); if (isset($_SESSION['code']) && $_SESSION['code'] != "" && $_SESSION['code'] == $spamstop) { $captcha_success = 1; // success } else { $captcha_success = 2; // fail } } if ($captcha_success != '2') { $contact = new mosContact(); $contact->load($this->con_id); $default = mamboCore::get('mosConfig_sitename') . ' ' . T_('Enquiry'); $email = mosGetParam($_POST, 'email', ''); $text = mosGetParam($_POST, 'text', ''); $name = mosGetParam($_POST, 'name', ''); $subject = mosGetParam($_POST, 'subject', $default); $email_copy = mosGetParam($_POST, 'email_copy', 0); if (!$email or !$text or !$this->is_email($email) or $this->has_emailheaders($text) or $this->has_newlines($email) or $this->has_newlines($name) or $this->has_newlines($subject) or !isset($_SERVER['HTTP_USER_AGENT']) or $_SERVER['REQUEST_METHOD'] != 'POST') { echo "<script>alert (\"" . T_('Please make sure the form is complete and valid.') . "\"); window.history.go(-1);</script>"; exit(0); } $prefix = sprintf(T_('This is an enquiry e-mail via %s from:'), mamboCore::get('mosConfig_live_site')); $text = $prefix . "\n" . $name . ' <' . $email . '>' . "\n\n" . $text; mosMail($email, $name, $contact->email_to, mamboCore::get('mosConfig_fromname') . ': ' . $subject, $text); if ($email_copy) { $copy_text = sprintf(T_('The following is a copy of the message you sent to %s via %s '), $contact->name, mamboCore::get('mosConfig_sitename')); $copy_text = $copy_text . "\n\n" . $text . ''; $copy_subject = sprintf(T_('Copy of: %s'), $subject); mosMail(mamboCore::get('mosConfig_mailfrom'), mamboCore::get('mosConfig_fromname'), $email, $copy_subject, $copy_text); } ?> <script> alert( "<?php echo T_('Thank you for your e-mail ') . $name; ?> " ); document.location.href='<?php echo sefRelToAbs('index.php?option=com_contact&Itemid=' . $this->Itemid); ?> '; </script> <?php } else { echo "<SCRIPT> alert('Incorrect Security Code'); window.history.go(-1);</SCRIPT>"; } }
function transferFileForm($lists) { ob_start(); ?> <form action="<?php echo sefRelToAbs($lists['action']); ?> " method="post" id="dm_frmupload" class="dm_form"> <fieldset class="input"> <p><label for="url"><?php echo _DML_REMOTEURL; ?> </label><br /> <input name="url" type="text" id="url" value="<?php echo $lists['url']; ?> " /> <?php echo DOCMAN_Utils::mosToolTip(_DML_REMOTEURLTT . '</span>', _DML_REMOTEURL . ':'); ?> </p> <p><label for="localfile"><?php echo _DML_LOCALNAME; ?> </label><br /> <input name="localfile" type="text" id="url" value="<?php echo $lists['localfile']; ?> "> <?php echo DOCMAN_Utils::mosToolTip(_DML_LOCALNAMETT . '</span>', _DML_LOCALNAME . ':'); ?> </p> </fieldset> <fieldset class="dm_button"> <input name="submit" id="dm_btn_back" class="button" value="<?php echo _DML_BACK; ?> " onclick="window.history.back()" type="button" > <input name="submit" id="dm_btn_submit" class="button" value="<?php echo _DML_TRANSFER; ?> " type="submit" /> </fieldset> <input type="hidden" name="method" value="transfer" /> <?php echo DOCMAN_token::render(); ?> </form> <?php $html = ob_get_contents(); ob_end_clean(); return $html; }
function getObjectLink($id) { if (JCOMMENTS_JVERSION == '1.0') { $_Itemid = JCommentsPlugin::getItemid('com_mtree'); $link = sefRelToAbs('index.php?option=com_mtree&task=viewlink&link_id=' . $id . '&Itemid=' . $_Itemid); } else { $link = 'index.php?option=com_mtree&task=viewlink&link_id=' . $id; $_Itemid = JCommentsPlugin::getItemid('com_mtree'); $link .= $_Itemid > 0 ? '&Itemid=' . $_Itemid : ''; $link = JRoute::_($link); } return $link; }
function redirect($link, $message = '') { global $mainframe; if (compa::joom10()) { if (!preg_match("/index2/", $link) and function_exists('sefRelToAbs') and $GLOBALS[ACA . 'use_sef']) { $link = sefRelToAbs($link); } mosRedirect($link, $message); exit; } else { $mainframe->redirect($link, $message); exit; } }
function getObjectLink($id) { global $mainframe; $_Itemid = JCommentsPlugin::getItemid('com_vfm'); $link = ''; $vfm_core = JOOMLATUNE_JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_vfm' . DS . 'VFM_Core.class.php'; if (is_file($vfm_core)) { require_once $vfm_core; $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT filename FROM #__vfm_files WHERE id = ' . $id); $filename = $db->loadResult(); $link = sefRelToAbs('index.php?option=com_vfm&do=view&file=' . VFM_Core::encodePath($filename) . '&Itemid=' . $_Itemid); } return $link; }
function NewItem(&$level, &$params, &$row, &$subMenus, &$name, &$cssRepeatNum, &$target, &$link) { /** /* Function Desc - Writes html for a new tree item */ $levTabs = str_repeat("\t", $level); $treeItemClass = $subMenus ? "folder" : "doc"; if ($row->type == "separator") { $treeItemClass = "separator"; } //makes seperator dissappear for tree menu echo "\n\t\t\t" . $levTabs . "<div class='{$treeItemClass}'>"; // Search engine friendly url code mod by Srdan Mahmutovic 2005-06-30 echo "<a target=" . $target . " href='" . htmlspecialchars(sefRelToAbs($link)) . "'>" . htmlentities($row->name) . "</a>"; }
/** * @param string $value Absolute or Relative URI to Joomla resource * @return The translated humanly readable URL */ public static function _($value) { if (JOOMLATUNE_JVERSION === '1.5') { $url = str_replace('&', '&', $value); $url = str_replace('&no_html=1', '&tmpl=component', $url); if (substr(strtolower($url), 0, 9) != "index.php") { return $url; } $uri = JURI::getInstance(); $prefix = $uri->toString(array('scheme', 'host', 'port')); return $prefix . JRoute::_($url); } else { return sefRelToAbs($value); } }
function getObjectLink($id) { $_Itemid = JCommentsPlugin::getItemid('com_poll'); if (JCOMMENTS_JVERSION == '1.5') { $db =& JCommentsFactory::getDBO(); $db->setQuery('SELECT alias FROM #__polls WHERE id = ' . $id); $alias = $db->loadResult(); $link = 'index.php?option=com_poll&id=' . $id . ':' . $alias; $link .= $_Itemid > 0 ? '&Itemid=' . $_Itemid : ''; $link = JRoute::_($link); } else { $link = sefRelToAbs('index.php?option=com_poll&task=results&id=' . $id . '&Itemid=' . $_Itemid); } return $link; }
function botVoting(&$row, &$params, $page = 0) { global $mosConfig_live_site, $mosConfig_absolute_path, $cur_template; global $Itemid; $id = $row->id; $option = 'com_content'; $task = mosGetParam($_REQUEST, 'task', ''); $html = ''; if ($params->get('rating') && !$params->get('popup')) { $html .= '<form method="post" action="' . sefRelToAbs('index.php') . '">'; $img = ''; // look for images in template if available $starImageOn = mosAdminMenus::ImageCheck('rating_star.png', '/images/M_images/'); $starImageOff = mosAdminMenus::ImageCheck('rating_star_blank.png', '/images/M_images/'); for ($i = 0; $i < $row->rating; $i++) { $img .= $starImageOn; } for ($i = $row->rating; $i < 5; $i++) { $img .= $starImageOff; } $html .= '<span class="content_rating">'; $html .= _USER_RATING . ':' . $img . ' / '; $html .= intval($row->rating_count); $html .= "</span>\n<br />\n"; $url = @$_SERVER['REQUEST_URI']; $url = str_replace('&', '&', $url); if (!$params->get('intro_only') && $task != "blogsection") { $html .= '<span class="content_vote">'; $html .= _VOTE_POOR; $html .= '<input type="radio" alt="vote 1 star" name="user_rating" value="1" />'; $html .= '<input type="radio" alt="vote 2 star" name="user_rating" value="2" />'; $html .= '<input type="radio" alt="vote 3 star" name="user_rating" value="3" />'; $html .= '<input type="radio" alt="vote 4 star" name="user_rating" value="4" />'; $html .= '<input type="radio" alt="vote 5 star" name="user_rating" value="5" checked="checked" />'; $html .= _VOTE_BEST; $html .= ' <input class="button" type="submit" name="submit_vote" value="' . _RATE_BUTTON . '" />'; $html .= '<input type="hidden" name="task" value="vote" />'; $html .= '<input type="hidden" name="pop" value="0" />'; $html .= '<input type="hidden" name="option" value="com_content" />'; $html .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />'; $html .= '<input type="hidden" name="cid" value="' . $id . '" />'; $html .= '<input type="hidden" name="url" value="' . $url . '" />'; $html .= '</span>'; } $html .= "</form>\n"; } return $html; }
function output_rssfeed($link, $img_default, $img_file, $img_alt, $img_name) { $img = mosAdminMenus::ImageCheck($img_default, '/images/M_images/', $img_file, '/images/M_images/', $img_alt, $img_name); ?> <div align="center"> <a href="<?php echo sefRelToAbs($link); ?> "> <?php echo $img; ?> </a> </div> <?php }
function uploadFileForm($lists) { global $mosConfig_live_site; $progressImg = $mosConfig_live_site . '/administrator/components/com_docman/images/dm_progress.gif'; ob_start(); ?> <form action="<?php echo sefRelToAbs($lists['action']); ?> " method="post" enctype="multipart/form-data" id="dm_frmupload" class="dm_form"> <fieldset class="input"> <p><div id="progress" style="display:none;"><img style="border:1px solid black;" src="<?php echo $progressImg; ?> " alt="Upload Progress" /> <?php echo _DML_ISUPLOADING; ?> </div> <label for="upload"><?php echo _DML_SELECTFILE; ?> </label><br /> <input id="upload" name="upload" type="file" name="file" /> </p> </fieldset> <fieldset class="dm_button"> <input name="submit" id="dm_btn_back" class="button" value="<?php echo _DML_BACK; ?> " onclick="window.history.back()" type="button" > <input name="submit" id="dm_btn_submit" class="button" value="<?php echo _DML_UPLOAD; ?> " type="submit" onclick="document.getElementById('progress').style.display = 'block';" /> </fieldset> <input type="hidden" name="method" value="http" /> <?php echo DOCMAN_token::render(); ?> </form> <?php $html = ob_get_contents(); ob_end_clean(); return $html; }
/** * Replaces the matched tags * @param array An array of matches (see preg_match_all) * @return string */ function botMosSef_replacer(&$matches) { // original text that might be replaced $original = 'href="' . $matches[1] . '"'; // array list of non http/https URL schemes $url_schemes = explode(', ', _URL_SCHEMES); foreach ($url_schemes as $url) { // disable bot from being applied to specific URL Scheme tag if (strpos($matches[1], $url) !== false) { return $original; } } if (strpos($matches[1], 'index.php?option') !== false) { // links containing 'index.php?option // convert url to SEF link $link = sefRelToAbs($matches[1]); // reconstruct html output $replace = 'href="' . $link . '"'; return $replace; } else { if (strpos($matches[1], '#') === 0) { // special handling for anchor only links $url = $_SERVER['REQUEST_URI']; $url = explode('?option', $url); if (is_array($url) && isset($url[1])) { $link = 'index.php?option' . $url[1]; // convert url to SEF link $link = sefRelToAbs($link) . $matches[1]; } else { $link = $matches[1]; // convert url to SEF link $link = sefRelToAbs($link); } // reconstruct html output $replace = 'href="' . $link . '"'; return $replace; } else { return $original; } } }
function traverse_tree_down(&$mymenu_content, $category_id = '0', $level = '0') { static $ibg = 0; global $mosConfig_live_site, $sess; $level++; $query = "SELECT category_name, category_id, category_child_id " . "FROM #__{vm}_category as a, #__{vm}_category_xref as b " . "WHERE a.category_publish='Y' AND " . " b.category_parent_id='{$category_id}' AND a.category_id=b.category_child_id " . "ORDER BY category_parent_id, list_order, category_name ASC"; $db = new ps_DB(); $db->query($query); while ($db->next_record()) { $itemid = '&Itemid=' . $sess->getShopItemid(); if ($ibg != 0) { $mymenu_content .= ","; } $mymenu_content .= "\n[ '<img src=\"' + ctThemeXPBase + 'darrow.png\" alt=\"arr\" />','" . $db->f("category_name", false) . "','" . sefRelToAbs('index.php?option=com_virtuemart&page=shop.browse&category_id=' . $db->f("category_id") . $itemid) . "',null,'" . $db->f("category_name", false) . "'\n "; $ibg++; /* recurse through the subcategories */ $this->traverse_tree_down($mymenu_content, $db->f("category_child_id"), $level); /* let's see if the loop has reached its end */ $mymenu_content .= "]"; } }