Jump to content
WebFlake

Recent Topics & Posts (All in 1)


Cookie Monster

Recommended Posts

I found out that I wanted to have Recent Topics and Recent posts all in one, for a bit more sleek overview. I didn't want to have two blocks for the same purpopse.

So this custom feed, will update the latest Topic with its post. So if somone creates a topic, and somone replies it will get updated and display the title of the topic but also who posted last.

So i re-wrote the standard and used both to combine it in all in one enjoy and lets get cracking

Diff level: 1

  • You only need to cut and paste

Whats Required.

  • IPS 4.x + (Works on 4.0 and 4.1)
  • IPS Pages

Firstly open AdminCP > Pages > Blocks

  • Click "Create new Block"
  • Select Plugin
  • In the dropdown box select "Topic Feed"
  • Now fill it in with these details.
    Name: Latest
    Description: Latest from the forum
    Template Key: latest2
  • Click on Feed Configuration
    Name: Latest on forums (You can call it whatever you want the block to be named)
    Honour Permissions: On
    The rest here is optional for how you want to display things for your users.
  • Click on Content
  • Under Template select in the dropdown box "Use as base for custom template" replace the code in the box with the following
{{if !empty( $topics ) }}
	<h3 class='ipsWidget_title ipsType_reset'>{$title}</h3>

	{{if $orientation == 'vertical'}}
		<div class='ipsPad_half ipsWidget_inner'>
			<ul class='ipsDataList ipsDataList_reducedSpacing'>
				{{foreach $topics as $topic}}
					<li class='ipsDataItem{{if $topic->unread()}} ipsDataItem_unread{{endif}}{{if $topic->hidden()}} ipsModerated{{endif}}'>
						<div class='ipsDataItem_icon ipsPos_top'>
{template="userPhoto" group="global" app="core" params="$topic->lastCommenter(), 'tiny'"}
						</div>
						<div class='ipsDataItem_main'>
							<div class="ipsCommentCount ipsPos_right {{if ( $topic->posts - 1 ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="replies_number" pluralize="$topic->posts - 1"}'>{expression="$topic->posts - 1"}</div>
							<a href="{$topic->url()->setQueryString( 'do', 'getLastComment' )}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title ipsType_break'>{wordbreak="$topic->title"}</a>
							{{if $topic->mapped('featured') || $topic->hidden() === -1 || $topic->hidden() === 1}}
								<span>
									{{if $topic->hidden() === -1}}
										<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$topic->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
									{{elseif $topic->hidden() === 1}}
										<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
									{{endif}}
									{{if $topic->mapped('featured')}}
										<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
									{{endif}}
								</span>
							{{endif}}
							<br>
<span class='ipsType_light ipsType_small'>{lang="byline_nodate" htmlsprintf="$topic->lastCommenter()->link()"} · {datetime="$topic->mapped('last_comment')"}</span>						</div>
					</li>
				{{endforeach}}
			</ul>
		</div>
	{{else}}
		<div class='ipsWidget_inner'>
			<ul class='ipsDataList'>
				{{foreach $topics as $topic}}
					{template="row" group="global" app="forums" location="front" params="NULL, NULL, $topic, FALSE"}
				{{endforeach}}
			</ul>
		</div>
	{{endif}}
{{endif}}
  • Once saved give the permissions to who can view the block.

Who to add the block to the sidebar on the forums

  • Open the main forum
  • Click on the > arrow to the left side
  • Pages > Custom Block > Drag Box to the side or where you want it
  • Click on Edit button on the block
  • In the popup window select in the dropdown box the box you created (In this example its "Latest")

Voila you got your custom block.

  • Like 1
  • Thanks 1

VAEfvMI.png

Liked what i posted remember to feed me a cookie ->
Or you can add a cookie to myCookieJar

Link to comment
Share on other sites

2 hours ago, Bernard_H said:

Sounds great! Do you maybe have a screenshot from the end result? I'm just curious how it looks before trying it out myself. 

This is how it will look. With posts (As you can see it only show latest reply) but also topics.

D2Ldt2d.png

gJw892C.png

As you can see, its who answered on it but also updates with the number as normal.

  • Upvote 1

VAEfvMI.png

Liked what i posted remember to feed me a cookie ->
Or you can add a cookie to myCookieJar

Link to comment
Share on other sites

@Cookie Monster Hmm, Thnx but that isn't really what I was looking for. 

What I want is 2 tabs in 1 block. With the newest topics and post. I know there is a plug-in for this, but you can't place that widget in the side bar unfortunately. 

The plugin: http://webflake.sx/files/file/2734-bim40-forums-stats-102/

Edited by Bernard_H
Link to comment
Share on other sites

24 minutes ago, Bernard_H said:

@Cookie Monster Hmm, Thnx but that isn't really what I was looking for. 

What I want is 2 tabs in 1 block. With the newest topics and post. I know there is a plug-in for this, but you can't place that widget in the side bar unfortunately. 

The plugin: http://webflake.sx/files/file/2734-bim40-forums-stats-102/

Well the difference is there isn't two blocks in my scrip its 1 line with both of them in one.

Person posts a new topic. It will show up.

Person replies to a that topic or another topic shows up in the same box :)

VAEfvMI.png

Liked what i posted remember to feed me a cookie ->
Or you can add a cookie to myCookieJar

Link to comment
Share on other sites

5 minutes ago, Cookie Monster said:

Well the difference is there isn't two blocks in my scrip its 1 line with both of them in one.

Person posts a new topic. It will show up.

Person replies to a that topic or another topic shows up in the same box :)

Yes I know. It's a really cool option, but not what I need unfortunately. 

Maybe you could tweak the script I post above so it becomes possible to add it in the side bar? The plugin also uses 1 block, but shows 2 tabs. 1 for recent post and 1 for recent topics. That's what I need for my forum :biggrin:

Edited by Bernard_H
Link to comment
Share on other sites

5 minutes ago, Bernard_H said:

Yes I know. It's a really cool option, but not what I need unfortunately. 

Maybe you could tweak the script I post above so it becomes possible to add it in the side bar? The plugin also uses 1 block, but shows 2 tabs. 1 for recent post and 1 for recent topics. That's what I need for my forum :biggrin:

What version is your forum running ?

VAEfvMI.png

Liked what i posted remember to feed me a cookie ->
Or you can add a cookie to myCookieJar

Link to comment
Share on other sites

22 minutes ago, Cookie Monster said:

I did check with offical IPS, I do have the same plugin for IPS 4.1
 :)

Hehe, I found the plugin and installed in on my board. It works, but I don't like the look. 

I miss the option that new, unread content is bold and it don't show how much reply's the topics have. 

It feels like it isn't finished, to bad because it could be a nice upgrade to my forum. 

Link to comment
Share on other sites

19 minutes ago, Cookie Monster said:

Well you can PM me if you want and need help with some customization or make a thread about it.

Just explain it a bit more and add some images.

I made a example in paint. I hope you understand what I mean. 

- bold tekst are New topic's I haven't read. 

- pictures before title are profile pictures. 

- new topics on the left, new messages on the right. 

569520e43da56_pluginberichten.png.a9c7e0

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...