1 (edited by 2008-08-23 17:53:55)

Topic: [HACK] Show news Over X amount of days/weeks/months/years

Name: Show news Over X amount of days/weeks/months/years
Author: John/Will
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Adds the ability to use an additional variable with your CN include code. So post will show for a set amount of time. This is not the same as individual expiration date.
Instructions:
open shows.inc.php
:::::::::::::::::::::::::::::::::::::::::::::::::::

Find:
:::::::::::::::::::::::::::::::::::::::::::::::::::

elseif($showed == $number){  break; }   
}


add below:
:::::::::::::::::::::::::::::::::::::::::::::::::::

  //show news per day hack
  if (isset($show_from)) {
  if ((time() - $news_arr[0]) > $show_from * 3600) {
  break; 
  }
  }
  //show news per day hack


USEAGE
:::::::::::::::::::::::::::::::::::::::::::::::::::

in the cutenews include code use:
:::::::::::::::::::::::::::::::::::::::::::::::::::

  $show_from = 24; for one day
  $show_from = 24 * 7; for one week
  etc