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

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : December 03, 2008, 05:52:43 pm
+  RSGallery2 Support Forums
|-+  RSgallery2 support forums
| |-+  Display and Templates (Moderators: Jonah, Tomislav Ribicic, Daniel Tulp, Ronald Smit)
| | |-+  How do I move "Latest images" to top?
Advanced search
  « previous next »
Pages 1
Author
Topic: How do I move "Latest images" to top?  (Read 6487 times)
« on: January 25, 2008, 05:05:57 pm »
lux Offline
Newbie
*
Posts: 5



The "Latest images" and "Random images" box are at the bottom of the main gallery page and I want to move them to the top.

I made this hack in an earlier install of RSGallery and now I can't remember what the hack was and which file it's in! I thought it was on the forum, but I can't find it now...

Anyone?
Logged
 
Reply #1
« on: January 26, 2008, 01:15:05 pm »
Ronald Smit Offline
Administrator
Hero Member
*****
Posts: 1219

WWW

Assuming you use semantic template, open up the file <yourinstall>/components/com_rsgallery2/templates/semantic/html/gallery.php.

There you will find a code block, like this:
Code:
<?php
if($this->gallery->id == 0){

// show random and latest only in the top gallery 

//Show block with random images 
$this->showImages("random"3);
//Show block with latest images
$this->showImages("latest"3);
}
if( 
$this->pageNav ):
?>
Move this anywhere in the template to modify the page layout.

Smart thing todo here is create a copy of the semantic template, and modify this copy to your liking.
This way you can bakcup just that template when upgrading and upload it once the upgrade is complete.

Good luck!
Logged

Ronald Smit
RSGallery2 Developer
FAQ|Known issues
 
Reply #2
« on: February 13, 2008, 12:43:33 pm »
gnubler Offline
Newbie
*
Posts: 7



This isn't working for me, what am I doing wrong?

I moved the above mentioned code block directly under this code block

Quote
//Show introduction text
?>
<div class="intro_text"><?php echo $rsgConfig->get('intro_text');?></div>

And when I viewed my main gallery page all the galleries disappeared and only the "latest images" box showed up.

Where exactly should I place the latest images code block so it appears at the top of the page?
Logged
 
Reply #3
« on: February 21, 2008, 12:56:23 pm »
Jonah Offline
Administrator
Hero Member
*****
Posts: 1414



somehow you screwed up the code.  try again and make sure that your php is within php tags and the html outside of php tags.
Logged

Due to time constraints, I have taken a step back from RSGallery2.  In the event of an emergency, you will need to PM me.
 
Reply #4
« on: February 21, 2008, 02:29:57 pm »
gnubler Offline
Newbie
*
Posts: 7



Okay, let's get the eye-rolling exasperation out of the way...  Roll Eyes
Believe it or not, I do have a brain...and I've done this with a previous install of RSGallery2.

Here's my existing code of gallery.php, which displays Random Images at the bottom of the page:

Code:
<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php

global $ItemId;

//Show My Galleries link
if ($rsgConfig->get('show_mygalleries')) {
echo $this->showRsgHeader();
}
//show search box
$this->showSearchBox();

//Show introduction text
?>

<div class="intro_text"><?php echo $rsgConfig->get('intro_text');?></div>



<?php
//Show limitbox
if( $this->pageNav ):
?>

<div class="rsg2-pagenav-limitbox">
<?php echo $this->getGalleryLimitBox(); ?>
</div>



<?php
endif;

foreach( 
$this->kids as $kid ):
?>

<div class="rsg_galleryblock">
<div class="rsg2-galleryList-status"><?php echo $kid->status;?></div>
<div class="rsg2-galleryList-thumb">
<?php echo $kid->thumbHTML?>
</div>
<div class="rsg2-galleryList-text">
<?php echo $kid->galleryName;?>
<span class='rsg2-galleryList-newImages'>
<sup><?php if( $this->gallery->hasNewImages() ) echo _RSGALLERY_NEW?></sup>
</span>
<?php echo $this->_showGalleryDetails$kid );?>
<div class="rsg2-galleryList-description"><?php echo $kid->description;?>
</div>
</div>
<div class="rsg_sub_url_single">
<?php $this->_subGalleryList$kid ); ?>
</div>
</div>
<?php
endforeach;
?>

<div class="rsg2-clr"></div>

<?php
if($this->gallery->id == 0){

// show random and latest only in the top gallery 

//Show block with random images 
$this->showImages("random"5);
//Show block with latest images
$this->showImages("latest"5);
}
if( 
$this->pageNav ):
?>


<div class="rsg2-pageNav">
<?php echo $this->getGalleryPageLinks(); ?>
<br/>
<?php echo $this->getGalleryPagesCounter(); ?>
</div>
<div class='rsg2-clr'>&nbsp;</div>
<?php endif; ?>

And here is the change I am making, moving the block of code that Ronald highlighted and placing it directly beneath the //Show introduction text div. When I upload this it breaks my entire main gallery page, displaying only the Random Images block and none of the galleries. What am I doing wrong?

Code:
<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php

global $ItemId;

//Show My Galleries link
if ($rsgConfig->get('show_mygalleries')) {
echo $this->showRsgHeader();
}
//show search box
$this->showSearchBox();

//Show introduction text
?>

<div class="intro_text"><?php echo $rsgConfig->get('intro_text');?></div>

<?php
if($this->gallery->id == 0){

// show random and latest only in the top gallery 

//Show block with random images 
$this->showImages("random"5);
//Show block with latest images
$this->showImages("latest"5);
}
if( 
$this->pageNav ):
?>


<?php
//Show limitbox
if( $this->pageNav ):
?>

<div class="rsg2-pagenav-limitbox">
<?php echo $this->getGalleryLimitBox(); ?>
</div>



<?php
endif;

foreach( 
$this->kids as $kid ):
?>

<div class="rsg_galleryblock">
<div class="rsg2-galleryList-status"><?php echo $kid->status;?></div>
<div class="rsg2-galleryList-thumb">
<?php echo $kid->thumbHTML?>
</div>
<div class="rsg2-galleryList-text">
<?php echo $kid->galleryName;?>
<span class='rsg2-galleryList-newImages'>
<sup><?php if( $this->gallery->hasNewImages() ) echo _RSGALLERY_NEW?></sup>
</span>
<?php echo $this->_showGalleryDetails$kid );?>
<div class="rsg2-galleryList-description"><?php echo $kid->description;?>
</div>
</div>
<div class="rsg_sub_url_single">
<?php $this->_subGalleryList$kid ); ?>
</div>
</div>
<?php
endforeach;
?>

<div class="rsg2-clr"></div>



<div class="rsg2-pageNav">
<?php echo $this->getGalleryPageLinks(); ?>
<br/>
<?php echo $this->getGalleryPagesCounter(); ?>
</div>
<div class='rsg2-clr'>&nbsp;</div>
<?php endif; ?>

Logged
 
Reply #5
« on: February 21, 2008, 09:16:28 pm »
Jonah Offline
Administrator
Hero Member
*****
Posts: 1414



Okay, let's get the eye-rolling exasperation out of the way...  Roll Eyes
Believe it or not, I do have a brain...and I've done this with a previous install of RSGallery2.


lol!  hey, without the code pasted, how was i supposed to know?  Smiley

looks like you have an extra if statement, causing the rest of the file to be conditional and so never shown.  take out line 28.

Cheers,
Logged

Due to time constraints, I have taken a step back from RSGallery2.  In the event of an emergency, you will need to PM me.
 
Reply #6
« on: February 28, 2008, 01:05:50 pm »
gnubler Offline
Newbie
*
Posts: 7



I'm baaaack...I only work on my website on Thursdays, so here I am. Thank you for the suggestion Jonah, but that isn't working either...

Line 28 is:
Code:
if( $this->pageNav ):

And when I remove it and upload my new gallery.php file I get this error:

Parse error: syntax error, unexpected T_ENDIF in /home/clicker/public_html/components/com_rsgallery2/templates/semantic/html/gallery.php on line 76

So I look at line 76,
Quote
<?php endif; ?>
and for "fun" I deleted it to see what that would do. That was bad, it broke the entire gallery page and displayed everything without CSS.

So I am still back where I started and I'm fairly close to just giving up on this.

As a final attempt, can anyone post the entire Semantic template gallery.php file with the latest/random images positioned to display above the galleries? I'm curious to compare that with my file to see what I'm doing wrong, and to see if your file works with my site. Anyone?
Logged
 
Reply #7
« on: April 09, 2008, 04:58:11 am »
pankaj Offline
Newbie
*
Posts: 3



Here is your Solution :

Code:
<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php

global $ItemId;


//Show My Galleries link
if ($rsgConfig->get('show_mygalleries')) {
echo $this->showRsgHeader();
}
//show search box
$this->showSearchBox();

//Show introduction text
?>


<div class="intro_text"><?php echo $this->gallery->description?></div>

<?php
if($this->gallery->id == 0){

// show random and latest only in the top gallery 


//Show block with latest images
$this->showImages("latest"5);
//Show block with random images 
$this->showImages("random"5);
}
if( 
$this->pageNav ):
?>
<div class="rsg2-clr"></div><br/><br/><br/><br/>

<div class="rsg2-pageNav">
<?php echo $this->getGalleryPageLinks(); ?>
<br/>
<?php echo $this->getGalleryPagesCounter(); ?>

</div>
<div class='rsg2-clr'>&nbsp;</div>
<?php endif; ?>

<?php
//Show limitbox
if( $this->pageNav ):
?>

<div class="rsg2-pagenav-limitbox">
<?php echo $this->getGalleryLimitBox(); ?>
</div>
<?php
endif;?>

<?php
foreach( $this->kids as $kid ):
?>



<div class="rsg_galleryblock">
<div class="rsg2-galleryList-status"><?php echo $kid->status;?></div>
<div class="rsg2-galleryList-thumb">
<?php echo $kid->thumbHTML?>
</div>
<div class="rsg2-galleryList-text">
<?php echo $kid->galleryName;?>
<span class='rsg2-galleryList-newImages'>
<sup><?php if( $this->gallery->hasNewImages() ) echo _RSGALLERY_NEW?></sup>
</span>
<?php echo $this->_showGalleryDetails$kid );?>
<div class="rsg2-galleryList-description"><?php echo $kid->description;?>
</div>
</div>
<div class="rsg_sub_url_single">
<?php $this->_subGalleryList$kid ); ?>
</div>
</div>
<?php
endforeach;
?>


Logged
 
Print  Pages 1
« previous next »
Jump to: