Jump to content


Byakuya Kuchiki

Member Since 07 Apr 2006
Offline Last Active Jan 30 2012 03:25 AM

Topics I've Started

PHP, how I hate thee.

29 January 2012 - 08:28 AM

Hello all,

Skinning for Ipb 3.2, and am running into a php variables problem. Not sure why the problem arises, as I can definitely say I'm not versed in <if test=""> tags. What I'm attempting to do is define if a topic has an admin post anywhere within it, not just first or last post, and then return a true/false that can be used to generate an [Admin] tag in forum view to denote that an admin has started/replied to a topic. So, here's the basic code:

<if test="hastopics:|:$data[member_group_id]==4">
<span class='ipsBadge ipsBadge_red'>Admin</span>&nbsp;
</if>

This is placed into the Look and Feel>Skin>Forum View>topic template. I found that, while it does kind of work, it only marks topics in which an administrator is the last person to post within any given topic. It apparently doesn't call the topic to find out if the topic has any admin posts anywhere else other than in the last post position. Now, I did find this:

<a href="{parse url="app=forums&amp;module=extras&amp;section=stats&amp;do=who&amp;t={$data['tid']}" base="public"}" onclick="return ipb.forums.retrieveWhoPosted( {$data['tid']} );">{parse format_number="$data['posts']"} <if test="replylang:|:intval($data['posts']) == 1">{$this->lang->words['reply']}<else />{$this->lang->words['replies']}</if></a>

Which is a function that displays an X Replies link that when a user clicks on it, it loads a lightbox along with all the users who have replied to that topic. However, I realize that the {parse url} function is incorrect syntax for an <if test> tag. Anyways, screenshot of first attempt below.

Posted Image

Thanks for any help, much appreciated,
-Nowe