vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Not Show Edit Post Button (https://vborg.vbsupport.ru/showthread.php?t=46972)

Boofo 12-24-2002 10:59 PM

Not Show Edit Post Button
 
I want to be able to only have the "Edit Post" button show up for anyone who is able to edit posts. I troed the caneditposts variable and I can't get it to work. the button still shows up for those who are not able to edit posts. this is the code I started with:

Code:

if ($post[userid]==$bbuserinfo[userid] or ($bbuserinfo[usergroupid]=="5" or $bbuserinfo[usergroupid]=="6" or $bbuserinfo[usergroupid]=="7")) {
                        eval("\$post[editpost] = \"".gettemplate("postbit_editpost")."\";");
                } else {
                        $post[editpost]="";
                }

and this is what I have and can't get to work:

Code:

if ($post[userid]==$bbuserinfo[userid] or ($bbuserinfo[usergroupid]=="6" or !ismoderator($threadinfo[forumid],"caneditposts"))) {
                        eval("\$post[editpost] = \"".gettemplate("postbit_editpost")."\";");
                } else {
                        $post[editpost]="";
                }


Dean C 12-25-2002 11:14 AM

Lol your trying to do the same as me :P

I'm still working on this little hack you know!

Both myself and Xenon couldn't get it to work..

But that code snippet there ^

I think it looks wrong but xmas so i can't be bothered to look thru showthread.php hehe

- miSt

Boofo 12-25-2002 01:10 PM

That first code snippet is not wrong. It is from Firefly and it is the same code he uses here. The second piece of code is definately wrong. That's what I changed it to.

Dean C 12-25-2002 03:59 PM

I meant the second snippet hehe :P

Boofo 12-25-2002 05:35 PM

Oops! Sorry. :o


All times are GMT. The time now is 09:13 PM.

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.01016 seconds
  • Memory Usage 1,715KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete