Alert in Bubble for custom member menu item

$who = $this -> iMemberID;

$referred = mysql_query("SELECT * FROM referrals WHERE to_id = '$who'");

$referrals = mysql_num_rows($referred);
echo $referrals;

this works in a php block, so now I want the output of this script to be displayed in a bubble like when you have a new friend request in the member menu.

caredesign.net
Quote · 13 Feb 2013

Well, I can nevermind this Topic, I have figured it out. Will post what i did in hopes someone can tell me how bad i messed it up.

1. created new line in database table sys_menu_member - INSERT INTO `table`.`sys_menu_member` (

`ID` ,
`Caption` ,
`Name` ,
`Icon` ,
`Link` ,
`Script` ,
`Eval` ,
`PopupMenu` ,
`Order` ,
`Active` ,
`Movable` ,
`Clonable` ,
`Editable` ,
`Deletable` ,
`Target` ,
`Position` ,
`Type` ,
`Parent` ,
`Bubble` ,
`Description`

)
VALUES (

NULL , '_referrals', '_referrals', 'envelope', 'page/referrals', '', '', ' ', '4', '1', '3', '1', '1', '0', '', 'top', 'link', '0', 'bx_import( ''BxDolReferrals'' ); $aRetEval = BxDolReferrals::get_member_menu_bubble_referrals_requests( {ID}, {iOldCount});', '_referrals'

);

2. created BxDolReferrals.php page in inc/classes directory with just the following code-

<?php
/**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */

bx_import( 'BxDolPageView' );
bx_import( 'BxBaseProfileView' );

class BxDolReferrals extends BxDolPageView
{
    // consit all necessary data for display members list ;
    var $aDisplayParameters;

    // contains the path to the current page ;
    var $sCurrentPage ;

     
    /**
     * Function will send count of member's friend requests;
     *
     * @param  : $iMemberId (integer) - logged member's Id;
     * @param  : $iOldCount (integer) - received old count of messages (if will difference will generate message)
     * @return : (array)
                [count]     - (integer) number of new messages;
                [message]   - (string) text message ( if will have a new messages );
     */
    function get_member_menu_bubble_referrals_requests($iMemberId, $iOldCount = 0)
    {
        global $oSysTemplate, $oFunctions, $site;

        $iMemberId           = (int) $iMemberId;
        $iOldCount          = (int) $iOldCount;
 

        $aNotifyMessages  = array();
        $aReferrals         = array();

        if ( $iMemberId ) {
            $sSql = "SELECT `tp`.`ID` FROM `referrals` AS `tf` LEFT JOIN `Profiles` AS `tp` ON `tf`.`id`=`tp`.`ID` WHERE `tf`.`to_id`={$iMemberId} AND `tf`.`status`='Unreviewed'";
            $aReferrals = $GLOBALS['MySQL']->getColumn($sSql);

            $iOnlineFriends = count($aReferrals);
           
        }

        $aRetEval = array(
           'count'     => $iOnlineFriends,
        );

        return $aRetEval;
    }

   
}

3. cleared dolphin cache and - HOLY SMOKES, it worked - lol.

caredesign.net
Quote · 13 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.