Joomla.it Forum

Componenti per Joomla! => Gallerie di immagini => : ncestaro 20 Sep 2009, 19:09:14

: Modificare codice per integrazione in Sh404sef di PhocaGallery
: ncestaro 20 Sep 2009, 19:09:14
Salve signori, premessa per i moderatori: spostate nella sezione più adatta se dovete.

Premesso: non voglio qualcuno che faccia il lavoro per me, semplicemente vorrei qualche dritta su dove andare a modificare, poi provando posso vedermela anche io :D

questo il problema: http://www.padula.info/galleria-fotografica/storiche/

Ho integrato PhocaGallery con Sh404sef con il codice sottostante, scaricato dal web.
Per le url nessun problema, però mi incasina il tag title!

Come potete vedere nel link che ho postato.
Dove dovrei andare ad intervenire? Temo che piuttosto che il nome mi prenda in considerazione l'alias... non si può cambiare sta cosa?

Vi ringrazio molto, saluti!
<?php
/**
 * sh404SEF support for com_phocagallery component.
 * Author :  Hi-Fi (Juho Saarinen)
 * contact : juho.saarinen@gmail.com
 *
 * {shSourceVersionTag: Version x - 2007-09-20}
 *
 * This is a Xmap sh404SEF native plugin file
 *   
 */
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );

// ------------------  standard plugin initialize function - don't change ---------------------------
global $sh_LANG, $sefConfig; 
$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_XXXXX', $shLangIso, '_SEF_Phocagallery_TEXT_STRING');
// ------------------  load language file - adjust as needed ----------------------------------------


//Functions to get names

//--------HIFI:FUNCTION GALERY multiple category NAMEs -> $galleries
/*Function is based on com_rsgallery2.php's function shRSCategoryNames, which is based on com_docman.php's function dm_sef_get_category_array() which was (according to that file) based on
 * Mark Fabrizio, Joomlicious, fabrizim@owlwatch.com, http://www.joomlicious.com
 */
if( !function_exists( 'shPhocaCategoryNames' ) ){
   function shPhocaCategoryNames( $gallery_id ){
      global $database;
                $database = &JFactory::getDBO();
      static $PhocaGalleryTree = null;
      $q  = "
         SELECT id, title, parent_id
         FROM #__phocagallery_categories";
      $database->setQuery( $q );
      $PhocaGalleryTree = $database->loadObjectList( 'id' );
      $title=array();
      do {
         $Phocaname[] =    $PhocaGalleryTree[ $gallery_id ]->title;
         $gallery_id =    $PhocaGalleryTree[ $gallery_id ]->parent_id;
      }    while($gallery_id != 0);
      return array_reverse($Phocaname);
      }
   }
   
if (!function_exists( 'shPhocaimagenameFromId')) {
   function shPhocaimagenameFromId($id){
      global $sefConfig, $database;
                $database = &JFactory::getDBO();
      $PhocaGalleryImageTree = null;
      $q  = "
         SELECT id, title
         FROM #__phocagallery
         WHERE id = " . $id;
      $database->setQuery( $q );
      $PhocaGalleryImageTree = $database->loadObjectList('id');
      $PhocaName  = $PhocaGalleryImageTree[$id]->name;   // name
      $PhocaTitle = $PhocaGalleryImageTree[$id]->title;   // title
      $title= $PhocaTitle;
      return $title;
      }
   }

// remove common URL from GET vars list, so that they don't show up as query string in the URL
shRemoveFromGETVarsList('option');
shRemoveFromGETVarsList('lang');
if (!empty($Itemid))
  shRemoveFromGETVarsList('Itemid');
/*if (!empty($limit)) 
shRemoveFromGETVarsList('limit');
if (isset($limitstart))
  shRemoveFromGETVarsList('limitstart'); // limitstart can be zero*/
shRemoveFromGETVarsList('view');
shRemoveFromGETVarsList('id');
shRemoveFromGETVarsList('catid');


// start by inserting the menu element title (just an idea, this is not required at all)
$task = isset($task) ? @$task : null;
$Itemid = isset($Itemid) ? @$Itemid : null;
$shPhocagalleryName = shGetComponentPrefix($option);
$shPhocagalleryName = empty($shPhocagalleryName) ? 
      getMenuTitle($option, $task, $Itemid, null, $shLangName) : $shPhocagalleryName;
$shPhocagalleryName = (empty($shPhocagalleryName) || $shPhocagalleryName == '/') ? 'PhocagalleryCom':$shPhocagalleryName;

          $title[] = $shPhocagalleryName;
          $title[] = '/';
   unset($vars['shPhocagalleryName']);
/*   
// -------Category name(s)--------------------------- [gid is needed for this]
if (isset($gid) && ($gid != 0)) {
   if ($rsInsertMultipleCategories) {
      $title = array_merge($title, shRSCategoryNames($gid));
   } else {
      $title[] = shRSCategoryName($gid);
   }
   shRemoveFromGETVarsList('gid');
   }
//-------Insert trailing / after Menuname or Categoryname when there is no image to avoid .html
if (empty($id)) {
   $title[] = '/';
   }
*/

switch ($view) {
   case 'categories':
   $title[] = '/';
   break;
   case 'category':
   if(substr($id,-2)==='3A')
   {
   $id = intval(substr($id,0,-2));
   }
   $title = array_merge($title, shPhocaCategoryNames($id));
   break;
   case 'detail':
   //there might be ':' in url, so it has to be removed
   if(substr($id,-2)==='3A')
   {
   $id = intval(substr($id,0,-2));
   }
   $title = array_merge($title, shPhocaCategoryNames($catid));
   $title[] = shPhocaimagenameFromId($id);
   shRemoveFromGETVarsList('tmpl');
   break;
}
 
   //$dosef = false;

// ------------------  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 ---------------------------
 
?>
: Re:Modificare codice per integrazione in Sh404sef di PhocaGallery
: 56francesco 20 Sep 2009, 20:07:48
sei sfortunato..

da poco Sh404sef  è diventato commerciale come estensione e quindi in questo forum viene considerato un argomento OT  (off topic)

purtroppo queste sono le regole..

puoi cambiare estensione oppure cercare supporto nel sito di chi la vende, oppure altrove..
 ;)
 
: Re:Modificare codice per integrazione in Sh404sef di PhocaGallery
: ncestaro 20 Sep 2009, 20:37:16
sei sfortunato..

da poco Sh404sef  è diventato commerciale come estensione e quindi in questo forum viene considerato un argomento OT  (off topic)

purtroppo queste sono le regole..

puoi cambiare estensione oppure cercare supporto nel sito di chi la vende, oppure altrove..
 ;)
Commerciale? Ma io non ho pagato una lira :/
Mi sono perso qualcosa? :D