vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Edit post error (https://vborg.vbsupport.ru/showthread.php?t=52650)

Boofo 05-06-2003 01:50 PM

Edit post error
 
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. ;)

PHP Code:

if($postinfo[editable]==and $getperms[cancontrolpanel]!=1) {
  
$editpriority="n Admin";
  eval(
"standarderror(\"".gettemplate("error_editpriority")."\");");
  exit;
} else if(
$postinfo[editable]==and $getperms[cancontrolpanel]!=and  $getperms[ismoderator]!=1) {
  
$editpriority=" Supermoderator or Admin";
  eval(
"standarderror(\"".gettemplate("error_editpriority")."\");");
  exit;
} else if(
$postinfo[editable]==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):
PHP Code:

$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:

PHP Code:

// 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 :)


All times are GMT. The time now is 05:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01204 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete