Help with hiding number of posts

Started by Dzonny, December 15, 2009, 05:22:46 PM

Previous topic - Next topic

Dzonny

Hello there.

I want to show custom text instead of number of posts in my forum.
What i've done is this:

Display.template.php
Find:
// Show how many posts they have made.
Replace:
// Show how many posts they have made.
if (($message['member']['id'] == 'ID OF MEMBER'))
echo $txt[26].': some text';
else


That works fine. But i want to hide number of posts in statistics center too. Can someone help me with that?

Regards.

Arantor

I'm guessing SMF 1.1, but what theme? Does your theme have a custom Stats.template.php file?
Holder of controversial views, all of which my own.


Dzonny

Sorry, i forgot about it.
Yes, smf 1.1.11, and dilbermc theme. It uses Stats.template from default theme...

Arantor

So, do you just want to hide it, or replace the area with something else, or what?
Holder of controversial views, all of which my own.


Dzonny

Well, if its possible, i'd like to replace it with the same text as in my first posts. Or i could just hide it if thats the only way.

Thanks for your help Arantor.

Arantor

Ah, I see. You're only changing it for one member.

Code (find) Select
foreach ($context['top_posters'] as $poster)
echo '
<tr>
<td width="60%" valign="top">', $poster['link'], '</td>
<td width="20%" align="left" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $poster['num_posts'], '</td>
</tr>';


Code (replace) Select
foreach ($context['top_posters'] as $poster)
echo '
<tr>
<td width="60%" valign="top">', $poster['link'], '</td>
<td width="20%" align="left" valign="top">', $poster['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', ($poster['id'] == 'ID OF MEMBER' ? 'some text' : $poster['num_posts']), '</td>
</tr>';


Doesn't hide the bar though that's not a problem either - let me know if you want to.
Holder of controversial views, all of which my own.


Dzonny

Works like a charm, thank you one again.

Is there a way to do the same in the profile, and in the memberlist? Sorry for bothering.

Arantor

Profile.template.php

Note this doesn't hide the posts per day thing.

Code (find) Select
<td>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</td>

Code (replace) Select
<td>', ($context['member']['id'] == 'ID OF MEMBER' ? 'some text' : $context['member']['posts']), ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</td>

Memberlist.template.php
Again, doesn't take the bar out
Code (find) Select
<td class="windowbg2" width="15">', $member['posts'], '</td>

Code (replace) Select
<td class="windowbg2" width="15">', ($member['id'] == 'ID OF MEMBER' ? 'some text' : $member['posts']), '</td>
Holder of controversial views, all of which my own.


Dzonny

Memberlist works fine, but profile dont.
Maybe because i use ultimate Profile mod?

Here is edited profile.template.php

Arantor

Holder of controversial views, all of which my own.


Dzonny

Quote from: Arantor on December 15, 2009, 06:13:44 PM
Any errors in the error log?
Nothing.

I've edited UlitameProfile.template.php as well, and nothing happened.

Arantor

The edits to Profile.template.php appear to be right though. I know nothing of UltimateProfile but I'll take a look shortly.
Holder of controversial views, all of which my own.


Dzonny


Dzonny


Arantor

Sorry, I just haven't had time to dig into UP to be honest, and don't really expect to have time soon to do so either.
Holder of controversial views, all of which my own.


Yağız...

Edit your UltimateProfile.template.php file too.

Dzonny

Quote from: Yağız... on December 20, 2009, 01:22:31 PM
Edit your UltimateProfile.template.php file too.
I am, but number of posts are still there...

Yağız...

It worked well for me... Attach your latest UltimateProfile.template.php.

Dzonny


Dzonny

#19
Sorry, ive fix this, i have that file in my custom theme aslo, and did not edited it till now.  8)

Advertisement: