Version: 1.00, by D|ver
Developer Last Online: Jul 2013
Version: 3.5.2
Rating:
Released: 01-03-2006
Last Update: Never
Installs: 45
Template Edits
No support by the author.
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
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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
hmm try using this one
postbit legacy
add to the very beginning:
Code:
<if condition="$post[postcount] > 1 and !$bbuserinfo['userid']">
<!-- 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 />
Where in the code do I put the usergroups that I want to get this message?
I ask because I installed it but guests can see all of the topics.
I am fairly new to php and vb (yep, one of those noobe's) so any help is greatly appreciated.
Thanks in advance.
have you replaced the XX in the first two lines of the first template edit with the number of posts shown in a page?
the !$bbuserinfo['userid'] should prevent guests from viewing the posts
<if condition="$post[postcount] > 1 and !$bbuserinfo['userid']">
<!-- 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 />
and at the end
Code:
</if>
With that code I also get that error message for every message in the thread.