Viernes, 28 Noviembre 2014 12:20
beggarly

Improved RSGallery2 extension for XMap

Suggest/Comment/Post new extensions for Xmap!

Improved RSGallery2 extension for XMap

Postby mirjam » Wed Feb 09, 2011 2:12 pm

I have just downloaded and installed XMap 1.2.10 which has an RSGallery2 extension in it (extension version 1.0.0). My Joomla 1.5.22 has a menuitem for RSGallery2 2.2.0 with galleries and images and a menuitem for one of the subgalleries. I haven't changed any of the default settings.

There is an error
No valid database connection Unknown column 'Array' in 'where clause' SQL=SELECT id,name,unix_timestamp(`date`) as `date` FROM jos_rsgallery2_galleries WHERE published=1 AND parent=Array ORDER BY ordering ASC
and the URLs that XMap generates are not the same as that RSGallery2 generates, this means that there will be two SEF link when e.g. sh404SEF is used.

In short: I corrected the order of parameters with which function getGalleries was called, changed catid into gid and removed catid where it shouldn't be.
File is attached. [Edit: When I try to attach a zip here there is an error in the zip when I download it, so I'll refer you to http://www.rsgallery2.nl/topicseen,/rsgallery2_bugs_problems/urls_xmap_are_different_sh404sef_than_rsg2_16683.msg43319.html#new to download the updated file.]

One question left: Why is there a bit
Code: Select all
      if ( $id )
         return $tree;
when there is no $tree in the entire file?

Long story:
This is what I changed, and the resulting file is attached:
1) Changed the lines 134-136
Code: Select all
if ($xmap->printNode($node) !== FALSE) {
xmap_com_rsgallery2::getGalleries($xmap,$parent,$row['id'],$params);
}

to
Code: Select all
if ($xmap->printNode($node) !== FALSE) {
xmap_com_rsgallery2::getGalleries($xmap,$parent,$params,$row['id']);
}

Parameters for the function getGalleries were mixed up.

2) URL to item is incorrect: it should not have a catid. Changed line 162
Code: Select all
$node->link = 'index.php?option=com_rsgallery2&page=inline&catid=' . $catid . '&id=' . $row['id'];   // parent id
to
Code: Select all
$node->link = 'index.php?option=com_rsgallery2&page=inline&id=' . $row['id'];   // parent id


3) Catid should be gid (the gallery id in the URL), so changed line 130
Code: Select all
$node->link = 'index.php?option=com_rsgallery2&catid='.$row['id'];
to
Code: Select all
$node->link = 'index.php?option=com_rsgallery2&gid='.$row['id'];


4) Menuitems linked to a subgallery don't have catid in their URL, they have a gid. Changing line 25 from
Code: Select all
$catid = JArrayHelper::getValue( $link_vars, 'catid', '', '' );
to
Code: Select all
$gid = JArrayHelper::getValue( $link_vars, 'gid', '', '' );
and then also the catid in lines 29-32 to
Code: Select all
      } elseif ( $gid) {
         $node->uid = 'rsgallery2c'.$gid;
         $node->expandible = true;
      }

Then in function getTree on line 47 catid is changed to gid.

5) function getGalleries also uses $catid, and has a line $gid=0; that is not used for anything, so it's removed. Then changed the 3 occurences in this function of catid to gid.

With kind regards,
Mirjam

p.s. RSGallery2 can be downloaded here http://joomlacode.org/gf/project/rsgallery2/frs/?action=FrsReleaseBrowse&frs_package_id=4863
mirjam
Fresh Boarder
Fresh Boarder
 
Posts: 5
Joined: Sat May 17, 2008 3:23 pm

Return to Plugins



Who is online

Users browsing this forum: No registered users and 2 guests

cron