Please login or register.
Login with username, password and session length
December 22, 2014, 07:58:28 AM

* User Info

Welcome, Guest. Please login or register.
Did you miss your activation email?

* Recent Posts

Image upload goes to blank page by whazzup
[December 11, 2014, 10:13:43 PM]

RSGallery Corruption Causes Unending Processes by mirjam
[November 03, 2014, 03:34:36 PM]

Joomla! 3.x ? by whazzup
[October 03, 2014, 11:25:51 AM]

Delete title image by mirjam
[August 10, 2014, 10:49:23 AM]

404 Component Not Found - [RSG2 3 will not install on J3.x] by whazzup
[July 01, 2014, 09:55:13 AM]

[Bug: watermarked img not removed] Thumb clicks through to incorrect image by scene66
[January 29, 2014, 09:56:44 AM]

Display images appearing outside RHS of screen in firefox by mirjam
[January 12, 2014, 01:59:31 PM]

Export Gallery Structure & Images From RSGallery2 by mirjam
[December 31, 2013, 02:50:43 PM]


Pages: [1]   Go Down

Author Topic: Changes and Questions  (Read 744 times)

Offline Calitar

  • Newbie
  • *
  • Posts: 1

Changes and Questions
« on: April 07, 2013, 08:16:40 AM »

So I have been investigating this gallery for use on my gaming guild website and I have to say I'm rather happy with it overall. There are, however, a few things I am either missing or I think could be improvements to the plugin; at least from my usecase perspective.

1) Have an option to have any photo uploaded to a gallery be auto published. Currently only the owner of the gallery has the option to have it auto published though other users can manually publish if they have the permissions. This extra click, however, is unnecessary for my need. I have edited the database array construction to always set 'published = 1'.

2) The random image and latest image features don't take security into account. If you have a gallery that is for registered members only and you are no logged in, you can still see the images from the restricted gallery in the 'random image' and 'latest image' modules. I have attempted to fix this in a brute force way by editing the SQL in the latestImages() function in config.rsgallery2.php from

$query = 'SELECT * FROM `#__rsgallery2_files` WHERE (`date` >= '. $database->quote($lastweek) .' AND `published` = 1 AND `gallery_id` (SELECT id FROM `#_rsgallery2_galleries` WHERE `access` = 1) ORDER BY `id` DESC LIMIT 0,5';


$query = 'SELECT * FROM `#__rsgallery2_files` WHERE (`date` >= '. $database->quote($lastweek) .' AND `published` = 1 AND `gallery_id` (SELECT id FROM `#_rsgallery2_galleries` WHERE `access` = 1) ORDER BY `id` DESC LIMIT 0,5';

but this doesn't seem to solve the problem. What I want is for security to apply to the 'latest image' and 'random image' modules such that only when a user is logged in will "registered" galleries have their images included.

3) Have the menu option to upload an image be on every gallery page if the user has the ability to do so. Having to go through the 'my galleries' interface adds extra clicks that are unnecessary and add confusion to users.

4) I'd like the ability to display the 'latest images' and 'random images' on my Joomla! front page. A module with these features would be very helpful and I think would find use outside of just my website. I haven't yet looked into making one but if anyone has any ideas or knows someone who has done this I would be eternally grateful.

I am happy to make the changes myself if anyone can tell me where in the php files I should look for each item.

Offline mirjam

  • Dev Team
  • Hero Member
  • *****
  • Posts: 629

Re: Changes and Questions
« Reply #1 on: April 11, 2013, 06:44:23 PM »
Quick response:

1. This is different for backend and frontend, you're talking about the My Galleries. Having images autopublished is possible by setting the "Default state for uploaded images (for users with either Edit State permission or with Edit State Own permission and item is uploaded to a gallery the user owns)" to Published and giving your users enough permissions (since having the permission does not seem a problem to you?)

2. You are right, have not thought about that one... Of course you can disable these two features, which I advise for the time being if this is a problem for you. Sorry that I don't have time to look into this now. Perhaps the Latest Images module mentioned here is a good enough example for you?

3. Not a priority for me now (see signature), and not sure I understand what you want, but you're welcome to expand RSGallery2.

4. See answer to number 2. Please test that one (and report in that thread). Random images can be made quickly by adjusting the query (and you seem able to do that?), languages string names, etc. should be adjusted as well for a release.

5. I always use Firebug to check out what the css elements are called at the places where I want to change things. That gives me a starting point to search in the code for these names. And then the search continues to, hopefully, in the end what I was looking for. Takes some time, but it works for me. And, of course, over time you'll get quicker to where you want to go ;-)
With a little boy in the house I don't spend as much time on RSG2 anymore.

I still like RSG2, if you do too, please think about how you can invest some of your time in RSG2... the one remaining coding volunteer (Whazzup) can use your help!

Offline Calitar2

  • Newbie
  • *
  • Posts: 1

Re: Changes and Questions
« Reply #2 on: April 14, 2013, 03:47:20 AM »

So I tried to change my email on Calitar to my personal website email, but never got a confirmation email so I had to re-register.

First let me say that while I use firebug all the time and it is very helpful for skinning items, it is not very useful for finding which php files define what section of the page HTML which is the more confusing and frustrating part of it. That being said, you actually had the solution to #2 in your module code, it just wasn't in the base RS2 platform when choosing random images.

$user       = JFactory::getUser();
$groups      = $user->getAuthorisedViewLevels();
$groupsIN    = implode(", ",array_unique ($groups));

$query->where('access IN ('.$groupsIN.')');

Adding that check will only display images the user has access to and therefore guests can not see "registered" albums.

With that in mind, I made a module for Joomla 2.5 based of the "latest galleries" module you linked. My module has the option to display both random and latest images. I'd be happy to share with you and the general public if you are interested. The full feature list is below:

*Users can select whether to display "random images" or "latest images" or both
*Galleries that have images included in either listing can be customized to that listing. That is you don't have to have the same source galleries for "random images" and "latest images"
*Users can specify whether or not to include subgalleries in the listings
*Users can specify the number of images in each row and column for each listing individually
*Users can specify whether or not to display the image name and upload date for each listing individually
*Users can choose a date format for each listing individually
*Users can choose to display the thumbnail, original size image, or sized image just like in the "latest galleries" module
*Users can define img element parameters just like in the "latest galleries" module
*The CSS of the module is linked to the RS2 gallery CSS and is not a separate sheet. I did this because that's the use case for my site but users can easily change the path to define a custom sheet for the module if they like.

I attached a screenshot of the administration options.

Also, as for number 1, the permissions weren't the issue. The problem was that even if users had the option to publish the image was automatically publish. They were uploaded in an unpublished state by default which I was able to fix by changing the SQL query to set the default to published when the image was first uploaded.

Anyways, great job with the gallery and I hope my additions will be useful to you and the general community.

Offline whazzup

  • Dev Team
  • Jr. Member
  • *****
  • Posts: 64

Re: Changes and Questions
« Reply #3 on: April 17, 2013, 09:38:44 PM »
Applause, i am just a guest here but im sure there will be a place where a installation of your module may be kept or your code will be taken into the general installation

Offline mirjam

  • Dev Team
  • Hero Member
  • *****
  • Posts: 629

Re: Changes and Questions
« Reply #4 on: May 11, 2013, 02:15:54 PM »
Feel free to post what you've created here, or to post changes. That way users can try/test your changes and respond to that.

The RSGallery2 file repository is the JoomlaCode SVN, see With a SVN program (on windows e.g. tortoiseSVN) you can make patches, which are files that can easily be used to see what changes are made in which files. That is handy for bug fixes and/or improvements.

(And sorry for the late response...)
With a little boy in the house I don't spend as much time on RSG2 anymore.

I still like RSG2, if you do too, please think about how you can invest some of your time in RSG2... the one remaining coding volunteer (Whazzup) can use your help!
Pages: [1]   Go Up