RSGallery2 Support Forums
Welcome, Guest. Please login or register.

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : October 29 12:30:10 PM
+  RSGallery2 Support Forums
|-+  Developers corner
| |-+  Nightly Builds for RSGallery2 in Joomla 1.5 (Moderators: Jonah, Daniel Tulp, Ronald Smit)
| | |-+  [SVN866] Backend gallery ordering errors - Fix Posted here
Advanced search
  « previous next »
Pages 1
Author
Topic: [SVN866] Backend gallery ordering errors - Fix Posted here  (Read 281 times)
« on: October 23 05:13:04 PM »
Sam Lewis Offline
Newbie
*
Posts: 1

View Profile Email

Backend gallery ordering is not usable in this version. Still relying on 1.0.x code.

In the file:
administrator/components/com_rsgallery2/options/gallery.php
Lines 345-389 - function saveOrder

Replace entire function with this:
Code:
function saveOrder( &$cid ) {
global $mainframe;
$database =& JFactory::getDBO();

$total = count( $cid );
$order = JRequest::getVar( 'order', array(0), 'post', 'array' );
JArrayHelper::toInteger($order, array(0));

$row = new rsgGalleriesItem( $database );

$conditions = array();

// update ordering values
for ( $i=0; $i < $total; $i++ ) {
$row->load( (int) $cid[$i] );
$groupings[] = $row->parent;
if ($row->ordering != $order[$i]) {
$row->ordering = $order[$i];
if (!$row->store()) {
JError::raiseError(500, $db->getErrorMsg());
} // if
} // if
} // for

// reorder each group
$groupings = array_unique( $groupings );
foreach ( $groupings as $group ) {
$row->reorder('parent = '.$database->Quote($group));
} // foreach

// clean any existing cache files
$cache =& JFactory::getCache('com_rsgallery2');
$cache->clean( 'com_rsgallery2' );

$msg = JText::_( 'New ordering saved' );
$mainframe->redirect( 'index2.php?option=com_rsgallery2&rsgOption=galleries', $msg );
} // saveOrder

Logged
 
Print  Pages 1
« previous next »
Jump to: