News:

Wondering if this will always be free?  See why free is better.

Main Menu

Remove spesific member from latest post

Started by hosjmeister, April 02, 2009, 05:07:36 AM

Previous topic - Next topic

hosjmeister

Hi.

I am using a rss feed mod that automaticly posts feed to a certain board on my forum. The problem is that I don't wan't posts from the "newsbot" to show up in the latest post part of my forum, both the board index and the SSI part.

I have fixed it so that if you go to hxxp:boardurl.com/index.php?action=recent [nonactive] it doesn't show post from this user, but the board index does. So does the ssi latest post on my main site.

Can anybody help?

margarett

I *THINK* that, in BoardIndex.template.php, if you replace this:

foreach ($context['latest_posts'] as $post)
echo '
<tr>
<td class="middletext" valign="top"><b>', $post['link'], '</b> ', $txt[525], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</td>
<td class="middletext" align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
</tr>';
echo '
</table>';

With:

foreach ($context['latest_posts'] as $post)
{
if ($post['poster']['id'] != xx)
{
echo '
<tr>
<td class="middletext" valign="top"><b>', $post['link'], '</b> ', $txt[525], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</td>
<td class="middletext" align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
</tr>';
}
}


It should solve you the problem with BoardIndex... Haven't tested, though...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

hosjmeister

#2
I fixed it for boardindex.template by simply adding this
if ($post['poster']['id'] != XX)
between
foreach ($context['latest_posts'] as $post)
and
echo '
<dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>', $post['time'], '</dd>';
echo '
</dl> ';


For SSI.php i did this:
After
echo '
<table border="0" class="ssi_table"  >';
foreach ($posts as $post)

I added
if ($post['poster']['id'] != XX)

Thanks for your help!

onepiece

It would be better to exclude the member id in query, in Subs-Recent.php file, to make sure that number of posts displayed are always same.

hosjmeister

So I did that, but that only works for boardindex.template , or am I wrong?

onepiece

That will just don't display them, but query will still get the posts of that user. If you have set to it to display 10 posts and 3 of them belongs to that member; then it will just show you 7 posts. You can exclude the user from the query like this.

./Sources/Subs-Recent.php

Code (Find) Select
WHERE m.id_msg >= {int:likely_max_msg}' .

Code (Replace) Select
WHERE m.id_msg >= {int:likely_max_msg}
AND m.id_member != xx' .

hosjmeister

I still cant get it to work for ssi.php :'s

*Feels like a noob*

onepiece

SSI.php

Find ssi_recentPosts() function. In this function.

Code (Find) Select
m.id_msg >= {int:min_message_id}

Code (Replace) Select
m.id_msg >= {int:min_message_id}
m.id_member != xx

hosjmeister

That worked, but somehow it is still bugged.

Example:
This is what I see when using SSI.php
QuoteTopicname    today at 18:58
   topicname    Tue 14/04, 17:24
And this is what I see on the board index:
Quotetopicname    today at 18:58
topicname    Tue 14/04, 17:24
topicname    Sat 11/04, 13:33
topicname     Sat 11/04, 13:00
topicname    Tue 07/04, 23:55

onepiece

Try this. In the same function.

Code (Find) Select
$modSettings['maxMsgID'] - 25

Code (Replace) Select
$modSettings['maxMsgID'] - 55

If that doesn't work, try replacing with this.

Code (Replace) Select
$modSettings['maxMsgID'] - 75


Advertisement: