Author Topic: How to run SobiSEF with JoomFish  (Read 9733 times)

0 Members and 1 Guest are viewing this topic.

Offline binarycoder

Re: How to run SobiSEF with JoomFish
« Reply #20 on: 15. May 2010, 19:22:25 »
Hi all,

After the following code in file "/components/com_sobi2/plugins/sobisef/sobisef.class.php"

      // if we don't have Menu Itemid
      if ( strstr( $request, "component/" ) ) {
         $request = str_replace( "component/", null, $request );
      }



Add this:

      // if joomfish installed
      if(JFile::exists(JPATH_SITE .DS. 'components' .DS. 'com_joomfish' .DS. 'helpers' .DS. 'defines.php')) {
         
         // get language sefprefixes (defined in jfrouter plugin admin panel)
         $my_joomla_conf =& JFactory::getConfig();
         $my_jfish_params = $my_joomla_conf->getValue("jfrouter.params");
         $my_jfish_sefprefixes = $my_jfish_params->getValue("sefprefixes",array());
         
         foreach ($my_jfish_sefprefixes as $my_jfish_prefix) {
            list( , $my_jfish_prefix) = split("::",$my_jfish_prefix,2);
           
            // removing language sefprefix if it exists in requested url
            if ( strstr( $request, $my_jfish_prefix."/" ) ) {
               $request = str_replace( $my_jfish_prefix."/", null, $request );
               break;
            }
         }
      }



This modification concerns function revert() which parses url requests, and we need to remove any additional info in the url that is not stored in the db (sobisef table) before further processing. Same thing is done when joomla is installed in a subdirectory and for 'component/' (when no sobi2 menu exists) and for "index.php/" when mod_rewrite not in use (look few lines before this added code)

Notes:
1. You might need to do the following: "Extensions>Plugin Manager>" click on "System - Jfrouter" then hit save or apply (getValue("jfrouter.params") did not return the plugin parameters before doing so)

2. Don't translate sobi2 menu item alias, translate menu name only.


Appreciate any feedback

First i want to say thanks

It works really good ...


Extending possibilities
Country: United States United States |  OS: Windows Vista/Server 2008 Windows Vista/Server 2008 |  Browser: Firefox 3.0.5 Firefox 3.0.5 | View Profile

Offline zman1015

Re: How to run SobiSEF with JoomFish
« Reply #21 on: 14. October 2010, 20:19:25 »
After upgrading to Sobi2 V 2.9.3.2 the errors below.  I have modified the Sobisef.class file per this discussion.  Am I missing something? 

Notice: Undefined offset: 1 in /home2/plastie2/public_html/components/com_sobi2/plugins/sobisef/sobisef.class.php on line 1410
No valid database connection You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=SELECT rel.catid FROM jos_sobi2_categories AS cat LEFT JOIN jos_sobi2_cat_items_relations AS rel ON cat.catid = rel.catid AND cat.published = 1 WHERE itemid =

Notice: Undefined offset: 0 in /home2/plastie2/public_html/components/com_sobi2/plugins/sobisef/sobisef.class.php on line 1411
Country: United States United States |  OS: Windows Vista/Server 2008 Windows Vista/Server 2008 |  Browser: Firefox 3.6.10 Firefox 3.6.10 | View Profile Plastic Places

Do you want continued ongoing development, new features and active support?
Please write a review or just vote for SOBI on JED.

Offline titchagui

  • Sobi Newbie
  • *
  • Posts: 1
Re: How to run SobiSEF with JoomFish
« Reply #22 on: 12. January 2012, 11:33:03 »
Thanks ah72 for your solution. It helped me but there is a little risk with this code.
For example, if you try to go to a page like 'es/modules/directory/subdirectory.html' and you are using spanish language (Joomfish code: es) you will obtain a request like this : 'modul/directory/subdirectory.html' which is wrong.

I changed the following code :
Code: [Select]
if ( strstr( $request, $my_jfish_prefix."/" ) ) {
               $request = str_replace( $my_jfish_prefix."/", null, $request );
               break;
}

with this code:
Code: [Select]
if (substr($request, 0, strlen($my_jfish_prefix) ) == $my_jfish_prefix) {
$request = preg_replace('/^' . $my_jfish_prefix . '\//', '', $request);
break;
}
In this case, it replaces "es/" only if $request begins with "es/".

Please note that this solution works only if the plugin "System - Jfrouter" is configured to work with SEF Prefix.
Country: France France |  OS: Windows XP Windows XP |  Browser: Chrome 16.0.912.75 Chrome 16.0.912.75 | View Profile

Tags: