Is there a way to add php script to top menu? This is the top menu....
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.
the result....
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?
|
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 |
Thanks for your awesome reply! I get it now but where do i add php script? sorry if this sounds stupid. |
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 |
haha sorry maybe you should try red next time. jk okay i'm trying now and will let you know how it goes. |
Anyone know how to do this for RayZ's chat? |
anyone know what code would work to tally the online user's in Rayz's chat? |
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 |
Me too! Maybe if I displayed the number of people chatting, it will entice others to want to join in the chat.
exactly :)
|
*bump* :) Anyone have some suggestions on this too? :) |
Nothing to see here |
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... |
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 |
wait a min.. did rays make this already? I think i saw it before! like me look. |
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.
|
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...
|
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.
|
fantastic! bought, installed and working great in less than 5 mins! |