Need to know total posts for current member in BoardIndex.Template.php

Started by Asgard, April 30, 2006, 02:06:51 PM

Previous topic - Next topic

Asgard

I'm trying to implement this little mod, i got the idea from TAZ, and the basics are to display a message inviting the new members to make the first, second and third post.
I came out with this, that i commented out because is not working:


// Show the news fader?  (assuming there are things to show...)
/* if $message['member']['posts'] = 0
      {
         $context['fader_news_lines'] = $txt[firstPostInvite];
      }
      else if $message['member']['posts'] = 1
      {
         $context['fader_news_lines'] = $txt[secondPostInvite];
      }
      else if $message['member']['posts'] = 2
      {
         $context['fader_news_lines'] = $txt[thirdPostInvite];
      }
      else
      {
         $context['fader_news_lines'] = $context['fader_news_lines'];
      }*/

if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{



As you can see, i'm trying to use the newsfader that i have active in my forum and trying to override context when users have 0, 1 or 2 posts and show the invitation that i have already defined in modsettings.language.php.  I have made some modifications on this way, like an invitation to use the karma system below the karma labels, but that is not post based, and if it was, is in display.template and the array element i'm using is valid in that context.

The problem is that $message['member']['posts'] is not valid in the BoardIndex.Template context.  I'm examining the code to find out the correct function or array element to use there, but i'm posting this just in case someone here haves a quicker answer.

Regards,
Asgard

Kindred

try this...   if statements MUST be enclosed within parens... and a single = is not the proper logical operator in an if statement.


// Show the news fader?  (assuming there are things to show...)
/* if ($message['member']['posts'] == 0)
      {
         $context['fader_news_lines'] = $txt[firstPostInvite];
      }
      else if ($message['member']['posts'] == 1)
      {
         $context['fader_news_lines'] = $txt[secondPostInvite];
      }
      else if ($message['member']['posts'] == 2)
      {
         $context['fader_news_lines'] = $txt[thirdPostInvite];
      }
      else
      {
         $context['fader_news_lines'] = $context['fader_news_lines'];
      }*/

if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Asgard

Hey, thanks, is not breaking anymore, but still not working...

with this line:

        $context['fader_news_lines'] = $txt[firstPostInvite];


i'm trying to override the contents of the newsfader, to show the invitation messages.
As i was saying, the code does not break anymore after making the changes you suggested, but that line seems not to be working, since my ordinary news are showing up.

I'm a developer, but these are my first try with PHP, i was succesful with the first one, but this other is giving me a little trouble.

Advertisement: