Here is a easy to use flatbase script u can use for any script on wml ...its easy to install and doesnt need a sql database for it..its mostly great for users that starts new chats...enjoy
u can paste this anywhere in any script its the main for the shout box ,,,u can past it in the front page of your index.php or in the inside of your chatroom
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>////////////////////////////////////////////
// shoutbox by cyberspider //
////////////////////////////////////////////
echo "---------------
";
echo "<img src=\"shoutlogo.gif\" alt=\"\"/>
";
echo "The shout box
";
$shoutboxfile=file('shoutbox.txt');
for ($x=0; $x<1; $x++)
{
$shoutboxfile[$x] = rtrim($shoutboxfile[$x]);
if (substr(trim($shoutboxfile[$x]),0,
!= "DELETED_"){
echo "$shoutboxfile[$x]";
}}
echo "";
echo "<anchor>Shout";
echo "<go method=\"post\" href=\"shoutbox_1.php\">";
echo "<postfield name=\"shout\" value=\"$(shout)\"/>";
echo "<setvar name=\"shout\" value=\"\"/>";
echo "</go>";
echo "</anchor>";
echo "";
echo " - ";
echo "<anchor>Read";
echo "<go method=\"post\" href=\"shoutbox_3.php\">";
echo "</go>";
echo "</anchor>";
echo "
---------------
";
////////////////////////////////////////////</div>
the following is the shoutbox_1.php file that need to be inserted and dont forget to change the index.php inside to where your shoutbox is:D<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "";
echo "<wml>";
echo "<card title=\"Send a shout\">";
echo "<p align=\"center\">";
echo "SEND A PUBLIC
";
echo "SHOUT
";
echo "---------------
";
echo "Do not use abusive
";
echo "or vulgar text in
";
echo "the shoutbox.
";
echo "---------------
";
echo "Your text
";
echo "<input type=\"text\" name=\"shout\" value=\"\" emptyok=\"true\" maxlength=\"200\"/>
";
echo "";
echo "<anchor>Send your shout";
echo "<go method=\"post\" href=\"shoutbox_2.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "<postfield name=\"shout\" value=\"$(shout)\"/>";
echo "</go>";
echo "</anchor>
";
echo "";
echo "<anchor>Back to menu";
echo "<go method=\"post\" href=\"index.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor>";
echo "";
echo "</p>";
echo "</card>";
echo "</wml>";
?></div> !!!
the third part for this is the shoutbox_2.php that need to be loaded up!!
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "";
/////////////////////
// Filter swearing //
/////////////////////
$rumatsanat=file('censored.txt');
$leeg = "";
for ($ri=0; $ri<count($rumatsanat); $ri++)
{
$vaihto=rtrim($rumatsanat[$ri]);
$viesti = str_replace ($vaihto,"censored", $viesti);
}
////////////////////
echo "<wml>";
echo "<card title=\"Send a shout\" ontimer=\"index.php?time=";
echo date('dmHis');
echo '&nimi=$nimi&salasana=$salasana';
echo "\">";
echo "<timer value=\"50\"/>";
echo "<p align=\"center\">";
if (filesize('shoutbox.txt')>30000)
{
$peke = fopen('shoutbox.txt', 'r+');
ftruncate ($peke,0);
fclose($peke);
}
$swe_from=array("Ã¥","ä","ö","Ã…","Ä","Ã-","$","&","Â");
$swe_to=array("å", "ä", "ö", "Å", "Ä", "Ö","d","j","");
$shout=str_replace ($swe_from[$i], $swe_to[$i], $shout);
$shout=htmlspecialchars($shout);
$shout=stripslashes($shout);
$uusirivi ='SHOUT : '.$shout.'
';
$tiedosto = fopen('shoutbox.txt', 'r+');
$kolmas=file_get_contents ('shoutbox.txt');
$toinen="$uusirivi $kolmas";
fputs($tiedosto, $toinen);
fclose($tiedosto);
echo "SEND A PUBLIC
";
echo "SHOUT
";
echo "---------------
";
echo "Your shout was send
";
echo "---------------
";
echo "<anchor>Back to menu";
echo "<go method=\"post\" href=\"index.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor>";
echo "";
echo "</p>";
echo "</card>";
echo "</wml>";
?></div>
after u done this now u will need to upload the 3rd section of shoutbox_3.php
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "";
echo "<wml>";
echo "<card title=\"View shouts\">";
echo "<p align=\"center\">";
echo "View the shouts
";
echo "";
echo "<anchor>Send a shout";
echo "<go method=\"post\" href=\"shoutbox_1.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "<postfield name=\"shout\" value=\"$(shout)\"/>";
echo "<setvar name=\"shout\" value=\"\"/>";
echo "</go>";
echo "</anchor>
";
echo "";
echo "<anchor>Back to menu";
echo "<go method=\"post\" href=\"index.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor>
";
echo "</p>
";
$shoutfile=file('shoutbox.txt');
for ($x=0; $x<10; $x++)
{
$shoutfile[$x] = rtrim($shoutfile[$x]);
if ($shoutfile[$x] != ''){
if (substr(trim($shoutfile[$x]),0,
!= "DELETED_"){
echo "$shoutfile[$x]";
}}}
echo "";
echo "</p>";
echo "</card>";
echo "</wml>";
?></div>
now for last part of this script is to create a shoutbox.txt file chmod 777 and then u create a censored.txt file that looks like this!!!
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>you can type any word here u dont like ppl to say in the shoutbox example:
you
me
****
f88k
create your own list as u wish and have fun..</div>
i hope this will come handy for someone enjoy the rest of the day cya
u can paste this anywhere in any script its the main for the shout box ,,,u can past it in the front page of your index.php or in the inside of your chatroom
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>////////////////////////////////////////////
// shoutbox by cyberspider //
////////////////////////////////////////////
echo "---------------
";
echo "<img src=\"shoutlogo.gif\" alt=\"\"/>
";
echo "The shout box
";
$shoutboxfile=file('shoutbox.txt');
for ($x=0; $x<1; $x++)
{
$shoutboxfile[$x] = rtrim($shoutboxfile[$x]);
if (substr(trim($shoutboxfile[$x]),0,
echo "$shoutboxfile[$x]";
}}
echo "";
echo "<anchor>Shout";
echo "<go method=\"post\" href=\"shoutbox_1.php\">";
echo "<postfield name=\"shout\" value=\"$(shout)\"/>";
echo "<setvar name=\"shout\" value=\"\"/>";
echo "</go>";
echo "</anchor>";
echo "";
echo " - ";
echo "<anchor>Read";
echo "<go method=\"post\" href=\"shoutbox_3.php\">";
echo "</go>";
echo "</anchor>";
echo "
---------------
";
////////////////////////////////////////////</div>
the following is the shoutbox_1.php file that need to be inserted and dont forget to change the index.php inside to where your shoutbox is:D<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "";
echo "<wml>";
echo "<card title=\"Send a shout\">";
echo "<p align=\"center\">";
echo "SEND A PUBLIC
";
echo "SHOUT
";
echo "---------------
";
echo "Do not use abusive
";
echo "or vulgar text in
";
echo "the shoutbox.
";
echo "---------------
";
echo "Your text
";
echo "<input type=\"text\" name=\"shout\" value=\"\" emptyok=\"true\" maxlength=\"200\"/>
";
echo "";
echo "<anchor>Send your shout";
echo "<go method=\"post\" href=\"shoutbox_2.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "<postfield name=\"shout\" value=\"$(shout)\"/>";
echo "</go>";
echo "</anchor>
";
echo "";
echo "<anchor>Back to menu";
echo "<go method=\"post\" href=\"index.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor>";
echo "";
echo "</p>";
echo "</card>";
echo "</wml>";
?></div> !!!
the third part for this is the shoutbox_2.php that need to be loaded up!!
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "";
/////////////////////
// Filter swearing //
/////////////////////
$rumatsanat=file('censored.txt');
$leeg = "";
for ($ri=0; $ri<count($rumatsanat); $ri++)
{
$vaihto=rtrim($rumatsanat[$ri]);
$viesti = str_replace ($vaihto,"censored", $viesti);
}
////////////////////
echo "<wml>";
echo "<card title=\"Send a shout\" ontimer=\"index.php?time=";
echo date('dmHis');
echo '&nimi=$nimi&salasana=$salasana';
echo "\">";
echo "<timer value=\"50\"/>";
echo "<p align=\"center\">";
if (filesize('shoutbox.txt')>30000)
{
$peke = fopen('shoutbox.txt', 'r+');
ftruncate ($peke,0);
fclose($peke);
}
$swe_from=array("Ã¥","ä","ö","Ã…","Ä","Ã-","$","&","Â");
$swe_to=array("å", "ä", "ö", "Å", "Ä", "Ö","d","j","");
$shout=str_replace ($swe_from[$i], $swe_to[$i], $shout);
$shout=htmlspecialchars($shout);
$shout=stripslashes($shout);
$uusirivi ='SHOUT : '.$shout.'
';
$tiedosto = fopen('shoutbox.txt', 'r+');
$kolmas=file_get_contents ('shoutbox.txt');
$toinen="$uusirivi $kolmas";
fputs($tiedosto, $toinen);
fclose($tiedosto);
echo "SEND A PUBLIC
";
echo "SHOUT
";
echo "---------------
";
echo "Your shout was send
";
echo "---------------
";
echo "<anchor>Back to menu";
echo "<go method=\"post\" href=\"index.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor>";
echo "";
echo "</p>";
echo "</card>";
echo "</wml>";
?></div>
after u done this now u will need to upload the 3rd section of shoutbox_3.php
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
header("Content-type: text/vnd.wap.wml; charset=ISO-8859-1");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"\n \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "";
echo "<wml>";
echo "<card title=\"View shouts\">";
echo "<p align=\"center\">";
echo "View the shouts
";
echo "";
echo "<anchor>Send a shout";
echo "<go method=\"post\" href=\"shoutbox_1.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "<postfield name=\"shout\" value=\"$(shout)\"/>";
echo "<setvar name=\"shout\" value=\"\"/>";
echo "</go>";
echo "</anchor>
";
echo "";
echo "<anchor>Back to menu";
echo "<go method=\"post\" href=\"index.php\">";
echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";
echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";
echo "</go>";
echo "</anchor>
";
echo "</p>
";
$shoutfile=file('shoutbox.txt');
for ($x=0; $x<10; $x++)
{
$shoutfile[$x] = rtrim($shoutfile[$x]);
if ($shoutfile[$x] != ''){
if (substr(trim($shoutfile[$x]),0,
echo "$shoutfile[$x]";
}}}
echo "";
echo "</p>";
echo "</card>";
echo "</wml>";
?></div>
now for last part of this script is to create a shoutbox.txt file chmod 777 and then u create a censored.txt file that looks like this!!!
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>you can type any word here u dont like ppl to say in the shoutbox example:
you
me
****
f88k
create your own list as u wish and have fun..</div>
i hope this will come handy for someone enjoy the rest of the day cya
Comment