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 - Show First Post Only To Unregistered User / Guest (https://vborg.vbsupport.ru/showthread.php?t=212437)

Raptor 04-28-2009 10:00 PM

Show First Post Only To Unregistered User / Guest
 
1 Attachment(s)
Ported from: https://vborg.vbsupport.ru/showthread.php?t=181462

Thanks to ryans

Fully tested on 3.8.1 - probably works the same on 3.8.2+

This is just a simple hack that will show the first post to unregistered users / guests. The rest of the posts in the thread will ask them to login or register. This is a template hack. Of course you can edit your own message.

Additions / Changes / Ideas are welcome.

In Postbit Templates edit the postbit_legacy or the postbit template depending on which one you use.

Find:

Code:

<!-- message -->
<div id="post_message_$post[postid]">
        $post[message]
</div>
<!-- / message -->

Replace With:

Code:

<!-- message -->

<if condition="$show['member']">
                <div id="post_message_$post[postid]">
                $post[message]
                </div>                               
                <else />                               
                <if condition="$post[postcount] == 1">
                <div id="post_message_$post[postid]">
                $post[message]</div>
                </if>
                <else />
                <if condition="$show['guest']">
                <if condition="$post[postcount] != 1">
                <br><br>You Must be a registered member and logged in to view this response.  To Register <a href=register.php>Please Click Here</a>
                <br><br>
                </if></if></if>

<!-- / message -->


Raptor 04-29-2009 02:51 PM

1 Attachment(s)
Here is another version which puts a nice graphical box around the "Please Register Text"

Upload Warn.png to images/misc/

Add this CSS code to Additional CSS :

Code:

.warning-box,
{
        color: #000;
        border: 1px solid #000;
        -moz-border-radius: 5px;
        background-color: #defee3;
        padding: 6px;
        text-align:left;
}

.warning-box img,
{
        float:left;
        margin-top: 10px;
        margin-right: 5px;
        vertical-align:middle;
        border: 0px;
}

.warning-box h2,
.warning-box p,
{
        padding: 0px;
        margin:  0px;
        margin-left: 60px;
}

.warning-box h2,
{
        padding-bottom: 4px;
        font-size: 14px;
        border-bottom: 1px solid #000;
}

.warning-box h1,
{
        padding: 0px;
        margin:  0px;
        margin-left: 60px;
        font-size: 12px;
        font-weight:normal;
}

.warning-box h6,
{
        margin:  20px;
        padding: 0px;
        margin-left: 60px;
        font-size: 12px;
        font-weight:normal;
}

.warning-box
{
        background-color: #FFCCCC;
}

.warning-box ul,
{
        margin-left: 30px;
}

In Postbit or Postbit_Legacy

find:

Code:

<!-- message -->
<div id="post_message_$post[postid]">
        $post[message]
</div>
<!-- / message -->

replace with:

Code:

<!-- message -->

<if condition="$show['member']">
                <div id="post_message_$post[postid]">
                $post[message]
                </div>                               
                <else />                               
                <if condition="$post[postcount] == 1">
                <div id="post_message_$post[postid]">
                $post[message]</div>
                </if>
                <else />
                <if condition="$show['guest']">
                <if condition="$post[postcount] != 1">


<div class='warning-box'>
<img src='images/misc/warn.png' alt='Warning' />
<h2><strong>Warning</strong></h2>
<h1><font color="#000000">

<br><br>You Must be a registered member and logged in to view this response.  To Register <a href=register.php>Please Click Here</a>

</font></h1>
<br /><br /></div>

<br><br>
</if></if></if>

<!-- / message -->


Trip 04-29-2009 07:41 PM

Interesting Raptor, I like the custom CSS and the included image. One quick question though. How will this affect search engines indexing one's site??

Raptor 04-29-2009 08:13 PM

I would think that most of the time the OP is what's important to a search engine.

Search engines crawl as guests so they wouldn't see the responses iirc

Black Tiger 05-02-2009 12:04 AM

Tagged this one for now.
Search engines crawl as guest but as a certain user agent:
http://www.pctools.com/guides/registry/detail/799/

People can imitate that, but maybe there is a way to change you mod and make a filter so the mod does not affect search engines.
I presume there are also user agent statements voor yahoo and others.

If it can be fixed that search engines still can crawl, I would be happy to use this mod.

Gersfan 08-09-2009 02:49 PM

I would be happy to use this mod. If you can a way that allows search engines to crawl,

sdavis2702 08-13-2009 03:24 PM

I agree. Search engine access and I REALLY like this one.

Gersfan 08-16-2009 06:53 PM

I don't really think, were going ot get what we want though are we? ha!

aJHier123 08-29-2009 07:08 PM

Quote:

Originally Posted by Raptor (Post 1801210)
Here is another version which puts a nice graphical box around the "Please Register Text"

Upload Warn.png to images/misc/

Add this CSS code to Additional CSS :

Code:

.warning-box,
{
        color: #000;
        border: 1px solid #000;
        -moz-border-radius: 5px;
        background-color: #defee3;
        padding: 6px;
        text-align:left;
}

.warning-box img,
{
        float:left;
        margin-top: 10px;
        margin-right: 5px;
        vertical-align:middle;
        border: 0px;
}

.warning-box h2,
.warning-box p,
{
        padding: 0px;
        margin:  0px;
        margin-left: 60px;
}

.warning-box h2,
{
        padding-bottom: 4px;
        font-size: 14px;
        border-bottom: 1px solid #000;
}

.warning-box h1,
{
        padding: 0px;
        margin:  0px;
        margin-left: 60px;
        font-size: 12px;
        font-weight:normal;
}

.warning-box h6,
{
        margin:  20px;
        padding: 0px;
        margin-left: 60px;
        font-size: 12px;
        font-weight:normal;
}

.warning-box
{
        background-color: #FFCCCC;
}

.warning-box ul,
{
        margin-left: 30px;
}

In Postbit or Postbit_Legacy

find:

Code:

<!-- message -->
<div id="post_message_$post[postid]">
        $post[message]
</div>
<!-- / message -->

replace with:

Code:

<!-- message -->

<if condition="$show['member']">
                <div id="post_message_$post[postid]">
                $post[message]
                </div>                               
                <else />                               
                <if condition="$post[postcount] == 1">
                <div id="post_message_$post[postid]">
                $post[message]</div>
                </if>
                <else />
                <if condition="$show['guest']">
                <if condition="$post[postcount] != 1">


<div class='warning-box'>
<img src='images/misc/warn.png' alt='Warning' />
<h2><strong>Warning</strong></h2>
<h1><font color="#000000">

<br><br>You Must be a registered member and logged in to view this response.  To Register <a href=register.php>Please Click Here</a>

</font></h1>
<br /><br /></div>

<br><br>
</if></if></if>

<!-- / message -->


thanks ...

DamasGate 11-26-2009 12:23 PM

Is there anyway to show only the first post and total hide all other posts?

Thank you

ravenfaust 11-30-2009 11:57 PM

Agreed This will rune your forum if you rely on indexing.

Hasann 01-11-2010 09:48 PM

Try this code for search enginee access with this mod :)

PHP Code:

<!-- message -->

<if 
condition="$show['search_engine']">
<
div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div>        
</if>
<if 
condition="$show['member']">
<
div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div>                
<else />                
<if 
condition="$post[postcount] == 1">
<
div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div>
</if>
<else />
<if 
condition="$show['guest']">
<if 
condition="$post[postcount] != 1">
<
div class='warning-box'>
<
img src='images/misc/warn.png' alt='Warning' />
<
h2><strong>Warning</strong></h2>
<
h1><font color="#000000"><br /><br />Konunun devamindaki mesajlari okuyabilmek icin ?ye olmaniz gerekmektedir. <br />L?tfen ?ye Olmak icin <a href=register.php>BURAYA</aTiklayin.
</
font></h1>
<
br /><br />
</
div>
<
br /><br />
</if></if></if>

<!-- / 
message --> 


ecreweb 08-22-2010 01:34 AM

Thanks. :)

Black Tiger 09-24-2010 11:13 PM

Sorry but for the search engine adjustment... could you translate this to English for me?
Quote:

Konunun devamindaki mesajlari okuyabilmek icin ?ye olmaniz gerekmektedir. <br />L?tfen ?ye Olmak icin <a href=register.php>BURAYA</a> Tiklayin.

kpmedia 02-18-2011 03:33 AM

Quote:

Originally Posted by Black Tiger (Post 2102895)
Sorry but for the search engine adjustment... could you translate this to English for me?

Google Translate says this is Turkish, and it means this:
Quote:

You must be a member of the subject to read the subsequent posts . Please CLICK HERE to Become a Member

Black Tiger 02-18-2011 12:38 PM

Thank you.

Simon Lloyd 04-06-2011 02:05 AM

Quote:

Originally Posted by Hasann (Post 1953085)
Try this code for search enginee access with this mod :)

PHP Code:

<!-- message -->

<if 
condition="$show['search_engine']">
<
div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div>        
</if>
<if 
condition="$show['member']">
<
div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div>                
<else />                
<if 
condition="$post[postcount] == 1">
<
div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]</div>
</if>
<else />
<if 
condition="$show['guest']">
<if 
condition="$post[postcount] != 1">
<
div class='warning-box'>
<
img src='images/misc/warn.png' alt='Warning' />
<
h2><strong>Warning</strong></h2>
<
h1><font color="#000000"><br /><br />Konunun devamindaki mesajlari okuyabilmek icin ?ye olmaniz gerekmektedir. <br />L?tfen ?ye Olmak icin <a href=register.php>BURAYA</aTiklayin.
</
font></h1>
<
br /><br />
</
div>
<
br /><br />
</if></if></if>

<!-- / 
message --> 


Hi Hassan, how would i work another condition in? you display only the first post to guests and display a message i would like to display only the first post to unconfirmed users but display a different message, like
PHP Code:

<if condition="is_member_of($bbuserinfo, 3)">PLEASE COMPLETE YOUR REGISTRATION</if> 

could you help?

cergat 04-16-2011 08:04 AM

what about vb 4.1.3 - i would like to apply this mod on that version - i tryed but seams not possible :( - help?

oliver22 05-26-2011 01:20 PM

Yes, what about 4.1.x support ? Is there any other plugin to do this ?

Simon Lloyd 05-26-2011 05:47 PM

This mod is for vb3.8.x not 4.x however, i believe it should work if you change the if condtionals properly for vb4 i.e instead of <if you would use <vb:if

Traxdata 06-25-2011 10:10 AM

Just wondering if it is possible to show it in specific and not all subforums?

Simon Lloyd 06-25-2011 11:26 AM

Just add conditionals to exclude the forums you don't want it to work in :)

FockerFGAA 07-29-2011 12:52 AM

Quote:

Originally Posted by Simon Lloyd (Post 2200281)
This mod is for vb3.8.x not 4.x however, i believe it should work if you change the if condtionals properly for vb4 i.e instead of <if you would use <vb:if

Can anyone test it on VB4?

I can't find the code to replace in postbit or postbit_legacy.

Traxdata 11-28-2011 04:25 PM

Quote:

Originally Posted by Simon Lloyd (Post 2212529)
Just add conditionals to exclude the forums you don't want it to work in :)

unfortunately it won't work with

<if condition="$forum[forumid] != XXX"></if>

Simon Lloyd 11-28-2011 05:26 PM

Quote:

Originally Posted by Traxdata (Post 2272778)
unfortunately it won't work with

<if condition="$forum[forumid] != XXX"></if>

Thats because in vb4.x you don't use <IF you use <vb:If ...etc

Traxdata 11-28-2011 08:34 PM

Im on vb3.7...

Simon Lloyd 11-29-2011 05:46 AM

try this:
HTML Code:

<if condition = "$thread['forumid']==x">
where x would be your forumid

Traxdata 12-06-2011 06:48 PM

no way. have tried several codes but no one worked so far.

Simon Lloyd 12-06-2011 07:58 PM

and you're editing the right template and portion?

matrex722 05-28-2012 09:41 PM

is there any way to hide replys from sorce page

i mean when you view sorce page

i hope you understand me

GiorgioV 01-31-2016 11:07 AM

Hi,
is there something similar for 4.2.3 ?

MarkFL 01-31-2016 01:46 PM

Quote:

Originally Posted by GiorgioV (Post 2563913)
Hi,
is there something similar for 4.2.3 ?

You could try:

Show First Post Only

and exclude all usergroups except "Unregistered / Not Logged In". :)

GiorgioV 02-03-2016 01:20 PM

I tried it, but it doesn't work. I can see the message "All Posts Except The First and Yours Are Hidden From View" , but scrolling down i can see all the posts without login. I tried both setting "all" in the active forum option, and selecting specific forum. It doesn't work.. :(

MarkFL 02-03-2016 02:36 PM

Quote:

Originally Posted by GiorgioV (Post 2564138)
I tried it, but it doesn't work. I can see the message "All Posts Except The First and Yours Are Hidden From View" , but scrolling down i can see all the posts without login. I tried both setting "all" in the active forum option, and selecting specific forum. It doesn't work.. :(

Are you using the "postbit" template, and not the "postbit_legacy" template? I meant to add support for the "postbit" template, but forgot...I will do that today. :)

GiorgioV 02-05-2016 09:54 AM

I tried with both templates, no way. All posts showed to unregistered users.

GiorgioV 02-07-2016 11:42 AM

Found and installed this . It works fine . Anyway thank you very much.


All times are GMT. The time now is 04:59 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.01403 seconds
  • Memory Usage 1,864KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (36)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