How can i edit your coding in PHP - Text / Images

    • 68 posts
    July 26, 2018 12:07 PM EDT

    Hey,

    i am facing the issue that i need to resolve.

    can you please let me know that how can i edit TEXT in you PHP coding. sample of code is added here

     

    if($('notifications_markread_link_main')){ $('notifications_markread_link_main').addEvent('click', function() { $('notifications_markread_main').setStyle('display', 'none'); en4.activity.hideNotifications('<?php echo $this->translate("0 Updates");?>'); }); }

     

    in this code i want to replace 0 updates with a small 48 x 48 icon

    how can i do this

    see the image :

     

    when users click on mark all updates as read the icon hide and show this text 0 updates. i want to show icon as your default theme is show as and same code is placed here.

     

    how can i do this if replace 0 update text with img src = noti . or i class=:fa fa icon , not working the format i need it


    This post was edited by socialenginestaff at July 27, 2018 4:23 AM EDT
    • Moderator
    • 6923 posts
    July 27, 2018 4:25 AM EDT

    Please note that our forum posting rules mention that you need to use code tags when posting code. To do that, the instructions show to use the code tag icon that is next to the smiley. We normally delete posts without the code tags. I edited yours to add the tags. The 0 updates should already have an icon for it if that is the notifications. You can see it here in this community or at the demo. Did you change the theme?

    • 68 posts
    July 27, 2018 6:00 AM EDT
    Donna said:

    Please note that our forum posting rules mention that you need to use code tags when posting code. To do that, the instructions show to use the code tag icon that is next to the smiley. We normally delete posts without the code tags. I edited yours to add the tags. The 0 updates should already have an icon for it if that is the notifications. You can see it here in this community or at the demo. Did you change the theme?

    Hey, thanks for respond me & sorry for this mistake

    well, we develop this theme by using the various code of your default theme

    i think we missed the code by implementable because this notification is working on member home page but when we goto all notification page this show me 0 updates and this issue is on header file

    i want to show you my header all code to you and let me know where i made a mistake.

    send i want to show separate message icon as your default image let me know how can i do that

     

    <!-- START - Notifications Box --> <li class="updates_pulldown icon_type_pulldown" id="core_menu_mini_menu_update" > <a href="javascript:void(0);" id="updates_toggle" <?php if( $this->notificationCount ):?> class="new_updates"<?php endif;?> title="<?php echo $this->translate('Notifications') ?>"> <span class="pulldown_toggle_icon updates_toggle_icon"></span><span id="updates_span"><?php echo $this->notificationCount; ?></span> </a> <div class="pulldown_contents_wrapper" id="pulldown_updates_wrapper"> <div class="pulldown_contents"> <strong class="font-size:15px">   <?php echo $this->translate("My Notifications") ?><a href="javascript:void(0);" class="toggle_closer">×</a></strong> <ul class="notifications_menu" id="notifications_menu"> <div class="notifications_loading" id="notifications_loading"> <img src='<?php echo $this->layout()->staticBaseUrl ?>application/modules/Core/externals/images/loading.gif' style='float:left; margin-right: 5px;' /> <?php echo $this->translate("Loading ...") ?> </div> </ul> </div> <div class="pulldown_options"> <?php echo $this->htmlLink(array('route' => 'default', 'module' => 'activity', 'controller' => 'notifications'), $this->translate('View All Updates'), array('id' => 'notifications_viewall_link')) ?> <?php echo $this->htmlLink('javascript:void(0);', $this->translate('Mark All Read'), array( 'id' => 'notifications_markread_link', )) ?> </div> </div> </li>

     

    in this above code how can i place message notification icon before pulldown box

    <?php ?> <script type="text/javascript"> var notificationPageCount = <?php echo sprintf('%d', $this->notifications->count()); ?>; var notificationPage = <?php echo sprintf('%d', $this->notifications->getCurrentPageNumber()); ?>; var loadMoreNotifications = function() { notificationPage++; new Request.HTML({ 'url' : en4.core.baseUrl + 'activity/notifications/pulldown', 'data' : { 'format' : 'html', 'page' : notificationPage }, 'onComplete' : function(responseTree, responseElements, responseHTML, responseJavaScript) { $('notifications_loading_main').setStyle('display', 'none'); if( '' != responseHTML.trim() && notificationPageCount > notificationPage ) { $('notifications_viewmore').setStyle('display', ''); } $('notifications_main').innerHTML += responseHTML; } }).send(); }; en4.core.runonce.add(function(){ if($('notifications_viewmore_link')){ $('notifications_viewmore_link').addEvent('click', function() { $('notifications_viewmore').setStyle('display', 'none'); $('notifications_loading_main').setStyle('display', ''); loadMoreNotifications(); }); } if($('notifications_markread_link_main')){ $('notifications_markread_link_main').addEvent('click', function() { $('notifications_markread_main').setStyle('display', 'none'); en4.activity.hideNotifications('<?php echo $this->translate("0 Updates");?>'); }); } $('notifications_main').addEvent('click', function(event){ event.stop(); //Prevents the browser from following the link. var current_link = event.target; var notification_li = $(current_link).getParent('li'); if(current_link.get('href')){ en4.core.request.send(new Request.JSON({ url : en4.core.baseUrl + 'activity/notifications/markread', data : { format : 'json', 'actionid' : notification_li.get('value') }, onSuccess : window.location = current_link.get('href') })); } }); }); </script> <div class='notifications_layout'> <div class='notifications_leftside'> <h3 class="sep"> <span><?php echo $this->translate("Recent Updates") ?></span> </h3> <ul class='notifications' id="notifications_main"> <?php if( $this->notifications->getTotalItemCount() > 0 ): ?> <?php foreach( $this->notifications as $notification ): ob_start(); try { ?> <li<?php if( !$notification->read ): ?> class="notifications_unread"<?php $this->hasunread = true; ?> <?php endif; ?> value="<?php echo $notification->getIdentity();?>"> <?php // removed onclick event onclick="javascript:en4.activity.markRead($notification->getIdentity() ?> <span class="notification_item_general notification_type_<?php echo $notification->type ?>"> <?php echo $notification->__toString(), $this->translate(' Posted %1$s', $this->timestamp($notification->date)) ?> </span> </li> <?php } catch( Exception $e ) { ob_end_clean(); if( APPLICATION_ENV === 'development' ) { echo $e->__toString(); } continue; } ob_end_flush(); endforeach; ?> <?php else: ?> <li> <?php echo $this->translate("You have no notifications.") ?> </li> <?php endif; ?> </ul> <div class="notifications_options"> <?php if( $this->hasunread ): ?> <div class="notifications_markread" id="notifications_markread_main"> <?php echo $this->htmlLink('javascript:void(0);', $this->translate('Mark All Read'), array( 'id' => 'notifications_markread_link_main', 'class' => 'buttonlink notifications_markread_link' )) ?> </div> <?php endif; ?> <?php if( $this->notifications->getTotalItemCount() > 10 ): ?> <div class="notifications_viewmore" id="notifications_viewmore"> <?php echo $this->htmlLink('javascript:void(0);', $this->translate('View More'), array( 'id' => 'notifications_viewmore_link', 'class' => 'buttonlink icon_viewmore' )) ?> </div> <?php endif; ?> <div class="notifications_viewmore" id="notifications_loading_main" style="display: none;"> <i class="fa fa-spinner fa-spin" style=' margin-right: 5px;'></i> <?php echo $this->translate("Loading ...") ?> </div> </div> </div> <div class='notifications_rightside'> <h3 class="sep"> <?php $itemCount = $this->requests->getTotalItemCount(); ?> <span><?php echo $this->translate(array("My Request (%d)","My Requests (%d)", $itemCount), $itemCount) ?></span> </h3> <ul class='requests'> <?php if( $this->requests->getTotalItemCount() > 0 ): ?> <?php foreach( $this->requests as $notification ): ?> <?php try { $parts = explode('.', $notification->getTypeInfo()->handler); echo $this->action($parts[2], $parts[1], $parts[0], array('notification' => $notification)); } catch( Exception $e ) { if( APPLICATION_ENV === 'development' ) { echo $e->__toString(); } continue; } ?> <?php endforeach; ?> <?php else: ?> <li> <?php echo $this->translate("You have no requests.") ?> </li> <?php endif; ?> </ul> </div> </div>

    the above code is for http ... activity/notifications

    page where i am facing this issue when click on mark all read

     

    Thanks, and i ma very thank full to you if you help me to resolve this issue 

    Regards

    • Moderator
    • 6923 posts
    July 27, 2018 11:18 AM EDT

    If you cloned the theme per the tutorials, the code should be there. Is it missing or did you make your theme from scratch? I'm not 100% sure what you are missing atm. 

    • 68 posts
    July 27, 2018 1:26 PM EDT
    Donna said:

    If you cloned the theme per the tutorials, the code should be there. Is it missing or did you make your theme from scratch? I'm not 100% sure what you are missing atm. 

    we made this theme from scratch & various things maybe we missed at the time of designing.

    can you please give me individual code of these things

    means how can i add code in text like i want to replace 0 UPDATES and place a code of IMG or ICON

    2nd, i want to show a ICON of separate message so, the display of icon is not difficult for us but the notification on it like numbers is our main TASK and we are not finding this proper code in your default theme because these thing are linked with your MINI MENU with TRUE & FALSE condition.

    Regards

    • 68 posts
    July 28, 2018 2:38 AM EDT

    hey,

    i am waiting for your respond if you let me know about how can i place code/php/css/html/js/etc on TRANSLATE file it is easy for us to resolve many issue

    mean to say this: 

    <?php echo $this->translate("0 Updates");?>
    • Moderator
    • 6923 posts
    July 30, 2018 9:08 AM EDT

     I don't have an answer at this time other than the one above about using the normal method to do your theme, by cloning default. The best advice I can give right now is to check the current code and do the same in your theme. I would need to investigate more in order to find another solution but at this time, I am not having enough time to dig into code as we normally do not provide customization assistance. It is normally something I do in my spare time. I haven't had much of that lately as it's taken me two weeks to get over a virus. Sorry for the lack of an answer.


    This post was edited by socialenginestaff at July 30, 2018 11:20 AM EDT
    • 68 posts
    July 30, 2018 12:51 PM EDT
    Donna said:

     I don't have an answer at this time other than the one above about using the normal method to do your theme, by cloning default. The best advice I can give right now is to check the current code and do the same in your theme. I would need to investigate more in order to find another solution but at this time, I am not having enough time to dig into code as we normally do not provide customization assistance. It is normally something I do in my spare time. I haven't had much of that lately as it's taken me two weeks to get over a virus. Sorry for the lack of an answer.

     

    no problem i will take a look by myself. if i need any help than let you know.