XF 2.2 Need XF2.2 versions of these template variables

Arno Nühm

Active member
I am currently making the final preparations to upgrade from XF1.5 to XF2.2. In one XF1.5 template I am using the following code:

HTML:
<xen:if is="{$post.user_id}
    AND {$visitor.user_id}
    AND ( {$post.message_count} < 10 OR {xen:calc '{$post.register_date} + 2629743'} > {$serverTime} )
    AND {$visitor.user_id} != {$post.user_id}">
        some text {$post.username} <xen:if is="{$post.message_count} < 10">some text<xen:else />some text</xen:if>some text<xen:if is="{$post.message_count} < 6"> some text <a href="posts/{$post.post_id}/report">some text</a> some text</xen:if>
</xen:if>

What would the matching XF2.2 variables look like?
 
untested:

HTML:
<xf:if is="{$post.user_id}
    AND {$xf.visitor.user_id}
    AND ( {$post.message_count} < 10 OR {{ {$post.register_date} + 2629743 }} > {$xf.time} )
    AND {$xf.visitor.user_id} != {$post.user_id}">
        some text {$post.username} <xf:if is="{$post.message_count} < 10">some text<xf:else />some text</xf:if>some text<xf:if is="{$post.message_count} < 6"> some text <a href="{{ link('posts/report', $post.post_id) }}">some text</a> some text</xf:if>
</xf:if>

basically:
  • You have to change xen: to xf:.
  • $visitor should be be changed to $xf.visitor
  • xen:calc is not necessary if you use {{ .. }}
  • You should use the link() helper function instead of doing it the way you did it.
  • $xf.time instead of $serverTime
 
Back
Top Bottom