vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   If creator of thread (https://vborg.vbsupport.ru/showthread.php?t=210364)

GCSkye 04-05-2009 03:51 PM

If creator of thread
 
Looking for an if statement for vbulletin, something like

if ($vbulletin->creator_of_thread

Reason being:
Code:

https://vborg.vbsupport.ru/showthread.php?t=183183
I would like to my members to have the ability to ban users from their own threads if they so choose.

Lynne 04-05-2009 04:19 PM

I don't know where you are trying to use the variable, but have you tried $thread[postuserid] ? (postuserid is the name of the field in the thread table - and postusername is the user's name)

GCSkye 04-05-2009 05:34 PM

if ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'])

That is where it givers permissions to users. I want it to instead give permissions to not only admins but also the creator of the thread.

Lynne 04-05-2009 05:51 PM

So did you try adding in something like "AND $vbulletin->userinfo['userid'] == $thread[postuserid]" ?

That would be if the viewer of the page is the thread creator.

GCSkye 04-05-2009 09:55 PM

Tried that with no luck. Even tried just the following:

Code:

<phpcode><![CDATA[if ($vbulletin->$vbulletin->userinfo['userid'] == $thread[postuserid])
{ $show['btu_canban'] = true; }]]></phpcode>

It allowed everyone to ban users from threads. I'm looking for something that will allow only the starter of the thread to be allowed to do this.

Lynne 04-05-2009 10:19 PM

What variable you use and whether it is available for use really depends on what hook location you are using. You should look in the code right before the hook location is called and see how they are defining/using variables. That is your best clue on what to do.


All times are GMT. The time now is 05:00 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.01145 seconds
  • Memory Usage 1,716KB
  • 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
  • (6)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