Xuups
Get an account!     Login

Utilities

Main menu

Who's Online

11 user(s) are online (1 user(s) are browsing Hacks and Tips)

Members: 0
Guests: 11

more...

Get Xoops

Support Xuups Project

Modules :  Hacking Notification System - The hack I love
Tags: notification  
 
This hack is for the notification options to collapse or expand.
Implemented on Xoops 2.0.16 and works great!

1.) Replace the modules/system/templates/system_notification_select.html with the following code:
<{if $xoops_notification.show}>
<
h4 style="text-align:center;">

<
img id="swap" src="<{$xoops_imageurl}>images/plus.gif" onClick="toggle('notifs_form');swapimage('swap');" />

<{
$lang_activenotifications}></h4>

<
form name="notification_select" id="notifs_form" action="<{$xoops_notification.target_page}>" method="post">
<
input type="hidden" name="not_redirect" value="<{$xoops_notification.redirect_script}>" />
<
input type="hidden" name="XOOPS_TOKEN_REQUEST" value="<{php}>echo $GLOBALS['xoopsSecurity']->createToken();<{/php}>" />
<{
$xoops_notification.token}>
<
table class="outer">
  <
tr><th colspan="3"><{$lang_notificationoptions}></th></tr>
  <
tr>
    <
td class="head"><{$lang_category}></td>
    <
td class="head"><input name="allbox" id="allbox" onclick="xoopsCheckAll('notification_select','allbox');" type="checkbox" value="<{$lang_checkall}>" /></td>
    <
td class="head"><{$lang_events}></td>
  </
tr>
  <{foreach 
name=outer item=category from=$xoops_notification.categories}>
  <{foreach 
name=inner item=event from=$category.events}>
  <
tr>
    <{if 
$smarty.foreach.inner.first}>
    <
td class="even" rowspan="<{$smarty.foreach.inner.total}>"><{$category.title}></td>
    <{/if}>
    <
td class="odd">
    <{
counter assign=index}>
    <
input type="hidden" name="not_list[<{$index}>][params]" value="<{$category.name}>,<{$category.itemid}>,<{$event.name}>" />
    <
input type="checkbox" id="not_list_<{$index}>" name="not_list[<{$index}>][status]" value="1" <{if $event.subscribed}>checked="checked"<{/if}> />
    </
td>
    <
td class="odd"><{$event.caption}></td>
  </
tr>
  <{/foreach}>
  <{/foreach}>
  <
tr>
    <
td class="foot" colspan="3"><input class="formbutton" type="submit" name="not_submit" value="<{$lang_updatenow}>" /></td>
  </
tr>
</
table>
<
div align="center">
<{
$lang_notificationmethodis}>:&nbsp;<{$user_method}>&nbsp;&nbsp;[<a href="<{$editprofile_url}>"><{$lang_change}></a>]
</
div>
</
form>
<{/if}>




2.) Add 2 icons of your choice for plus (+) and minus (-) inside the folder themes/yourtheme/images/ If you don't have any folder, create it.

3.) Add the following code at the end of the themes/yourtheme/style.css

#notifs_form {display: none;}


4.) Add the following code just before the
</head>
tag at themes/yourtheme/theme.html

<script type="text/javascript">

function 
toggle(notifs_form
{
obj=document.getElementById(notifs_form);
obj.style.display=!(obj.style.display=="block")? "block" "none";  
}

function 
swapimage(swap)
{
img_plus="<{$xoops_imageurl}>images/plus.gif";
img_minus="<{$xoops_imageurl}>images/minus.gif";
obj=document.getElementById(swap);
obj.src=!(obj.src==img_minus)? img_minus img_plus;  
}

</script>


That's it. Your notification options can now collapse and expand.
Have fun...


Xtreemweb.Net - The One Stop Center For Your Hosting Needs!

Images created using Shutter and Inkscape on a linux Ubuntu 9.04 system.

Click to see original Image in a new window
Author
Themis
Author Themis
News by the same authorMore stories
Author rssAuthor rss
StatisticsStatistics
 
Story
Date 2008/6/1 13:58:49
Views 6122
Favorites 0
Send this Story to a FriendSend
Printer Friendly PagePrint
Create a PDF from the articleCreate a pdf
 
Bookmarks
         
         
         
         
         
     
Recents
Hacking Notification System - The hack I love
Random
Hacking Notification System - The hack I love
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
trabis
Posted: 2008/6/1 14:41  Updated: 2008/6/1 14:41
Moderator
Joined: 2008/4/7
From: Portugal
Posts: 303
 Re: Hacking Notification System - The hack I love
Wow! Thanks for sharing that, I think I have other places were I can use that, It is and effective!
Themis
Posted: 2009/6/16 10:01  Updated: 2009/6/16 10:01
Just popping in
Joined: 2008/6/1
From: Greece
Posts: 12
 Re: Hacking Notification System - The hack I love
Post updated...
(Includes image)
 

Login

Username:

Password:

Remember me



Lost Password?

Register now!

Ajax Search


Advanced Search

Sub menu

Last comments