Jump to content

Download: (SOS31) Recent Topics


Adriano Faria

Recommended Posts

Guest Danny Michel

i cleaned it up

<style type="text/css" >

	/* Inline CSS */


	table.recentTopicsTable

	{

		border: 0;

	}


	#recentTopics

	{

		border-bottom: 4px solid #D5DDE5;

	}


	.block_wrap h3.collapsed a.toggle 

	{

		background-image: url({$this->settings['img_url']}/cat_maximize.png);

	}

</style>

<style>

	table.novo a{ padding-left: 5px; text-decoration: none;}

</style>



<script src="{$this->settings['public_dir']}js/ips.recentTopicsHook.js" type="text/javascript"></script>

<script src="{$this->settings['public_dir']}js/ips.forums.js" type="text/javascript"></script>


<script type="text/javascript">

	ipb.recentTopics.updateInterval = parseInt( {$this->settings['topicosrecentes_updateInterval']} );

</script>

<div class='block_wrap' id="recentTopicsWrapper">

	<h3 id='hook_recentTopics' class='maintitle'><a class='right toggle' href='#' title='{$this->lang->words['click_toggle']}'>{$this->lang->words['click_toggle']}</a>{$this->lang->words['topicos_recentes']}</h3>

	<table class="ipb_table" cellspacing="0" cellpadding="0">

                            <tr class="header">

	                <th class='col_f_icon' scope="col"></th>

	                <th class='col_f_topic' scope="col">{$this->lang->words['forum_topic']}</th>

	                <th class="col_f_starter short" scope="col">Started By</th>

	                <th class='col_f_views stats' scope="col">{$this->lang->words['stats']}</th>

	                <th class='col_f_post' scope="col">{$this->lang->words['forum_last_post_info']}</th>

	        </tr>

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

			{parse striping="topicosrecentes_hook" classes="row1,row2"}

				<foreach loop="topicosrecentes_hook:$topicos as $r">

			        <php>

			        	$class 		= "class='altrow'";

			        	$classTwo 	= '';

			        </php>


				        <tr class="{parse striping="topicosrecentes_hook"}">

				            <td {$class} align='center' width='4%'>

								<a title="{$this->lang->words['topico_lido']}" href="{parse url="app=forums&amp;module=ajax&amp;section=recentTopics&amp;do=maskasread&amp;f={$r['topico']['forum_id']}&amp;t={$r['topico']['tid']}&amp;secure_key={$this->member->form_hash}" base="public"}">{parse replacement="{$r['image']}"}</a>

							</td>

							<td {$class2} class='__topic __tid{$r['topico']['tid']}' width='52%'>

								<if test="$r['topico']['state'] !='link'"><span class='topic_preview right'>{parse template="topic_popup" group="global" params="$r['topico']['tid']"}</span></if>

								<if test="$r['topico']['pinned']"><span class='topic_prefix'>{$this->settings['pre_pinned']}</span></if>

								<if test="$r['topico']['poll_state']"><span class='topic_prefix'>{$this->settings['pre_polls']}</span></if>

								<if test="$this->settings['topicosrecentes_movidos'] AND $r['topico']['state'] == 'link'"><span class='topic_prefix'>{$this->settings['pre_moved']}</span></if>

								<if test="$r['topico']['topic_hasattach']">

									<a class="topic_title" href="{parse url="app=forums&amp;module=forums&amp;section=attach&amp;tid={$r['topico']['tid']}" base="public"}" title="{parse expression="intval($r['topico']['topic_hasattach'])"} {$this->lang->words['topic_attach']}" onclick="return ipb.forums.retrieveAttachments( {$r['topico']['tid']} );">{parse replacement="t_attach"}</a>

								</if>

								<if test="istracking:|:! empty($r['topico']['trackingTopic'])">{parse replacement="watch_small"}</if>

								<a class="topic_title" href='{parse url="showtopic={$r['topico']['tid']}&view=getnewpost" base="public" template="showtopic" seotitle="{$r['topico']['title_seo']}"}' title='{$r['topico']['title']}'>{IPSText::truncate($r['topico']['title'],60)}</a> {$r['topico']['_rate_img']}<br />

								<span class='desc'>{$this->lang->words['cat_name']}:

									<foreach loop="topicsForumTrail:$r['breadcrumb'] as $i => $f">

										<a href='{parse url="{$f[1]}" template="showforum" seotitle="{$f[2]}" base="public"}'>{$f[0]}</a> <if test="notLastFt:|:$i+1 != count( $r['breadcrumb'] )">{parse replacement="f_nav_sep"}</if>

									</foreach>

								</span>

							</td>

				            <td {$class} align='center' width='15%'><address class="author vcard">{IPSLib::makeProfileLink(IPSLib::makeNameFormatted( $r['topico']['starter_name'], $r['topico']['grupo1']), $r['topico']['starter_id'])}{parse template="user_popup" group="global" params="$r['topico']['starter_id'], $r['topico']['nome1']"}</address>

				            </td>

							<td {$class2} align='right' width='11%'>

								<ul>

									<li>

										<span><a href="{parse url="app=forums&amp;module=extras&amp;section=stats&amp;do=who&amp;t={$r['topico']['tid']}" base="public"}" onclick="return ipb.forums.retrieveWhoPosted( {$r['topico']['tid']} );">{$this->registry->getClass('class_localization')->formatNumber( $r['topico']['posts'] )}</a> {$this->lang->words['replies']}</span>

									</li>

									<li>

										<span>{$this->registry->getClass('class_localization')->formatNumber( $r['topico']['views'] )} {$this->lang->words['views']}</span>

									</li>

								</ul>

							</td>

				            <td {$class} width='18%'><ul  class="last_post">

<li><a href='{parse url="showtopic={$r['topico']['tid']}&amp;view=getlastpost" base="public" template="showtopic" seotitle="{$r['topico']['title_seo']}"}' title='{$this->lang->words['view_last_post']}'>{parse replacement="f_lastpost"}</a> <a href='{parse url="showtopic={$r['topico']['tid']}&amp;view=getlastpost" base="public" template="showtopic" seotitle="{$r['topico']['title_seo']}"}' title='{$this->lang->words['view_last_post']}'>{parse date="$r['topico']['last_post']" format="short"}</a></li><li>{$this->lang->words['forum_by']} <address class="author vcard">{IPSLib::makeProfileLink(IPSLib::makeNameFormatted( $r['topico']['last_poster_name'], $r['topico']['grupo2']), $r['topico']['last_poster_id'])}{parse template="user_popup" group="global" params="$r['topico']['last_poster_id'], $r['topico']['nome2']"}</address></li>

</ul>

				            </td>

				        </tr>


				</foreach>

		</if>

    </table>

</div>

Link to comment
  • Replies 149
  • Created
  • Last Reply

This option in user control panel will appear for those who can view the block in board index and this is you as admin who set in Admin CP.



If you disallow MEMBERS to use the hook, those settings won't appear in Control Panel for users of MEMBERS groups.



ok thanks

for the members who can choose how many topics will be displayed i just wanted a limit on the maximuim amount they can choose or it could be
abused by having to many topics showing.
as example a member could pick to have 20 topics showing and impact the server if i have 500 members do the same.
thanks
Link to comment

I'll give it a try.




Well, this is what really makes this hook so nice, but I can make it as a setting (default value: ON)... so you'll can disable it.



Anyway, have you tried to use a higher number of seconds (45s, 1min, etc.) ?




I tried 90, but it refreshes when the page loads, and it's a massive load. Every select query execution time is > 5 secs. It gives hardons on my i7 12gb ram machine.
Link to comment

Is there anyway that this hook can be hidden from members of less than 1 post.


Im trying to get new members to post their introductions before they view the rest of the board.


So far I have achieved this but this mod is enabling them to gain access to other areas.



you can do that by using the hooks group settings in acp
if you have your groups setup correctly thats is
Link to comment

I don't think so. If he choose MEMBERS, will show the block for members with 0, 100, 1000000000 (etc.) posts. He doesn't want to show for users with 0 POSTS.

You need a small change in the script but I don't see this as a nice feature to change the hook and release a new version, so I can make it as a custom job.

Link to comment

I don't think so. If he choose MEMBERS, will show the block for members with 0, 100, 1000000000 (etc.) posts. He doesn't want to show for users with 0 POSTS.



You need a small change in the script but I don't see this as a nice feature to change the hook and release a new version, so I can make it as a custom job.



You have it in One. :thumbsup:
Link to comment

I don't think so. If he choose MEMBERS, will show the block for members with 0, 100, 1000000000 (etc.) posts. He doesn't want to show for users with 0 POSTS.



Bit late now but.......

got mine setup ok for what he wants, just the same setup as not allowing guests to see recent topics or posts.

Just an example:

setup group "members" in members user groups
set Promote members of this group to: full members after 1 post

create another user group "full members"

not forgetting to setup the user permissions for both groups


in recent topics hook options

Groups
Select here the user groups that will can see the list - DO NOT INCLUDE MEMBERS

The recent topics will only show only when they have posted one post and been moved to the new user group.

job done
Link to comment
  • 3 weeks later...

When I went from 2.1.0 to 2.1.2, I get this issue. As a guest, everything functions perfectly. When logged in as a member, admin, mod, etc the "loading" stays at the top of the page indefinitely. It never goes away and the topics do not ever refresh. What have I done wrong and what can I do to fix it?

Link to comment

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...