rejetto forum

Sending messages to the server via {.notify.}

0 Members and 1 Guest are viewing this topic.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Hi !  ;)

As rejetto added the ability to send notifications (tray baloons), I have incorporated this feature into the template of beta #266 #267.

If you want to try, the template is attached below of this message.

When you load the template, a Group named #notifications# will be created ... you need only include users of your choice into this group for enable them to send messages.






Updated template at August 31, 2010:

I took the opportunity to implement the possibility of sending an audio event at the same time as the written notification.

So when you load a template, are created two groups: #notifications# and #playsounds#  
You associate users allowed to send notifications to the server, into the group #notifications#, and into the group #playsounds# those which you also allowed the right to send sound events.

Note: #playsounds# is not independent, it's part of the notification form, dealing with sound event.
The group #playsounds# can be enabled or disabled only for authorized users in the group #notifications#, it can not be used alone.

« Last Edit: August 31, 2010, 08:48:29 PM by SilentPliz »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
very nice idea SP!
i think you should publish it as a diff tpl, or people will
- go crazy trying to stay up to date
- not update at all, maybe even without knowing it
:)


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
i think you should publish it as a diff tpl, or people will
- go crazy trying to stay up to date
- not update at all, maybe even without knowing it
:)

It's done! ;)

Notifications (Diff template release).

For use in folder(s) (or sub-folder(s)) of your choice.

1. Use a recent beta version of HFS (2.3 #266 at time of writing)

2. Create a folder that you name for example: Notifications (add it to the VFS)
  - Right-click on this folder > Properties... > Give Access permission to all users that you want.
  - Paste in the Diff template tab the "code" below, and save the Virtual File System:
 
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>{.!Notifications to the Server.}</title>
<link rel="stylesheet" href="/?mode=section&id=style.css" type="text/css">
<link rel="shortcut icon" href="/favicon.ico">
</head>

<body>
  <br />
<div style="margin-top:1em; margin-left:2em; max-width:400px;">
{.if|{.#notifications#.}|{:
  <br />
&nbsp;<font size=4>{.!Notifications to the Server.}</font>   
<form method='post' id='notifications'>
  :}.}
 <fieldset>
 {.if|{.#notifications#.}|{:
  <br />
{.repeat|20|&nbsp;.}<i><b>{.!Notification title.}{.!:.}</b></i>
  <br /> 
{.repeat|20|&nbsp;.}<input type='text' name='notifytitle'onMouseOver="this.focus();" style="background-color:#fff; border:2px solid #AB9F82; width:230px;">
  <br />
  <br />
{.repeat|20|&nbsp;.}<i><b>{.!Notification text.}{.!:.}</b></i>
  <br />
{.repeat|20|&nbsp;.}<textarea name="notifytext" wrap="soft" onMouseOver="this.focus();" style="width:230px; height:120px; background-color:#fff; border:2px solid #AB9F82;"></textarea>
  <br />
{.repeat|20|&nbsp;.}<b><SELECT name="type" style="background-color:#fff; border:2px solid #AB9F82; width:117px;">
<OPTION VALUE="none">{.!icon (none).}</OPTION>
<OPTION VALUE="error">{.!error.}</OPTION>
<OPTION VALUE="info">{.!info.}</OPTION>
<OPTION VALUE="warning">{.!warning.}</OPTION>
</b>
</SELECT>
<input type='text' name='timeout' value="{.! timeout.}" onclick="if(this.value=='{.! timeout.}')this.value=''" style="background-color:#fff; border:2px solid #AB9F82; width:109px;">
  <br />
 {.if|{.#playsounds#.}|{:
  <br />
{.repeat|20|&nbsp;.}<i><b>{.!Playing a sound event.}{.!:.}</b></i>
  <br />
{.repeat|20|&nbsp;.}<b><SELECT name="play" style="background-color:#fff; border:2px solid #AB9F82; width:234px;">
<OPTION VALUE="">{.!Sound event (none).}</OPTION>
<OPTION VALUE="CriticalBatteryAlarm">{.!Critical Battery Alarm.}</OPTION>
<OPTION VALUE="Close">{.!Close.}</OPTION>
<OPTION VALUE="DeviceConnect">{.!Device Connect.}</OPTION>
<OPTION VALUE="DeviceFail">{.!Device Fail.}</OPTION>
<OPTION VALUE="EmptyRecycleBin">{.!Empty Recycle Bin.}</OPTION>
<OPTION VALUE="InternetAlert">{.!Internet Alert.}</OPTION>
<OPTION VALUE="MailBeep">{.!Mail Beep.}</OPTION>
<OPTION VALUE="Open">{.!Open.}</OPTION>
<OPTION VALUE="SystemExclamation">{.!System Exclamation.}</OPTION>
<OPTION VALUE="SystemExit">{.!System Exit.}</OPTION>
<OPTION VALUE="SystemQuestion">{.!System Question.}</OPTION>
<OPTION VALUE="SystemStart">{.!System Start.}</OPTION>
</b>
</SELECT>
  <br />
:}.}
  <br />
{.repeat|20|&nbsp;.}<input type='submit' name='notify' value="{.!Notify.}">
  <br />
  <br /> 
</form>
</fieldset>
{.repeat|21|&nbsp;.}<a href=".."><img src="/~img14"> {.!Up.}</a>
</div>
</body>
:}.}
 {.if not|{.#notifications#.}|{:
<font size=4><center><img src="/~img11"> {.!You are not authorized to access at this feature.}. <br />{.!Please, contact the site administrator.}.</center></font>
</fieldset>
{.repeat|30|&nbsp;.}<a href=".."><img src="/~img14"> {.!Up.}</a>
</div>
</body>
:}.}
</html>

[+special:begin]

{.$special:forms.}

[special:forms]

{.if|{.#notifications#.}|{:
{.if|{.filename|{.postvar|notify.}.}|{:{.notify|{.force ansi|%user%{.!:.}
{.postvar|notifytext.}.}|title={.force ansi|{.postvar|notifytitle.}.}  [%time%]|type={.postvar|type.}|timeout={.postvar|timeout.}.}
{.add to log|.
{.force ansi|{.!*Begin Notification*.}.}  [%time%]

{.force ansi|%user%.}{.!:.}
::. {.force ansi|{.postvar|notifytitle.}.} .::
{.force ansi|{.postvar|notifytext.}.}

{.force ansi|{.!*End Notification*.}.}.}
{.if|{.#playsounds#.}|
{.play|{.postvar|play.}.}.}
:}.}:}.}

[+special:alias|private]
#notifications#={.member of|#notifications#.}
#playsounds#={.member of|#playsounds#.}

[* Pour les utilisateurs Français : Veuillez remplacer le symbole - par le symbole + dans la section [-special:strings] ci-dessous, pour utiliser cette fonctionnalité en français *]

[-special:strings]
 timeout= Dur&eacute;e
icon (none)=Aucune ic&ocirc;ne
Error=Erreur
warning=Alerte
info=Information
:= :
Critical Battery Alarm=Alarme critique
Close=Fermer
Device Connect=Connexion
Device Fail=Echec de la connexion
Empty Recycle Bin=Corbeille vid&eacute;e
Internet Alert=Alarme internet
Mail Beep=Mail entrant
Open=Ouvrir
System Exclamation=Exclamation
System Exit=Quitter
System Question=Question
System Start=D&ecute;marrage syst&egrave;me
Sound event (none)=Aucun &eacute;v&egrave;nement sonore
Notifications to the Server=Notifications vers le serveur
Playing a sound event=Jouer un &eacute;v&egrave;nement sonore
Sound event (none)=Aucun &eacute;v&egrave;nement sonore
Notification title=Titre de la notification
Notify=Envoyer la notification
Notification text=Texte de la notification
Up=Retour
You are not authorized to access at this feature=Vous n'&ecirc;tes pas autoris&eacute; &agrave; acc&eacute;der &agrave; cette fonctionnalit&eacute;
Please, contact the site administrator=Veuillez contacter l'administrateur du site
*Begin Notification*=*Début de la Notification*
*End Notification*=*Fin de la Notification*

 
3. Create two groups named:

#notifications#
#playsounds#


4. Bind the User Accounts of your choice with the #notifications# group, and optionally, with the group #playsounds#, depending on what you want to allow.
  - Validate and save options

Now, users can to send notifications to the server admin.

Note:
If you use this "diff template" with a main template different from the one provided by default with the "266" ... it will work, but you will have probably to correct the appearance of the diff template to match with your main template.


Pour les utilisateurs Français : Veuillez remplacer le symbole - par le symbole + dans la section [-special:strings] du "diff template", pour utiliser cette fonctionnalité en français.
Ou vous pouvez utiliser la version "françisée" de HFS, qui inclue cette fonctionnalité de manière plus directe.
« Last Edit: April 03, 2019, 10:18:36 PM by SilentPliz »


Offline CivicScootin

  • Occasional poster
  • *
    • Posts: 37
    • View Profile
Confirmed working just fine on the new RAWR 0.1.3 Template..

Thank you Silent..
Just what I needed for my fellow mods on my site..

1 question however..
Is the notification logged in anyway?..
If so where would it be located in case Im away from my server at the time of the message..
Then when I return I can see what has been sent via {.notify.}~
« Last Edit: August 24, 2010, 07:02:39 PM by CivicScootin »


Offline r][m

  • Tireless poster
  • ****
    • Posts: 347
    • View Profile
@ SilentPliz
I'm running HFS on older computer used as network attached storage.
{.notify.} doesn't seem to work here.
Could it be operating system?


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
@ SilentPliz
I'm running HFS on older computer used as network attached storage.
{.notify.} doesn't seem to work here.
Could it be operating system?


It's possible, or maybe the "balloons" notifications are disabled on your OS.

Which version of Windows you use on this "older computer"?
« Last Edit: August 24, 2010, 08:10:15 PM by SilentPliz »


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
1 question however..
If so where would it be located in case Im away from my server at the time of the message..
Then when I return I can see what has been sent via {.notify.}~

The easiest way (for me ;) ) is to use {.add to log.}

Replace this code:

Code: [Select]
{.if|{.#notifications#.}|{:
{.if|{.filename|{.postvar|notify.}.}|{:
{.notify|{.force ansi|%user%{.!:.}
{.postvar|notifytext.}.}|title={.force ansi|{.postvar|notifytitle.}.}  [%time%]|type={.postvar|type.}|timeout={.postvar|timeout.}.}
{.if|{.#playsounds#.}|
{.play|{.postvar|play.}.}.}
:}.}:}.}

By this code:

Code: [Select]
{.if|{.#notifications#.}|{:
{.if|{.filename|{.postvar|notify.}.}|{:{.notify|{.force ansi|%user%{.!:.}
{.postvar|notifytext.}.}|title={.force ansi|{.postvar|notifytitle.}.}  [%time%]|type={.postvar|type.}|timeout={.postvar|timeout.}.}
{.add to log|.
{.force ansi|{.!*Begin Notification*.}.}  [%time%]

{.force ansi|%user%.}{.!:.}
::. {.force ansi|{.postvar|notifytitle.}.} .::
{.force ansi|{.postvar|notifytext.}.}

{.force ansi|{.!*End Notification*.}.}.}
{.if|{.#playsounds#.}|
{.play|{.postvar|play.}.}.}
:}.}:}.}

You will just search in the log: Begin Notification

Edit:
I changed the code of yesterday, it's more easier ... you can copy it entirely.
« Last Edit: August 30, 2010, 01:38:38 PM by SilentPliz »


Offline CivicScootin

  • Occasional poster
  • *
    • Posts: 37
    • View Profile

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile

Offline BiGBOSS

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
ok..im new to this..
how do we import this in our template again? =_=


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
i think instructions given in the 3rd post are quite clear
http://www.rejetto.com/forum/index.php/topic,9000.msg1051769.html#msg1051769
if you think they aren't, you should specify what part.


Offline Fysack

  • Tireless poster
  • ****
    • Posts: 598
  • present picture
    • View Profile
    • Admin
wow..! f... that html course i took back in the 90`s  ::)
GOD CAN READ YOUR MIND