Jump to content

Finding Zero Replies....


Ocean West

Recommended Posts

I used this code in a manual html page to list topics without replies... it was mainly a "mod/staff tool" to have quick access to topics without replies, to possibly reply to these topics and boost the forum activity.

As I said it was something solely used by mods and I made it to my needs. The topic listing doesn't respect any kind of per forum topic view permissions, the only permission is to set who can view the page to see the listing.

{{$topics = \IPS\Db::i()->select( 'tid', 'forums_topics', 'posts = 1' );}}
{{$num_topics = 0;}}

<h4 class="ipsType_pageTitle">Topics without replies</h4>

<div class="ipsMessage ipsMessage_warning ipsSpacer_top">
  This page list topics without replies, ignoring any kind of forum read permissions. Double check this page permissions for access.
</div>

<ol class="ipsDataList ipsDataList_zebra ipsClear cForumTopicTable cTopicList data-role="tableRows">                                                                                             
{{foreach $topics as $topic_id}}                                                                                           
	{{$topic_title = \IPS\Db::i()->select( 'title', 'forums_topics', 'tid = "' . $topic_id . '"' )->first();}}
	{{$topic_furl = \IPS\Db::i()->select( 'title_seo', 'forums_topics', 'tid = "' . $topic_id . '"' )->first();}}
    {{$topic_by = \IPS\Db::i()->select( 'starter_name', 'forums_topics', 'tid = "' . $topic_id . '"' )->first();}}
    {{$topic_url = \IPS\Http\Url::internal( "app=forums&module=forums&controller=topic&id={$topic_id}", 'front', 'forums_topic', array( "{$topic_furl}" ) );}}
	

	<li class="ipsDataItem ipsDataItem_responsivePhoto">
		<div class="ipsDataItem_main">	
			<h4 class="ipsDataItem_title ipsContained_container">
				<span class="ipsType_break ipsContained">
					<a href="{$topic_url}"><span>{$topic_title}</span></a>
				</span>
			</h4>
         <div class="ipsDataItem_meta ipsType_reset ipsType_light ipsType_blendLinks">
			<span>By {$topic_by}</span>
         </div>
        </div>
    </li>
{{$num_topics ++;}}
{{endforeach}}                                                                                              
</ol>
{{if $num_topics == 0}}
  <div class="ipsMessage ipsMessage_success">
    There are no topics without replies!
  </div>
{{endif}} 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...