<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[2.5] Modificare parte della url]]></title><description><![CDATA[<p dir="auto">Ciao a tutti volevo sapere se qualcuno sa come modificare il seguente codice (components/com_sh404sef/sef_ext/com_content.php in joomla 2.5) perchè l'id dell'articolo venga mostrato alla fine dell'url e non all'inizio in questo modo.</p>
<p dir="auto">L'url attualmente è mostrata così:<br />
<a href="http://www.mysite.com/section/category/" rel="nofollow ugc">http://www.mysite.com/section/category/</a>1277-article_title.html<a href="http://www.mysite.com/section/category/" rel="nofollow ugc">http://www.mysite.com/section/category/</a></p>
<p dir="auto">Vorrei modificarla così:<br />
<a href="http://www.mysite.com/section/category/" rel="nofollow ugc">http://www.mysite.com/section/category/</a>article_title-1277.html</p>
<p dir="auto">Ecco il codice:</p>
<pre><code class="language-php">&lt;?php/** * sh404SEF - SEO extension for Joomla! * * @author      Yannick Gaultier * @copyright   (c) Yannick Gaultier 2012 * @package     sh404sef * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL * @version     3.7.0.1485 * @date		2012-11-26 */
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
// ------------------  standard plugin initialize function - don't change ---------------------------global $sh_LANG;$sefConfig = &amp; Sh404sefFactory::getConfig();$shLangName = '';$shLangIso = '';$title = array();$shItemidString = '';$dosef = shInitializePlugin( $lang, $shLangName, $shLangIso, $option);if ($dosef == false) return;// ------------------  standard plugin initialize function - don't change ---------------------------
// ------------------  load language file - adjust as needed ----------------------------------------$shLangIso = shLoadPluginLanguage( 'com_content', $shLangIso, 'COM_SH404SEF_CREATE_NEW');// ------------------  load language file - adjust as needed ----------------------------------------
// get DB$database =ShlDbHelper::getDb();
// 1.2.4.q this is content item, so let's try to improve missing Itemid handling// retrieve section id to know whether this static or not$shHomePageFlag = false;
$shHomePageFlag = !$shHomePageFlag ? shIsHomepage ($string): $shHomePageFlag;
if (!$shHomePageFlag) {  // we may have found that this is homepage, so we msut return an empty string  // do something about that Itemid thing  if (!preg_match( '/Itemid=[0-9]+/iu', $string)) { // if no Itemid in non-sef URL    // V 1.2.4.t moved back here    if ($sefConfig-&gt;shInsertGlobalItemidIfNone &amp;&amp; !empty($shCurrentItemid)) {      $string .= '&amp;Itemid='.$shCurrentItemid; ;  // append current Itemid      $Itemid = $shCurrentItemid;      shAddToGETVarsList('Itemid', $Itemid); // V 1.2.4.m    }
    if ($sefConfig-&gt;shInsertTitleIfNoItemid)    $title[] = $sefConfig-&gt;shDefaultMenuItemName ?  		$sefConfig-&gt;shDefaultMenuItemName : getMenuTitle($option, (isset($view) ? $view : null), $shCurrentItemid, null, $shLangName );  // V 1.2.4.q added forced language  		$shItemidString = '';  		if ($sefConfig-&gt;shAlwaysInsertItemid &amp;&amp; (!empty($Itemid) || !empty($shCurrentItemid)))    $shItemidString = JText::_('COM_SH404SEF_ALWAYS_INSERT_ITEMID_PREFIX').$sefConfig-&gt;replacement    .(empty($Itemid)? $shCurrentItemid :$Itemid);  } else {  // if Itemid in non-sef URL    $shItemidString = $sefConfig-&gt;shAlwaysInsertItemid ?    JText::_('COM_SH404SEF_ALWAYS_INSERT_ITEMID_PREFIX').$sefConfig-&gt;replacement.$Itemid    : '';    if ($sefConfig-&gt;shAlwaysInsertMenuTitle){      //global $Itemid; V 1.2.4.g we want the string option, not current page !      if ($sefConfig-&gt;shDefaultMenuItemName)      $title[] = $sefConfig-&gt;shDefaultMenuItemName;// V 1.2.4.q added force language      elseif ($menuTitle = getMenuTitle($option, (isset($view) ? $view : null), $Itemid, '',$shLangName )) {        if ($menuTitle != '/') $title[] = $menuTitle;      }    }  }  // V 1.2.4.m  shRemoveFromGETVarsList('option');  shRemoveFromGETVarsList('lang');  if (!empty($Itemid))  shRemoveFromGETVarsList('Itemid');  if (!empty($limit))  shRemoveFromGETVarsList('limit');  if (isset($limitstart))  shRemoveFromGETVarsList('limitstart');
  $view = isset($view) ? $view : null;  $layout = isset($layout) ? $layout : null;  $task = isset($task) ? $task : null;  switch ($view) {    case 'archivecategory':    case 'archivesection' :    case 'archive' :      $dosef = false;      break;    case 'form':      if ($layout == 'edit' &amp;&amp; empty($a_id)) { // submit new article        $title[] = $sh_LANG[$shLangIso]['COM_SH404SEF_CREATE_NEW'];      } else {        $dosef = false;      }      break;    default:      if (sh404SEF_PDF_DIR &amp;&amp; $view == 'article' &amp;&amp; !empty($format) &amp;&amp; $format == 'pdf') {        $title[] = sh404SEF_PDF_DIR;		// insert pdf directory        shMustCreatePageId( 'set', true);      }
      // V 1.2.4.j 2007/04/11 : numerical ID, on some categories only      if ($sefConfig-&gt;shInsertNumericalId &amp;&amp; isset($sefConfig-&gt;shInsertNumericalIdCatList)      &amp;&amp; !empty($id) &amp;&amp; ($view == 'article')) {
        try {          $contentElement = ShlDbHelper::selectObject( '#__content', array( 'id', 'catid', 'created'), array( 'id' =&gt; $id));        } catch( Exception $e) {          ShlSystem_Log::error( 'sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e-&gt;getMessage());        }
        if ($contentElement) {          $foundCat = array_search($contentElement-&gt;catid, $sefConfig-&gt;shInsertNumericalIdCatList);          if (($foundCat !== null &amp;&amp; $foundCat !== false)          || ($sefConfig-&gt;shInsertNumericalIdCatList[0] == ''))  { // test both in case PHP &lt; 4.2.0            $shTemp = explode(' ', $contentElement-&gt;created);            $title[] = str_replace('-','', $shTemp[0]).$contentElement-&gt;id;          }        }      }
      // use libray function to fetch Joomla content title      if ($task == 'article.edit') {        if (empty($a_id)) { // submit new article          $title[] = $sh_LANG[$shLangIso]['COM_SH404SEF_CREATE_NEW'];        } else {          $dosef = false;        }      } else if (empty($layout) || (!empty($layout) &amp;&amp; $layout != 'edit')) {
        $contentTitle = sef_404::getContentSlugsArray((isset($view) ? $view : null),(isset($id) ? $id : null),        (isset($layout) ? $layout : null), (isset($Itemid) ? $Itemid : null), $shLangName);        if (!empty($title)) {          $title = array_merge($title, $contentTitle); // V 1.2.4.q added forced language        } else {          $title = $contentTitle; // V 1.2.4.q added forced language        }        if (!empty($format) &amp;&amp; $format == 'feed'){          $title[] = $format;          if (!empty($type) &amp;&amp; $format != $type)          $title[] = $type;        }        if (!empty($print)) {          $title[] = JText::_( 'Print' );        } else {          shMustCreatePageId( 'set', true);        }      } else {        $dosef = false;      }
  }  // V 1.2.4.q  shRemoveFromGETVarsList('view');  if (isset($id))  shRemoveFromGETVarsList('id');  if (isset($layout))  shRemoveFromGETVarsList('layout');  // only remove format variable if forma tis 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) &amp;&amp; (!sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR || (sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR &amp;&amp; $format == 'html')))  shRemoveFromGETVarsList('format');  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) &amp;&amp; $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));
}
</code></pre>
]]></description><link>https://dev.connect.gt/topic/184631/2-5-modificare-parte-della-url</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 22:13:23 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/184631.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Feb 2013 16:01:10 GMT</pubDate><ttl>60</ttl></channel></rss>