vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Hide BB Code Content From Unregistered Users (https://vborg.vbsupport.ru/showthread.php?t=265063)

ALBCODERS 06-11-2011 10:00 PM

Hide BB Code Content From Unregistered Users
 
1 Attachment(s)
I couldn't find any addon for vb 4 to hide the bbcode content from unregistered users and showing a register message instead as here on vbulletin.org,so i have just fixed manualy on my forum.
add a new phrase first from Admincp ? Languages & Phrases ? Phrase Manager ? Add New Phrase
  • Phrase Type : GLOBAL
  • Product : vBulletin
  • Varname : hide_code
  • Text : Please Login or <a href="register.php">Register</a> to see codes
Go to your Admincp ? Styles & Templates ? Style Manager ? Your Style ? BB Code Layout Templates

Open the bbcode_code template and find:
HTML Code:

<div class="bbcode_description">{vb:rawphrase code}:</div>
add this below:
HTML Code:

<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />

In the same template add above the last </div> :
HTML Code:

</vb:if>
Open the bbcode_html template and find:
HTML Code:

<div class="bbcode_description">{vb:rawphrase html_code}:</div>
add this below:
HTML Code:

<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />

In the same template add above the last </div> :
HTML Code:

</vb:if>
Now Open the bbcode_php template and find:
HTML Code:

<div class="bbcode_description">{vb:rawphrase php_code}:</div>
add this below:
HTML Code:

<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />

In the same template add above the last </div> :
HTML Code:

</vb:if>
LIVE DEMO

AttalaEA 06-12-2011 09:29 AM

Thanks for this nice addon. I was looking for that. :)

ellovo 06-13-2011 10:56 PM

Thanks Bro great job.....

hiker 06-16-2011 04:34 AM

How do you decide which content to hide? Which bbcode do you use?

nacaruncr 07-09-2011 10:08 PM

I used a hack for 3.8 or 3.5 (I don't remember XD) but this, is the same :D awesome men :D thanks :D

installed + MOTM + 5 stars :D

as7apcool 07-12-2011 05:28 PM

Thanks a lot for This

ngocol 07-30-2011 09:34 PM

can I change the word ? "Please Login or <a href="register.php">Register</a> to see codes" i try but it didnot change any suggestion ?

nacaruncr 07-30-2011 11:15 PM

I've a little problem... sometimes when I put my codes in the bbc tags , or even the registers users it appear the message "Please Login or Register to see the code"

How I can fix it?

ALBCODERS 08-10-2011 12:17 PM

Sorry but I can't check the codes now because I'm not in my Home these days, and this needs some php functions you can use this other one coded by nhawk

nacaruncr 08-10-2011 08:26 PM

ok :)...... I'm using other style, I'm going to try if continue this problem or not ;)

thanks anyway :D

bumbo 08-12-2011 10:59 AM

All I did as you wrote. However, when I wanted to edit bbcode_php, I got the following message:

"1||1313150055||80.65.85.121||s=&do=add&dostyleid= 41&title=bbcode_php&group=bbcode&searchstring=&exp andset=41|| http://xxx.com/admincp/template.php?...e||Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0Access Denied, you have been logged."

What is the problem Can you help me? Thank you!

hhumas 08-30-2011 07:29 AM

i have done everything .. now tell me how to tell which content to hide ....

setishock 09-03-2011 06:10 AM

At your live demo I can see the code for the embedded clocks just fine. Even nabbed one.

kfyonur 09-03-2011 06:53 AM

i can see too.

westbam666 09-05-2011 08:25 AM

Quote:

Originally Posted by bumbo (Post 2232592)
All I did as you wrote. However, when I wanted to edit bbcode_php, I got the following message:

"1||1313150055||80.65.85.121||s=&do=add&dostyleid= 41&title=bbcode_php&group=bbcode&searchstring=&exp andset=41|| http://xxx.com/admincp/template.php?...e||Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0Access Denied, you have been logged."...

Beside you on forum is installed probably vBFirewall.
Necessary must uncouple him, install the product then once again to include.

maxie 10-09-2011 01:53 PM

Quote:

Originally Posted by ngocol (Post 2227010)
can I change the word ? "Please Login or <a href="register.php">Register</a> to see codes" i try but it didnot change any suggestion ?

work for me just clear you cokies and try again

nacaruncr 10-09-2011 10:02 PM

Quote:

Originally Posted by nacaruncr (Post 2227043)
I've a little problem... sometimes when I put my codes in the bbc tags , or even the registers users it appear the message "Please Login or Register to see the code"

How I can fix it?

Are there news about this???

uninvited13th 11-18-2011 05:06 AM

as far as I know it is because bbcode template is cached

ioscoder 11-18-2011 11:17 PM

Not Success. It hides with all groups!

Berdus2012 02-15-2012 12:22 PM

not working, show for admin and all groups ! -.- not for Guest's

gendhenk 05-29-2012 04:39 AM

http://s11.postimage.org/5jsth781u/n...529_123620.jpg
why error?
I admin,no guest
please help my

faisaly.com 02-01-2013 04:23 PM

hope someone can help with this, I tried using vb4.2 and failed! will this hide custom bbcodes?

neya 02-18-2013 12:53 PM

Been looking for this, thanks a bunch, tagged for now, will install later. :)

Quote:

Originally Posted by faisaly.com (Post 2401088)
hope someone can help with this, I tried using vb4.2 and failed! will this hide custom bbcodes?

Yep, I just tried it and it failed to work. Using 4.2

fxdigi-cash 03-11-2013 08:18 PM

I don't know why this code doesn't function well, but maybe we can reverse the method.... instead of assigning a condition against the "guest", we can assign a condition for members only....

we will use the same steps the coder did, as the following:

Open the bbcode_code template and find:
PHP Code:

<div class="bbcode_description">{vb:rawphrase code}:</div

and insert below it:
PHP Code:

<vb:if condition="is_member_of($bbuserinfo, 1,2,3)"

and will do the same to the rest of the codes....

meaning instead of adding this code:
PHP Code:

<vb:if condition="$show['guest']">
<
pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<
vb:else /> 

we will add this code for the allowed user groups:
PHP Code:

<vb:if condition="is_member_of($bbuserinfo, 1,2,3)"

save the changes in each template and see whether it works or not...logically, it should work, but didn't test it...

MissKalunji 03-25-2013 03:40 AM

^this worked :) thanks!

MissKalunji 04-04-2013 02:25 PM

I take that back, it does work but when a post was JUST posted....the link shows until I edit the post and save, only then the please register appears.

Has anyone experienced this issue?

semaster 07-04-2014 06:23 PM

can anyone make this work properly ? i really need this.


All times are GMT. The time now is 04:41 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.01951 seconds
  • Memory Usage 1,780KB
  • 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
  • (9)bbcode_html_printable
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)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