Jump to content

IP.Content - Recent Topics Block


Mysterioux

Recommended Posts

You're charging $3.00 for this? Myself and others have freely posted code for creating your own Recent Topic blocks.

I don't have a problem with people making a few bucks making hooks and mods but not for really simple stuff like this. This should be a freebie in my opinion.

3DKiwi

Link to comment
Share on other sites


You're charging $3.00 for this? Myself and others have freely posted code for creating your own Recent Topic blocks.



I don't have a problem with people making a few bucks making hooks and mods but not for really simple stuff like this. This should be a freebie in my opinion.



3DKiwi




Sorry, this is my mistake :P this is supposed to be free!.
Link to comment
Share on other sites

  • 1 month later...

I've installed both Latest Posts and Latest Topics blocks. Thanks :)

The Latest Topics however was not displaying member photos. Comparing the code between these two blocks I noticed they are both very different for what I thought would be almost identical tasks.

Snipet of your code:


<ul class='ipsList_withminiphoto'>

   <li class='clearfix'>

<a href='{parse url="showuser={$r['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class='ipsUserPhotoLink left'>{$this->settings['pics']}</a>


<div class='list_content'>

<a href='{parse url="showtopic={$r['tid']}" base="public" template="showtopic" seotitle="{$r['title_seo']}"}' rel='bookmark' class='ipsType_small' title='{$this->lang->words['view_topic']}'>{$r['topic_title']}</a>


<p class='desc ipsType_smaller'>{parse expression="IPSMember::makeProfileLink( $r['author_name'], $r['author_id'], $r['author_seo_name'] )"}

- {parse date="$r['start_date']" format="short"}</p>

</div>


					    </li>

        </ul>

I modified it (to get Member Photo's displaying):


<ul class='ipsList_withminiphoto'>

   <li class='clearfix'>

   <a href='{parse url="showuser={$r['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class='ipsUserPhotoLink left'><img src='{$r['pp_mini_photo']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" class='ipsUserPhoto ipsUserPhoto_mini' /></a>

<div class='list_content'>

<a href='{parse url="showtopic={$r['tid']}" base="public" template="showtopic" seotitle="{$r['title_seo']}"}' rel='bookmark' class='ipsType_small' title='{$this->lang->words['view_topic']}'>{$r['topic_title']}</a>

<p class='desc ipsType_smaller'>{parse expression="IPSMember::makeProfileLink( $r['author_name'], $r['author_id'], $r['author_seo_name'] )"}

- {parse date="$r['start_date']" format="short"}</p>

</div>


					    </li>

  </ul>



All I really changed was the img source tag and used the code from your Latest Posts. It works, but I'm not sure if there are bugs I haven't discovered yet.


Also, could you please check the code for the DIV tags at the end. They start outside the IF tag, but are closed inside the IF tag.

Link to comment
Share on other sites


I've installed both Latest Posts and Latest Topics blocks. Thanks :smile:



The Latest Topics however was not displaying member photos. Comparing the code between these two blocks I noticed they are both very different for what I thought would be almost identical tasks.



Snipet of your code:



<ul class='ipsList_withminiphoto'>

   <li class='clearfix'>

<a href='{parse url="showuser={$r['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class='ipsUserPhotoLink left'>{$this->settings['pics']}</a>


<div class='list_content'>

<a href='{parse url="showtopic={$r['tid']}" base="public" template="showtopic" seotitle="{$r['title_seo']}"}' rel='bookmark' class='ipsType_small' title='{$this->lang->words['view_topic']}'>{$r['topic_title']}</a>


<p class='desc ipsType_smaller'>{parse expression="IPSMember::makeProfileLink( $r['author_name'], $r['author_id'], $r['author_seo_name'] )"}

- {parse date="$r['start_date']" format="short"}</p>

</div>


						</li>

		</ul>

I modified it (to get Member Photo's displaying):


<ul class='ipsList_withminiphoto'>

   <li class='clearfix'>

   <a href='{parse url="showuser={$r['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class='ipsUserPhotoLink left'><img src='{$r['pp_mini_photo']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" class='ipsUserPhoto ipsUserPhoto_mini' /></a>

<div class='list_content'>

<a href='{parse url="showtopic={$r['tid']}" base="public" template="showtopic" seotitle="{$r['title_seo']}"}' rel='bookmark' class='ipsType_small' title='{$this->lang->words['view_topic']}'>{$r['topic_title']}</a>

<p class='desc ipsType_smaller'>{parse expression="IPSMember::makeProfileLink( $r['author_name'], $r['author_id'], $r['author_seo_name'] )"}

- {parse date="$r['start_date']" format="short"}</p>

</div>


						</li>

  </ul>



All I really changed was the img source tag and used the code from your Latest Posts. It works, but I'm not sure if there are bugs I haven't discovered yet.


Also, could you please check the code for the DIV tags at the end. They start outside the IF tag, but are closed inside the IF tag.



The code you changed it into was that the profile photo of the topic starter wont get replaced with the one that replies. But if you want that, go with the code you have ;)
Link to comment
Share on other sites

  • 4 weeks later...

is this supposed to move a topic to the top of the list whenever someone makes a reply?



You can easily change this by editing the block and going to "Sorting Options" tab. Just change it from "Last Post Date" to something else.

Thanks for this free block. Found it very useful :smile:


I made a few customizations to this code to suit my own site, and thought I'd post here in case someone else can use it. I didn't find it useful at all to include any details on the 'Topic Author' so I made the Avatar and 'Member Name' all for the "Last person to post". You'll see I added some text "Last post by" just to avoid confusion for my visitors. Also made it so clicking the links take you to your "Last Read Post" instead of the start of the topic.

Lastly, I've re-ordered the DIV tags because the default code had a DIV tag start outside the IF statement and end inside the closing IF statement (see AusArmA's post). This caused the block to look really weird on my Android phone so I guess it wasn't 100% legit HTML. It now looks okay.


<div class="maintitle">

<h3>{$title}</h3>

</div>

<div class="ipsBox">

<div class="ipsBox_container ipsPad">

<if test="is_array( $records ) && count( $records )">

  {parse striping="feed_striping" classes="row1,row2 altrow"}

  <foreach loop="$records as $r">

  <ul class="ipsList_withminiphoto">

  <li class="clearfix">

   <a href="{parse url="showuser={$r["member_id"]}" seotitle="{$r["members_seo_name"]}" template="showuser" base="public"}" title="{$this->lang->words["view_profile"]}" class="ipsUserPhotoLink left"><img src="{$r["pp_mini_photo"]}" alt="{$r["members_display_name"]}{$this->lang->words["users_photo"]}" class="ipsUserPhoto ipsUserPhoto_mini" /></a>


<div class="list_content">

  <a href="{$r["url"]}page__view__getnewpost" rel="bookmark" title="{$r["title"]}" class="ipsType_small">{parse expression="IPSText::truncate( $r["topic_title"], 50 )"}</a>

<br /><p class="desc ipsType_smaller">Last post by {parse expression="IPSMember::makeProfileLink( $r["lastpostername"], $r["last_poster_id"], $r["seo_last_name"] )"} - <span class="date"><abbr class="published" title="{parse expression="date( "c", $r["date"] )"}">{parse date="$r["date"]" format="short"}</abbr></span></p></div>

  </li>

  </ul>

  </foreach>

  </if>

</div>

</div>




P.S: You might want to use my code only as a reference. I couldn't copy and post my code as it turned any apostrophe into ascii code, so I replaced my apostrophe's with quotes.

Link to comment
Share on other sites

Tenaki, refer to my code 3 posts up.

Mine shows the Avatar of the 'last person to post'.
If you click the title of the topic, it will also take the person to the last post in that topic they have read (instead of to the start of the topic).

This is how I preferred it, and hopefully the author will make this the default view (or an option anyway).

This is what mine looks like. The avatars you see belong to the "last post by" member. No-where is the topic author mentioned or linked to (it's not useful for my requirements although I can see why it would be useful for other boards)
post-202568-0-23137700-1317603241_thumb.

Link to comment
Share on other sites

Can't even upload text files. That's kind of lame.

Here's a zip file, that contains a text file with my block code.
freeborne_latest_topics.zip

Just copy and paste that into the "Template" tab of Shaydx's block if you want it looking like my version.

- Clicking topic title takes you to 'last read post'
- Avatar is for the "last person to post"
- Topic title is limited to 50 characters. Change the truncate value if you want short/longer titles depending on how wide you expect your block to be.


post-202568-0-23137700-1317603241_thumb.

Link to comment
Share on other sites

  • 2 months later...

Archived

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

  • Recently Browsing   0 members

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