• Welcome to Simple Machines Community Forum. Please login or sign up.

Remove member and its post from show last replies lis

Started by SpelingMistakes, May 18, 2008, 02:16:52 AM

Previous topic - Next topic

SpelingMistakes


Is it possible to remove some specific members from showing them and their post in recent posts list which is visible on bottom of my forum?

I am on 1.1.5

Spel


There is a huge difference between living and being alive!

SpelingMistakes

Is there any solution - I am administrator - and I also have another administrator I created myself - he is kind of boot - he catch rss news from several different places and post on forum - I will gladly remove them from that list because sometimes there is lots of admins posts which is little annoying - If there is some solution - I will gladly like to heard it




http://img357.imageshack.us/img357/6315/adminpostsmt4.jpg
There is a huge difference between living and being alive!

Eliana Tamerin

It is possible to hardcode a solution to this.

Open up your BoardIndex.template.php in your custom theme (/Themes/(customthemename)/BoardIndex.template.php). If you don't have one, open up your (/Themes/default/BoardIndex.template.php) default file.

Find 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>';


Replace it with this:
foreach ($context['latest_posts'] as $post)
{
        if ($context['user']['id'] == 2)
          echo '';
        else
          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>';
}


I checked out your forum, and Administrator is listed as ID 2. I'm assuming that's your bot user. If it's not, simply replace the 2 in if ($context['user']['id'] == 2) with whatever ID the bot user is.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SpelingMistakes

Several attempts I made without a success :( -

I have access to server – I found that file – I found the code, but that change didn't do anything :(

Is there anything else I can do?
There is a huge difference between living and being alive!

Eliana Tamerin

Oops, sorry, wrong code.

Replace $context['user']['id'] with $post['poster']['id'].

Sorry about that.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SpelingMistakes

Works great – but I have one question

That part of code – I changed – obviously he has influence only in that part of recent post - I am sure but I must ask because I am not so experienced on coding – but clear thinking tells me that – I only want to check for sure.


Thanks in advance
There is a huge difference between living and being alive!

SpelingMistakes

I noticed also something other than wanted "modification" My forum is little faster – How this modification can influence on server work – What is now "removed" from work and I can notice little but noticeable improvements in speed. Any tip will be helpful

I will be grateful in advance but this can help others also

Can I add more users on this list?

if  ($post['poster']['id'] = = 2)

For istance

if  ($post['poster']['id'] = = 2,5,10)  or similar?
There is a huge difference between living and being alive!

Dragooon

You can do it this way
if  (in_array($post['poster']['id'],array(2,5,10)))
Not sure about your first comment though.

Eliana Tamerin

Not too sure on what you're asking, but to clarify, the modification I showed you will only remove the posts from the user ID (or IDs, if you use Dragoon's tweak) in the Recent Posts area. They will continue to show up elsewhere and in other stats.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SpelingMistakes

One problem – I have set that list show 20 last posts but ...

I don't have 20 last posts – sometime I have 5 – than like time goes list is shorter and shorter – This is obviously something connected to time – Like something which shows last posts depending by time – and not globally last 20 messages whenever they have been post

Any tips how to solve this?

Spel
There is a huge difference between living and being alive!

Eliana Tamerin

Try replacing the echo ''; with continue;. Not sure if that would work right or not, but it's worth a try.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SpelingMistakes

My code looks like this – I try to make change like you have suggest but without success

Quoteforeach ($context['latest_posts'] as $post)
                                 {
                               if  (in_array($post['poster']['id'],array(2)))
                                  echo '';
                                else
                                  echo '
                                         <tr>
                                        <td class="smalltext" align="right" valign="top" nowrap="nowrap">[', $post['board']['link'], ']</td>
                                        <td class="smalltext" valign="top">', $post['link'], ' ', $txt[525], ' ', $post['poster']['link'], '</td>
                                        <td class="smalltext" align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
                                </tr>';
                                }
                        echo '
There is a huge difference between living and being alive!

Eliana Tamerin

Are you trying to edit from within your Admin CP? I'm guessing that the files permissions have been altered. Try downloading the file to your computer via FTP and editing it there, then re-uploading.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SpelingMistakes

No - That is ok - I have direct access to server - via remote control - I have done that changes - and nothing changed - I am still in problem - I want that 20 last post when I get 5 I am happy - very fast that drops to 2,1 or 0.

Spel
There is a huge difference between living and being alive!

Eliana Tamerin

Hrm.

Does this bot post only to one forum? And is it the only poster in that forum? We could just shut off recent posts from that forum. (And that's not a feature, it would take more coding tweaks.)
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SpelingMistakes

Interesting view for solving problem

That boot post only in 2 different forums and your idea can work – actually

I will think about it – and we will continue tomorrow – Here is 2:45 after midnight – and I need to rest little :)

Spel
There is a huge difference between living and being alive!

SpelingMistakes

Is there any idea how to solve this with solving that time problem? There is surely something which cause problem and that is connected to time

Spel
There is a huge difference between living and being alive!

SpelingMistakes

When I set 200 messages I get some 20 or similar - but this is only kind of work around - not permanent solution – I am still in search for solution of problem

Spel
There is a huge difference between living and being alive!

Rumbaar

Well I'm sure it has to do with the accounts you're 'ignoring', as you just no displaying the content for them but the code behind the feature is populating the whole 20 replies based on the current postings.

So you are most likely getting all 20 posts, but the people you have removed, their posts aren't being displayed but are filling up your 20 last posts.
"An important reward for a job well done is a personal sense of worthwhile achievement."


[ Themes ]

SpelingMistakes

There is a huge difference between living and being alive!

Advertisement: