Open GoogleCodeExporter opened 9 years ago
Great Idea!
Original comment by b...@mycodenow.com
on 5 Jul 2008 at 10:28
Original comment by ben%benm...@gtempaccount.com
on 11 Feb 2009 at 11:59
Here's the code again for the modified checkPastes method:
function checkPaste($seg=2) {
if($this->uri->segment($seg) == ""){
return FALSE;
} else {
$this->db->where("pid", $this->uri->segment($seg));
$query = $this->db->get("pastes");
if($query->num_rows() > 0) {
$paste = $query->row_array();
if ( $paste['expire'] < time() ) {
$this->db->delete('pastes',array('pid'=>$paste['pid']));
return FALSE;
} else {
return TRUE;
}
} else {
return FALSE;
}
}
}
I realize that my earlier patch was probably not used because it also contained
changes to other methods, that relied on other features etc... I'm new to this,
so I
didn't consider that the patch should be completely atomic, and not have other
dependencies. If you want the checkPaste method to handle deleting, the method
above
should work, but note that that is copied and pasted from an earlier release of
Stikked that I was working on. You may need to make slight changes to be
compatible
with the current release.
Original comment by michelle...@gmail.com
on 15 Feb 2009 at 6:04
That was actually me, not my wife Michelle!
Original comment by perrytri...@gmail.com
on 15 Feb 2009 at 6:26
I think the if statement should be :
if ( $paste['expire'] < time() && $paste['expire']!=0)
Since Stikked assigns a default expiration time of 0, $paste['expire']!=0 is
needed so that pastes marked "Keep Forever" won't be deleted, as time() is
always greater than 0.
This code works with current (0.5.4) version.
Original comment by Rick...@gmail.com
on 12 Jan 2012 at 12:03
Original issue reported on code.google.com by
perrytri...@gmail.com
on 18 May 2008 at 5:05Attachments: