add php script in top menu

Is there a way to add php script to top menu? This is the top menu....

screenshot20110114at801.png

 

I have the php script that pulls the total number of online chatters....  like this  "Chat (3)"  I'm using a different chat software, not rayz's.

 

I added a simple php script in Language Settings to see if it works with php.

screenshot20110114at757.png

 

the result....

 

screenshot20110114at808.png

 

I find it interesting that half of php script works but the other still showing ';?>.  What's going on?  Is it possible to add php script in Langauage settings?  Any idea to make it php friendly? Undecided

 

 

Quote · 14 Jan 2011

The menus will not process php code. Your just seeing part of the text from that string. It's not really processing it as php.

PHP also can't be used in the language keys. But html can.

Dolphin is written in PHP, so the obvious location to place it is in the code that generates the menu.

You can try this.

In inc\classes\BxDolMenu.php look for this at about line 109.

if (isMember()) {
$this->aMenuInfo['memberID']   = (int)$_COOKIE['memberID'];
$this->aMenuInfo['memberNick'] = getNickName( $this->aMenuInfo['memberID'] );
$this->aMenuInfo['memberLink'] = getProfileLink( $this->aMenuInfo['memberID'] );
$this->aMenuInfo['visible']    = 'memb';
} else {
$this->aMenuInfo['memberID'] = 0;
$this->aMenuInfo['memberNick'] = '';
$this->aMenuInfo['memberLink'] = '';
$this->aMenuInfo['visible']  = 'non';
}


Add the lines in Green

Place code to get a count of chatters here and load that
number into $iChatCount
if (isMember()) {
$this->aMenuInfo['memberID']   = (int)$_COOKIE['memberID'];
$this->aMenuInfo['memberNick'] = getNickName( $this->aMenuInfo['memberID'] );
$this->aMenuInfo['memberLink'] = getProfileLink( $this->aMenuInfo['memberID'] );
$this->aMenuInfo['visible']    = 'memb';
$this->aMenuInfo['chatCount'] = _t('_chat_top_menu_item') . ' ' . $iChatCount;

} else {
$this->aMenuInfo['memberID'] = 0;
$this->aMenuInfo['memberNick'] = '';
$this->aMenuInfo['memberLink'] = '';
$this->aMenuInfo['visible']  = 'non';
$this->aMenuInfo['chatCount'] = _t('_chat_top_menu_item') . ' ' . $iChatCount;
}

Then edit your menu in menu builders and replace the language key of _chat_top_menu_item with {chatCount}

Basically what this code does is create another variable that can be placed in the menus. If you look through some of your other menu items you will see {memberID}, {memberNick} and the others defined there in use on the menus. This procedure just adds another one.

https://www.deanbassett.com
Quote · 14 Jan 2011

Thanks for your awesome reply! I get it now but where do i add php script?  sorry if this sounds stupid.

Quote · 14 Jan 2011

 

Thanks for your awesome reply! I get it now but where do i add php script?  sorry if this sounds stupid.

I showed you where.

Above that section you add the script needed to obtain the number of chatters and load that number into the $iChatCount varible i used in the edits i made.

Place code to get a count of chatters here and load that
number into $iChatCount
if (isMember()) {
$this->aMenuInfo['memberID']   = (int)$_COOKIE['memberID'];
$this->aMenuInfo['memberNick'] = getNickName( $this->aMenuInfo['memberID'] );
$this->aMenuInfo['memberLink'] = getProfileLink( $this->aMenuInfo['memberID'] );
$this->aMenuInfo['visible']    = 'memb';
$this->aMenuInfo['chatCount'] = _t('_chat_top_menu_item') . ' ' . $iChatCount;

} else {
$this->aMenuInfo['memberID'] = 0;
$this->aMenuInfo['memberNick'] = '';
$this->aMenuInfo['memberLink'] = '';
$this->aMenuInfo['visible']  = 'non';
$this->aMenuInfo['chatCount'] = _t('_chat_top_menu_item') . ' ' . $iChatCount;
}

https://www.deanbassett.com
Quote · 14 Jan 2011

haha sorry maybe you should try red next time. jk  okay i'm trying now and will let you know how it goes.

Quote · 14 Jan 2011

Anyone know how to do this for RayZ's chat?

Quote · 29 Sep 2012

anyone know what code would work to tally the online user's in Rayz's chat?

Quote · 24 Jan 2013

Me too! Maybe if I displayed the number of people chatting, it will entice others to want to join in the chat.

Geeks, making the world a better place
Quote · 24 Jan 2013

 

Me too! Maybe if I displayed the number of people chatting, it will entice others to want to join in the chat.

 exactly :)

Quote · 24 Jan 2013

*bump* :) Anyone have some suggestions on this too? :)

Quote · 12 Feb 2013

This is the easiest way for Rayz:

 

http://www.boonex.com/m/Chat_Summary

Nothing to see here
Quote · 12 Feb 2013

I saw that one before... but it sounds like it is a block not a menu mod? Also.. I see it's been reported that it isn't not working in 7.1...

Quote · 12 Feb 2013

 

but it sounds like it is a block not a menu mod?

 That is correct, its not a menu mod. As far as 7.1 compatible, it 'says' it is. According to the last review, that person said he was having problems, but looking at the 'updated' date of the mod 1/17/2013, it may have been updated then. So the user may need to re-download it. 

 

I know I have had to re-download in order to make mods work with 7.1 after updates.

Nothing to see here
Quote · 12 Feb 2013

wait a min.. did rays make this already?  I think i saw it before!  like me look.  

Quote · 12 Feb 2013

 ahh hmm gotcha

 

but it sounds like it is a block not a menu mod?

 That is correct, its not a menu mod. As far as 7.1 compatible, it 'says' it is. According to the last review, that person said he was having problems, but looking at the 'updated' date of the mod 1/17/2013, it may have been updated then. So the user may need to re-download it. 

 

I know I have had to re-download in order to make mods work with 7.1 after updates.

 

Quote · 12 Feb 2013

 did you ask rays.  I'm sure he's more than happy to tell you.  :)

I saw that one before... but it sounds like it is a block not a menu mod? Also.. I see it's been reported that it isn't not working in 7.1...

 

Quote · 12 Feb 2013

Hello everyone.

My mod Chat Summary (http://www.boonex.com/m/Chat_Summary) works fine with Dolphin 7.1. You can see it at http://rayzzz.com/d71/ (hope to be able to upgrade it to rayzzz.com soon).

It's not a block mod, it's a js function that changes the "Chat" text to "Chat (#count#)".

The main trick that online chat users number can't be retrieved from database or anywhere else if you use RMS version, so I designed the special plugin for chat that stores that info in database and my js code inserts that info into top menu item.

That's all. please contact me directly via inbox to ask any questions.

Quote · 14 Feb 2013

fantastic! bought, installed and working great in less than 5 mins!

Quote · 14 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.