Announcement

Collapse
No announcement yet.

Displaying forum post counts but not allowing access

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kaith Rustaz
    replied
    Jake,
    I tried both options you posted, and in both cases guests still had full access to the forums. They could see every post in the forums. Is there something you have to do prior to adding this code?

    Thanks!

    Leave a comment:


  • Jake Bunce
    replied
    FYI to others:

    There were a bunch of weird "E" characters where the asterisks are in the above code. I replaced the weird characters with tabs. It's working now.

    Leave a comment:


  • Jake Bunce
    replied
    In that case everything looks fine. If you want me to take a look then send me a private message with a URL and admin login to your forums.

    Leave a comment:


  • dandy
    replied
    Originally posted by Jake Bunce
    The asterisks shouldn't be in your phpinclude_start template (********).

    I am so sorry, but the asteriks weren't there actually
    Somehow, they just "showed up" when I was posting them here. I promise.

    Leave a comment:


  • Jake Bunce
    replied
    The asterisks shouldn't be in your phpinclude_start template (********).

    Leave a comment:


  • dandy
    replied
    Originally posted by Jake Bunce
    Post the contents of these templates:

    phpinclude_start
    forumhome_forumbit_level1_post
    forumhome_forumbit_level2_post
    Hi Jake,
    here's what I have: (sorry I don't know how to include the code in the separate box here?)

    _________________________________________________________________
    1. "phpinclude_start"

    // Example of how to include a seperate file:
    // ob_start();
    // require("yourheader.html");
    // $header = ob_get_contents();
    // ob_end_clean();
    // IF FORUMHOME OR FORUMDISPLAY PAGE
    if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay')
    {
    ****// GET FORUM COUNTERS
    ****$forumcounts= $DB_site->query("SELECT forumid, replycount, threadcount
    ********FROM " . TABLE_PREFIX . "forum
    ********");

    ****// SET VALUES
    ****while ($forumcount = $DB_site->fetch_array($forumcounts))
    ****{
    ********$forumreply[$forumcount[forumid]] = $forumcount[replycount];
    ********$forumthread[$forumcount[forumid]] = $forumcount[threadcount];
    ****}
    }

    _________________________________________________________________
    2. "forumhome_forumbit_level1_post"

    <tbody>
    <tr align="center">
    <td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

    <table cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
    <td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
    <td>
    <div>
    <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    <if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    </div>
    <if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    <if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    <if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    </td>
    </tr>
    </table>

    </td>
    <td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    <td class="alt1">{$GLOBALS[forumthread][$forum[forumid]]}</td>
    <td class="alt2">{$GLOBALS[forumreply][$forum[forumid]]}</td>
    <if condition="$vboptions['showmoderatorcolumn']">
    <td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    </if>
    </tr>
    </tbody>
    <if condition="$childforumbits">
    <tbody>
    $childforumbits
    </tbody>
    </if>
    _________________________________________________________________
    3. "forumhome_forumbit_level2_post"

    <tr align="center">
    <td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
    <td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
    <div>
    <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
    <if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
    </div>
    <if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
    <if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
    <if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
    </td>
    <td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
    <td class="alt1">{$GLOBALS[forumthread][$forum[forumid]]}</td>
    <td class="alt2">{$GLOBALS[forumreply][$forum[forumid]]}</td>
    <if condition="$vboptions['showmoderatorcolumn']">
    <td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
    </if>
    </tr>
    $childforumbits

    Leave a comment:


  • Jake Bunce
    replied
    Post the contents of these templates:

    phpinclude_start
    forumhome_forumbit_level1_post
    forumhome_forumbit_level2_post

    Leave a comment:


  • Aurous
    replied
    Thanks a lot Zach, thats the best solution!!!

    Leave a comment:


  • dandy
    replied
    Originally posted by Jake Bunce
    This can be done by modifying the files or adding an extra query in the phpinclude_start template. For help with modifying the files I recommend you post on www.vbulletin.org , otherwise try this:

    Go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start

    Add this code:

    PHP Code:
    // IF FORUMHOME OR FORUMDISPLAY PAGE
    if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay')
    {
        
    // GET FORUM COUNTERS
        
    $forumcounts$DB_site->query("SELECT forumid, replycount, threadcount
            FROM " 
    TABLE_PREFIX "forum
            "
    );

        
    // SET VALUES
        
    while ($forumcount $DB_site->fetch_array($forumcounts))
        {
            
    $forumreply[$forumcount[forumid]] = $forumcount[replycount];
            
    $forumthread[$forumcount[forumid]] = $forumcount[threadcount];
        }

    Then go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates

    Replace $forum[threadcount] and $forum[replycount] with {$GLOBALS[forumthread][$forum[forumid]]} and {$GLOBALS[forumreply][$forum[forumid]]} in the forumhome_forumbit_level1_post and forumhome_forumbit_level2_post templates.

    That should work for you.
    Actually, I just tried this and it didn't work for me at all. I followed all the instruction carefully, and now the index page shows nothing (it doesn't show counted threads/post, neither does say "never". It's just blank (the "threads/post", while the "last post" states "never"?

    I should also mention that in my forum permissions/and unregistered usergroups permissions I have, show forum > YES + show threads > NO.

    If I change to show threads to > YES, the treads can be seen without being prompted to register.

    Grrrrr...

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by JustAskJulie
    Jake, yours almost works. It does show an actual number (instead of 0) for the number of posts and threads in the forum but it still shows "Never" where the Last Post info should be.
    Ya, this was only designed to work for reply / thread counts.

    I am whipping up some code for the last post right now.

    Leave a comment:


  • Deep Blue
    replied
    That's somewhat similar to what i needed, but i only wanted users from a certain usergroup to be able to read threads. Regular users and Unreg'd should only be able to see thread / post counts, nothing else

    Leave a comment:


  • JustAskJulie
    replied
    Jake, yours almost works. It does show an actual number (instead of 0) for the number of posts and threads in the forum but it still shows "Never" where the Last Post info should be.

    Leave a comment:


  • JustAskJulie
    replied
    Zachary, what your option does is a little different than what I think the user was looking for (or at least what I was looking for which I think is the same thing he was).

    Yours allows the user to see ALL threads and the first post of the thread but to read any responses it requires them be registered.

    What I was looking for (and I think what the original poster was looking for) is an option that on the Forum Home page instead of showing "Last Post" as "Never", would show the thread title and info for the last post, then when they attempt to access the forum they are required to register.

    Leave a comment:


  • Deep Blue
    replied
    I followed the instructions....


    Will PM you, cheers

    Leave a comment:


  • Jake Bunce
    replied
    And I tested my solution before posting it. It worked.

    If you send me a private message with a URL and admin login for your forums then I can take a look at why my solution isn't working.

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X