Log in

View Full Version : Hide [code] from guests


Devanand
04-06-2009, 04:16 PM
Hello,

I want to know how to hide content in [code] from guests and put in my text a.i. " please register to see this code"

Is there some MOD or something for this?

Thank You

D

soundbarrierpro
04-06-2009, 05:16 PM
I'm looking for something similar but I don't want to hide links, I want to hide text in a story.

Here is the mod to hide links.

https://vborg.vbsupport.ru/showthread.php?t=123415&highlight=links

Devanand
04-06-2009, 05:28 PM
Yes, I don't wan't to hide links also. Only what is inside [code] box.

soundbarrierpro
04-06-2009, 05:33 PM
Oh, like entire code chunks for programming? Yeh, I guess you and I are looking for something similar then.

I've done searchs for "Block Code", "Block Text" and they all return the same results.

It appears there was a 3.0 mod which doesn't work on 3.7 or above, and there was a 3.7 mod to block php/html etc code but it's been binned.

They appear to function by phrasers and bbcode.

Anybody know if there is anything new?

Devanand
04-06-2009, 06:08 PM
Funny thing is that I am running phpBB forum and I could menage that there.

soundbarrierpro
04-06-2009, 06:28 PM
This appears to be the hack for 3.7 - all of the other versions are located in the similar threads section in the middle fo the page.

https://vborg.vbsupport.ru/showthread.php?t=179034

Devanand
04-07-2009, 02:36 AM
But this is not what we are looking for.
I don't want to use it manual. I want every [code] to be hiden from guest with message" please register if you want to see message "

mikey1991
04-07-2009, 05:10 AM
you mean like the one at vBulletin.org? I think that you have to go into your template (wherever the code one is) and add a conditional..

that should look something like this:



<if condition="$show['member']">
$code
<else />
<if condition="$show['guest']">
You are not allowed to view this content until you register.
</if></if>


that code may be wrong though, its 7AM and I haven't slept :@

Devanand
04-07-2009, 05:39 AM
Thank you , but where should I add it?

Lynne
04-07-2009, 02:36 PM
Find the template and modify it as he said.

To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. Sometimes the template is the one mentioned at the very top of the page source.

Devanand
04-07-2009, 03:40 PM
Great, I did it :)

Thank you

D

soundbarrierpro
04-07-2009, 03:51 PM
Great, I did it :)

Thank you

D


Can you tell us what you did? Which template you edited, and where you put the statement within the template code?

Devanand
04-07-2009, 04:13 PM
First you do what Lynne said. Then when you open source of page find part where is your code. I had some rapidshare links in code so I was just searching "rapid" in my source with CTRL+F and find it easily. Then I've look to name of template :

http://img149.imageshack.us/img149/4445/poruka1.gif

Than I went to ACP->Stiles and templates -> Serach in Templates > and entered " bbcode_code"

He found me that template and I just put code mikey1991 provide instead $code

http://xs138.xs.to/xs138/09152/poruka2358.gif
Enjoy :)

soundbarrierpro
04-07-2009, 04:44 PM
Awesome, thanks for your response!

Devanand
04-12-2009, 06:57 PM
It looks that this not work fine. Sometimes not registered users can see what is inside code and sometimes registered users can't see.
Did I put code on good place or I should add it somewere alse or the code is not good?

Can anyone from this forum can tell?
This is working here so there is solution.

mikey1991
04-13-2009, 02:18 PM
Hmm, I'm sorry to hear it is not going as well as I'd planned, Maybe there is some problem with the conditional, however I cannot seem to see where.

Are your usergroup permissions correct?

Also, I'll test this out on my board for you.

Lynne
04-13-2009, 02:27 PM
I would guess you have post caching turned on and that is why it isn't working properly. Every hide hack for stuff in posts that I have seen has said you need to have post caching turned off.

mikey1991
04-13-2009, 04:06 PM
I searched for you; and found these:

https://vborg.vbsupport.ru/showpost.php?p=1729140&postcount=99
https://vborg.vbsupport.ru/showthread.php?p=1761581

Wonder if they'd help.

Lynne
04-13-2009, 05:18 PM
I searched for you; and found these:

https://vborg.vbsupport.ru/showpost.php?p=1729140&postcount=99
https://vborg.vbsupport.ru/showthread.php?p=1761581

Wonder if they'd help.
And this is posted at the top of the thread (which is what I was talking about in my previous post):
NOTES: Do not apply any code changes posted before the twenty-second post, and when using this mod, Cached Posts Lifespan should be zero, but turning off post caching can result in slower display time, as posts would then be parsed into HTML at display time rather than at post time.

algert
05-14-2009, 02:58 PM
you mean like the one at vBulletin.org? I think that you have to go into your template (wherever the code one is) and add a conditional..

that should look something like this:



<if condition="$show['member']">
$code
<else />
<if condition="$show['guest']">
You are not allowed to view this content until you register.
</if></if>


that code may be wrong though, its 7AM and I haven't slept :@

Thanks for this. :D

--------------- Added 1242317093 at 1242317093 ---------------

I would guess you have post caching turned on and that is why it isn't working properly. Every hide hack for stuff in posts that I have seen has said you need to have post caching turned off.

Is it possible to get it worked with post caching?

Andy69
05-14-2009, 03:41 PM
how u turn off posts caching im admin and i carnt see links how do i fix this so only non registerd users carnt see links but registerd user groups can. all i see is u register to see links even for me !

Lynne
05-14-2009, 03:46 PM
Is it possible to get it worked with post caching?
I haven't seen one that works with post caching on. However, I don't use a mod like this so I've not read every single one.

Andy69
05-14-2009, 03:48 PM
yes but how do u turn post caching of im using the $code replace 1 and even i carnt see the links ? is there anyway to fix this ?

Lynne
05-14-2009, 03:50 PM
It's in your options - vboptions > server settings > cached post lifespan > 0

Andy69
05-14-2009, 03:55 PM
ty lynne its working now just want to say u guys at vb are so much help to newbies like me thankyou for the help its much appreciated.

--------------- Added 1242321060 at 1242321060 ---------------

i should of asked in post above about this is there any way to make the text that shows up bold or in colour. what would i need to add to this code to achive that ?
<if condition="$show['member']">
$code
<else />
<if condition="$show['guest']">
You are not allowed to view this content until you register.
</if></if>

Lynne
05-14-2009, 04:58 PM
Just use standard html:
<span style="font-weight:bold; color:red;">You are not allowed to view this content until you register.</span>


(I think that's correct.)

algert
05-15-2009, 04:09 AM
I haven't seen one that works with post caching on. However, I don't use a mod like this so I've not read every single one.

if u can find a mod like this, or somehow u stumbled upon one, please let me know because this one needs caching off, and caching off just slows the site down.. :(

maidos
06-08-2009, 06:47 PM
it would be nice if there were a mod for 3.8.x because obviouslymany people want this mod to encourage guests to register so please
we could use a mod that can hide the links in a specific forum sections and allow links on other sections

algert
06-10-2009, 12:07 PM
This doesn't seem to work with tubenow link checker.. :(

voter
07-26-2009, 01:55 PM
it would be nice if there were a mod for 3.8.x because obviouslymany people want this mod to encourage guests to register so please
we could use a mod that can hide the links in a specific forum sections and allow links on other sections
There is a mode as mentioned above by Lynne see post 19 or just go https://vborg.vbsupport.ru/showthread.php?p=1761581 but it is not hiding code in print view.

--------------- Added 1248622804 at 1248622804 ---------------

I am wondering why vbulletin.org not releasing mode for hiding CODE for unlicensed Guests that they useing.

At least a simplified one to hide CODE bbcode from guests would be nice.

voter
08-04-2009, 06:47 AM
you mean like the one at vBulletin.org? I think that you have to go into your template (wherever the code one is) and add a conditional..

that should look something like this:



<if condition="$show['member']">
$code
<else />
<if condition="$show['guest']">
You are not allowed to view this content until you register.
</if></if>


that code may be wrong though, its 7AM and I haven't slept :@
Will not work properly, with non zero Cached Posts Lifespan in Server Settings and Optimization Options.
So put it 0 or check this http://www.vbhackers.com/f76/hide-code-usergroups-5884/