Example #1
0
 function getHomepageInfo($sUser, $sPwd)
 {
     if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
         return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
     }
     $aRet = BxDolXMLRPCUtil::getUserInfo($iId);
     $aRet['unreadLetters'] = new xmlrpcval(getNewLettersNum($iId));
     $aFriendReq = db_arr("SELECT count(*) AS `num` FROM `sys_friend_list` WHERE `Profile` = {$iId} AND  `Check` = '0'");
     $aRet['friendRequests'] = new xmlrpcval($aFriendReq['num']);
     return new xmlrpcval($aRet, "struct");
 }
function HelloMemberSection()
{
    global $logged;
    global $site;
    ob_start();
    if ($logged['member']) {
        $memberID = (int) $_COOKIE['memberID'];
        $iLet = getNewLettersNum($memberID);
        $sNewLet = $iLet > 0 ? '<b>(' . $iLet . ')</b>' : '';
        ?>
                <div class="topMemberBlock">
                        <?php 
        echo get_member_icon($memberID, 'right');
        ?>
                        <div class="hello_member"><?php 
        echo _t('_Hello member', getNickName($memberID));
        ?>
</div>

                        <div class="hello_actions">
                                <span><a href="<?php 
        echo $site['url'];
        ?>
member.php"><?php 
        echo _t('_My account');
        ?>
</a></span>
                                <span><a href="<?php 
        echo $site['url'];
        ?>
mail.php?mode=inbox"><?php 
        echo _t('_My Mail');
        ?>
</a><?php 
        echo ' ' . $sNewLet;
        ?>
</span>
                                <span><a href="<?php 
        echo getProfileLink($memberID);
        ?>
"><?php 
        echo _t('_My Profile');
        ?>
</a></span>
                                <span><a href="javascript:void(0);"
                                  onclick="window.open( '<?php 
        echo $site['url'];
        ?>
presence_pop.php' , 'Presence', 'width=224,height=600,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1');"
                                  ><?php 
        echo _t('_RayPresence');
        ?>
</a></span>
                                <span><a href="<?php 
        echo $site['url'];
        ?>
logout.php?action=member_logout"><?php 
        echo _t('_Log Out2');
        ?>
</a></span>
                        </div>
                </div>
                <?php 
    } elseif ($logged['admin']) {
        ?>
                <div class="topMemberBlock">
						<div class="thumbnail_block" style="float:right;position:relative;">
	                        <img style="width: 45px; height: 45px; background-image: url(<?php 
        echo getTemplateIcon('man_small.gif');
        ?>
);"
							  src="<?php 
        echo getTemplateIcon('spacer.gif');
        ?>
" alt="" />
						</div>
                        <div class="hello_member"><?php 
        echo _t('_Hello member', 'admin');
        ?>
</div>

                        <div class="hello_actions">
                                <span><a href="<?php 
        echo $site['url_admin'];
        ?>
index.php"><?php 
        echo _t('_Admin Panel');
        ?>
</a></span>
                                <span><a href="<?php 
        echo $site['url'];
        ?>
logout.php?action=admin_logout"><?php 
        echo _t('_Log Out2');
        ?>
</a></span>
                        </div>
                </div>
                <?php 
    } else {
        //<a href="<_?= $site['url'] ?_>member.php"><_?= _t( '_Member Login' ) ?_></a>
        ?>
                <div class="topMemberBlock">
                        <div class="no_hello_actions">
                                <a href="<?php 
        echo $site['url'];
        ?>
join.php"><?php 
        echo _t('_Join Now Top');
        ?>
</a>
                                <a href="<?php 
        echo $site['url'];
        ?>
member.php" onclick="showItemEditForm('login_div'); $( '#login_div' ).show().load( '<?php 
        echo $site['url'];
        ?>
member.php?action=show_login_form&relocate=' + encodeURIComponent( window.location )  );return false;"><?php 
        echo _t('_Member Login');
        ?>
</a>
                        </div>
                </div>
                <?php 
    }
    return ob_get_clean();
}