The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Restrict [IMG] tag to registered members only
This hack was already successfully created for vB2, isn't available for vB3. There seems to be some nice interest in this hack, and it would be a great addition (and a bandwidth saver) for sites with many guests and few members, etc.
The vB2 version has been discussed in this thread: https://vborg.vbsupport.ru/showthread.php?t=57536 This hack was supplied by Lesane in the thread above, but sadly, last I heard is that he's banned and no longer here at vb.org. Anyone want to pick this one up for vB3? I'm looking for a hack that would allow an Admin the ability to "flip a switch" and make it so that any posts which include imbedded images (using the [IMG] tag) would be "disabled" for guests. Instead of guests seeing the images within a post (as you normally would) they would see a replacement graphic that says something along the lines of "In order to view this image, you need to register." (Admins could make this any graphic they wish.) I made a completely generic vb2 style graphic which could be used as a replacement. This is attached to this post. I'll be happy to update the graphic to a more vB3 style graphic if needed. Any help with this hack would be appreciated, thanks. |
#2
|
||||
|
||||
Edit the functions_bbcodeparse.php file, look for the handle_bbcode_img function.
Just edit the conditionals and add one if no userid to display the image you posted instead... easy as pie... |
#3
|
||||
|
||||
Quote:
If you don't mind, when you have some time, if you could list this as a step-by-step, I'm sure myself and a few others would really appreciate it. |
#4
|
||||
|
||||
Sure, I could probably whip something out in a few... lemme give it a test on my forum then I'll post some code.
|
#5
|
||||
|
||||
Awesome, thanks Jason!
|
#6
|
||||
|
||||
Okay, as mentioned before, open the functions_bbcodeparse.php file.
Find the following code: PHP Code:
PHP Code:
Keep in mind though, this also affects sigs with the IMG tag.... |
#7
|
||||
|
||||
Awesome, Jason!!
I'm going to have to test this out on my forum, but thanks for the code help. I'm sure others will use this as well. Great bandwidth saver for non-members, etc. |
#8
|
||||
|
||||
It worked perfecty, thanks!
For those of us that use a portal (like vBAdvanced) is there any way to allow for the IMG tag function on just the index page? I'm guessing that the easiest way to do this would be to just include some code that EXCLUDES a forum ID number (or multiple forum IDs) from this new IMG rule for registered only. Then we could enter in the forum ID (or IDs) for the news forum used on the index page. I know the "theory" of what should be done, but don't know the code. Would it be possible to add this as well? Thanks!! |
#9
|
||||
|
||||
Jason was kind enough to tweak this hack to allow for a specific single forum to be EXCLUDED from this hack. In order words, you can choose a particular forum (by forum ID #) to allow even guests to view images from the IMG tag.
In case anyone needs this tweak as well, I'm posting this code from Jason, and any and all credit goes to him: All you need to do is change the "$forumid != X" to whatever the forumid you want to exclude. If you want multiple forums you will need to defind them as an array and use the in_array function. PHP Code:
This is an excellent hack! |
#10
|
|||
|
|||
Hey just found this thread again. I used to have this in 3.0 but now with 3.5 how do you do this. I dont have functions_bbcodeparse.php, where is it done now?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|