View Full Version : Edit post error
Boofo
05-06-2003, 01:50 PM
Can anyone please tell me why the following code will give me the error_editpriority template whenever I go to edit a post in only 1 certain forum? It tells me I have to be an Admin to edit the post and won't let me in to edit it. ;)
if($postinfo[editable]==0 and $getperms[cancontrolpanel]!=1) {
$editpriority="n Admin";
eval("standarderror(\"".gettemplate("error_editpriority")."\");");
exit;
} else if($postinfo[editable]==3 and $getperms[cancontrolpanel]!=1 and $getperms[ismoderator]!=1) {
$editpriority=" Supermoderator or Admin";
eval("standarderror(\"".gettemplate("error_editpriority")."\");");
exit;
} else if($postinfo[editable]==2 and !ismoderator($threadinfo[forumid],"caneditposts")) {
$editpriority=" Moderator, Supermoderator or Admin";
eval("standarderror(\"".gettemplate("error_editpriority")."\");");
exit;
}
filburt1
05-06-2003, 01:58 PM
Label me crazy but isn't the global permissions variable $permissions and not $getperms?
Boofo
05-06-2003, 02:02 PM
I think so. But (are you ready for this?), Xenon wrote that code for his edit heiarchy hack. ;) He knows way more about this stuff than I do.
Boofo
05-06-2003, 02:33 PM
filburt, your suggestion seemed to fix it. I changed all of the $getperms to $permissions and now I can edit the post. Thank you. ;)
Xenon
05-06-2003, 03:51 PM
hmm, wiered, AFAIK it has worked when i released it....
Boofo
05-06-2003, 04:25 PM
I'm not sure. I had Logician's edit Hierarchy hack right above this code when I put it in. They are both still there. Is there a way to combine the two into one? By the way, changing the getperms to permissions seems to work now. ;)
filburt1
05-06-2003, 04:35 PM
You could be lazy and do (IIRC):
$getperms = &$permissions;
Then the two variables are essentially the same.
Xenon
05-06-2003, 04:42 PM
yes it's possible to use them both, as i use it on my board ;)
hmm, maybe i defined getperms there somewhere ;)
Boofo
05-06-2003, 06:00 PM
When I use them both, I always end up with the template from Logician's hack being called. The only time it called yours is when I had the problem with it. ;) I didn't see getperms defined anywhere in your code. Maybe I missed something?
Xenon
05-06-2003, 07:02 PM
line 36 in a unhacked editpost.php:
// get permissions info
$getperms=getpermissions($threadinfo[forumid]);
so you can see getperms has to be set :)
if this doesnt exists on your file, you should readd it again ;)
also be sure the if block of logicians/mine hack is BELOW that :)
Boofo
05-06-2003, 07:07 PM
I have this:
// get permissions info
$getperms=getpermissions($threadinfo[forumid]);
updateuserforum($threadinfo['forumid'], $threadinfo['threadid']);
and then Logician's hack and yours right below his.
But the error didn't go away until I changed the getperms to permissions in yours. That is strange. It should have worked, shouldn't it?
Xenon
05-06-2003, 07:09 PM
it should have worked, and as i can see on my board it also does work :)
i cant say more, sorry ;)
Boofo
05-06-2003, 07:12 PM
I can pm you the code block for Logician's and your hack if it will help figure it out at all. ;)
Xenon
05-06-2003, 07:14 PM
ok, maybe i can find something :)
Boofo
05-06-2003, 07:17 PM
On it's way. Thank you. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.