Skip to content

Instantly share code, notes, and snippets.

@Kindari
Created October 24, 2012 22:25
Show Gist options
  • Save Kindari/3949336 to your computer and use it in GitHub Desktop.
Save Kindari/3949336 to your computer and use it in GitHub Desktop.
public static function addview($tid) {
$viewed = Session::get('viewed', array());
if ( in_array($tid, $viewed) )
{
$viewed[] = $tid;
Theme::where_id($tid)->increment('views');
}
Session::put('viewed', $viewed);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment