vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Attachment in first post only. Disable attachments when replying to a thread. (https://vborg.vbsupport.ru/showthread.php?t=64493)

Aurous 04-28-2004 05:52 PM

Attachment in first post only. Disable attachments when replying to a thread.
 
I need my users to upload attachments only when making a new thread, so it only shows in the first post. Rest can only reply but not post attachments.

How do I implement this?

Xenon 04-28-2004 08:21 PM

open newreply.php find this:
PHP Code:

$forumperms fetch_permissions($forumid); 

and below add:

PHP Code:

$forumperms $forumperms & ~CANPOSTATTACHMENT

that should work..

Aurous 04-29-2004 06:32 AM

That works like a charm!

Thanks a LOT!

May God bless u!

Xenon 04-29-2004 12:24 PM

:)

You're welcome

Boofo 04-29-2004 12:51 PM

Stefan, what does this do in front of CANPOSTATTACHMENT?

Quote:

~
I've never seen that before.

Xenon 04-29-2004 12:55 PM

i hardle believe you've never seen it before, as it's on every vb3 php file at the top

PHP Code:

error_reprtin(E_ALL & ~E_NOTICE); 

and it stands for the bit-wise not operator, as permissions are stored in a bitfield, you have to use bitoperators lie & ~ or |

Boofo 04-29-2004 01:39 PM

Quote:

Originally Posted by Xenon
i hardle believe you've never seen it before, as it's on every vb3 php file at the top

PHP Code:

error_reprtin(E_ALL & ~E_NOTICE); 

and it stands for the bit-wise not operator, as permissions are stored in a bitfield, you have to use bitoperators lie & ~ or |

You're right. I guess I never paid that much attention to it before. How do you know which one to use when?

Xenon 04-29-2004 04:07 PM

Well, it's just binary logic.

You just have to know what you want.

Here for example if you want to know if someone has the permission to add an attachment, you would use this.

PHP Code:

if ($forumperms CANPOSTATTACHMENT

if you want to know if a user has every permission EXCEPT adding attachments, you would use ~ before.
and so on.

You just have to use it a few times, and then you will get into it :)

Aurous 05-07-2004 05:14 PM

Also, is it possible to limit this to a few forums not all?

Xenon 05-07-2004 10:41 PM

PHP Code:

if (in_array($foruminfo['forumid'], array(x,y,z)))
{
$forumperms $forumperms & ~CANPOSTATTACHMENT;


replacing the x,y,z with a list of forumids where it's restricted :)


All times are GMT. The time now is 04:39 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.01164 seconds
  • Memory Usage 1,737KB
  • 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
  • (6)bbcode_php_printable
  • (2)bbcode_quote_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