change on forumlist_body.htmlforumrow.S_UNREAD_FORUM
Code: Select all
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
Code: Select all
<!-- IF forumrow.S_UNREAD_FORUM --><a style="color: #FF0000;" href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a>
<!-- ELSE -->
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a>
<!-- ENDIF -->
<br />
Code: Select all
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle" <!-- IF forumrow.S_UNREAD_FORUM -->style="color: #FF6600"<!-- ENDIF -->>{forumrow.FORUM_NAME}</a>
Code: Select all
// Used to tell whatever we have to create a dummy category or not.
$last_catless = true;
$forum_rows_copy = $forum_rows; // Get a copy to not mess up the original $forum_rows
foreach ($forum_rows as $row)
Code: Select all
// Empty category
if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
{
Code: Select all
$cat_unread = false;
foreach ($forum_rows_copy as $frows)
{
if ($frows['parent_id'] == $row['forum_id'])
{
$cat_unread = (isset($forum_tracking_info[$frows['forum_id']]) && $frows['orig_forum_last_post_time'] > $forum_tracking_info[$frows['forum_id']]) ? true : false;
}
if ($cat_unread) break;
}
Code: Select all
'S_IS_CAT' => true,
Code: Select all
'S_UNREAD_FORUM' => $cat_unread,
Its clear, however, im not fluent enough yet with PHP or phpbb3 to beable to know where to start to use {forumrow.S_UNREAD_FORUM} .njs wrote:I managed to find a solution, but I don't know if it is the best one.. but IT Works.
Here it goes:
I've changed the includes/function_display.php:
Around Line 315 I've added a line which is commented below:A few lines afterward there's.Code: Select all
// Used to tell whatever we have to create a dummy category or not. $last_catless = true; $forum_rows_copy = $forum_rows; // Get a copy to not mess up the original $forum_rows foreach ($forum_rows as $row)
I've added the following:Code: Select all
// Empty category if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT) {
And a few lines below, after:Code: Select all
$cat_unread = false; foreach ($forum_rows_copy as $frows) { if ($frows['parent_id'] == $row['forum_id']) { $cat_unread = (isset($forum_tracking_info[$frows['forum_id']]) && $frows['orig_forum_last_post_time'] > $forum_tracking_info[$frows['forum_id']]) ? true : false; } if ($cat_unread) break; }
Add:Code: Select all
'S_IS_CAT' => true,
Then you can use {forumrow.S_UNREAD_FORUM} in the template to check if the category has unread topics.Code: Select all
'S_UNREAD_FORUM' => $cat_unread,
Is this clear enough ?
Regards,
Nuno
Code: Select all
<!-- IF forum.S_UNREAD_FORUM -->
<span style="color:#FF0000">{forumrow.FORUM_NAME}</span>
<!-- ELSE -->
{forumrow.FORUM_NAME}
<!-- END -->
So something like:njs wrote:The {forumrow.S_UNREAD_FORUM} can be used in the forum_list.html in the style/templates directory.
There should be something like
{forumrow.S_IS_CAT} somewhere and afterwars for instance in the {forumrow.FORUM_NAME} you can replace it with whatever you want based on that condition.
Example:
find forumrow.S_IS_CAT
find {forumrow.FORUM_NAME}
replace {forumrow.FORUM_NAME} withI've made it from the top of my head, I don't have access to code right now. Forgive me if there's any mistake in here.Code: Select all
<!-- IF forum.S_UNREAD_FORUM --> <span style="color:#FF0000">{forumrow.FORUM_NAME}</span> <!-- ELSE --> {forumrow.FORUM_NAME} <!-- END -->
Regards,
Nuno
Code: Select all
<dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>
Code: Select all
<dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}"><!-- IF forum.S_UNREAD_FORUM --><span style="color:#FF0000">{forumrow.FORUM_NAME}</span><!-- ELSE -->{forumrow.FORUM_NAME}<!-- ENDIF --></a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>