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)

amykhar 06-01-2006 05:28 PM

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.

karlm 07-28-2006 02:59 AM

Works for me on 3.5.4 test board... :)

mano1.com 07-29-2006 01:34 PM

*install*

thanks

Jim O 07-30-2006 01:59 AM

FWIW, it works in 3.6 RC3 (no real surprise there). Installed.

karlm 08-18-2006 03:39 AM

working also on 3.6 gold...

AndyA 08-24-2006 08:29 AM

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. :confused:

Thanks
Andy

AndyA 08-25-2006 02:06 PM

Anyone ?

dxguru 11-15-2006 06:53 AM

Does anyone have a solution to the printthread.php issue? This hack can simply be bypassed by using the printthread script.

dxguru 11-15-2006 09:29 AM

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'

bigfraggle 04-14-2008 09:12 PM

Does this hack works with vB 3.7?


All times are GMT. The time now is 06:59 AM.

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.01322 seconds
  • Memory Usage 1,745KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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