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

Reply
 
Thread Tools
Guests may only view first page of thread Details »»
Guests may only view first page of thread
Version: 1.00, by D|ver D|ver is offline
Developer Last Online: Jul 2013 Show Printable Version Email this Page

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.

Comments
  #32  
Old 06-01-2006, 05:28 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For the guy who wanted one error message to show after post 3, I have NOT tested this and do not know if it will work, but you could try this:

Code:
<if condition="$post[postcount] > 4 and !$bbuserinfo['userid']">
<else />

<if condition="$post[postcount] > 3 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 3 posts 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 />
You'll need an extra </if> at the end of the postbit though.
Reply With Quote
  #33  
Old 07-28-2006, 02:59 AM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works for me on 3.5.4 test board...
Reply With Quote
  #34  
Old 07-29-2006, 01:34 PM
mano1.com mano1.com is offline
 
Join Date: May 2002
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*install*

thanks
Reply With Quote
  #35  
Old 07-30-2006, 01:59 AM
Jim O's Avatar
Jim O Jim O is offline
 
Join Date: Mar 2006
Location: my house
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FWIW, it works in 3.6 RC3 (no real surprise there). Installed.
Reply With Quote
  #36  
Old 08-18-2006, 03:39 AM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

working also on 3.6 gold...
Reply With Quote
  #37  
Old 08-24-2006, 08:29 AM
AndyA AndyA is offline
 
Join Date: Apr 2005
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using the code as shown in the original mod post, does this still create an error for each post ? I'd like to clarify that before I install.

Thanks
Andy
Reply With Quote
  #38  
Old 08-25-2006, 02:06 PM
AndyA AndyA is offline
 
Join Date: Apr 2005
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone ?
Reply With Quote
  #39  
Old 11-15-2006, 06:53 AM
dxguru dxguru is offline
 
Join Date: May 2005
Location: England
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone have a solution to the printthread.php issue? This hack can simply be bypassed by using the printthread script.
Reply With Quote
  #40  
Old 11-15-2006, 09:29 AM
dxguru dxguru is offline
 
Join Date: May 2005
Location: England
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, don't worry. I've fixed it mayself.

For those interested ...

printthread.php needs to be changed first -
Find:
PHP Code:
$postbits '';
while (
$post $db->fetch_array($posts))

and Replace with:
PHP Code:
//PostCounter
    
$postcount = ($vbulletin->GPC['pagenumber'] - ) * $vbulletin->GPC['perpage'];
    if (
$postorder)
    { 
// Newest first
        
if ($totalposts $postcount $vbulletin->GPC['perpage'])
        {
            
$postcount $totalposts $postcount 1;
        }
        else
        {
            
$postcount $totalposts $postcount 1;
        }
    }
    
$counter 0;
// PostCounter

$postbits '';
while (
$post $db->fetch_array($posts))
{
// PostCounter
            
if ($counter >= $vbulletin->GPC['perpage'])
            {
                break;
            }
            ++
$counter;
            if (
$postorder)
            {
                
$post['postcount'] = --$postcount;
            }
            else
            {
                
$post['postcount'] = ++$postcount;
            }
// PostCounter 
Then make the same changes to template 'printthreadbit' as you do in 'postbit/legacy'
Reply With Quote
  #41  
Old 04-14-2008, 09:12 PM
bigfraggle bigfraggle is offline
 
Join Date: Oct 2007
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this hack works with vB 3.7?
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 04:52 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.05128 seconds
  • Memory Usage 2,321KB
  • 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
  • (3)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete