vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - Additional Notification Alert [jQuery] (https://vborg.vbsupport.ru/showthread.php?t=262940)

boydy 04-30-2011 10:00 PM

Additional Notification Alert [jQuery]
 
1 Attachment(s)
Hi guys,

This mod/hack started off as a PM notification but after some requests i've extended it for all notifications and thrown in some jQuery just to make things smooth and look good :)

Anyway on to the mod itself, when a user recieves a notification a red bar will show at the top of the forum telling the user they have a notification and there is a clickable link which will extend the red box using jQuery giving the user links to specific notifications. 2 Demo gif's i've made here to help people understand, the actual jQuery animation isn't shown in the gif's but i've made it clear what it does,

DEMO 1 - Notification Alert (Extension Closed)
DEMO 2 - Notification Alert (Extension Open)

(Ignore the image movement, just an un-even cut lol)

=|= Install =|=

- Download and unzip attached file.
- Upload contents of the UPLOAD folder to the forum root.

Open Template - header

Add at Top -

Code:

<!-- Notification Alert -->
<style type="text/css">
.alert {
    background-color:#F00;
    width:100%;
    height:30px;
    color:#fff;
    font-size:14px;
    display:block;
}
.alert p {
    padding:5px;
}
.alert a {
    color:#ccc;
    text-decoration:none;
}
.alert a:hover {
    color:#fff;
    text-decoration:underline;
}
#slidealert {
    display: none;
    height:auto;
    padding-bottom:5px;
    background-color: #F00;
}
#slidealert a {
    text-decoration:none;
    color:#CCC;
    padding:5px;
}
#slidealert a:hover {
    text-decoration:underline;
    color:#fff;
}
</style>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function ShowHide(){
$("#slidealert").animate({"height": "toggle"}, { duration: 1000 });
}
//]]>
</script>
<vb:if condition="$notifications_total">
<div class="alert">
<p><span style="text-decoration:blink; font-weight:bold;">ATTENTION! {vb:raw bbuserinfo.username}</span> You've got {vb:raw notifications_total} new notification(s), click <a onclick="ShowHide(); return false;" href="#">here</a> to view.</div><div id="slidealert">{vb:raw notifications_menubits}<a onclick="ShowHide(); return false;" href="#">Close</a></div></p>                   
</vb:if>
<!-- Notification Alert End -->

And that's it installed! Any questions or issues just post in here.

Enjoy! And remember to mark as installed for future updates and support!

Boydy

evilTone 05-01-2011 03:51 PM

installed and working fine, thanks

boydy 05-01-2011 04:19 PM

Quote:

Originally Posted by evilTone (Post 2190726)
installed and working fine, thanks

No problem :) Remember and mark as installed to keep up-to-date with future updates.

Juggernaut 05-01-2011 06:11 PM

Installed, and looks very good. :)

goxy63 05-01-2011 10:21 PM

This is great, but with pop-up window regarding to message its bit too much...how to remove pop up window?

boydy 05-02-2011 08:41 AM

Which popup window? There is not popup involved in this mod?

goxy63 05-02-2011 09:26 AM

Quote:

Originally Posted by boydy (Post 2190966)
Which popup window? There is not popup involved in this mod?

Not regarding this mod, there is default pop up (small) window with VB, and together with this notification its bit too much.

boydy 05-02-2011 10:29 AM

Ok mate, i know what you mean, i'll look into it for you.

boydy 05-02-2011 11:38 AM

Quote:

Originally Posted by goxy63 (Post 2190972)
Not regarding this mod, there is default pop up (small) window with VB, and together with this notification its bit too much.

Ok mate, to remove the vbulletin built in notification dropdown do the following,

Open template - header

Find and remove -
Code:

<vb:if condition="$notifications_total">
                                <li class="popupmenu notifications" id="notifications">
                                        <a class="popupctrl" href="usercp.php{vb:raw session.sessionurl_q}">{vb:rawphrase your_notifications}: <span class="notifications-number"><strong>{vb:raw notifications_total}</strong></span></a>
                                        <ul class="popupbody popuphover">
                                                {vb:raw notifications_menubits}
                                        </ul>
                                </li>
                                <vb:else />
                                <li class="popupmenu nonotifications" id="nonotifications">
                                        <a class="popupctrl" href="usercp.php{vb:raw session.sessionurl_q}">{vb:rawphrase your_notifications}</a>
                                        <ul class="popupbody popuphover">
                                                <li>{vb:rawphrase no_new_messages}</li>
                                                <li><a href="private.php{vb:raw session.sessionurl_q}">{vb:rawphrase inbox}</a></li>
                                        </ul>
                                </li>
                                </vb:if>

That's you :)

COL NIL SATIS 05-02-2011 05:41 PM

top man Boydy,will install this now...amazing work

rates 5


All times are GMT. The time now is 12:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01220 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete