Jump to content

lanox

Members
  • Posts

    8
  • Joined

  • Last visited

lanox's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. jsut an update, i got it sorted using my original code in first post, the issue was that i didn't enable php in my expressionengine , as soon as i did that all worked as expected.
  2. It's currently running on my server not facing Internet I can try uploading or if u want a screen shoot Echo of that displays 0
  3. Hi Phear thank you for helping this is the function that i have wrote in mod.forum.php ( file) ** * Unread Private Message Box in header */ public function unread_private_messages() { $str = $this->load_element('unread_private_messages'); $pms = $this->EE->session->userdata('private_messages'); if ($pms == '' OR ! is_numeric($pms)) { $pms = 0; } if ($pms > 0) { $str = $this->allow_if('private_messages', $str); $str = $this->deny_if('no_private_messages', $str); } else { $str = $this->deny_if('private_messages', $str); $str = $this->allow_if('no_private_messages', $str); } return $this->var_swap($str, array( 'total_unread_private_messages' => $pms ) ); } what i mean by nod showing 0 in my forum the function above will display number of new private message if there is no new private message it show number 0 what i would like is to hide that 0 so it doesn show. This is what my member currently ses when they login user name: bob | 0 UNREAD MESSAGES what i would like for them to see if there is no new messages user name: bob and this is what i would like to see if there is a message user name: bob | 1 UNREAD MESSAGE once they read message i would like it to go back to user name: bob at the moment its actually showing user name: bob | 0 UNREAD MESSAGES after they read they message i want to hide that 0 UNREAD MESSAGES. thanks heaps
  4. Strider, That is fine, i have tried to figure it out my self but unfortunately i haven't as of yet. Basically the total_unread_private_messages does all the work including incrementing the numbers and resetting back to 0, what i cant figure out is how to hide 0 when there is no new messages.
  5. right tnx.
  6. anyone ?
  7. Hi Tnx for reply It's not variable as such it's like a link where the code is stored and that calls the code and displays number of new messages. And it resets it self once the member clicks on the new message and reads it. My issue is that my code doesn't check if the count is 0 I am assuming.
  8. Hi Guys been borwsing and learning from here and i though it was time to register. I was wondering if someone could help me with if statment that i am stuck here is my if statment <?php if ({total_unread_private_messages} != 0): ?> {total_unread_private_messages} <?php endif; ?> Now to explain {total_unread_private_messages} --> this is variable to show number of how many messages you have by default it always shows 0 till u dont get a private message then it increases to 1 and so on. now what i am trying to achive is this. if count is 0 dont display anything, if you receive message then i wan to display 1 unread message. which what my if statmen does but this is where it failes. if you read the private message counter will reset to 0 but it will not desaper it will say 0 unread messages. i am not sure what i am doing wrong ? ( i assuming its not checking if the count is 0 then dont display anything ? if someone could help would be much appreaciated. thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.