The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
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.
|
#12
|
|||
|
|||
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).
|
#13
|
||||
|
||||
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 --> 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. |
#14
|
|||
|
|||
That's fine with me. You can mention me as having contributed if you want, but I don't care.
|
#15
|
|||
|
|||
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> |
#16
|
|||
|
|||
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. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|