vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Show Thread Enhancements - Hide threads to guests according to title (https://vborg.vbsupport.ru/showthread.php?t=228117)

Arcade Fire 11-15-2009 10:00 PM

Hide threads to guests according to title
 
1 Attachment(s)
Hello, long time to create a plugin for my users to add a code in the title (+ pv) deprived his subjects could do if they wanted visitors.

You can change +pv (+private) to the other code you want.

Go to AdminCP > Plugins & Products > Add New Plugin:


Product: vBulletin
Hook Location: showthread_postbit_create
Title: Only Reg.
Execution Order: 5
Plugin PHP Code:
Code:

if(stristr($thread[title], '+pv') == TRUE)
{
$onlyreg = TRUE;
}

Plugin is Active: YES

and in your showthread tempalte after $navbar:

Code:

<if condition="($onlyreg == TRUE) and ($bbuserinfo[posts]<=1)">
<center><h2>Thread for Registered Users Only</h2></center>
<else />

and above $footer:

Code:

</if>
Tested on vB 3.7.x & 3.8.x

Demo: http://www.rotolandia.com/showthread.php?t=70365(spanish site)
and all titles with +pv in this forum http://www.rotolandia.com/forumdisplay.php?f=2

Please Mark Install


Note for vB4.x.x updates:


Only change <if...> for <vb:if...>

Code:

<vb:if condition="($onlyreg == TRUE) and ($bbuserinfo[posts]<=1)">
<center><h2>Thread for Registered Users Only</h2></center>
<vb:else />

and above $footer:

Code:

</vb:if>

And plugin:

Code:

if(stristr($thread[title], '+pv') == TRUE)
{
$onlyreg = TRUE;

vB_Template::preRegister('SHOWTHREAD', array('onlyreg' => $onlyreg));
}


concepts 11-16-2009 06:10 PM

Nice Work! Will Give It A Try!

abdobasha2004 11-16-2009 07:38 PM

thanks
reserved

Arcade Fire 11-24-2009 02:07 PM

Edit: Available for vb4 if someone needs it.

Mike08 07-16-2010 02:10 PM

Gracias, siempre me hab?a preguntado como lo hacian en FC :roto2: ;)
Solo una cosa, el <if> deber?a ir por encima de $footer, si no no sale todo el cuerpo de la pagina.

Only one thing. <if> must be above of $footer for proper page display.

papalph 07-29-2010 04:03 AM

FYI, if you have your archive pages turned on the thread is still fully visible through those pages.

Arcade Fire 08-01-2010 09:04 AM

Quote:

Originally Posted by papalph (Post 2076065)
FYI, if you have your archive pages turned on the thread is still fully visible through those pages.

You can put the same code in the template file, check my site for testing (any + pv)

http://www.rotolandia.com/archive/in...f-2-p-246.html

Arcade Fire 08-01-2010 09:13 AM

Quote:

Originally Posted by Mike08 (Post 2070106)
Gracias, siempre me hab?a preguntado como lo hacian en FC :roto2: ;)
Solo una cosa, el <if> deber?a ir por encima de $footer, si no no sale todo el cuerpo de la pagina.

Only one thing. <if> must be above of $footer for proper page display.

My bad, thanks!

Ps: In Forocoches, is likely to use a similar plugin but based on user groups, as some posts are for users with +6 months old ... and others based on the date of the post (registered users subsequent to the creation of the post, can not see it.

Pd: En Fc, es probable que usen un plugin parecido pero basado en grupos de usuario, ya que algunos post son para usuarios con +6 meses de antig?edad... y otros basados en la fecha del post (usuarios registrados posteriormente a la creaci?n del post, no pueden verlo.

rarauz 11-22-2011 09:42 PM

Hola,

lo he probado y funciona. Tan solo hay que hacer un peque?o cambio en tu c?digo para v.4.*

<vb:if condition="($onlyreg == TRUE) and ($bbuserinfo[posts]<=1)">
<center><h2>Thread for Registered Users Only</h2></center>
<vb:else />

Muchas gracias.

-----

Hi,

I tried your plugin and works fine !!!

Only you must have one little change in the code for Vbulletin v.4.*


<vb:if condition="($onlyreg == TRUE) and ($bbuserinfo[posts]<=1)">
<center><h2>Thread for Registered Users Only</h2></center>
<vb:else />

Thanks a lot.

Arcade Fire 11-23-2011 09:29 AM

My bad, thanks rarauz.

suko22 02-13-2012 10:36 AM

Gracias por el código Arcade Fire. Ahora para rizar el rizo, ¿sabes cómo se podría ocultar los banners de adsense en los post +18? Por más que lo intento no se me ocurre la forma...

TR: Thanks for the mod Arcade Fire. Bytheway, you know how to hide adsense in +18 threads? I´ve been trying it whitout any success...

matrex722 05-28-2012 09:37 PM

if i used this i think it will effict seachangine like google
how spiders will see my threads ?

al2thero 12-02-2012 01:00 AM

Thanks a lot

packosoft 10-23-2013 03:03 PM

I make a little modification.
from
PHP Code:

<if condition="($onlyreg == TRUE) and ($bbuserinfo[posts]<=1)"

to
PHP Code:

<if condition="($onlyreg == TRUE) and ($bbuserinfo['userid'] == 0)"

because before, users with 0 posts can't see the posts. I will use it with +reg to force user to register an with +prv to have at least 100 posts

he hecho una peque?a modificacion para que los usuarios con 0 posts puedan ver el hilo.
Yo lo voy a usar para que poniendo +reg haga falta registrarse y con +prv adem?s hagan falta 100 mensajes

PHP Code:

<if condition="($onlyreg == TRUE) and ($bbuserinfo['userid'] == 0)"
                <
br><br><br>
                <
center><h2>Este hilo solo estdisponible para usuarios registrados</h2></center>
                <
br><br><br>
         <else /> 

i.e.: http://www.hardlimit.com/off-topic/t...reg-76600.html

PHP Code:

<if condition="($onlyprv == TRUE) and ($bbuserinfo[posts]<=100)">
                <
br><br><br>
                <
center><h2>Este hilo solo estdisponible para usuarios con m?s de 100 mensajes</h2></center>
                <
br><br><br>
         <else /> 

i.e.: http://www.hardlimit.com/off-topic/t...prv-76603.html

booble 03-12-2014 08:50 PM

I don't understand what is the template...showthread? navbar?

thanks

booble 03-14-2014 05:27 PM

any help?


All times are GMT. The time now is 07:33 AM.

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.01117 seconds
  • Memory Usage 1,766KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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