Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Show First Post Only To Unregistered User / Guest Details »»
Show First Post Only To Unregistered User / Guest
Version: 1.00, by Raptor Raptor is offline
Developer Last Online: Jun 2022 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.1 Rating:
Released: 04-28-2009 Last Update: Never Installs: 33
Template Edits
Re-useable Code Translations  
No support by the author.

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 -->

Screenshots

File Type: jpg firstpostgurst.jpg (77.2 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-29-2009, 02:51 PM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 -->
Attached Images
File Type: jpg firstpostguest.jpg (81.0 KB, 0 views)
Reply With Quote
  #3  
Old 04-29-2009, 07:41 PM
Trip's Avatar
Trip Trip is offline
 
Join Date: Mar 2008
Location: Eastern Canada
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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??
Reply With Quote
  #4  
Old 04-29-2009, 08:13 PM
Raptor Raptor is offline
 
Join Date: Nov 2001
Posts: 499
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 05-02-2009, 12:04 AM
Black Tiger's Avatar
Black Tiger Black Tiger is offline
 
Join Date: Apr 2004
Location: Netherlands
Posts: 957
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-09-2009, 02:49 PM
Gersfan Gersfan is offline
 
Join Date: Dec 2007
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would be happy to use this mod. If you can a way that allows search engines to crawl,
Reply With Quote
  #7  
Old 08-13-2009, 03:24 PM
sdavis2702 sdavis2702 is offline
 
Join Date: Apr 2008
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I agree. Search engine access and I REALLY like this one.
Reply With Quote
  #8  
Old 08-16-2009, 06:53 PM
Gersfan Gersfan is offline
 
Join Date: Dec 2007
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't really think, were going ot get what we want though are we? ha!
Reply With Quote
  #9  
Old 08-29-2009, 07:08 PM
aJHier123 aJHier123 is offline
 
Join Date: May 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Raptor View Post
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 ...
Reply With Quote
  #10  
Old 11-26-2009, 12:23 PM
DamasGate DamasGate is offline
 
Join Date: Aug 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thank you
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04768 seconds
  • Memory Usage 2,327KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (8)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete