Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 11-19-2010, 05:55 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I am already trying to use your code in a php module. So I placed your entire code in a php file and uploaded it to my modules directory and then created a new center block with it included but your code shows above the block when activated.
Reply With Quote
  #12  
Old 11-19-2010, 05:58 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh. If you put it in its own php file then the file needs to start with "<?php" on the first line and end with "?>" on the last line. You also will need to include some other stuff. It would probably be best to look at an existing module php file to see what to do, or else make the code a plugin and use a template module. (Creating a plugin is pretty easy, if you've never done it before).
Reply With Quote
  #13  
Old 11-19-2010, 06:02 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So yea I added a new plug-in as you said to do and I am making a new template module in vba with this as my template code:

Code:
<!-- BANNED REASON -->
<tr>
   <td class="$altbgclass">
      <table border="0" cellpadding="10"><tr>
         <tr><td>$bbuserinfo[banned_reason_text]</td></tr>
      </table>
   </td>
</tr>
<!-- BANNED REASON -->
This worked perfectly! THANK YOU!!!

Here is how my sick new YOU HAVE BEEN BANNED page looks when a member logins in:

Do you care if I release this here on vborg with you as credited for it's creation?

Side Note: The last bit I have to work out is I want to remove the vba module template wrapper so it shows without the block around it. However, when I select do not use the wrapper the block breaks and goes off to the side.
Attached Images
File Type: jpg VBA Banned Reason.jpg (55.4 KB, 0 views)
Reply With Quote
  #14  
Old 11-21-2010, 01:01 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yotsume View Post
Do you care if I release this here on vborg with you as credited for it's creation?
That's fine with me. You can mention me as having contributed if you want, but I don't care.
Reply With Quote
  #15  
Old 01-31-2011, 11:31 AM
furnival furnival is offline
 
Join Date: Mar 2008
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone help me with a variation of the above please?
What I want to do is display the reason a user was banned under the word 'Banned' in the postbit.
I created a new plugin and inserted kh99's code. I assigned this plugin to the hook postbit_display_complete and made it active.
Then in the postbit template I inserted the code
Code:
<if condition="$bbuserinfo[banned_reason_text]"><div class="smallfont">$bbuserinfo[banned_reason_text]</div></if>
just below where user titles are displayed. Yet the reason the user was banned does not display. Any ideas why not, please?
Reply With Quote
  #16  
Old 01-31-2011, 11:55 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, this looks familiar... Anyway, I think the reason it isn't working is that $vbulletin->userinfo is the "current" user (the one viewing the page), and you need to look up the ban reason for the user who wrote the post. It might work if you use $post['usergroupid'] and $post['userid'] in place of $vbulletin->userinfo. There's also no reason to put the result in $vbulletin->userinfo['banned_reason_text'] - you could use $post there as well (so maybe just change $vbulletin->userinfo to $post everywhere in that code?).

Another thing you could do is to make a plugin on showthread_query and add the ban reason fields to the main post query (you can add to $hook_query_fields and $hook_query_joins in the plugin - see showthread.php around line 985). But I don't know, maybe if there are few users banned it would actually be faster to only do the query when needed rather than add it to every post. I suppose you could build a cache of ban info so that if a user posts a bunch of times on one page you're not doing the same query over and over.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07018 seconds
  • Memory Usage 2,231KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete