Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
831 florian 1
<?php
2
 
3
if(!defined("PHORUM")) return;
4
 
5
require_once("./mods/smileys/defaults.php");
6
 
7
function phorum_mod_smileys_after_header()
8
{
9
    $PHORUM = $GLOBALS["PHORUM"];
10
 
11
    // Return immediately if we have no active smiley replacements.
12
    if (!isset($PHORUM["mod_smileys"])||!$PHORUM["mod_smileys"]["do_smileys"]){
13
        return $data;
14
    } ?>
15
 
16
    <style type="text/css">
17
    .mod_smileys_img {
18
        vertical-align: bottom;
19
        margin: 0px 3px 0px 3px;
20
    }
21
    </style> <?php
22
}
23
 
24
function phorum_mod_smileys_format($data)
25
{
26
    $PHORUM = $GLOBALS["PHORUM"];
27
 
28
    // Return immediately if we have no active smiley replacements.
29
    if (!isset($PHORUM["mod_smileys"])||!$PHORUM["mod_smileys"]["do_smileys"]){
30
        return $data;
31
    }
32
 
33
    // Run smiley replacements.
34
    $replace = $PHORUM["mod_smileys"]["replacements"];
35
	foreach ($data as $key => $message)
36
    {
37
        // Do subject replacements.
38
        if (isset($replace["subject"]) && isset($message["subject"])) {
39
            $data[$key]['subject'] = str_replace ($replace["subject"][0] , $replace["subject"][1], $message['subject'] );
40
        }
41
        // Do body replacements.
42
        if (isset($replace["body"]) && isset($message["body"])) {
43
            $data[$key]['body'] = str_replace ($replace["body"][0] , $replace["body"][1], $message['body'] );
44
        }
45
	}
46
 
47
	return $data;
48
}
49
 
50
?>