vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Guests may only view first page of thread (https://vborg.vbsupport.ru/showthread.php?t=104447)

D|ver 01-03-2006 10:00 PM

Guests may only view first page of thread
 
i use a small template modification in my forums, so that guests may only view the first page of a thread. otherwise they will get a (error) message
maybe someone want to use this, too


in the following,
XX is the number of posts shown in a thread
(i think default was 25)
you need to replace this 2 times in the first 2 lines according to your posts/page

postbit legacy
add to the very beginning:
Code:

<if condition="$post[postcount] > XX and !$bbuserinfo['userid']">
<if condition="$post[postcount]%XX == 1">
<!-- Start Error Message -->
<if condition="$show['spacer']">
    $spacer_open
    <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
    <if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>   
</if>
<table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr><td class="alt1" id="td_post_$post[postid]">
<div><b>Guests may only view the first page of a thread. You need to register to get full access. <a href="register.php" rel="nofollow">Click here to register.</a>
</b></div>
</td></tr>
</table>
<if condition="$show['spacer']">
    </div>
    $spacer_close
</if>
<!-- End Error Message -->
<else /></if><else />

and add to the end of the template:
Code:

</if>
this modification saves traffic and it should increase your registrations rate :)

its my first release to please be kind ;)

sensimilla 01-04-2006 05:40 PM

great hack! keep up the good work

Snake 01-04-2006 07:00 PM

Yeah well done!

Robru 01-05-2006 12:45 PM

*installed*

NuclioN 01-05-2006 01:35 PM

Does this have an effect on the Google adsense bot's that are scanning your threads?

D|ver 01-05-2006 03:19 PM

well i tried to set rel="nofollow" attributes for all other pages than page 1
so i think it wouldn't affect them at all

hollyboy 01-05-2006 08:07 PM

It would be interesting to have the same hack that does the same but for the first post

D|ver 01-06-2006 10:54 PM

Quote:

Originally Posted by hollyboy
It would be interesting to have the same hack that does the same but for the first post

here i found a solution for this

in postbit_legacy replace:
PHP Code:

<!-- message --> 
<
div>$post[message]</div
<!-- / 
message --> 

with:
PHP Code:

<!-- message --> 
<
div><if condition="$post[postcount] > 1 and !$bbuserinfo['userid']"
$vbphrase[guest_no_posts
<else /> 
$post[message
</if></
div
<!-- / 
message --> 

then create a customguest_no_posts phrase

hollyboy 01-07-2006 07:02 AM

Quote:

Originally Posted by D|ver
here i found a solution for this

in postbit_legacy replace:
PHP Code:

<!-- message --> 
<
div>$post[message]</div
<!-- / 
message --> 

with:
PHP Code:

<!-- message --> 
<
div><if condition="$post[postcount] > 1 and !$bbuserinfo['userid']"
$vbphrase[guest_no_posts
<else /> 
$post[message
</if></
div
<!-- / 
message --> 

then create a customguest_no_posts phrase

thank u for looking for it, but with that code I get a message for every reply given saying "guest can only read first post" so if there are 100 replies I get 100 of those messages :) by each members who replied in the topic.

It would be better to get only 1 message

Emmy2 01-10-2006 12:52 PM

Why are all the quotes (") in the code in the first box coming out as &quot; ????

I actually tried to install this with just copying the code (without looking at it too closely) and nearly sent my server into septic shock! Once I replaced all the &quot; with normal quotes it all worked, but it's very odd it's posted that way, and that no one else has commented on it.

but other than that, I love the concept of this and it's working well on my forum.


All times are GMT. The time now is 02:26 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.01215 seconds
  • Memory Usage 1,751KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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