Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12358
Latest: KekoWorld
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 40096
Total Topics: 7060
Most Online Today: 63
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 65
Total: 65

Author Topic: Not show closed/expired listings (code hack)  (Read 3013 times)

0 Members and 1 Guest are viewing this topic.

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Not show closed/expired listings (code hack)
« on: March 05, 2014, 03:19:39 am »
I realize that there is no use for the viewers to see the listings that are closed/expired, so I decided to change the SQL queries to exclude these. Here is what I have done, and it's working (tested in version 3.0.2 and SMF 2.0.x). If you try it and see that I have missed something, please say so.

In classifieds2.template.php change:
for page count:
Code: [Select]
WHERE removed = 0 AND ID_CAT = $cat AND approved = 1");to:
Code: [Select]
WHERE removed = 0 AND ID_CAT = $cat AND approved = 1 AND UNIX_TIMESTAMP() < expiredate");
for view listings:
Code: [Select]
WHERE  i.removed = 0 AND i.ID_CAT = $cat AND i.approved = 1to:
Code: [Select]
WHERE  i.removed = 0 AND i.ID_CAT = $cat AND i.approved = 1 AND UNIX_TIMESTAMP() < i.expiredate
for search results:
Code: [Select]
WHERE  i.approved = 1 " . $class_where ." AND  (" . $context['class_search_query'] . ")to:
Code: [Select]
WHERE  i.approved = 1 " . $class_where ." AND  (" . $context['class_search_query'] . ") AND UNIX_TIMESTAMP() < i.expiredate

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15052
    • View Profile
Re: Not show closed/expired listings (code hack)
« Reply #1 on: March 05, 2014, 07:36:36 am »
The only part I would be careful is if you have listings that never expire

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/

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
3238 Views
Last post August 23, 2008, 12:23:07 pm
by torty
13 Replies
14225 Views
Last post January 06, 2009, 10:45:26 am
by Riley
1 Replies
2238 Views
Last post May 27, 2010, 11:33:42 am
by SMFHacks
8 Replies
3296 Views
Last post October 25, 2011, 05:43:53 pm
by zimmerman
9 Replies
4376 Views
Last post December 19, 2011, 12:41:19 pm
by SMFHacks

+- Recent Topics

[Mod]Telegram AutoPost Bot by SMFHacks
April 06, 2020, 03:38:36 pm

[Mod]SMF2WPBridge - Wordpress Login Bridge by SMFHacks
April 04, 2020, 07:16:59 pm

BUG Message Editor Pro1.0.5 by marcimila
April 04, 2020, 09:01:21 am

MOVED: BUG Message Editor Pro1.0.5 by SMFHacks
April 03, 2020, 07:54:07 pm

Only variables should be passed by reference by Zaphod
April 02, 2020, 11:19:11 am

Cannot install Gallery Pro on SMF 2.1 RC2 by Hatshepsut
March 19, 2020, 12:55:00 am

Newbie questions by SMFHacks
March 08, 2020, 09:28:17 am

Update detect mobile mode PHP5 to PHP7 by Plus
March 05, 2020, 11:19:05 am

Just a hello by Plus
March 05, 2020, 11:05:56 am

Enotify Copyright Problem by SMFHacks
March 04, 2020, 09:21:09 pm

Powered by EzPortal