• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Which different between post and message template ?

Blandt

Well-known member
#2
Everything is in the title.

Which different between post and message template (I talk about managing) ?
Your question is not clear .. Do you mean the difference in the template ?
post is posting in a thread, message is the private messages between users ..

Ask in French .. i'll translate
 

Allan

Well-known member
#3
the post template manage just the messages on the forum, and the message template manage the messages on the forum and conversations, it's right ?
 

Jake Bunce

XenForo moderator
Staff member
#4
message is a generic template that represents all messages including forum posts and personal conversations.

post represents forum posts specifically. It uses message and passes appropriate values to it to build a forum post. You can see this in the post template. The entire post template is a call for message. It's like a function call with parameters being passed to message:

Code:
<xen:include template="message">

	<xen:map from="$post" to="$message" />

	<xen:set var="$messageId">post-{$post.post_id}</xen:set>
	
	<xen:set var="$likesUrl">{xen:link posts/likes, $post}</xen:set>
	
	<xen:set var="$messageContentAfterTemplate"><xen:if is="{$post.attachments}"><xen:include template="attached_files" /></xen:if></xen:set>
	
	<xen:set var="$messageAfterTemplate">
				
		<div class="messageMeta">
			
			<div class="privateControls">
				<xen:if is="{$post.canInlineMod}"><input type="checkbox" name="posts[]" value="{$post.post_id}" class="InlineModCheck item" data-target="#post-{$post.post_id}" title="{xen:phrase select_this_post_by_x, 'name={$post.username}'}" /></xen:if>
				<span class="item muted">
					<a href="{xen:link members, $post}" class="author username">{$post.username}</a>,
					<a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" title="{xen:phrase permalink}" class="datePermalink"><xen:datetime time="$post.post_date" /></a>
				</span>
				<xen:if is="{$post.canEdit}"><a href="{xen:link posts/edit, $post}" class="item control edit"><span></span>{xen:phrase edit}</a></xen:if>
				<xen:if is="{$post.canDelete}"><a href="{xen:link posts/delete, $post}" class="item control delete OverlayTrigger"><span></span>{xen:phrase delete}</a></xen:if>
				<xen:if is="{$post.canCleanSpam}"><a href="{xen:link spam-cleaner, $post}" class="item control deleteSpam OverlayTrigger"><span></span>{xen:phrase spam}</a></xen:if>
				<xen:if is="{$canViewIps} AND {$post.ip_id}"><a href="{xen:link posts/ip, $post}" class="item control ip OverlayTrigger"><span></span>{xen:phrase ip}</a></xen:if>
				<xen:if is="{$visitor.user_id}"><a href="{xen:link posts/report, $post}" class="OverlayTrigger item control report" data-cacheOverlay="false"><span></span>{xen:phrase report}</a></xen:if>
			</div>
			
			<div class="publicControls">
				<a href="{xen:link threads/post-permalink, $thread, 'post={$post}'}" class="item muted postNumber hashPermalink" title="{xen:phrase permalink}">#{xen:calc '{$post.position} + 1'}</a>
				<xen:if is="{$post.canLike}">
					<a href="{xen:link posts/like, $post}" class="LikeLink item control {xen:if $post.like_date, unlike, like}" data-container="#likes-post-{$post.post_id}"><span></span><span class="LikeLabel">{xen:if $post.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
				</xen:if>
				<xen:if is="{$canReply}">
					<a href="{xen:link threads/reply, $thread, 'quote={$post.post_id}'}" data-postUrl="{xen:link posts/quote, $post}" class="ReplyQuote item control reply" title="{xen:phrase reply_quoting_this_message}"><span></span>{xen:phrase reply}</a>
				</xen:if>
			</div>
		</div>
	</xen:set>
	
</xen:include>
Incidentally, the conversation_message template is for messages in personal conversations. That template uses message in the same way, but it passes different values:

Code:
<xen:include template="message">
	
	<xen:set var="$messageId">message-{$message.message_id}</xen:set>
	
	<xen:set var="$messageAfterTemplate">
		<div class="messageMeta">
			<div class="privateControls">
				<span class="item muted"><a href="{xen:link members, $message}" class="author username">{$message.username}</a>, 
					<a href="{xen:link conversations/message, $conversation, 'message_id={$message.message_id}'}" class="datePermalink"><xen:datetime time="$message.message_date" /></a>
				</span>
				<xen:if is="{$message.canEdit}">
					<a href="{xen:link 'conversations/edit-message', $conversation, 'm={$message.message_id}'}"
						class="item control edit"><span></span>{xen:phrase edit}</a>
				</xen:if>
			</div>
			
			<xen:if hascontent="true">
			<div class="publicControls">
				<xen:contentcheck>
					<xen:if is="{$canReplyConversation}">
						<a href="{xen:link 'conversations/reply', $conversation, 'm={$message.message_id}'}"
							class="item control reply ReplyQuote"><span></span>{xen:phrase reply}</a>
					</xen:if>
				</xen:contentcheck>
			</div>
			</xen:if>
		</div>
	</xen:set>
	
</xen:include>