Why disallow "posts" in robots.txt ?

Wouldn't it be cool if Google had an API that we could use to update it directly. That way every time a new post is created, or a post that has been edited is saved, the new data would be sent to Google for them to put into their index.

You could probably do it by invoking Google Webmaster Tools (fetch as Google Bot) under program control and then submitting each page fetched to Google, but you're limited to 500 fetches/week.

Google Bot seems to tune its rate of visits to your rate of changes: The more often Google Bot finds new content, the more often it will visit. In forums that are primarily blogs, I find that if I'm distracted by work or personal issues for a few days, it might be 2-4 more days before Google Bot indexes any new content. When I'm posting several new threads / day, new content is usually indexed in 30-60 minutes. The way around this is to use Fetch as Google Bot for critical new content. Bing's webmaster tools have a similar option.
 
Last edited:
The recent posts link is a nofollow'd link.

"nofollow'd" links aren't necessarily not followed.

Google Bot is rumored often to follow the links and not attribute its target to the source of the link. Other search engines admit such behavior or just ignore "nofollow" entirely.
 
Last edited:
Hello everyone, my first post here :)
We are considering switching from VB to xenforo, and I am currently checking out as much as possible before we make our decision.

The thing with having urls like community/posts/ , will this be fixed in the near future

On my forum I have the option that guest see always the orig. url of threads on my forum homepage
only logged in member go to latest posts.

All in all, I really like xenforo so far, but this may be an issue.
So, can you tell if this is being worked on?

I find the option to disallow the urls via robots txt not good.
 
Simply linking to the first page of the thread for non-logged-in users can be done with a template mod, and is the default behavior at some places in the code.

Again the problem is to link TO THE LAST PAGE of the thread, for guests (and robots) without redirects
(and this I haven't figured out out to do with a template mod)
 
The thing with having urls like community/posts/ , will this be fixed in the near future
It's not broken.

On my forum I have the option that guest see always the orig. url of threads on my forum homepage
only logged in member go to latest posts.
You can edit the template to show the thread URL instead of the last post URL, if you wish. You can use template conditionals to show a different link to guests vs registered members.
 
Thank you very much Chris, this is useful .

Yeah sorry for saying fixed, english is not my native language
I know it is not broken, but I know you understood what I meaned.
 
Chris, any advice on linking with a xen helper or anything else to the last page of a thread ?
(no need to have the anchor link to the lats post, just link to the beginning of the last page )
 
That would probably require modifying the PHP code for the posts redirect.

You'd do it in such a way so the posts link just delivers you to the page of the thread that the post redirect is on, rather than adding the anchor ID at the end.

It's actually a very simple code edit, but an add-on would always be much better.

In library/XenForo/ControllerPublic/Post.php

Change:

PHP:
    public function getPostSpecificRedirect(array $post, array $thread,
        $redirectType = XenForo_ControllerResponse_Redirect::SUCCESS
    )
    {
        $page = floor($post['position'] / XenForo_Application::get('options')->messagesPerPage) + 1;

        return $this->responseRedirect(
            $redirectType,
            XenForo_Link::buildPublicLink('threads', $thread, array('page' => $page)) . '#post-' . $post['post_id']
        );
    }

To:

PHP:
    public function getPostSpecificRedirect(array $post, array $thread,
        $redirectType = XenForo_ControllerResponse_Redirect::SUCCESS
    )
    {
        $page = floor($post['position'] / XenForo_Application::get('options')->messagesPerPage) + 1;

        return $this->responseRedirect(
            $redirectType,
            XenForo_Link::buildPublicLink('threads', $thread, array('page' => $page))
        );
    }
 
Hi Chris,

This isn't really what we need (but it gave me some other ideas :) )

I would like to replace, eg in the "theadbit" template, links like
{xen:link threads/unread, $thread}

With a link that always goes to the last page of a thread ( something like what you've got in the pagenav template)

I would like to get rid of /posts/blah et /unread and all redirects for search engines. ( = "guests" )
Because, as we explain, google does not handle 301 redirects as it should and "says it does". It really does not.

So my question is, inside templates, how to create a link to the last page of a thread ?
(Page 1 if it's got no other page, page N if it's got N pages)
 
Actually if you replace {$thread.lastPageNumbers} with 999999999 (e.g. a page number so high it will never exist) it will always return you to the very last page.
 
Goes to page 99999999 on my (1.1) install...
Of course, AFTER ANOTHER FREAKING REDIRECT :) it goes to the right page

The point is to generate a link to the right page...

But I'm sure we're moving in the right direction :)
 
I (and all people in this thread fell the same need :) ) absolutely need to generate a link that goes straight to the last page of a thread, with no redirect whatsoever, and with the "correct" link (the one pagenav creates)
 
Mh, Lastpagenumbers is not a flag, it's an array
[lastPageNumbers] => Array ( [0] => 2 [1] => 3 ) )

So I would need to access, from template, the last value of that array...
Sometimes it's the first, sometimes the second or third element of that array that contains the value I'm lloking for... It's a nightmare :(

I could also divide the number of posts by the number of posts per page... Not sure how to do that in the context of a template tough :(
 
I'm trying with something like this but no result so far
<xen:foreach loop="$thread.lastPageNumbers" value="$pageNumber" i="$i" count="$count">
</xen:foreach>
Last page number on that thread should be page number {$thread.lastPageNumbers.{$count}}

There are issues with array keys, or so it seems.
 
I'm trying with something like this but no result so far
<xen:foreach loop="$thread.lastPageNumbers" value="$pageNumber" i="$i" count="$count">
</xen:foreach>
Last page number on that thread should be page number {$thread.lastPageNumbers.{$count}}

There are issues with array keys, or so it seems.
try something like =>

floor($thread['reply_count'] / XenForo_Application::get('options')->messagesPerPage
 
in a template ?

I'm sure this has a simple answer for someone who knows the template system better than I do, @Mike if you're reading this :) :)
 
Back
Top Bottom