The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||
Custom Conditional BB-Codes: Create your own
![]() Developer Last Online: Dec 2010 ![]() ![]()
Custom Conditional BB-Codes: Create your own - Version 1.00
Description This Hack will give you all building blocks to create your own BB-Codes that eveluate different based on a condition. You can create almost any condition you want. As an example full instructions are given to install a "[noguest]text[/noguest]" BB-Code that will only show "text" to logged in users. This hack is a result of the following 2 threads: - https://vborg.vbsupport.ru/showthrea...threadid=75162 (now withdrawn) - https://vborg.vbsupport.ru/showthread.php?t=74940 WARNING: With exception of the provided example, does this hack need some basic PH-coding skills. Tested on - vB 3.0.6 Install Information Install time: from 2 minute till ...... hours ![]() File edits: 1 - 5 (depending on configuration) Template edits: 0 IT IS EXTREME IMPORTANT THAT YOU READ ALL INSTRUCTIONS CAREFULLY. Features - Included example will give you a [noguest]Text[/noguest] BB-Code - You can write your own conditional BB-Codes - Post caching is modified not to include posts that contain user dependent conditionals. - Post preview on forumdisplay.php is modified not to show text that contain user dependent conditionals. Support Support will be given in this thread. I will not charge for this hack. But if you like it and are looking for a way to spend your money, paypal donations are always welcome (marcoh64@msn.com) ![]() Please click Install if you are using this hack Show Your Support
|
Comments |
#2
|
|||
|
|||
![]()
hi marco,
can you tell me why this does not work? Code:
function handle_bbcode_noguest($code) { global $bbuserinfo; // remove empty codes if (trim($code) == '') { return ''; } // Prevent caching if a BB-code is used that is userdependent // Uncomment the following 2 lines if the parsing of the bb-code is user dependent. // So: // - If user permissions are checked // - If usergroup is checked // - if userid is checked // - ..... // Leave commented if: // - No checking is done // - Checking is done based on forumid // - .... global $bbcodeparse_nopostcache; $bbcodeparse_nopostcache = 1; if ($bbuserinfo['userid'] == 0 OR $bbuserinfo['usergroupid'] == 2) // Guest { $code = "no guest!"; } return $code; } haha, i solved the "problem" myself. i just added usergroupid instead of userid. thanks a lot for this great hack. everything works fine now! ![]() |
#3
|
|||
|
|||
![]()
I am going to have a play with this, as i have recently been developing an admin notes system where admins can leave notes in posts stating if somebody has done somethign wrong, rather than just editing the post
![]() |
#4
|
||||
|
||||
![]() Quote:
|
#5
|
|||
|
|||
![]()
this will exactly display something different to different groups.
for example the media to the paying customers and an error notice to the guests. i am just not too sure about the built-in archive of vb3. |
#6
|
|||
|
|||
![]() Quote:
Not check for that one yet. I know it will work ok for: - Normal post/thread viewing - In all view modes (linear/threaded) - Using cached posts - Preview on forum index Will try to check put the archive tomorrow. @roundhost/eric Yes i think it will work fine for what you want to do. |
#7
|
||||
|
||||
![]()
Okay, here is what I have and it's not working for me i.e. nothing happens and it does not send the permissions error allowing anyone to view. Let's say I want to send a no permissions error code to my custom [media] BBcode.
I change all instances of mycustombbcode to media according to the instructions in Install Conditional Custom BB-Codes.txt and applied the instructed changes to functions_bbcodeparse.php Then I make the proper additions to the functions_forumdisplay.php and it still does not block the group. Here is the function_bbcodeparse.php that I am using. PHP Code:
|
#8
|
|||
|
|||
![]()
Yes 2 things are wrong:
1. Since this condition is user dependant, you will need to uncomment the line: PHP Code:
PHP Code:
PHP Code:
|
#9
|
||||
|
||||
![]() Quote:
PHP Code:
|
#10
|
|||
|
|||
![]()
Did you made the file edits as instructed in "Install with user based conditionals.txt" and optionally in "Install with use of post cache.txt"?
PS You could try the "noguest" example. It is almost the same as what you want, and tested. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|