Esempio n. 1
0
 function shFetchRowName($rowid, $listid) {
	 if (empty($rowid) || $rowid == '-1') return null;
	  $database = FabrikWorker::getDbo();
	  $listModel = JModel::getInstance('View', 'FabrikFEModel');
	  $listModel->setId($listid);
	  $table = $listModel->getTable();
	  $db_primary_key = $table->db_primary_key;
	  $db_primary_key = explode('.', $db_primary_key);
	  $db_table = $db_primary_key[0];
	  $db_pk = $db_primary_key[1];
	  $sqlrow = 'SELECT title_sef, '.$db_pk.' FROM '.$db_table.' WHERE '.$db_pk.' = \''.$rowid.'\'';
	  $database->setQuery($sqlrow);
	  if (empty($shLangName))
	  $rowLabel = $database->loadResult('title_sef', false);
	  if (!empty($rowLabel)) {
		  shRemoveFromGETVarsList('rowid');
	  }
	  return isset($rowLabel) ? $rowLabel : '';
  }
Esempio n. 2
0
 function shGetJSUsernameSlug($id, $option, $shLangName)
 {
     $sefConfig =& shRouter::shGetConfig();
     $slug = '';
     if (empty($id)) {
         return $slug;
     }
     $database =& JFactory::getDBO();
     $query = 'SELECT id, username, name FROM #__users WHERE id =' . $id;
     $database->setQuery($query);
     if (!shTranslateUrl($option, $shLangName)) {
         $result = $database->loadObject(false);
     } else {
         $result = $database->loadObject();
     }
     // just in case
     if (empty($result)) {
         return 'user' . $sefConfig->replacement . $id;
     }
     // what prefix ?
     $prefix = $sefConfig->shJSInsertUserId ? $id : '';
     // what should be use as name ?
     $name = $sefConfig->shJSInsertUserFullName ? $result->name : '';
     if (empty($name)) {
         $name = $sefConfig->shJSInsertUsername ? $result->username : '';
     }
     if (!empty($name)) {
         $slug = (empty($prefix) ? '' : $prefix . $sefConfig->replacement) . $name;
     }
     // if we added the user name or full name to sef url
     // remove it from query string
     if (!empty($name) && ($sefConfig->shJSInsertUsername || $sefConfig->shJSInsertUserFullName)) {
         shRemoveFromGETVarsList('userid');
     }
     return $slug;
 }
Esempio n. 3
0
    shRemoveFromGETVarsList('limit');
}
if (isset($limitstart)) {
    shRemoveFromGETVarsList('limitstart');
}
// limitstart can be zero
// start by inserting the menu element title (just an idea, this is not required at all)
$view = isset($view) ? @$view : null;
$Itemid = isset($Itemid) ? @$Itemid : null;
$shName = shGetComponentPrefix($option);
$shName = empty($shName) ? getMenuTitle($option, '', $Itemid, null, $shLangName) : $shName;
$shName = empty($shName) || $shName == '/' ? 'jea' : $shName;
switch ($view) {
    case 'properties':
        if (!empty($id)) {
            shRemoveFromGETVarsList('id');
        }
        $title[] = $shName;
        if (!empty($id)) {
            $q = 'SELECT p.id AS id, ttype.value AS type, ttown.value AS town FROM #__jea_properties AS p' . PHP_EOL . 'LEFT JOIN #__jea_types as ttype ON ttype.id = p.type_id' . PHP_EOL . 'LEFT JOIN #__jea_towns as ttown ON ttown.id = p.town_id' . PHP_EOL . 'WHERE p.id = ' . intval($id);
            $database->setQuery($q);
            $property = $database->loadObject();
            $title[] = $id . '-' . $property->type . '--' . $property->town;
        }
        break;
    case 'manage':
        $dosef = false;
        // these tasks do not require SEF URL
        break;
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 4
0
        $title[] = '/';
        break;
    default:
        $dosef = false;
        break;
}
shRemoveFromGETVarsList('catid');
/* get catid */
if (isset($catid) && !$shSobi2Details) {
    // if task=sobi2Details, catid is NOT item category, but Current category!
    shSobi2GetCatName($catid, $title);
    shRemoveFromGETVarsList('catid');
}
/* and now get sobiid */
if (!empty($sobi2Id) && $shSobi2Details) {
    $shTemp = shSobi2GetItemName($sobi2Id);
    if (sh404SEF_SOBI2_PARAMS_ALWAYS_INCLUDE_CATS) {
        // params say include cat, but there is no cat id
        $shCatId = shSobi2GetItemCat($sobi2Id);
        if (!empty($shCatId)) {
            shSobi2GetCatName($shCatId, $title);
        }
    }
    $title[] = empty($shTemp) ? $sh_LANG[$shLangIso]['_SH404SEF_SOBI2_ENTRY'] . $sobi2Id : $shTemp;
    shRemoveFromGETVarsList('sobi2Id');
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
    if (isset($type)) {
        shRemoveFromGETVarsList('type');
    }
    if (!empty($catid)) {
        shRemoveFromGETVarsList('catid');
    }
    // V 1.2.4.m
    if (isset($showall)) {
        shRemoveFromGETVarsList('showall');
    }
    if (empty($page)) {
        // remove page if not set or 0
        shRemoveFromGETVarsList('page');
    }
    if (isset($print)) {
        shRemoveFromGETVarsList('print');
    }
    if (isset($tmpl) && $tmpl == 'component') {
        // remove if 'component', show otherwise as querystring
        shRemoveFromGETVarsList('tmpl');
    }
    // ------------------  standard plugin finalize function - don't change ---------------------------
    if ($dosef) {
        $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? $limit : null, isset($limitstart) ? $limitstart : null, isset($shLangName) ? $shLangName : null, isset($showall) ? $showall : null);
    }
    // ------------------  standard plugin finalize function - don't change ---------------------------
} else {
    // this is multipage homepage
    $title[] = '/';
    $string = sef_404::sefGetLocation($string, $title, null, isset($limit) ? $limit : null, isset($limitstart) ? $limitstart : null, isset($shLangName) ? $shLangName : null, isset($showall) ? $showall : null);
}
Esempio n. 6
0
 function create($string, &$vars, &$shAppendString, $shLanguage, $shSaveString = '', &$originalUri)
 {
     $sefConfig =& shRouter::shGetConfig();
     // get DB
     $database =& JFactory::getDBO();
     _log('Calling sef404 create function with ' . $string);
     if ($sefConfig->shInsertGlobalItemidIfNone && !empty($GLOBALS['Itemid'])) {
         // V 1.2.4.t
         $shCurrentItemid = $GLOBALS['Itemid'];
     } else {
         $shCurrentItemid = null;
     }
     _log('CurrentItemid = ' . $shCurrentItemid);
     $index = str_replace($GLOBALS['shConfigLiveSite'], '', $_SERVER['PHP_SELF']);
     $base = dirname($index);
     $base .= $base == '/' ? '' : '/';
     _log('Extracting $vars:', $vars);
     extract($vars);
     if (isset($title)) {
         // V 1.2.4.r : protect against components using 'title' as GET vars (com_jim for instance)
         $sh404SEF_title = $title;
     }
     // means that $sh404SEF_title has to be used in plugins or extensions
     $title = array();
     // V 1.2.4.r
     // get extension plugin
     $extPlugin =& Sh404sefFactory::getExtensionPlugin($option);
     // which plugin file are we supposed to use?
     $extPluginPath = $extPlugin->getSefPluginPath($vars);
     $pluginType = $extPlugin->getPluginType();
     // use Joomla router.php file in extension dir
     switch ($pluginType) {
         case Sh404sefClassBaseextplugin::TYPE_JOOMLA_ROUTER:
             // Load the plug-in file.
             _log('Loading component own router.php file');
             $functionName = ucfirst(str_replace('com_', '', $option)) . 'BuildRoute';
             if (!function_exists($functionName)) {
                 include JPATH_ROOT . DS . 'components' . DS . $option . DS . 'router.php';
             }
             $originalVars = empty($originalUri) ? $vars : $originalUri->getQuery($asArray = true);
             $title = $functionName($originalVars);
             //$title = shRemoveSlugs( $title, $removeWhat = 'removeId');
             global $mainframe;
             $router =& $mainframe->getRouter();
             $title = $router->_encodeSegments($title);
             // manage GET var lists ourselves, as Joomla router.php does not do it
             if (!empty($vars)) {
                 // there are some unused GET vars, we must transfer them to our mechanism, so
                 // that they are eventually appended to the sef url
                 foreach ($vars as $k => $v) {
                     switch ($k) {
                         case 'option':
                         case 'Itemid':
                             shRemoveFromGETVarsList($k);
                             break;
                         default:
                             // if variable has not been used in sef url, add it to list of variables to be
                             // appended to the url as query string elements
                             if (array_key_exists($k, $originalVars)) {
                                 shAddToGETVarsList($k, $v);
                             } else {
                                 shRemoveFromGETVarsList($k);
                             }
                             break;
                     }
                 }
             }
             // special case for search component, as router.php encode the search word in the url
             // wa can't do that, as we are storing each url in the db
             if (isset($originalVars['option']) && $originalVars['option'] == 'com_search' && !empty($vars['searchword'])) {
                 // router.php has encoded that in the url, we need to undo
                 $title = array();
                 $originalVars['searchword'] = $vars['searchword'];
                 shAddToGETVarsList('searchword', $vars['searchword']);
                 if (!empty($vars['view'])) {
                     $vars['view'] = $vars['view'];
                     shAddToGETVarsList('view', $vars['view']);
                 }
             }
             // handle menu items, having only a single Itemid in the url
             // (router.php will return an empty array in that case, even if we have restored
             // the full non-sef url, as we already did)
             /*
              * Build the application route
              */
             $tmp = '';
             if (empty($title) && isset($vars['Itemid']) && !empty($vars['Itemid'])) {
                 $menu =& shRouter::shGetMenu();
                 $item = $menu->getItem($vars['Itemid']);
                 if (is_object($item) && $vars['option'] == $item->component) {
                     $title[] = $item->route;
                 }
             }
             if (empty($title)) {
                 //$title[] = 'comp';
                 $title[] = substr($vars['option'], 4);
             }
             // add user defined prefix
             $prefix = shGetComponentPrefix($option);
             if (!empty($prefix)) {
                 array_unshift($title, $prefix);
             }
             // now process the resulting title string
             $string = shFinalizePlugin($string, $title, $shAppendString, '', isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null, isset($showall) ? @$showall : null);
             break;
             // use sh404sef plugins, either in ext. dir or in sh404sef dir
         // use sh404sef plugins, either in ext. dir or in sh404sef dir
         case Sh404sefClassBaseextplugin::TYPE_SH404SEF_ROUTER:
             _log('Loading sh404SEF plugin in ' . $extPluginPath);
             include $extPluginPath;
             break;
         case Sh404sefClassBaseextplugin::TYPE_JOOMSEF_ROUTER:
             Sh404sefHelperExtplugins::loadJoomsefCompatLibs();
             include_once $extPluginPath;
             $className = 'SefExt_' . $option;
             $plugin = new $className();
             if (!shIsHomepage($string)) {
                 // make sure the plugin does not try to calculate pagination
                 $params =& SEFTools::GetExtParams('com_content');
                 $params->set('pagination', '1');
                 // ask plugin to build url
                 $plugin->beforeCreate($originalUri);
                 $result = $plugin->create($originalUri);
                 $title = empty($result['title']) ? array() : $result['title'];
                 $plugin->afterCreate($originalUri);
                 // make sure we have a url
                 if (empty($title) && isset($vars['Itemid']) && !empty($vars['Itemid'])) {
                     $menu =& shRouter::shGetMenu();
                     $item = $menu->getItem($vars['Itemid']);
                     if (is_object($item) && $vars['option'] == $item->component) {
                         $title[] = $item->route;
                     }
                 }
                 $prefix = shGetComponentPrefix($option);
                 if (!empty($prefix)) {
                     array_unshift($title, $prefix);
                 }
                 if (empty($title) && !shIsHomepage($string)) {
                     $title[] = substr($vars['option'], 4);
                 }
                 list($usedVars, $ignore) = $plugin->getNonSefVars($result);
                 if (!empty($ignore)) {
                     $usedVars = array_merge($usedVars, $ignore);
                 }
             } else {
                 $string = '';
                 $title[] = '/';
                 $usedVars = array();
             }
             // post process result to adjust to our workflow
             if (!empty($vars)) {
                 foreach ($vars as $key => $value) {
                     if (!array_key_exists($key, $usedVars)) {
                         shRemoveFromGETVarsList($key);
                     }
                 }
             }
             // finalize url
             $string = shFinalizePlugin($string, $title, $shAppendString = '', $shItemidString = '', isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null, isset($showall) ? @$showall : null);
             break;
         case Sh404sefClassBaseextplugin::TYPE_ACESEF_ROUTER:
             Sh404sefHelperExtplugins::loadAcesefCompatLibs();
             include_once $extPluginPath;
             $className = 'AceSEF_' . $option;
             $plugin = new $className();
             $plugin->AcesefConfig = AcesefFactory::getConfig();
             // some plugins appear to not call the constructor parent, and so AcesefConfig is not set
             $tmp =& JPluginHelper::getPlugin('sh404sefextacesef', $option);
             $params = new JParameter($tmp->params);
             $plugin->setParams($params);
             $segments = array();
             $do_sef = true;
             $metadata = array();
             $item_limitstart = 0;
             $plugin->beforeBuild($originalUri);
             $originalVars = empty($originalUri) ? $vars : $originalUri->getQuery($asArray = true);
             $plugin->build($originalVars, $title, $do_sef, $metadata, $item_limitstart);
             $plugin->afterBuild($originalUri);
             $prefix = shGetComponentPrefix($option);
             if (empty($title) && isset($vars['Itemid']) && !empty($vars['Itemid'])) {
                 $menu =& shRouter::shGetMenu();
                 $item = $menu->getItem($vars['Itemid']);
                 if (is_object($item) && $vars['option'] == $item->component) {
                     $title[] = $item->route;
                 }
             }
             if (!empty($prefix)) {
                 array_unshift($title, $prefix);
             }
             if (empty($title) && !shIsHomepage($string)) {
                 $title[] = substr($vars['option'], 4);
             }
             // acesef plugin don't remove used vars from our GET var manager
             // we'll do it now. Vars used are those not present anymore in
             // $originalVars
             // they will be reappended to the SEF url by shFinalizePlugin
             $usedVars = array_diff($vars, $originalVars);
             if (!empty($usedVars)) {
                 foreach ($usedVars as $key => $value) {
                     shRemoveFromGETVarsList($key);
                 }
             }
             // remove Itemid and option, as these are not unset by plugin
             shRemoveFromGETVarsList('Itemid');
             shRemoveFromGETVarsList('option');
             // finalize url
             $string = shFinalizePlugin($string, $title, $shAppendString = '', $shItemidString = '', isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null, isset($showall) ? @$showall : null);
             break;
         default:
             _log('Falling back to sefGetLocation');
             if (empty($sefConfig->defaultComponentStringList[str_replace('com_', '', $option)])) {
                 $title[] = getMenuTitle($option, isset($task) ? @$task : null, null, null, $shLanguage);
             } else {
                 $title[] = $sefConfig->defaultComponentStringList[str_replace('com_', '', $option)];
             }
             if ($title[0] != '/') {
                 $title[] = '/';
             }
             // V 1.2.4.q getMenuTitle can now return '/'
             if (count($title) > 0) {
                 // V 1.2.4.q use $shLanguage insted of $lang  (lang name rather than lang code)
                 $string = sef_404::sefGetLocation($string, $title, isset($task) ? @$task : null, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLanguage) ? @$shLanguage : null);
             }
             break;
     }
     return $string;
 }
Esempio n. 7
0
            $itemId = substr($itemId, 0, $pos);
            $app = JFactory::getApplication();
            $menus = $app->getMenu();
            $menusId = $menus->getMenu();
            $title[] = $menusId[$itemId]->title;
            shRemoveFromGETVarsList('id');
            shMustCreatePageId('set', true);
        } else {
            if (isset($id)) {
                $title[] = shFetchVizName($id);
                shRemoveFromGETVarsList('id');
                shMustCreatePageId('set', true);
            }
        }
        break;
}
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('calculations');
shRemoveFromGETVarsList('formid');
shRemoveFromGETVarsList('listid');
shRemoveFromGETVarsList('cid');
shRemoveFromGETVarsList('view');
shRemoveFromGETVarsList('Itemid');
shRemoveFromGETVarsList('lang');
shRemoveFromGETVarsList('calculations');
shRemoveFromGETVarsList('random');
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($doSef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitStart) ? @$limitStart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 8
0
function addLayout(&$title, $view, $layout)
{
    $title[] = JString::ucwords(JText::_('COM_EASYSOCIAL_ROUTER_' . strtoupper($view) . '_LAYOUT_' . strtoupper($layout)));
    shRemoveFromGETVarsList('layout');
}
Esempio n. 9
0
        }
        $Itemid = $match->id;
    }
}
switch ($view) {
    case 'xml':
        $title[] = 'sitemap-xml' . (!empty($sitemap) && $sitemap > 1 ? "-{$sitemap}" : '');
        //$sefConfig->suffix='.xml';
        break;
    default:
        $shXmapName = getMenuTitle($option, isset($view) ? @$view : null, $Itemid, '', $shLangName);
        $shXmapName = empty($shXmapName) || $shXmapName == '/' ? 'Site Map' : $shXmapName;
        // V 1.2.4.t
        $title[] = $shXmapName . (!empty($sitemap) ? "-{$sitemap}" : '');
        break;
}
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('Itemid');
shRemoveFromGETVarsList('lang');
if (!empty($view)) {
    shRemoveFromGETVarsList('view');
}
if (!empty($sitemap) && $view != 'xml') {
    shRemoveFromGETVarsList('sitemap');
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
$sefConfig->suffix = $sefSuffix;
Esempio n. 10
0
    }
    $title = empty($title) ? $title : $pageInfo->router->encodeSegments($title);
}
// manage GET var lists ourselves, as Joomla router.php does not do it
if (!empty($vars)) {
    // there are some unused GET vars, we must transfer them to our mechanism, so
    // that they are eventually appended to the sef url
    foreach ($vars as $k => $v) {
        switch ($k) {
            case 'option':
            case 'Itemid':
            case 'lang':
                shRemoveFromGETVarsList($k);
                break;
            default:
                // if variable has not been used in sef url, add it to list of variables to be
                // appended to the url as query string elements
                if (array_key_exists($k, $originalVars)) {
                    shAddToGETVarsList($k, $v);
                } else {
                    shRemoveFromGETVarsList($k);
                }
                break;
        }
    }
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? $limit : null, isset($limitstart) ? $limitstart : null, isset($shLangName) ? $shLangName : null, isset($showall) ? $showall : null, $suppressPagination = true);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 11
0
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
if (isset($view)) {
    addView($title, $view);
}
if (isset($type)) {
    $title[] = $type;
    shRemoveFromGETVarsList('type');
}
if (isset($filter)) {
    $title[] = $filter;
    shRemoveFromGETVarsList('filter');
}
if (isset($listId)) {
    $title[] = getListAlias($listId);
    shRemoveFromGETVarsList('listId');
}
if (isset($appId)) {
    $title[] = getAppAlias($appId);
    shRemoveFromGETVarsList('appId');
}
if (isset($filterid)) {
    $title[] = $filterid;
    shRemoveFromGETVarsList('filterid');
}
if (isset($groupId)) {
    $title[] = getGroupAlias($groupId);
    shRemoveFromGETVarsList('groupId');
}
Esempio n. 12
0
            $title[] = '/';
            shRemoveFromGETVarsList('section');
        } else {
            $dosef = false;
        }
        break;
    case 'category':
        $cat = '';
        $sec = '';
        if (shGetNEWSPCategories($id, $option, $shLangName, $cat, $sec)) {
            $title[] = $sec;
            // section
            $title[] = $cat;
            // category
            $title[] = '/';
            shRemoveFromGETVarsList('category');
        } else {
            $dosef = false;
        }
        break;
    case '':
        $title[] = $shNewsPortalName;
        $title[] = '/';
        break;
    default:
        $dosef = false;
        break;
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
Esempio n. 13
0
 function shGetJSUsernameSlug($id, $option, $shLangName)
 {
     $sefConfig =& Sh404sefFactory::getConfig();
     $slug = '';
     if (empty($id)) {
         return $slug;
     }
     try {
         $result = ShlDbHelper::selectObject('#__users', array('id', 'username', 'name'), array('id' => $id));
     } catch (Exception $e) {
         ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());
     }
     // just in case
     if (empty($result)) {
         return 'user' . $sefConfig->replacement . $id;
     }
     // what prefix ?
     $prefix = $sefConfig->shJSInsertUserId ? $id : '';
     // what should be use as name ?
     $name = $sefConfig->shJSInsertUserFullName ? $result->name : '';
     if (empty($name)) {
         $name = $sefConfig->shJSInsertUsername ? $result->username : '';
     }
     if (!empty($name)) {
         $slug = (empty($prefix) ? '' : $prefix . $sefConfig->replacement) . $name;
     }
     // if we added the user name or full name to sef url
     // remove it from query string
     if (!empty($name) && ($sefConfig->shJSInsertUsername || $sefConfig->shJSInsertUserFullName)) {
         shRemoveFromGETVarsList('userid');
     }
     return $slug;
 }
Esempio n. 14
0
<?php

/**
* @package    EasySocial
* @copyright  Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
// Determine how is the user's current id being set.
if (isset($userid)) {
    $title[] = getUserAlias($userid);
    shRemoveFromGETVarsList('userid');
}
if (isset($view)) {
    addView($title, $view);
}
if (isset($filter)) {
    $title[] = JString::ucwords(JText::_('COM_EASYSOCIAL_ROUTER_FRIENDS_FILTER_' . strtoupper($filter)));
    shRemoveFromGETVarsList('filter');
}
Esempio n. 15
0
        break;
    case 'new':
        $title[] = $sh_LANG[$shLangIso]['COM_SH404SEF_CREATE_NEW_NEWSFEED'] . $sefConfig->suffix;
        break;
    default:
        $title[] = '/';
        // V 1.2.4.s
        break;
}
shRemoveFromGETVarsList('option');
if (!empty($Itemid)) {
    shRemoveFromGETVarsList('Itemid');
}
shRemoveFromGETVarsList('lang');
if (!empty($catid)) {
    shRemoveFromGETVarsList('catid');
}
if (isset($id)) {
    shRemoveFromGETVarsList('id');
}
if (!empty($view)) {
    shRemoveFromGETVarsList('view');
}
if (!empty($feedid)) {
    shRemoveFromGETVarsList('feedid');
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 16
0
<?php

/**
* @package    EasySocial
* @copyright  Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
if (isset($view)) {
    addView($title, $view);
}
if (isset($filter)) {
    $title[] = $filter;
    shRemoveFromGETVarsList('filter');
}
if (isset($sort)) {
    $title[] = $sort;
    shRemoveFromGETVarsList('sort');
}
Esempio n. 17
0
/**
* @package    EasySocial
* @copyright  Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
// Determine how is the user's current id being set.
if (isset($userid)) {
    $title[] = getUserAlias($userid);
    shRemoveFromGETVarsList('userid');
}
if (isset($view)) {
    addView($title, $view);
}
if (isset($id)) {
    $points = FD::table('Points');
    $points->load($id);
    $title[] = $id . '-' . JFilterOutput::stringURLSafe($points->get('title'));
    shRemoveFromGETVarsList('id');
    shRemoveFromGETVarsList('layout');
}
// URL: /user/achievements
if (isset($layout) && !isset($id)) {
    addLayout($title, $view, $layout);
}
Esempio n. 18
0
}
if (!empty($archiveyear)) {
    $title[] = $archiveyear;
    shRemoveFromGETVarsList('archiveyear');
}
if (!empty($archivemonth)) {
    $title[] = $archivemonth;
    shRemoveFromGETVarsList('archivemonth');
}
if (!empty($archiveday)) {
    $title[] = $archiveday;
    shRemoveFromGETVarsList('archiveday');
}
if (isset($limitstart)) {
    shRemoveFromGETVarsList('limitstart');
    // limitstart can be zero}
}
if (isset($pagestart)) {
    $pagestarttitle = 'page-' . ($pagestart + 1);
    $title[] = $pagestarttitle;
    shRemoveFromGETVarsList('pagestart');
    // limitstart can be zero}
}
if (isset($inclusion)) {
    shRemoveFromGETVarsList('inclusion');
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 19
0
<?php

/**
* @package    EasySocial
* @copyright  Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license    GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
// Determine how is the user's current id being set.
// /view/profile/alias
if (isset($id)) {
    $userAlias = getUserAlias($id);
    $title[] = JFilterOutput::stringURLSafe($userAlias);
    shRemoveFromGETVarsList('id');
    shRemoveFromGETVarsList('layout');
    shRemoveFromGETVarsList('view');
}
// /view
if (!isset($id) && isset($view)) {
    addView($title, $view);
}
// /view/layout
if (isset($layout)) {
    addLayout($title, $view, $layout);
}
Esempio n. 20
0
        if ($shVmCChk) {
            $title[] = 'vmchk';
        }
        // process filter hack
        $shFilterType = isset($shFilterType) ? @$shFilterType : null;
        $shFilterValue = isset($shFilterValue) ? @$shFilterValue : null;
        switch ($shFilterType) {
            case '':
                break;
            case 'minStock':
                $title[] = 'dispo';
                if (!empty($shFilterValue)) {
                    $title[] = $shFilterValue;
                }
                shRemoveFromGETVarsList('shFilterType');
                shRemoveFromGETVarsList('shFilterValue');
                break;
        }
        if (count($title) == 0) {
            $dosef = false;
        }
        break;
    default:
        $dosef = false;
        break;
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 21
0
                    // Internal to external parameter conversion
                } else {
                    $bits = explode($_PARAM_CHAR, $urlParam);
                    shAddToGETVarsList($bits[0], stripslashes(urldecode($bits[1])));
                }
            }
        }
        shAddToGETVarsList('url', 'menu');
        shRemoveFromGETVarsList('url');
    }
}
if (isset($page)) {
    shAddToGETVarsList('page', $page);
}
// Home page - there's no query string
if (isset($Itemid) && $Itemid != '') {
    shRemoveFromGETVarsList('Itemid');
} else {
    unset($shGETVars['Itemid']);
}
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('lang');
unset($shGETVars['view']);
// This param is not required for JReviews
//shRemoveFromGETVarsList('section');
//shRemoveFromGETVarsList('dir');
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 22
0
            } else {
                $title[] = $id;
            }
        } else {
            $query = "SELECT id, title from #__bt_portfolios where id='{$id}' and published = 1";
            $database->setQuery($query);
            $result = $database->loadObject();
            if (!empty($result)) {
                $title[] = $result->title;
            } else {
                $title[] = $id;
            }
        }
    case '':
        $task = isset($task) ? $task : null;
        if ($task) {
            $title[] = str_replace('.', '_', $task);
            shRemoveFromGETVarsList('task');
        }
        break;
    default:
        $dosef = false;
        break;
}
$Itemid = isset($Itemid) ? $Itemid : null;
if (isset($Itemid)) {
    shRemoveFromGETVarsList('Itemid');
}
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
Esempio n. 23
0
    shRemoveFromGETVarsList('Itemid');
}
if (isset($year)) {
    shRemoveFromGETVarsList('year');
}
if (isset($month)) {
    shRemoveFromGETVarsList('month');
}
if (isset($day)) {
    shRemoveFromGETVarsList('day');
}
if (isset($id)) {
    shRemoveFromGETVarsList('id');
}
/*
 * Only remove format variable if form is html. In all other situations, leave it there as some system plugins
 * may cause pdf and rss to break if they call JFactory::getDocument() in the onAfterInitialize event handler
 * because at this time SEF url are not decoded yet.
 *
 */
if (isset($format) && (!sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR || sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR && $format == 'html')) {
    shRemoveFromGETVarsList('format');
}
if (isset($moduleID)) {
    shRemoveFromGETVarsList('moduleID');
}
// ------------------ Standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------ Standard plugin finalize function - don't change ---------------------------
                }
                shRemoveFromGETVarsList('redirect');
                shRemoveFromGETVarsList('submission_id');
                shRemoveFromGETVarsList('submission_hash');
                shRemoveFromGETVarsList('type_id');
                shRemoveFromGETVarsList('item_id');
                shRemoveFromGETVarsList('layout');
                break;
            case 'mysubmissions':
                $title[] = ZOO_SEF_SUBMISSION;
                if (isset($submission_hash)) {
                    $title[] = $submission_hash;
                }
                $title[] = $alias->submission->translateIDToAlias((int) $submission_id);
                $title[] = isset($page) ? ZOO_SEF_PAGE . $page : '';
                shRemoveFromGETVarsList('submission_hash');
                shRemoveFromGETVarsList('page');
                shRemoveFromGETVarsList('layout');
                shRemoveFromGETVarsList('submission_id');
                break;
            default:
                break;
        }
        break;
    default:
        $dosef = false;
        $title = null;
        // trigger yoonique404sef event
        $zooapp->event->dispatcher->notify($zooapp->event->create(null, 'application:yoonique404sef', array('title' => &$title, 'query' => &$query, 'dosef' => &$dosef)));
        break;
}
Esempio n. 25
0
        $title[] = '/';
        shRemoveFromGETVarsList('task');
        break;
    case '':
        if (empty($title)) {
            $title[] = $shHotPropName;
        }
        // at least put defautl name, even if told not to do so
        $title[] = '/';
        break;
    default:
        $dosef = false;
        break;
}
/* sh404SEF extension plugin : remove vars we have used, adjust as needed --*/
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('lang');
shRemoveFromGETVarsList('Itemid');
if (isset($limit)) {
    shRemoveFromGETVarsList('limit');
}
if (isset($limitstart)) {
    shRemoveFromGETVarsList('limitstart');
}
// limitstart can be zero
/* sh404SEF extension plugin : end of remove vars we have used -------------*/
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 26
0
 function shMTGetCustomFieldById($cfId)
 {
     static $fields = null;
     if (is_null($fields)) {
         $db =& JFactory::getDBO();
         $sql = 'select cf_id, caption from #__mt_customfields';
         $db->setQuery($sql);
         $fields = $db->loadObjectList('cf_id');
     }
     // check if we have this field
     $cfCaption = empty($fields[$cfId]) ? '' : $fields[$cfId]->caption;
     if (!empty($cfCaption)) {
         shRemoveFromGETVarsList('cf_id');
     }
     return $cfCaption;
 }
Esempio n. 27
0
 * Websites: http://www.bang2joom.com
  ------------------------------------------------------------------------
 */
global $sh_LANG;
$sefConfig =& shRouter::shGetConfig();
$shLangName = '';
$shLangIso = '';
$title = array();
$shItemidString = '';
$dosef = shInitializePlugin($lang, $shLangName, $shLangIso, $option);
if ($dosef == false) {
    return;
}
if (isset($Itemid)) {
    shRemoveFromGETVarsList('Itemid');
} else {
    $Itemid = null;
}
shRemoveFromGETVarsList('lang');
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('bid');
if (strpos($string, "view=loader") === false) {
    shRemoveFromGETVarsList("view");
}
if (!isset($task)) {
    $task = '';
}
$title[] = getMenuTitle($option, $task, $Itemid, null, $shLangName);
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
Esempio n. 28
0
// limitstart can be zero
//$title[] = getMenuTitle($option, (isset($task) ? @$task : null));
$title[] = $sh_LANG[$shLangIso]['COM_SH404SEF_SEARCH'];
$ordering = isset($ordering) ? @$ordering : null;
switch ($ordering) {
    case 'newest':
        $title[] = $sh_LANG[$shLangIso]['_SEARCH_NEWEST'];
        shRemoveFromGETVarsList('ordering');
        break;
    case 'oldest':
        $title[] = $sh_LANG[$shLangIso]['_SEARCH_OLDEST'];
        shRemoveFromGETVarsList('ordering');
        break;
    case 'popular':
        $title[] = $sh_LANG[$shLangIso]['_SEARCH_POPULAR'];
        shRemoveFromGETVarsList('ordering');
        break;
    case 'alpha':
        $title[] = $sh_LANG[$shLangIso]['_SEARCH_ALPHABETICAL'];
        shRemoveFromGETVarsList('ordering');
        break;
    case 'category':
        $title[] = $sh_LANG[$shLangIso]['_SEARCH_CATEGORY'];
        shRemoveFromGETVarsList('ordering');
        break;
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 29
0
        // according to language
        // only if you have defined the
        if (!empty($sampleId)) {
            // fetch some data about the content
            try {
                // using shLib database helper is J2.x/J3.x safe
                $sampleTitle = ShlDbHelper::selectObject('#__sample_names', array('id', 'title'), array('id' => $sampleId));
            } catch (Exception $e) {
                ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());
            }
            if ($sampleTitle) {
                // if we found a title for this element
                $title[] = $sampleTitle->title;
                // insert it in URL array
                shRemoveFromGETVarsList('sampleId');
                // remove sampleId var from GET vars list
                // as we have found a text equivalent
                shMustCreatePageId('set', true);
                // NEW: ask sh404sef to create a short URL for this SEF URL (pageId)
            }
        }
        shRemoveFromGETVarsList('task');
        // also remove task, as it is not needed
        // because we can revert the SEF URL without
        // it
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------
Esempio n. 30
0
        }
        if (isset($id)) {
            $title[] = $id;
            shRemoveFromGETVarsList('id');
        }
        break;
    case 'notifications-cron':
    case 'refreshObjectsAjax':
        $dosef = false;
        break;
    default:
        $title[] = $shJCommentsName;
        $title[] = $task;
}
shRemoveFromGETVarsList('task');
shRemoveFromGETVarsList('view');
shRemoveFromGETVarsList('format');
shRemoveFromGETVarsList('tmpl');
if (isset($object_group)) {
    $title[] = $object_group;
    shRemoveFromGETVarsList('object_group');
}
if (isset($object_id)) {
    $title[] = $object_id;
    shRemoveFromGETVarsList('object_id');
}
// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef) {
    $string = shFinalizePlugin($string, $title, $shAppendString, $shItemidString, isset($limit) ? @$limit : null, isset($limitstart) ? @$limitstart : null, isset($shLangName) ? @$shLangName : null);
}
// ------------------  standard plugin finalize function - don't change ---------------------------