MyBB Community Forums

Full Version: Creating Notifications for PMs and Profile Comments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
thanks here is what i made from this tutorial. [Image: OF0VE.png]

[Image: h0SOY.png]
Is there any way to add notifications for subscribed threads?
(2012-05-23, 09:23 AM)Maj Wrote: [ -> ]Is there any way to add notifications for subscribed threads?

+ 1 maybe a plugin?
Would definitely have to be a plugin, but euantor is working on one so no problem there.
can this work like this..
when the number klik it's show a popup menu and we can choice PMs or Profile Comments?
Any way to integrate it to the Euantor Plugin?
Thats what mine looks like.. but yours still show private message.. and i can't figure out how to make it be beside the private messaging spot..

im fairly new with mybb edits..

<span style="float:right;">{$lang->welcome_current_time}</span>
		{$lang->welcome_back} <a href="{$mybb->settings['bburl']}/private.php" id="pm_notification">{$mybb->user['pms_unread']}</a> (<a href="{$mybb->settings['bburl']}/usercp.php"><strong>{$lang->welcome_usercp}</strong></a>{$modcplink}{$admincplink} &mdash; <a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}">{$lang->welcome_logout}</a>)<br />
				<span class="links">
					<a href="#" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/misc.php?action=buddypopup', 'buddyList', 350, 350);">{$lang->welcome_open_buddy_list}</a>
				</span>
				<a href="{$mybb->settings['bburl']}/search.php?action=getnew">{$lang->welcome_newposts}</a> | <a href="{$mybb->settings['bburl']}/search.php?action=getdaily">{$lang->welcome_todaysposts}</a> | <a href="search.php?action=finduserthreads&uid={$mybb->user['uid']}">View Your Threads</a> | <a href="search.php?action=finduser&uid={$mybb->user['uid']}">View Your Posts</a> | <span id="pm_link"><a href="{$mybb->settings['bburl']}/private.php"></a></span>
<span id="pm_link">


<script type="text/javascript">
jQuery.noConflict()
jQuery(function($) {
var pmcontents = parseInt("{$mybb->user['pms_unread']}");
var pc_string = "{$lang->profile_comments_new_inmenu_count}";
var pc_count = parseInt(pc_string.slice(1, -1));
    if(isNaN(pc_count)) {
        var pc_count = 0;
    }
var total_count = pmcontents + pc_count;
    if(pmcontents == 0) {
        $("#pm_link").show();
    }
    else {
        $("#pm_link").hide();
    }

    if(total_count == 0){
        $("#pm_notification").hide();
    } 
    else { 
        $("#pm_notification").replaceWith("<a href=\"{$mybb->settings['bburl']}/private.php\" id=\"pm_notification\" title=\"{$mybb->user['pms_unread']} PMs, "+pc_count+" Profile Comments\">"+total_count+"</a>"); 
    };
});
</script>

so can you help me?
(2012-07-23, 02:27 AM)bekti Wrote: [ -> ]can this work like this..
when the number klik it's show a popup menu and we can choice PMs or Profile Comments?

It's certainly possible, just takes some work. I can't currently do it atm but if I figure something out I'll let you know. Smile

(2012-07-28, 12:46 AM)alv4 Wrote: [ -> ]Any way to integrate it to the Euantor Plugin?

No idea, but seeing as I'll be working with Euantor's plugin very soon I'll be sure to post here saying.

(2012-08-07, 11:31 AM)MichaudĀ© Wrote: [ -> ]Thats what mine looks like.. but yours still show private message.. and i can't figure out how to make it be beside the private messaging spot..

im fairly new with mybb edits..

<span style="float:right;">{$lang->welcome_current_time}</span>
		{$lang->welcome_back} <a href="{$mybb->settings['bburl']}/private.php" id="pm_notification">{$mybb->user['pms_unread']}</a> (<a href="{$mybb->settings['bburl']}/usercp.php"><strong>{$lang->welcome_usercp}</strong></a>{$modcplink}{$admincplink} &mdash; <a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;logoutkey={$mybb->user['logoutkey']}">{$lang->welcome_logout}</a>)<br />
				<span class="links">
					<a href="#" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/misc.php?action=buddypopup', 'buddyList', 350, 350);">{$lang->welcome_open_buddy_list}</a>
				</span>
				<a href="{$mybb->settings['bburl']}/search.php?action=getnew">{$lang->welcome_newposts}</a> | <a href="{$mybb->settings['bburl']}/search.php?action=getdaily">{$lang->welcome_todaysposts}</a> | <a href="search.php?action=finduserthreads&uid={$mybb->user['uid']}">View Your Threads</a> | <a href="search.php?action=finduser&uid={$mybb->user['uid']}">View Your Posts</a> | <span id="pm_link"><a href="{$mybb->settings['bburl']}/private.php"></a></span>
<span id="pm_link">


<script type="text/javascript">
jQuery.noConflict()
jQuery(function($) {
var pmcontents = parseInt("{$mybb->user['pms_unread']}");
var pc_string = "{$lang->profile_comments_new_inmenu_count}";
var pc_count = parseInt(pc_string.slice(1, -1));
    if(isNaN(pc_count)) {
        var pc_count = 0;
    }
var total_count = pmcontents + pc_count;
    if(pmcontents == 0) {
        $("#pm_link").show();
    }
    else {
        $("#pm_link").hide();
    }

    if(total_count == 0){
        $("#pm_notification").hide();
    } 
    else { 
        $("#pm_notification").replaceWith("<a href=\"{$mybb->settings['bburl']}/private.php\" id=\"pm_notification\" title=\"{$mybb->user['pms_unread']} PMs, "+pc_count+" Profile Comments\">"+total_count+"</a>"); 
    };
});
</script>

so can you help me?

Hiding the PM message is part of the tutorial. xD But if you want to move the notification, just move this part around and see where you like it:

<a href="{$mybb->settings['bburl']}/private.php" id="pm_notification">{$mybb->user['pms_unread']}</a>
You should adjust your jquery code so it sends the user to his profile when there is only a visitor message and NO pm. Sending them to the private.php is nonsense in that case.

Here is mine (I use different classes / id's!):

<script type="text/javascript">
 jQuery.noConflict()
 jQuery(function($) {
 var pmcontents = parseInt("{$mybb->user['pms_unread']}");
 var pc_string = "{$lang->profile_comments_new_inmenu_count}";
 var pc_count = parseInt(pc_string.slice(1, -1));
     if(isNaN(pc_count)) {
         var pc_count = 0;
     }
 var total_count = pmcontents + pc_count;
     if(pmcontents == 0) {
         $(".pms_unread").show();
     }
     else {
         $(".pms_unread").hide();
     }
     if(total_count == 0){
         $(".pms_unread").hide();
     } 
     else if(pc_count > 0){ 
         $(".pms_unread").replaceWith("<a href=\"{$mybb->settings['bburl']}/member.php?action=profile&uid={$mybb->user['uid']}\" class=\"pms_unread\" title=\"{$mybb->user['pms_unread']} PMs, "+pc_count+" Profile Comments\">"+total_count+"</a>"); 
     }
     else { 
         $(".pms_unread").replaceWith("<a href=\"{$mybb->settings['bburl']}/private.php\" class=\"pms_unread\" title=\"{$mybb->user['pms_unread']} PMs, "+pc_count+" Profile Comments\">"+total_count+"</a>"); 
     };
 });
 </script>
Thanks Smile
Pages: 1 2 3