Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 201
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 203
Total: 203

Author Topic: Last Commented instead of Most Commented  (Read 8900 times)

0 Members and 1 Guest are viewing this topic.

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Last Commented instead of Most Commented
« on: November 22, 2007, 10:48:44 pm »
Would it be possible to change the MOST COMMENTED to LAST COMMENTED files? I am talking about changing some code to instead show the last commented files rather than the most commented.

Hope we can do this...

Thanks,

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Last Commented instead of Most Commented
« Reply #1 on: November 24, 2007, 12:50:13 pm »
So is this possible on the main gallery page...this way the images are always changing...as opposed to the same images appearing on the page.

Thanks,

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Last Commented instead of Most Commented
« Reply #2 on: November 24, 2007, 08:52:54 pm »
Not tested

Open Gallery.template.php
Find
Code: [Select]
case 'mostcomments':
$query = "SELECT p.ID_PICTURE, p.commenttotal, p.totalratings, p.rating, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.realName, p.date, p.description
FROM {$db_prefix}gallery_pic as p
LEFT JOIN {$db_prefix}members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
LEFT JOIN {$db_prefix}gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
WHERE (s.private =0 AND s.password = '' AND p.USER_ID_CAT !=0 AND p.approved =1) || (p.approved =1 AND p.USER_ID_CAT =0)
ORDER BY p.commenttotal DESC LIMIT 4";
break;
Change to
Code: [Select]
case 'mostcomments':
$query = "SELECT p.ID_PICTURE, p.commenttotal, p.totalratings, p.rating, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.realName, p.date, p.description
FROM ({$db_prefix}gallery_pic as p, {$db_prefix}gallery_comment as c)
LEFT JOIN {$db_prefix}members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
LEFT JOIN {$db_prefix}gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
WHERE p.ID_PICTURE = c.ID_PICTURE AND (s.private =0 AND s.password = '' AND p.USER_ID_CAT !=0 AND p.approved =1) || (p.approved =1 AND p.USER_ID_CAT =0)
ORDER BY c.ID_COMMENT DESC LIMIT 4";
break;
« Last Edit: November 25, 2007, 03:57:30 pm by SMFHacks »
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Last Commented instead of Most Commented
« Reply #3 on: November 24, 2007, 09:10:47 pm »
Thank you...I will try this and let you know.

Thanks.

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Last Commented instead of Most Commented
« Reply #4 on: November 24, 2007, 10:55:51 pm »
Ooops...got this error:

Quote
FUNCTION c.ID_PICTURE does not exist
File: /home/wallyjar/public_html/website/Sources/Load.php(1746) : eval()'d code
Line: 3293

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.4, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Last Commented instead of Most Commented
« Reply #5 on: November 24, 2007, 11:21:54 pm »
Check the code again made a change.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Last Commented instead of Most Commented
« Reply #6 on: November 24, 2007, 11:50:05 pm »
Close...but no cigar (as Prez Clinton would say...here is the error now:

Quote
Unknown column 'p.ID_MEMBER' in 'on clause'
File: /home/wallyjar/public_html/website/Sources/Load.php(1746) : eval()'d code
Line: 3293

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.4, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Last Commented instead of Most Commented
« Reply #7 on: November 25, 2007, 01:18:38 pm »
hmm not sure what the issue would be ran that same query above inside phpmyadmin and was able to pull up the last commented pictures.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Last Commented instead of Most Commented
« Reply #8 on: November 25, 2007, 03:52:23 pm »
Here's a screen capture if that helps any...

Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Last Commented instead of Most Commented
« Reply #9 on: November 25, 2007, 03:57:41 pm »
Try the query again made a small change
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline rumboogy

  • Full Member
  • ***
  • Posts: 215
    • View Profile
    • Smorgasboard Forums
Re: Last Commented instead of Most Commented
« Reply #10 on: November 25, 2007, 04:28:53 pm »
No Error this time, but the first image in the group has 2 comments...and the rest have "0" comments. I have a total  of 19 commented images in the gallery...

So it is bringing something else up for some reason...

Wally
Rumboogy
"Yeah, I got way too many irons in the fire"
Biker Site:      http://www.razorbiker.com
Biker Site:      http://www.arkansasbiker.net
Zumo GPS:     http://www.zumoforums.com
Personal Site:  http://www.wallyjarratt.com

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
3639 Views
Last post August 06, 2007, 02:43:58 pm
by rumboogy
2 Replies
4530 Views
Last post April 17, 2008, 03:24:26 am
by SoehnelS
5 Replies
6393 Views
Last post August 23, 2009, 04:09:39 am
by davieb
1 Replies
4264 Views
Last post August 24, 2009, 09:19:02 pm
by SMFHacks
0 Replies
3927 Views
Last post June 10, 2012, 10:46:16 am
by shaka

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal