hmm, i was trying to fix the permission up becayse the way you have it, it lets any moderator, super moderator, admin and the one who posted it edit it, im trying to make it so it checks the users permission first and see if they are a moderator in the forum or have the editpost permission and if there the one that posted it, if there not, they cant see the edit link or edit the file but i cant seem to get it to work, i tried using this
PHP Code:
if (!isset($postid)) {
$postinfo=$DB_site->query_first("SELECT postid FROM post WHERE attachmentid=$attachmentid");
$postid=$postinfo[postid];
}
$postinfo=getpostinfo($postid);
$threadinfo=getthreadinfo($postinfo[threadid]);
$getperms=getpermissions($threadinfo[forumid]);
if (!ismoderator($threadinfo[forumid],"caneditposts")) { // check for moderator
if (!$threadinfo[open]) {
eval("standardredirect(\"".gettemplate("redirect_threadclosed")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadinfo[threadid]\");");
exit;
}
if (!$getperms[caneditpost]) {
show_nopermission();
} else {
if ($bbuserinfo[userid]!=$postinfo[userid]) {
// check user owns this post
show_nopermission();
} else {
// check for time limits
if ($postinfo[dateline]<(time()-($edittimelimit*60)) and $edittimelimit!=0) {
eval("standarderror(\"".gettemplate("error_edittimelimit")."\");");
exit;
}
}
}
}