php help

I am trying to modify a joomla component but I have little to no knowledge in php, however i do try to figure thing out with a little reading. However I can seem to get this done, my problem is this code below

[code]




  • <?php if( $newEventInviteCount ) { ?>
    <?php echo $newEventInviteCount; ?>
    <?php } ?>

  • 				<li>
    					<a href="<?php echo CRoute::_( 'index.php?option=com_community&view=friends&task=pending' );?>" onclick="joms.notifications.showRequest();return false;" title="<?php echo JText::_( 'COM_COMMUNITY_NOTIFICATIONS_INVITE_FRIENDS' );?>">
    						<i class="js-icon-users"></i>
    						<?php if( $newFriendInviteCount ){ ?><span class="js-counter"><?php echo $newFriendInviteCount; ?></span><?php } ?>
    					</a>
    				</li>
    
    				<li>
    					<a href="<?php echo CRoute::_( 'index.php?option=com_community&view=inbox' );?>"  onclick="joms.notifications.showInbox();return false;" title="<?php echo JText::_( 'COM_COMMUNITY_NOTIFICATIONS_INBOX' );?>">
    						<i class="js-icon-chat"></i>
    						<?php if( $newMessageCount ){ ?><span class="js-counter"><?php echo $newMessageCount; ?></span><?php } ?>
    					</a>
    				</li>[/code]
    

    so every time i use it i get these errors below

    Notice: Undefined variable: $newEventInviteCount
    Notice: Undefined variable: $newFriendInviteCount
    Notice: Undefined variable: $newMessageCount

    With my little knowledge I know i need to define those variables but I don’t know where and how.

    [php]if(isset($newEventInviteCount))

    if(isset($newFriendInviteCount))

    if(isset($newMessageCount))[/php]

    Sponsor our Newsletter | Privacy Policy | Terms of Service