
SureshT
Members-
Posts
13 -
Joined
-
Last visited
SureshT's Achievements

Newbie (1/5)
0
Reputation
-
As I said, I was trying it for an open source forum software. When I followed the instructions here and was told that $context could be the issues, the forum software guys told me to try $user_info. I tried all possible combinations. Still no luck.
-
Still no out put displayed for echo.
-
Thank you. Here is the code /* Popup alert notification using Growl Notifications */ function growl_based_notification($mentions) { if (!empty($mentions) > 0) // Say they have unread alerts. echo ' <html ng-app="af_notify" ng-controller="growlCtrl"> <growl-notifications> <growl-notification> Psst ! You have unread notifications <a href="#" ng-click="$growlNotification.remove()"> x</a> </growl-notification> </growl-notifications> </html>'; } growl_based_notification($user_info['mentions']); // call function
-
Used the pass the array method Parse error: syntax error, unexpected 'function' (T_FUNCTION) in .../themes/notify1/index.template.php on line 737 728: 729: growl_based_notification($user_info['mentions']) // call function 730: 731: 732: 733: /** 734: * Very simple and basic template to display a legend explaining the meaning 735: * of some icons used in the messages listing (locked, sticky, etc.) 736: */ 737: function template_basicicons_legend() 738: { 739: global $context, $modSettings, $txt; 740: 741: echo '
-
I am using this code now. Can I ? /* Popup alert notification using Growl Notifications */ function growl_based_notification() { global $context; if (!empty($context['user']['mentions']) > 0) // Say they have unread alerts. echo ' <body ng-app="af_notify" ng-controller="growlCtrl"> <growl-notifications> <growl-notification> Psst ! You have unread notifications </growl-notification> </growl-notifications> </body>'; } var_dump($context); growl_based_notification();
-
This, on top of the page array(25) { ["html_headers"]=> string(80) " " ["user"]=> array(13) { ["id"]=> int(1) ["is_logged"]=> bool(true) ["is_guest"]=> &bool(false) ["is_admin"]=> &bool(true) ["is_mod"]=> &bool(false) ["is_moderator"]=> &bool(false) ["can_mod"]=> bool(true) ["username"]=> string(6) "wizard" ["language"]=> string(7) "english" ["email"]=> string(20) "[email protected]" ["ignoreusers"]=> array(0) { } ["name"]=> string(6) "wizard" ["smiley_set"]=> string( "Sunshine" } ["linktree"]=> array(1) { [0]=> array(2) { ["url"]=> string(35) "http://localhost/elktheme/index.php" ["name"]=> string(11) "Admin Forum" } } ["open_mod_reports"]=> string(1) "0" ["admin_preferences"]=> array(0) { } ["minmax_preferences"]=> array(0) { } ["links"]=> array(0) { } ["javascript_files"]=> array(0) { } ["css_files"]=> array(1) { ["index.css"]=> array(2) { ["filename"]=> string(54) "http://localhost/elktheme/themes/notify1/css/index.css" ["options"]=> array( { ["subdir"]=> string(3) "css" ["extension"]=> string(3) "css" ["index_name"]=> string(9) "css_files" ["debug_index"]=> string(6) "sheets" ["basename"]=> string(9) "index.css" ["local"]=> bool(true) ["dir"]=> string(46) "/opt/lampp/htdocs/elktheme/themes/notify1/css/" ["url"]=> string(40) "http://localhost/elktheme/themes/notify1" } } } ["javascript_inline"]=> array(2) { ["standard"]=> array(0) { } ["defer"]=> array(0) { } } ["javascript_vars"]=> array(0) { } ["menu_separator"]=> string(1) " " ["session_var"]=> string(7) "a583269" ["session_id"]=> string(32) "6690911edfa716ddb2456b5fdf71f5ea" ["forum_name"]=> string(11) "Admin Forum" ["forum_name_html_safe"]=> string(11) "Admin Forum" ["current_action"]=> NULL ["current_subaction"]=> NULL ["can_register"]=> bool(true) ["theme_header_callbacks"]=> array(0) { } ["upper_content_callbacks"]=> array(0) { } ["server"]=> array(9) { ["is_iis"]=> bool(false) ["is_apache"]=> bool(true) ["is_litespeed"]=> bool(false) ["is_lighttpd"]=> bool(false) ["is_nginx"]=> bool(false) ["is_cgi"]=> bool(false) ["is_windows"]=> bool(false) ["iso_case_folding"]=> bool(false) ["needs_login_fix"]=> bool(false) } ["browser_body_id"]=> string(7) "firefox" ["browser"]=> array(9) { ["is_opera"]=> bool(false) ["is_webkit"]=> bool(false) ["is_konqueror"]=> bool(false) ["is_gecko"]=> bool(true) ["is_firefox"]=> bool(true) ["is_firefox41"]=> bool(true) ["is_opera_mini"]=> bool(false) ["is_opera_mobi"]=> bool(false) ["possibly_robot"]=> bool(false) } ["insert_after_template"]=> string(0) "" }
-
I am adding notification bar to alerts of likes and @mentions for a forum software. The code inside echo runs ok if I remove function and if. The home page is loading without the notification. It is just that the condition is not met using the code I am using.
-
My bad. I was not use the calling piece of code.But when I use this, it is still not giving any display of content in echo. PS : Beginner in php, sorry for being noob /* Popup alert notification using Growl Notifications */ function growl_based_notification( $context ) { if ($context['user']['mentions'] > 0) // Say they have unread alerts. echo ' <body ng-app="af_notify" ng-controller="growlCtrl"> <growl-notifications></growl-notifications> <growl-notification> Psst ! You have unread notifications </growl-notification> </body>'; } growl_based_notification($context['user']['mentions']);
-
This is the way I used in the project /* Popup alert notification using Growl Notifications */ function growl_notification( $context ) { if ($context['user']['mentions'] > 0) // Say they have unread alerts. echo ' <body ng-app="af_notify" ng-controller="growlCtrl"> <growl-notifications></growl-notifications> <growl-notification> Psst ! You have unread notifications </growl-notification> </body>'; }
-
Thanks for the reply. But it didn't displayed the output of echo.
-
Hello, I was just wondering how to create a gallery plugin for a forum software similar to the one used on PHP Freaks. Can someone tell me how it can be done conceptually ? Features like promoting thread to gallary, carousel etc. Thanks.
-
I have certain code in Angular which I need to display under certain condtion. The condition, I was told is $context['user']['mentions'] is greater than zero I have written code for a function, use global array, and then if (!empty) to make sure the array condition is not zero. But it seems I need to add something further to this code. I am really new to php and would be happy to have a helping hand. Please find what I have now below function growl_notification() { global $context; if (!empty($context['user']['mentions'])) // Say they have unread alerts. echo ' <body ng-app="af_notify" ng-controller="growlCtrl"> <growl-notifications> <growl-notification> Psst ! You have unread notifications </growl-notification> </growl-notifications> </body>'; }