Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
<?php
2
//Dc-shout2.0 (c)devilcoderz 2004
3
include "admin/config.php";
4
include "template/$theme/top.htm" ;
5
include "inc/functions.php";
6
 
7
 
8
 
9
//start codes
10
$setstart = mysql_query("select * from dc_setings WHERE id='1'");
11
$settings=mysql_fetch_array($setstart);
12
 
13
 
14
 
15
//just makeing it making it more tidy
16
$box = $settings[shout] ;
17
$bc =  $settings[bbcode] ;
18
$word =  $settings[word] ;
19
if ($box== "y")  // is the shoutbox on ?
20
{
21
 
22
//Dis the use add a shout hummm
23
if ($submit)
24
{
25
if (!$_POST['user'])
26
{
27
die('You did not put in a name.<u><a href=javascript:%20history.back(-2)>Back</a></u>.') ;
28
}
29
if (!$_POST['message'])
30
{
31
die('You did not put in a message.<u><a href=javascript:%20history.back(-2)>Back</a></u>.') ;
32
}
33
$post = $_POST[message] ;
34
if ($word== "y")
35
{
36
//lets do some word blocking
37
$word = mysql_query("select * from dc_word");
38
while($w=mysql_fetch_array($word))
39
{
40
$post = str_replace("$w[word]", "****", $post) ;
41
}
42
}
43
$add = strip_tags($post) ;
44
$add = mysql_escape_string($add);
45
$addtwo = strip_tags($_POST[user]) ;
46
$addtwo = mysql_escape_string($addtwo);
47
$ip = $REMOTE_ADDR ; //makes the vistors ip store in db all ways on
48
$result = MYSQL_QUERY("INSERT INTO dc_shoutbox (id, name, text, ip)". "VALUES ('NULL', '$addtwo', '$add', '$ip')"); // inssert done
49
//show the posts
50
}
51
 
52
 
53
 
54
//lets show these nice people there shouts
55
$result = mysql_query("select * from dc_shoutbox order by id desc limit 10 ");
56
while($r=mysql_fetch_array($result))
57
{
58
$bb = $r[text] ;//starts off the bb thing
59
if ($bc == "y") //if on y it should be on
60
{
61
$bb = str_replace("DD", "<b>Darkdevils</b>", $bb);
62
$bb = str_replace("<f red>", "<font color=red>", $bb);
63
$bb = str_replace("<f green>", "<font color=green>", $bb);
64
$bb = str_replace("<f blue>", "<font color=blue>", $bb);
65
$bb = str_replace("<f gray>", "<font color=gray>", $bb);
66
$bb = str_replace("<f gold>", "<font color=gold>", $bb);
67
$bb = str_replace("</f>", "</font>", $bb);
68
}
69
$loop_template = @implode("", @file("template/$theme/post.htm"));
70
$template = str_replace("{name}", $r['name'], $loop_template);
71
$template = str_replace("{mess}", $bb, $template);
72
echo $template ;
73
}
74
}
75
 
76
 
77
 
78
if ($box== "n")//hope the shoutbox is not off lol
79
{
80
echo "Shoutbox offline :(";
81
}
82
?>
83
 
84
 
85
 
86
 
87
 
88
 
89
 
90
 
91
 
92
 
93
 
94
 
95
 
96
 
97
 
98
 
99
 
100
 
101
 
102
 
103
 
104
 
105