Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Ajax notification of a new personal message Details »»
Ajax notification of a new personal message
Version: 1.1, by pedigree pedigree is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Category: Private Messages Enhancements - Version: 3.6.5 Rating:
Released: 07-18-2007 Last Update: 07-18-2007 Installs: 61
Uses Plugins Template Edits
Additional Files Is in Beta Stage  
No support by the author.

A small mod that puts a flashing envelope in the top right corner of your screen when you get a new personal message, even if youre sitting idle. You dont have to open / reload any pages to see the notification

My default, it checks once per minute but its configurable in the javascript

PLEASE - Read the instructions, anything in there that is asked here will be ignored or simply a RTFM reply.

Ive tried it with FF2 / IE6 and Opera 9.21. Ive tried it on two forums running 3.6.5 but it should work on 3.6.0-3.6.7

Edit footer template, add this to the very bottom
HTML Code:
<if condition="$bbuserinfo[userid] > 0">
<if condition="$vboptions['ajaxchecknewpmactive']">
<script>
	sessionurl = '$session[sessionurl]';
	checkNewPM()
</script>

<if condition="$vboptions[ajaxchecknewpm_position]=='F'">
<div id="ajaxnewpmdiv" style="
    position:absolute;
    display:none;
    width:32px;height:32px;left:0px;top:0px;
    padding:0px;background:transparent;
    border:0px solid #ffffff"><a href="private.php?$session[sessionurl_q]"><img src="images/newpm.gif" alt="You have a new PM" border="0"></a></div>

<script type="text/javascript"><!--
/* Script by: www.jtricks.com
 * Version: 20060303
 * Latest version:
 * www.jtricks.com/javascript/navigation/floating.html
 */
var target_x = -60;
var target_y = 12;

var has_inner = typeof(window.innerWidth) == 'number';
var has_element = document.documentElement && document.documentElement.clientWidth;

var fm_id='ajaxnewpmdiv';
var floating_menu =
    document.getElementById
    ? document.getElementById(fm_id)
    : document.all
      ? document.all[fm_id]
      : document.layers[fm_id];

var fm_shift_x, fm_shift_y, fm_next_x, fm_next_y;

function move_menu()
{
    if (document.layers)
    {
        floating_menu.left = fm_next_x;
        floating_menu.top = fm_next_y;
    }
    else
    {
        floating_menu.style.left = fm_next_x + 'px';
        floating_menu.style.top = fm_next_y + 'px';
    }
}

function compute_shifts()
{
    fm_shift_x = has_inner
        ? pageXOffset
        : has_element
          ? document.documentElement.scrollLeft
          : document.body.scrollLeft;
    if (target_x < 0)
        fm_shift_x += has_inner
            ? window.innerWidth
            : has_element
              ? document.documentElement.clientWidth
              : document.body.clientWidth;

    fm_shift_y = has_inner
        ? pageYOffset
        : has_element
          ? document.documentElement.scrollTop
          : document.body.scrollTop;
    if (target_y < 0)
        fm_shift_y += has_inner
            ? window.innerHeight
            : has_element
              ? document.documentElement.clientHeight
              : document.body.clientHeight;
}

function float_menu()
{
    var step_x, step_y;

    compute_shifts();

    step_x = (fm_shift_x + target_x - fm_next_x) ;
    if (Math.abs(step_x) < .5)
        step_x = fm_shift_x + target_x - fm_next_x;

    step_y = (fm_shift_y + target_y - fm_next_y) ;
    if (Math.abs(step_y) < .5)
        step_y = fm_shift_y + target_y - fm_next_y;

    if (Math.abs(step_x) > 0 ||
        Math.abs(step_y) > 0)
    {
        fm_next_x += step_x;
        fm_next_y += step_y;
        move_menu();
    }

    setTimeout('float_menu()', 20);
};

compute_shifts();
if (document.layers)
{
    // Netscape 4 cannot perform init move
    // when the page loads.
    fm_next_x = 0;
    fm_next_y = 0;
}
else
{
    fm_next_x = fm_shift_x + target_x;
    fm_next_y = fm_shift_y + target_y;
    move_menu();
}
float_menu();
//--></script>
</if>
</if>
</if>
Edit headerinclude and add this to the bottom
HTML Code:
<script type="text/javascript" src="clientscript/vbulletin_ajax_checknewpm.js"></script>
Edit template navbar

Find this
HTML Code:
<strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
		</div>
		</td>
And below that, add this
HTML Code:
<if condition="$vboptions[ajaxchecknewpm_position]=='N'">
<td class="alt2" valign="top" nowrap="nowrap"><div id="ajaxnewpmdiv" style="
    display:none;
    width:32px;height:32px;left:0px;top:0px;
    padding:0px;background:transparent;
    border:0px solid #ffffff"><a href="private.php?$session[sessionurl_q]"><img src="images/newpm.gif" alt="You have a new PM" border="0"></a></div></td>
</if>
NOTICE : If you have the New PM Notification mod installed (https://vborg.vbsupport.ru/showthread.php?t=124056) you will need to remove it by searching for and deleting this text in the navbar template
HTML Code:
<if condition="$bbuserinfo['pmunread']">
		<td class="alt2" valign="top" nowrap="nowrap">
	<a href="/forum/private.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/newpm.gif" alt="You have a new PM" border="0"></a>
		</td>
	</if>
If you want the floating notifier on a new page load and not the ajax checking, edit the JS file and delete

HTML Code:
setTimeout("checkNewPM()", checkdelay);
Youll need to:
Upload 1 GIF file
Upload 1 Javascript file
Import 1 XML product

Makes 1 plugin hook into misc.php (adds ajaxchecknewpm function)

History 19 July 2007
Version 1.1
  • Bug fix, IE complains when a guest gets a permission denied response when it expects XML. Removed Guests from checking for PMs via Ajax
  • Added options to have the Notification in the navbar as well as floating.

if you have 1.0 installed, youll need to upload the Jaavscript file again, uninstall / reinstall the XML product and make the template changes to footer (not headerinc) and add 1 to navbar

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 04-16-2008, 10:01 PM
pedigree pedigree is offline
 
Join Date: Jul 2005
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah, thats in navbar. Ive got my head deep in an integration of vb and stopforumspam.com but Ill sort them all when Im done
Reply With Quote
  #23  
Old 04-21-2008, 12:38 PM
pedigree pedigree is offline
 
Join Date: Jul 2005
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can place the <DIV>code</div> anywhere you want in the navbar template, or replace the GIF with anything you like
Reply With Quote
  #24  
Old 04-21-2008, 12:40 PM
pedigree pedigree is offline
 
Join Date: Jul 2005
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dancue View Post
Interested here as well.
Also, I'd love for this to go on the left side of the welcome box. In the navbits, I believe?
Is that possible?
Take a screenshot of where you want it to go and put a circle or an arrow and Ill knock something up for you.
Reply With Quote
  #25  
Old 05-01-2008, 12:25 PM
dancue dancue is offline
 
Join Date: Feb 2008
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for the wait.

Hopefully this helps.
Reply With Quote
  #26  
Old 05-24-2008, 11:11 PM
EhsanAhmad's Avatar
EhsanAhmad EhsanAhmad is offline
 
Join Date: May 2008
Location: Pakistan
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed it but it shows up at the top right corner of my forum is there anyway so it appears just beside the your notifications or Private Messages Link ?
Reply With Quote
  #27  
Old 05-26-2008, 02:19 AM
Deepdog009's Avatar
Deepdog009 Deepdog009 is offline
 
Join Date: Dec 2004
Location: Almost out of PHP TZone
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beauts...
Reply With Quote
  #28  
Old 06-05-2008, 02:55 PM
dancue dancue is offline
 
Join Date: Feb 2008
Posts: 569
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pedigree,
Have you figured out how to do what's mentioned in posts #23,24?

I'd really appreciate it!
Reply With Quote
  #29  
Old 06-09-2008, 01:29 PM
pedigree pedigree is offline
 
Join Date: Jul 2005
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dancue, PM me a link to your forum so I can look at the HTML for your template.

Coding around template / theme changes can be a real pain in the a** sometimes. You cant code for every template
Reply With Quote
  #30  
Old 06-09-2008, 01:34 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not make a js file and just link to it? It would save adding so much code to the footer.
Reply With Quote
  #31  
Old 06-09-2008, 01:36 PM
pedigree pedigree is offline
 
Join Date: Jul 2005
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could link to a js file but Ive had other people hot linking to js files on my site before, no thanks. If people want to do that, then they can do that.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:08 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11558 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete