• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Guests See First Post Only

borbole

Well-known member
This is a simple template modification which will show the first post only to guests and hide the rest and show them a message instead. Which you can alter to fit your needs.

At the message template replace all the code in there with the following code:

Code:
<xen:require css="message.css" />
<xen:require css="bb_code.css" />
<li id="{$messageId}" class="message{xen:if $message.isDeleted, ' deleted'}{xen:if '{$message.is_admin} OR {$message.is_moderator}', ' staff'}" data-author="{$message.username}">

    <xen:include template="message_user_info">
        <xen:map from="$message" to="$user" />
    </xen:include>
    <div class="messageInfo">
        <br /><br />
       <xen:if is="!{$visitor.user_id} && !{$post.isFirst}">
       <p class="importantMessage">Hello there guest. Please <a href="{xen:link 'register/'}">Register</a> or <a href="{xen:link 'login/'}">login</a> to view the posts!</p>
       <xen:else />
        <xen:if is="{$message.isNew}"><span class="newIndicator"><span></span>{xen:phrase new}</span></xen:if>
        <xen:if hascontent="true">
            <ul class="messageNotices">
                <xen:contentcheck>
                    <xen:if is="{$message.isDeleted}">
                        <li class="deletedNotice">{xen:phrase this_message_has_been_removed_from_public_view}</li>
                    <xen:elseif is="{$message.isModerated}" />
                        <li class="moderatedNotice">{xen:phrase this_message_is_awaiting_moderator_approval_and_is_invisible_to_normal}</li>
                    </xen:if>
                </xen:contentcheck>
            </ul>
        </xen:if>

        <div class="messageContent">
            <article><blockquote class="messageText ugc baseHtml">{xen:raw $message.messageHtml}</blockquote></article>

            {xen:raw $messageContentAfterTemplate}
        </div>
             </xen:if>

        <xen:if is="{$visitor.content_show_signature} && {$message.signature}">
            <div class="baseHtml signature ugc"><aside>{xen:raw $message.signatureHtml}</aside></div>
        </xen:if>

        {xen:raw $messageAfterTemplate}

        <div id="likes-{$messageId}"><xen:if is="{$message.likes}"><xen:include template="likes_summary" /></xen:if></div>
    </div>

</li>


The end result can be seen at the below attached screenshot.
 

Attachments

  • - XenForo_1287155818774.webp
    - XenForo_1287155818774.webp
    39.2 KB · Views: 290
Could you post the code for having spiders treated just as unregistered guests. I'm not a huge fan of serving spiders different content than regular visitors as it could lead to a penalty should it be figured out / reported. Otherwise I love this hack.

Edit: My bad, no where did the hack author say that spiders were allowed to see, it was me misreading a quoted text. :oops:
 
Could you post the code for having spiders treated just as unregistered guests. I'm not a huge fan of serving spiders different content than regular visitors as it could lead to a penalty should it be figured out / reported. Otherwise I love this hack.

exactly. After reading the code, I dont see any where it allows spiders and not members. I think it's just some confusion in this thread.

Also why would you want spiders to see it and not members? You realize Google cache's what they see and all someone will have to do is visit the cache for that page to view it? Unless of course you disallow Google to cache your pages.

Also, is there a way to get the total number of replies to the thread, and only show one postbit area message

"Hello Guest! To see XXX replies to TOPIC TITLE you'll need to be a member and logged in. If you're not a member, register here {register link}, if you are, login at the top of this page!"
 
I didn''t see that the spiders have been defined in xenforo. But maybe I missed it.
I think it is a case of me misinterpreting a quote that had been edited by the 'quoter' and not reading the post that was quoted. Your hack is fine it is my bad.
 
This is a good idea. I don't know about the execution here, repeating Hello there guest for every subsequent post, but a good idea.
 
Google is going to be very upset if you show stuff to the spider that is not shown to regular visitors. Showing more content to the spider is just another form of cloaking.
 
If the spiders are seeing more or different things than the unregistered visitors, then it's definitely against Google's policy. If guests see the same as spiders it's ok in that department, but still bad because Google can't index your whole content. Either way, for me, the benefits do not outweigh the costs.

And I don't want to rain on your parade too much, but if there's one thing on the web that I hate with passion, it's sites that have content indexed in Google, and then make you register or pay to see everything when you find it...

Sorry, just my opinion :)
 
If the spiders are seeing more or different things than the unregistered visitors, then it's definitely against Google's policy. If guests see the same as spiders it's ok in that department, but still bad because Google can't index your whole content. Either way, for me, the benefits do not outweigh the costs.

And I don't want to rain on your parade too much, but if there's one thing on the web that I hate with passion, it's sites that have content indexed in Google, and then make you register or pay to see everything when you find it...

Sorry, just my opinion :)
I'll leave that site immediately if they want me to register to read. It may increase membership but not the kind of members you want for a long term growth.
 
It may increase membership but not the kind of members you want for a long term growth.
Au contraire Pierre. Those are exactly the kind of users you want for "long term growth," because they care about the topic and want to participate.

One of the forums I run has all the topics related to the subject open for public view, but the small handful off topic forums are register-to-read. So Google crawls all the relevant forums, but the "community" type conversations are for the community.

Which records the forum users are listening to, or which movies or TV shows they watch has nothing to do with the subject of the forum so it doesn't have to be indexed by Google. The users like it that way, because they can talk about things they don't necessarily want to show up on Google.
 
Top Bottom