Esempio n. 1
0
 function save_code()
 {
     $code = JREQUEST::getVar('code', '', '', 'string');
     $code = addslashes($code);
     jimport('joomla.form.form');
     $params =& JForm::getInstance('params', JPATH_ADMINISTRATOR . '/components/com_muzeetop/config.xml');
     $code_activation = $params->getInput('code_activation');
     var_dump($code_activation);
     var_dump($params);
     $component =& JComponentHelper::getComponent('com_muzeetop');
     if ($code != "" and strlen($code) == 8) {
         $params->setValue('code_activation', $code);
         var_dump($params);
         var_dump($code_activation);
         $parameters = $params->toString();
         $db =& JFactory::getDBO();
         $donnees = new stdClass();
         $donnees->id = $component->id;
         $donnees->params = $parameters;
         $db->updateObject('#__components', $donnees, 'id');
         if ($db !== false) {
             $msg = JTEXT::_('COM_MUZEETOP_MSG_CODE_ENREGISTRE');
         } else {
             $msg = JTEXT::_('COM_MUZEETOP_MSG_ERREUR_BASE_CODE');
         }
     } else {
         $msg = JText::_('COM_MUZEETOP_ERREUR_SAUVEGARDE_CODE');
     }
     $link = 'index.php?option=com_muzeetop';
     $this->setRedirect($link, $msg);
 }
Esempio n. 2
0
 function save()
 {
     $model = $this->getModel('mzpromoradio');
     $db = $model->connectMuzeeli();
     $nom = JRequest::getVar('nom', '', '', 'string');
     $description = JRequest::getVar('description', '', '', 'string');
     $uid = JRequest::getVar('uid', '', '', 'string');
     $nom_site = JRequest::getVar('nom_site', '', '', 'string');
     $lien_site = JRequest::getVar('lien_site', '', '', 'string');
     $id_user = JRequest::getVar('id_abonnes', '', '', 'int');
     $flux = JREQUEST::getVar('flux', '', '', 'flux');
     //$params = &JComponentHelper::getParams( 'com_muzeededi' );
     $q_nom = $db->Quote(htmlspecialchars($nom));
     $q_description = $db->Quote(htmlspecialchars($description));
     $q_uid = $db->Quote(htmlspecialchars($uid));
     $q_nom_site = $db->Quote(htmlspecialchars($nom_site));
     $q_lien_site = $db->Quote(htmlspecialchars($lien_site));
     $q_flux = $db->Quote(htmlspecialchars($flux));
     $query = "INSERT INTO #__mzpromoradio (id,nom,description,uid,nom_site,lien_site,id_user,flux) VALUES ('',{$q_nom},{$q_description},{$q_uid},{$q_nom_site},{$q_lien_site},'{$id_user}',{$q_flux})";
     $test = $db->SetQuery($query);
     $test2 = $db->query();
     $msg = "";
     if ($test2 === true) {
         //point alphauserpoints
         $api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
         if (file_exists($api_AUP)) {
             require_once $api_AUP;
             AlphaUserPointsHelper::newpoints('plgaup_mzpromoradio', '', $uid, 'Promo Radio');
         }
         //fin alphauserpoints
         $mail = $this->alerteMail($nom);
         $msg = JTEXT::_("COM_MZPROMORADIO_PROMO_ENREGISTREE");
     } else {
         $msg = JTEXT::_("COM_MZPROMORADIO_PROMO_ERREUR");
     }
     $link = 'index.php?option=com_mzpromoradio';
     $this->setRedirect($link, $msg);
 }
Esempio n. 3
0
defined('_JEXEC') or die('Restricted access');
global $_client_auth_key;
$_M_configuration = $this->getModel('configuration');
$_M_jobsharing = $this->getModel('jobsharing');
$msg = JRequest::getVar('msg');
$option = 'com_jsjobs';
$mainframe = JFactory::getApplication();
if ($_client_auth_key == "") {
    $_client_auth_key = $_M_jobsharing->getClientAuthenticationKey();
}
$layoutName = JRequest::getVar('layout', '');
if ($layoutName == '') {
    $layoutName = $this->getLayout();
}
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = JREQUEST::getVar('limitstart', 0, 'int');
$isNew = true;
$user = JFactory::getUser();
$uid = $user->id;
// get configurations
$config = array();
if ($_M_configuration->isTestMode()) {
    $config = null;
} else {
    if (isset($_SESSION['jsjobconfig'])) {
        $config = $_SESSION['jsjobconfig'];
    } else {
        $config = null;
    }
}
if (sizeof($config) == 0) {
Esempio n. 4
0
$mainframe = JFactory::getApplication();
$shPageInfo =& Sh404sefFactory::getPageInfo();
// get page details gathered by system plugin
$sefConfig =& Sh404sefFactory::getConfig();
$database = ShlDbHelper::getDb();
$view = JREQUEST::getCmd('view', null);
$catid = JREQUEST::getInt('catid', null);
$id = JREQUEST::getInt('id', null);
$limit = JREQUEST::getInt('limit', null);
$limitstart = JREQUEST::getInt('limitstart', null);
$layout = JREQUEST::getCmd('layout', null);
$showall = JREQUEST::getInt('showall', null);
$format = JREQUEST::getCmd('format', null);
$print = JREQUEST::getInt('print', null);
$tmpl = JREQUEST::getCmd('tmpl', null);
$lang = JREQUEST::getString('lang', null);
$shLangName = empty($lang) ? $shPageInfo->currentLanguageTag : shGetNameFromIsoCode($lang);
$shLangIso = isset($lang) ? $lang : shGetIsoCodeFromName($shPageInfo->currentLanguageTag);
$shLangIso = shLoadPluginLanguage('com_content', $shLangIso, 'COM_SH404SEF_CREATE_NEW');
//-------------------------------------------------------------
global $shCustomTitleTag, $shCustomDescriptionTag, $shCustomKeywordsTag, $shCustomLangTag, $shCustomRobotsTag, $shCanonicalTag;
// special case for 404
if (!empty($shPageInfo->httpStatus) && $shPageInfo->httpStatus == 404) {
    $shCustomTitleTag = '404';
    $shCustomRobotsTag = 'noindex, follow';
    return;
}
// add no follow to print pages
$shCustomRobotsTag = $tmpl == 'component' && !empty($print) ? 'noindex, nofollow' : $shCustomRobotsTag;
// calculate page title
$title = array();
Esempio n. 5
0
$path = dirname(__FILE__);
$path = explode("/modules/", $path);
$path = $path[0];
define('JPATH_BASE', $path);
define('DS', DIRECTORY_SEPARATOR);
/* Required Files */
require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php';
/* To use Joomla's Database Class */
require_once JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php';
/* Create the Application */
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
//on execute le module muzeetopalea
jimport('joomla.application.module.helper');
$titre_module = JREQUEST::getVar('titre', '', '', 'string');
//on cherche l'itemid d'une page qui comporte le module muzeeliNow
$db = JFactory::getDBO();
$query = "select menuid from #__modules_menu AS mm, #__modules AS m WHERE mm.moduleid=m.id AND m.title=" . $db->Quote($titre_module);
$db->setQuery($query);
$result = $db->loadResult();
$Itemid = JRequest::setVar('Itemid', $result);
//on execute le module
$module = JModuleHelper::getModule('muzeetopalea', $titre_module);
$html = JModuleHelper::renderModule($module);
//on supprime le premier div
$chaine = "<p class='mtopa_titre'>";
$pos = strpos($html, $chaine);
$html = substr($html, $pos);
$html = substr($html, 0, strlen($html) - 6);
//On affiche le contenu du div
Esempio n. 6
0
 function onAfterRoute()
 {
     $app = JFactory::getApplication();
     // No need in admin panel
     if ($app->isAdmin()) {
         return;
     }
     $option = JREQUEST::getVar("option", null, "REQUEST");
     $view = JREQUEST::getVar("view", null, "REQUEST");
     $Itemid = JREQUEST::getVar("Itemid", null, "REQUEST");
     $task = JREQUEST::getVar("task", null, "REQUEST");
     $id = JREQUEST::getVar("id", null, "GET");
     $do = JREQUEST::getVar("do", null, "REQUEST");
     $layout = JREQUEST::getVar("layout", null, "REQUEST");
     //$func_kunena=JREQUEST::getVar("func",null,"GET");
     $route =& JRouter::getInstance("site");
     $uri =& JURI::getInstance();
     $path = $uri->getPath();
     $mode = $route->getMode();
     $count = "";
     if ($mode != "1") {
         //pas de mode SEF
         // We verify in database that article exists and that it is published
         if ($option == "com_content" && $view == "article" && $id != "") {
             $id = explode(':', $id, 2);
             $id = $id[0];
             $db =& JFactory::getDBO();
             $query = "SELECT COUNT(*) FROM #__content WHERE id = {$id} and (state=1 or state='-1') and (publish_down>NOW() OR publish_down='0000-00-00 00:00:00')";
             $db->setQuery($query);
             $count = $db->loadResult();
         }
         if ($option == "com_kunena" && $do != "") {
             return;
         }
         if ($option == "com_camelcitycontent") {
             return;
         }
         if ($option == "com_content" && $view == "frontpage" && $Itemid == 1 && !isset($_SERVER['REDIRECT_URL']) && $mode == "1") {
             return;
         }
         if ($option == "com_content" && $view == "frontpage" && $Itemid == 1 && $_SERVER['SCRIPT_FILENAME'] == JPATH_BASE . "/index.php" && $mode == "0" && !isset($_SERVER['REDIRECT_URL'])) {
             return;
         }
         if ($option == "com_content" && $view == "article" && $layout == "form") {
             return;
         }
         if ($view == "article" && $task == "edit") {
             return;
         }
         if ($task == "save" or $task == "cancel") {
             return;
         }
         if ($path == "/index2.php" or $task == "login" or $task == "logout") {
             return;
         }
         $result_error404 = JComponentHelper::getComponent("com_error404");
         //we test if com_error404 is enabled
         if ($result_error404->enabled == 1) {
             //we verify if the component in the query string is enabled
             $component = JComponentHelper::getComponent($option, true);
             if ($component->enabled != 1 and $option != "" or strpos($_SERVER['REQUEST_URI'], 'index.php') === false and $_SERVER['REQUEST_URI'] != "/" or $option == "com_content" and $view == "article" and $count != "1") {
                 JREQUEST::setVar("option", "com_error404");
                 JREQUEST::setVar("uri", $_SERVER['REQUEST_URI']);
                 JREQUEST::setVar("view", "error404");
             }
         }
     }
 }
Esempio n. 7
0
 static function addTitleAndMetaTags()
 {
     global $database, $doc, $mainframe, $Itemid;
     $view = JREQUEST::getCmd('view', null);
     $catid = JREQUEST::getInt('catid', null);
     $id = JREQUEST::getInt('id', null);
     $lang = JREQUEST::getString('lang', null);
     $title = array();
     $sitename = htmlspecialchars($mainframe->getCfg('sitename'));
     if (isset($view)) {
         $view = str_replace("_", " ", $view);
         $view = ucfirst($view);
         $title[] = $view;
     }
     $s = blLittleThings::getWhereUsergroupsCondition();
     if (!isset($catid)) {
         // Parameters
         if (version_compare(JVERSION, '3.0', 'ge')) {
             $menu = new JTableMenu($database);
             $menu->load($Itemid);
             $params = new JRegistry();
             $params->loadString($menu->params);
         } else {
             $menu = new mosMenu($database);
             $menu->load($Itemid);
             $params = new mosParameters($menu->params);
         }
         if (version_compare(JVERSION, "1.6.0", "lt")) {
             $catid = $params->get('catid');
         } else {
             if (version_compare(JVERSION, "1.6.0", "ge") && version_compare(JVERSION, "3.5.100", "lt")) {
                 $single_category_id = '';
                 // for 1.6
                 $single_category_id = $params->get('single_category');
                 if ($single_category_id > 0) {
                     $catid = $single_category_id;
                 }
             }
         }
     }
     //To get name of category
     if (isset($catid)) {
         $query = "SELECT  c.name, c.id AS catid, c.parent_id\n                    FROM #__booklibrary_main_categories AS c\n                    WHERE ({$s}) AND c.id = " . intval($catid);
         $database->setQuery($query);
         $row = null;
         $row = $database->loadObject();
         if (isset($row)) {
             $cattitle = array();
             $cattitle[] = $row->name;
             while (isset($row) && $row->parent_id > 0) {
                 $query = "SELECT  name, c.id AS catid, parent_id \n                        FROM #__booklibrary_main_categories AS c\n                        WHERE ({$s}) AND c.id = " . intval($row->parent_id);
                 $database->setQuery($query);
                 $row = $database->loadObject();
                 if (isset($row) && $row->name != '') {
                     $cattitle[] = $row->name;
                 }
             }
             $title = array_merge($title, array_reverse($cattitle));
         }
     }
     //To get Name of the book
     if (isset($id)) {
         $row = $database->loadObject();
         if (isset($row)) {
             $idtitle = array();
             $title = array_merge($title, $idtitle);
         }
     }
     $tagtitle = "";
     for ($i = 0; $i < count($title); $i++) {
         $tagtitle = trim($tagtitle) . " | " . trim($title[$i]);
     }
     $blm = "BookLibrary Manager ";
     //To set Title
     $title_tag = PHP_booklibrary::mylenStr($blm . $tagtitle, 75);
     //To set meta Description
     $metadata_description_tag = PHP_booklibrary::mylenStr($blm . $tagtitle, 200);
     //To set meta KeywordsTag
     $metadata_keywords_tag = PHP_booklibrary::mylenStr($blm . $tagtitle, 250);
     $doc->setTitle($title_tag);
     $doc->setMetaData('description', $metadata_description_tag);
     $doc->setMetaData('keywords', $metadata_keywords_tag);
 }
Esempio n. 8
0
<?php

/**
 * shCustomTags support for com_content
 * Yannick Gaultier, shumisha
 * shumisha@gmail.com
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @version     $Id$
 *
 *  This module must set $shCustomTitleTag, $shCustomDescriptionTag, $shCustomKeywordsTag,$shCustomLangTag, $shCustomRobotsTag according to specific component output
 *
 * if you set a variable to '', this will ERASE the corresponding meta tag
 * if you set a variable to null, this will leave the corresponding meta tag UNCHANGED
 *
 * {shSourceVersionTag: Version x - 2007-09-20}
 *
 */
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
global $shCustomTitleTag, $shCustomDescriptionTag, $shCustomKeywordsTag, $shCustomLangTag, $shCustomRobotsTag;
$subtype = JREQUEST::getVar('subtype', null);
$xref = JRequest::getInt('xref', false);
$app =& JFactory::getApplication();
if (!is_null($subtype) && $xref) {
    $db = JFactory::getDBO();
    /* Get the event name/place/start date/start time */
    $q = "SELECT e.title, v.city, DATE_FORMAT(x.dates, '%d-%m-%Y') AS dates, TIME_FORMAT(x.times, '%H-%i') AS times\n\t\tFROM #__redevent_event_venue_xref x\n\t\tLEFT JOIN #__redevent_events e\n\t\tON e.id = x.eventid\n\t\tLEFT JOIN #__redevent_venues v\n\t\tON v.id = x.venueid\n\t\tWHERE x.id = " . $xref;
    $db->setQuery($q);
    $details = $db->loadObject();
    // 'website' Online Signup | Date | Location | Coursetitle
    $shCustomTitleTag = $app->getCfg('sitename') . ' Online Signup' . ' | ' . $details->dates . ' | ' . ucfirst($details->city) . ' | ' . ucfirst($details->title);
}
Esempio n. 9
0
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
global $Itemid;
global $shMosConfig_locale, $sh_LANG, $mainframe;
$sefConfig =& shRouter::shGetConfig();
$database =& JFactory::getDBO();
$view = JREQUEST::getVar('view', null);
$catid = JREQUEST::getVar('catid', null);
$id = JREQUEST::getVar('id', null);
$limit = JREQUEST::getVar('limit', null);
$limitstart = JREQUEST::getVar('limitstart', null);
$layout = JREQUEST::getVar('layout', null);
$showall = JREQUEST::getVar('showall', null);
$format = JREQUEST::getVar('format', null);
$print = JREQUEST::getVar('print', null);
$tmpl = JREQUEST::getVar('tmpl', null);
$lang = JREQUEST::getVar('lang', null);
$shLangName = empty($lang) ? $shMosConfig_locale : shGetNameFromIsoCode($lang);
$shLangIso = isset($lang) ? $lang : shGetIsoCodeFromName($shMosConfig_locale);
$shLangIso = shLoadPluginLanguage('com_content', $shLangIso, 'COM_SH404SEF_CREATE_NEW');
//-------------------------------------------------------------
global $shCustomTitleTag, $shCustomDescriptionTag, $shCustomKeywordsTag, $shCustomLangTag, $shCustomRobotsTag;
// add no follow to print pages
$shCustomRobotsTag = $tmpl == 'component' && !empty($print) ? 'noindex, nofollow' : $shCustomRobotsTag;
// calculate page title
$title = array();
switch ($view) {
    case 'archivecategory':
    case 'archivesection':
        $shCustomTitleTag = $sh_LANG[$shLangIso]['COM_SH404SEF_ARCHIVE'] . ' ' . $sefConfig->replacement . ' ' . $GLOBALS['shConfigLiveSite'];
        break;
    case 'edit':