1
DjMikeWatt
copying "inbox" w/ new indicator
  • 2007/10/29 9:14

  • DjMikeWatt

  • Just popping in

  • Posts: 41

  • Since: 2007/4/7 2


I'd like to turn off the user menu block, opting instead to put those links elsewhere in the site... my only question is, how can I copy the code from system_block_user.html over to the horizontal nav bar in my theme's theme.html file so that it will indicate new messages waiting in the horizontal nav bar? This seems like it should be easy to do, but then again, I'm not really all that good...

I think it's got to do with the
<{$block.lang_inbox}> (<{$block.new_messages}>)
part... but it's not that simple, as I figured out... when I put that into theme.html it just displays that exactly as it is above...

Any thoughts?

2
DjMikeWatt
Re: copying "inbox" w/ new indicator
  • 2007/10/30 11:00

  • DjMikeWatt

  • Just popping in

  • Posts: 41

  • Since: 2007/4/7 2


hmmm... nobody??

3
stefan88
Re: copying "inbox" w/ new indicator
  • 2007/10/30 11:19

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

this is from one of my theme files:

<{if $xoops_isuser}>

    <{
php}>
    GLOBAL 
$xoopsUser;
    
$pm_handler =& xoops_gethandler('privmessage');
    
$uid $xoopsUser->getVar('uid');
    
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
    
$criteria->add(new Criteria('to_userid'$uid));
    
$msgcount $pm_handler->getCount($criteria);
    
$GLOBALS['xoopsTpl']->assign('msgcount'$msgcount);
    <{/
php}>

    <{if 
$msgcount 0}>
    &
nbsp;<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_on.jpg" alt=You&nbsp;have&nbsp;<{$msgcount}>&nbsp;new&nbsp;message border="0" />a>
    <{else}>
    &
nbsp;<a href="<{$xoops_url}>/viewpmsg.php"><img src="<{$xoops_imageurl}>images/prvmsg_off.jpg" alt="You have no new messages" border="0" />a>
    <{/if}>

    <{/if}>



also imenu module has special functionality to work with inbox
..

4
DjMikeWatt
Re: copying "inbox" w/ new indicator
  • 2007/10/31 3:16

  • DjMikeWatt

  • Just popping in

  • Posts: 41

  • Since: 2007/4/7 2


whttp://www.WATTPRODUCTIONS.COM

Okay - so... here's where I am...

Right now, the horizontal nav bar looks like this:
<td class="topnav" align="center" colspan="3"> <a href="/user.php?xoops_redirect=/">Logina
            &
nbsp;&bull;&nbsp; <a href="/">Homea> &nbsp;&bull;&nbsp; <a href="/user.php">My 
            Account
a> &nbsp;&bull;&nbsp;<class="highlight" href="<{$xoops_url}>/viewpmsg.php"><{$block.lang_inbox}> 
            (<
span style="color:#ff0000; font-weight: bold;"><{$block.new_messages}>span>)a>&nbsp;&bull;&nbsp
            <
a href="/notifications.php">Notificationsa> &nbsp;&bull;&nbsp
            <
a href="/user.php?op=logout">Logouta>td>

Right now I have the two parenthesis visable on the page and they link to "/viewpmsg.php" but the word INBOX still doesn't appear and the number of messages waiting won't appear either...

I'm learning as I go... can anyone see what I can do to make this work??

Thank you so much!
Mike

5
stefan88
Re: copying "inbox" w/ new indicator
  • 2007/10/31 6:03

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

in theme.html you can refer smarty constants like this:

<{$smarty.const._SEARCH}>


so in your case it would be:

<{$smarty.const._US_INBOX}>


or

<{$smarty.const._PM_INBOX}>


...
..

6
DjMikeWatt
Re: copying "inbox" w/ new indicator
  • 2007/10/31 6:59

  • DjMikeWatt

  • Just popping in

  • Posts: 41

  • Since: 2007/4/7 2


Yeah, I don't really know what that means...

Why can't I copy the code from the system_block_user.html file? It works in that block, why would it not work in the theme.html?

Isn't there a piece of code I can paste in there that will provide the functionality I'm looking for?

Just a link that says "Inbox" and points to "/viewpmsg.php" but that will show new messages when they exist... as in:

Inbox(3)

Seems like this shouldn't be all that difficult...

7
DjMikeWatt
Re: copying "inbox" w/ new indicator
  • 2007/11/4 8:24

  • DjMikeWatt

  • Just popping in

  • Posts: 41

  • Since: 2007/4/7 2


An expert user I do not make, but I think I've figured thtat the issue here is that at the time the THEME.HTML file is setting up the horizontal nav bar, the variable {$block.new messages} has not yet been retrieved.

What can I do to move the retrieval of that variable to earlier in the page?

8
stuie200
Re: copying "inbox" w/ new indicator
  • 2007/11/4 9:18

  • stuie200

  • Friend of XOOPS

  • Posts: 161

  • Since: 2004/1/4 2


Quote:

DjMikeWatt wrote:
Yeah, I don't really know what that means...

Why can't I copy the code from the system_block_user.html file? It works in that block, why would it not work in the theme.html?

Isn't there a piece of code I can paste in there that will provide the functionality I'm looking for?

Just a link that says "Inbox" and points to "/viewpmsg.php" but that will show new messages when they exist... as in:

Inbox(3)

Seems like this shouldn't be all that difficult...


Hi,

I have ammeneded your navbar code below to hopefully include what you are after, replace you current code with the example below. I am no way an expert at this but this should do the job for you but it may still require some formatting on your part to get it looking how you want it.

<td class="topnav" align="center" colspan="3"> <a href="<{$xoops_url}>/user.php?xoops_redirect=/">Logina
            &
nbsp;&nbsp; <a href="<{$xoops_url}>">Homea> &nbsp;&nbsp; <a href="<{$xoops_url}>/user.php">My 
            Account
a> &nbsp;&nbsp;<class="highlight" href="<{$xoops_url}>/viewpmsg.php">Inboxa> <{php}>
global 
$xoopsUser;
if( 
$xoopsUser )
{
$pm_handler =& xoops_gethandler('privmessage');
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
$criteria->add(new Criteria('to_userid'$xoopsUser->getVar('uid')));
$pm $pm_handler->getCount($criteria);
}

if( 
$pm )
{
echo 
"($pm)n";
}
<{/
php}>&nbsp;&nbsp
            <
a href="<{$xoops_url}>/notifications.php">Notificationsa> &nbsp;&nbsp
            <
a href="<{$xoops_url}>/user.php?op=logout">Logouta>td>


I have a much more advanced top navigation bar in my theme which included a login form if the user is not logged in and once they are logged in they get a personal greeting along with a customised navigation bar to administer their account, notifications, personal messages and also if the user is an administrator it will also display a link to the admin page but for now i can't post the code as there is too much hacking required but if you are interested i can post it here later.

Regards

Stuart
"I'm as confused as a baby in a topless bar."

9
DjMikeWatt
Re: copying "inbox" w/ new indicator
  • 2007/11/4 20:52

  • DjMikeWatt

  • Just popping in

  • Posts: 41

  • Since: 2007/4/7 2


STUIE -

Thank you very much... it does work. Now I'm going to sit and study it to see how it works...

One other question pops up, though... what can I change to maintain the highlight and bold properties of the area when new messages are present? I'd like for the Inbox to really stand out when there are new messages so that the user is sure to see that they have new messages waiting... just like the original block_user_menu file does when the inbox has new messages.

Resized ImageResized Image

10
stuie200
Re: copying "inbox" w/ new indicator
  • 2007/11/7 19:27

  • stuie200

  • Friend of XOOPS

  • Posts: 161

  • Since: 2004/1/4 2


I can only presume its a stylesheet issue but im not a coder so unfortunatly can not advise correctly.

Maybe somebody else may be able to offer help on this one?

regards

Stuart
"I'm as confused as a baby in a topless bar."

Login

Who's Online

334 user(s) are online (70 user(s) are browsing Support Forums)


Members: 0


Guests: 334


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits