Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Old Articles Hack
Author Message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Tue May 06, 2003 9:53 pm Reply with quote

If you would like to limit the old articles by the date age, in addition to the number of articles controlled by the Preferences setting, try this.
Find these lines in blocks/block-Old_Articles.php
Code:
$sql = "SELECT sid, title, time, comments FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT $storynum, $oldnum";


Try changing them to this.
Code:
define("_CUTOFFDAYS",60);

$cutoffDate = time()-(_CUTOFFDAYS*86400);
if (isset($cutoffDate)) $querylang .= " AND (unix_timestamp(time) >= $cutoffDate)";
$sql = "SELECT sid, title, time, comments FROM ".$prefix."_stories $querylang ORDER BY time DESC LIMIT $storynum, $oldnum";

The '60' is 60 days. Make it whatever you want. Let me know if this works or not.

[Edited] I was using a modified version of Old Articles in my original post. I have corrected this hack to work with the 'virgin' 6.5 code.
 
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Old Articles Hack

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©