Seite 1 von 3

Messaging Notification

Verfasst: 21.08.2002 18:19
von Sekey
I received a PM requesting this mod. It's very similar to my "New message(s) sound, blink/marquee" mod except that this mod will play random sounds from the audio folder you specify.

########################################################
## Mod Title: New PM(s) Random-Sound, blink/marquee
## Mod Version: 1.0.4
## Author: Bill Beardslee < webmaster@webxtractions.com >
##
## Tested: RC2 and Latest CVS
##
## Description: This mod will show the word "new" in the links
## section of the header either blinking or as a marquee for
## new message(s) along with random new message sounds such as:
## .wav, .mid, .au, etc. formats.
## [It's already set up for (.wav, .mid and .au)]
##
## Installation Level: (easy)
## Installation Time: 2-5 Minutes
## Files To Edit: 3 - functions.php, lang_main.php and *.css
## Included Files: 1 - (anim_messages.zip)
##
## Get this mod as a text file and 10 compressed .wav files at:
## http://webxtractions.com/downloads/anim_messages.zip (83kb)
##
########################################################
##
## Installation Notes:
##
## /lang_XXX/ = Your default language
##
## Create a folder for your audio files.
##
## Change the "ABSOLUTE" and "URL" paths to your audio folder.
##
## Change the wording, color, etc. variables to suit.
##
## Upload your audio files (.wav, .mid, .au, etc.) to the audio
## folder you specify in the script.
##
########################################################

#
#-----[ OPEN ]------------------------------------------
#

language/lang_XXX/lang_main.php

#
#-----[ FIND ]------------------------------------------
#

The header comments located at the top.
(ie: Text within /* */ or text after // tags)

#
#-----[ ADD AFTER ]-------------------------------------
#

//
// Random Sound Script Start
//
// Create a folder for your audio files. The default below is "/audio"
// Change the full "ABSOLUTE" path to your audio folder for $localdir
// Change the full "URL" path to your audio folder for $webdir. No ending "/"
//

$localdir = "/usr/local/home/site_name.com/httpdocs/phpBB/audio/";
$webdir = "http://www.site_name.com/phpBB/audio";

$snd = getRandomSound($localdir);
$snd = str_replace("$localdir","",$snd);

//
// Random Sound Script End
//

#
#-----[ FIND ]------------------------------------------
#

$lang['New_pms'] = "You have %d new messages"; // You have 2 new messages

#
#-----[ REPLACE WITH ]----------------------------------
#

$lang['New_pms'] = "You have %d <span class=pm><blink>*<marquee width=50>new</marquee>*</blink></span> messages<bgsound src='$webdir/$snd' border='0'>"; // You have 2 new messages

#
#-----[ FIND ]------------------------------------------
#

$lang['New_pm'] = "You have %d new message"; // You have 1 new message

#
#-----[ REPLACE WITH ]----------------------------------
#

$lang['New_pm'] = "You have %d <span class=pm><blink>*<marquee width=50>new</marquee>*</blink></span> message<bgsound src='$webdir/$snd' border='0'>"; // You have 1 new message

#
#-----[ SAVE AND CLOSE ]--------------------------------
#

language/lang_XXX/lang_main.php


#
#-----[ OPEN ]------------------------------------------
#

includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

function get_userdata($user)

#
#-----[ ADD BEFORE ]--------------------------------
#

//
// Random Sound Mod Start
// Variables
function getRandomSound($dir,$type='random'){
global $errors,$seed;
if (is_dir($dir)){
$fd = opendir($dir);
$sounds = array();
while (($part = @readdir($fd)) == true){
clearstatcache();

// If you want to use other formats, simply add them to (wav|mid|au) below
if (eregi("(wav|mid|au)$",$part)){
$sounds[] = $part;
}
}
if ($type == 'all') return $sounds;
if ($seed !== true){
mt_srand ((double) microtime() * 1000000);
$seed = true;
}
$key = mt_rand (0,sizeof($sounds)-1);
return $dir . $sounds[$key];
}
else
{
$errors[] = $dir.' is not a directory';
return false;
}
}
// Random Sound Script End
//

#
#-----[ SAVE AND CLOSE ]--------------------------------
#

includes/functions.php


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.css // or whatever .css file you are using

#
# NOTE: This next one may be different depending on your version of
# RC2 files. You can actually place it just about anywhere within
# your .css file. I just chose this spot.
#
#-----[ FIND ]------------------------------------------
#

/* General text */ or /* General normal text */

#
#-----[ ADD BEFORE ]------------------------------------
#

/* New Messages */
.pm { font-size: 11px; text-decoration: none; color: #FF0000 }

#
#-----[ SAVE AND CLOSE ]--------------------------------
#

templates/subSilver/subSilver.css // or whatever .css file you are using

#
#-------------------------------------------------------
#
Ich schnall das nicht.

1.) Ich finde dass hier in der lang_main.php (German) nicht:
The header comments located at the top. (ie: Text within /* */ or text after // tags)
2.) Dass hier find ich auch nicht:
/* General text */ or /* General normal text */

Kann mir jemand helfen ?

Verfasst: 21.08.2002 19:09
von Gast
in beiden fällen ist es fast egal, wo du es reinpackst.
bei der lang_main einfach ziemlich weit oben rein und bei dem template
zwischen die

Code: Alles auswählen

<style> ... </style>

Verfasst: 21.08.2002 19:35
von Sekey
ok.... jetzt habe ich aber gerade gesehen, dass man die Zeilen:
$localdir = "/usr/local/home/site_name.com/httpdocs/phpBB/audio/";
$webdir = "http://www.site_name.com/phpBB/audio";
anpassen muss. Dies möchte ich aber gerne umgehen. Auf deutsch:
Ich habe im Forum einen Ordner angelegt unter images/audio und dort soll er jedesmal die Sounds her holen. Nun soll er sich die Info (wo dass Board installiert ist (der Pfad) von dem Board holen, wie mach ich dass nun ?

Verfasst: 22.08.2002 18:44
von saerdnaer

Code: Alles auswählen

$localdir = "../images/audio/"; 
$webdir = "./images/audio/"; 
sollte funktionieren...

ah

Verfasst: 22.08.2002 20:10
von Sekey
nee, dass hat leider nicht geklappt. Der gibt mir keine Fehlermeldung aus und er spielt die Audio-Datei nicht ab.

Hast du noch eine Idee ?

Verfasst: 23.08.2002 19:22
von saerdnaer
wo liegen die audio dateien?

ah

Verfasst: 27.08.2002 21:20
von Sekey
Dort liegen die Audio-Dateien:

C:\Localhost\www\Board\images\audio

Verfasst: 28.08.2002 19:24
von saerdnaer
dann probier doch mal $webdir = "../images/audio/";
ah

Verfasst: 28.08.2002 19:31
von Sekey
es klappt leider immer noch nicht. Er spielt die Sounddateien immer noch nicht ab.

Hast du vielleicht noch eine Idee ?

Verfasst: 28.08.2002 19:51
von saerdnaer
ach jetzt weiß ich warums nicht geht... das wird ja in der lang datei ausgeführt... :oops:

also dann probier doch mal diese kombination:

Code: Alles auswählen

$localdir = "../../images/audio/"; 
$webdir = "./images/audio/"; 
ah