Messaging Notification

Probleme bei der regulären Arbeiten mit phpBB, Fragen zu Vorgehensweisen oder Funktionsweise sowie sonstige Fragen zu phpBB im Allgemeinen.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Benutzeravatar
Sekey
Ehemaliges Teammitglied
Beiträge: 928
Registriert: 06.04.2002 23:51

Messaging Notification

Beitrag 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 ?
Die Such(t)funktion dein Freund und Helfer :D
-[Siegertyp]-
Gast

Beitrag 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>
Benutzeravatar
Sekey
Ehemaliges Teammitglied
Beiträge: 928
Registriert: 06.04.2002 23:51

Beitrag 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 ?
Die Such(t)funktion dein Freund und Helfer :D
-[Siegertyp]-
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag von saerdnaer »

Code: Alles auswählen

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

ah
Benutzeravatar
Sekey
Ehemaliges Teammitglied
Beiträge: 928
Registriert: 06.04.2002 23:51

Beitrag 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 ?
Die Such(t)funktion dein Freund und Helfer :D
-[Siegertyp]-
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag von saerdnaer »

wo liegen die audio dateien?

ah
Benutzeravatar
Sekey
Ehemaliges Teammitglied
Beiträge: 928
Registriert: 06.04.2002 23:51

Beitrag von Sekey »

Dort liegen die Audio-Dateien:

C:\Localhost\www\Board\images\audio
Die Such(t)funktion dein Freund und Helfer :D
-[Siegertyp]-
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag von saerdnaer »

dann probier doch mal $webdir = "../images/audio/";
ah
Benutzeravatar
Sekey
Ehemaliges Teammitglied
Beiträge: 928
Registriert: 06.04.2002 23:51

Beitrag von Sekey »

es klappt leider immer noch nicht. Er spielt die Sounddateien immer noch nicht ab.

Hast du vielleicht noch eine Idee ?
Die Such(t)funktion dein Freund und Helfer :D
-[Siegertyp]-
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag 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
Antworten

Zurück zu „phpBB 2.0: Administration, Benutzung und Betrieb“