Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 241
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 266
Total: 266

Author Topic: Not show closed/expired listings (code hack)  (Read 4399 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: 16452
    • 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
4796 Views
Last post August 23, 2008, 12:23:07 pm
by torty
13 Replies
16552 Views
Last post January 06, 2009, 10:45:26 am
by Riley
1 Replies
3907 Views
Last post May 27, 2010, 11:33:42 am
by SMFHacks
8 Replies
5277 Views
Last post October 25, 2011, 05:43:53 pm
by zimmerman
9 Replies
6711 Views
Last post December 19, 2011, 12:41:19 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

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

Powered by EzPortal