XF 1.1 Blank page after replying to a thread

Marco Famà

Active member
It happens all the time, and I don't understand why.
If I reply to a thread, I get a total white page, with 0 data retrieved from server.

But in fact, the reply is added properly, because if I refresh the page I suddendly see the whole thread, including my answer.

Do you know why this happens?
This is the URL:
http://timelapseitalia.com/forum

Thanks!
Marco
 
Hi Jake!
Sorry for getting back to you here... just got a complain from some users.

They say that the same issue (blank page) is experienced when editing the message.
Do you believe it is possible to change this behavior also for those edited messages?

That would be just great, to me.

Thanks, hope you can help
Marco

That one requires custom code:

XenForo_ViewPublic_Thread_ViewPosts

You would have to add the param to the template call:

Rich (BB code):
		foreach ($this->_params['posts'] AS $postId => $post)
		{
			$output['messagesTemplateHtml']["#post-$postId"] =
				$this->createTemplateObject('post', array_merge($this->_params, array('post' => $post, 'ajaxInsert' => 1)))->render();
		}

This can be made into an addon by extending the view.
 
Thanks for the reply Jake, although I'm afraid this is something I cannot do.
Tried to find "XenForo_ViewPublic_Thread_ViewPosts" within the ACP but couldn't. :(

Do you have any tutorial / guide to suggest so that I can implement this by myself?

Thanks mate
 
Tried to do the same steps, for me it's not working :( Maybe I should renew the whole forum somehow after editing the ViewPosts.php ?

I added
Code:
, 'ajaxInsert' => 1
into the ViewPosts.php
also I'm using
Code:
<xen:if is="{$ajaxInsert}">
 
</xen:if>

I'm not sure I'm using the <xen:if is="{$ajaxInsert}"></xen:if>correctly, probably no.

I'm using it like that:

Code:
<xen:if is="{$ajaxInsert}">
 
my google adsense code
 
</xen:if>


after that I have no adsense showed. If I put the <xen:if is="{$ajaxInsert}"></xen:if> at the end of the message template, than I have the same problem - advertisements are on the forum, but the post is disappearing after editing. :(

p.s.
also I did this

Admin CP -> Appearance -> Templates -> thread_reply_new_posts

Code:
<xen:if is="{$firstUnshownPost}">
    <li class="newMessagesNotice">{xen:phrase there_more_posts_to_display} <a href="{xen:link posts, $firstUnshownPost}#post-{$firstUnshownPost.post_id}">{xen:phrase view_them}</a></li>
</xen:if>
 
<xen:set var="$ajaxInsert">1</xen:set>
 
<xen:foreach loop="$posts" value="$post">
    <xen:include template="post" />
</xen:foreach>
 
Jake thanks a lot, now the content is not disappearing, but have the same problem. After quick editing, the post is gone. I checked everything several times. I've done everything what was written in the thread. Probably I'm too stupid for this :)
 
Yes I did.

I changed the ViewPosts.php

Now the file looks like:

Code:
<?php
 
class XenForo_ViewPublic_Thread_ViewPosts extends XenForo_ViewPublic_Base
{
public function renderHtml()
{
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array(
'states' => array(
'viewAttachments' => $this->_params['canViewAttachments']
)
);
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
}
 
public function renderJson()
{
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array(
'states' => array(
'viewAttachments' => $this->_params['canViewAttachments']
)
);
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
 
$output = array('messagesTemplateHtml' => array());
 
foreach ($this->_params['posts'] AS $postId => $post)
{
$output['messagesTemplateHtml']["#post-$postId"] =
$this->createTemplateObject('post', array_merge($this->_params, array('post' => $post, 'ajaxInsert' => 1)))->render();
}
 
$template = $this->createTemplateObject('', array());
 
$output['css'] = $template->getRequiredExternals('css');
$output['js'] = $template->getRequiredExternals('js');
 
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
}
 
Hello friends, again have the same problem :( But this time when I'm trying to edit the private conversation (direct message to a user). When I'm trying to edit the message I wrote to a user, have the same problem, help please.

I understand that the answer is simple, but I don't know where to fix it :(
 
Top Bottom