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.


All times are GMT. The time now is 01:23 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.01256 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete