SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
May 25, 2012, 06:14:58 am

Login with username, password and session length
Members
Total Members: 10073
Latest: makablue
Stats
Total Posts: 28687
Total Topics: 4977
Online Today: 81
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 71
Total: 71
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
| | | | |-+ 
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Quirks/Annoyances  (Read 2159 times)
TWD
Newbie
*
Offline Offline

Posts: 6


View Profile
« on: March 07, 2007, 02:33:21 pm »

Please forgive me if this should be in a different forum.  I have SMF Gallery Pro and for the most part it's a nice package.  There are a few things about it that are kind of a pain for me, though.  If there are quick fixes for these, please tell me how to implement.  If not, please add them to the next version.

1. The galleries appear to auto sort from high to low.  I use mine almost exclusively for slideshows of football games and the sort order for the pictures should almost always be low to high (lower number pictures occurred earlier in the game).  Is there an easy way to change to sort order or (better) to manually sort?

2. The Next|Previous links are still displayed even when a user has reached the Beginning|End of the gallery.  Is there a way to keep a running count somewhere so that when one reaches the end of a gallery, the "Next" link is not displayed?

3. My galleries are stored by years.  I'll have a category of 2006 which contains maybe 12 subcategories - 1 for each game played in 2006.  When I create a new subcategory, I do a bulk import of all the pictures for that game and then go in and edit each picture to add the captions.  Problem is that after I edit a picture, I'm thrown back to a page containing all of the thumbnails from the entire category.  I want to go back to a page with all the thumbnails from just the SUBCATEGORY (or - ideally - I'd like to just have the option to EDIT the next photo in the subgallery).  Is there a way to do this?

Thanks.
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #1 on: March 07, 2007, 08:10:59 pm »

1. Not an option currently requires some code edits
Open Themes/default/Gallery.template.php
Find on line 104
Code:
//Show the pictures
$dbresult = db_query("SELECT p.ID_PICTURE, p.totalratings, p.rating, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.memberName, m.realName, p.date, p.description FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER  AND p.ID_CAT = $cat AND p.approved = 1 ORDER BY ID_PICTURE DESC LIMIT $curpage," . $modSettings['gallery_set_images_per_page'], __FILE__, __LINE__);
$rowlevel = 0;
Change to
Code:
//Show the pictures
$dbresult = db_query("SELECT p.ID_PICTURE, p.totalratings, p.rating, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.memberName, m.realName, p.date, p.description FROM {$db_prefix}gallery_pic as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER  AND p.ID_CAT = $cat AND p.approved = 1 ORDER BY ID_PICTURE ASC LIMIT $curpage," . $modSettings['gallery_set_images_per_page'], __FILE__, __LINE__);
$rowlevel = 0;


2. Currently not an option built I could look into doing in the future. I looked at in the past saw no way to do so without extra queries.

3. That is something I will think about adding in the future.
Logged
TWD
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #2 on: March 08, 2007, 08:45:08 am »

Thanks.  I was hoping I hadn't missed anything incredibly obvious! Wink

For #2 (the "Next | Previous" question) - and forgive my ignorance, as I'm very unfamiliar with mysql - is there a way to do a subquery inside of your initial "get all the pictures" query which would indicate that a picture is first or last on the list?  Something along the lines of:

SELECT pictable.picname, pictable.picdesc,
(select max(picname) from pictable) AS [first], (select min(picname) from pictable) AS [last])
FROM pictable
ORDER BY pictable.picname DESC;


Then when you display the links for next and previous, you'd put them into if statements (if [picname]<>[First] then display the previous link, etc).

Make any sense?  I did something very similar in .asp for an articles database and it worked great.



The edit next picture thing would be a huge blessing for me, but I guess I'll just get around it now by editing the database directly. 

Thanks again for the quick response.
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9678


View Profile
« Reply #3 on: March 08, 2007, 08:51:03 am »

SMF blocks subqueries since they are not used anywhere in SMF. I will take a look at it again see if I can come up with a better solution.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[May 24, 2012, 08:02:50 am]

[May 24, 2012, 04:11:41 am]

[May 21, 2012, 08:54:11 am]

[May 20, 2012, 11:06:52 am]

[May 20, 2012, 05:58:11 am]

[May 19, 2012, 06:16:58 pm]

[May 19, 2012, 05:42:37 pm]

[May 18, 2012, 03:08:38 pm]

[May 17, 2012, 06:07:46 pm]

[May 17, 2012, 02:22:07 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.219 seconds with 19 queries.