here is my script for that. this is edited from some script from net. Jast put in smilies folder on lavalair script and run!
CODE<?php
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("../config.php");
include("../core.php");
connectdb();
$action = $_GET["action"];
$sid = $_GET["sid"];
$whoimage = $_GET["whoimage"];
if(islogged($sid)==false)
{
echo "<card id="main" title="Kiss Forum">";
echo "
";
echo "Not logged!
";
echo "<a href="index.php">Login</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
$uid = getuid_sid($sid);
if(isbanned($uid))
{
echo "<card id="main" title="Kiss Forum">";
echo "
";
echo "<img src="images/notok.gif" alt="x"/>
";
echo "You are banned!
";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
$remain = $banto[0]- (time() );
$rmsg = gettimemsg($remain);
echo "Time to finish: $rmsg
";
//echo "<a href="index.php">Login</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
//////////////////////////////////////////////////////////////////////////MAIN
if($action=="main")
{
echo "<card id="main" title="Mass Import">";
echo "
";
echo "Mass smilies import
";
echo "Start from id
(Id of smilie in DB)
<input name="smid" format="*N" maxlength="30"/>
";
echo "Prefix of smilies
(Ex - for -haha-)
<input name="smprefix" maxlength="1"/>
";
echo "<anchor>Import";
echo "<go href="index.php?action=addsmlilies&sid=$sid" method="post">";
echo "<postfield name="smid" value="$(smid)"/>";
echo "<postfield name="smprefix" value="$(smprefix)"/>";
echo "</go></anchor>";
echo "
<a href="../index.php?action=admincp&sid=$sid">";
echo "AdminCP</a>
";
echo "<a href="../index.php?action=main&sid=$sid">";
echo "Home</a>";
echo "
";
echo "</card>";
}
//////////////////////////////////////Scan directory and add smilies
else if($action=="addsmlilies")
{
$startid = $_POST["smid"];
$smileprefix = $_POST["smprefix"];
addonline(getuid_sid($sid),"Adding smilies","");
echo "<card id="main" title="Add smilies">";
echo "
";
if($startid=="")
{
echo "enter id to start import
";
echo "<a href="index.php?action=main&sid=$sid">";
echo "Back</a>
";
}
else
{
if($smileprefix=="")
{
echo "enter smile prefix to start import
";
echo "<a href="index.php?action=main&sid=$sid">";
echo "Back</a>
";
}
else
{
$items_per_page = "100000";
if(!($dp = opendir("./"))) die ("Ne mogu otvoriti ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
echo "Adding Smilies
";
echo "Added $file_count ";
if ($file_count == 1)
{
echo "smilie";
}
else
{
echo "smilies";
}
if ($file_count > 0)
{
$first_record = $page * $items_per_page;
$last_record = $first_record + $items_per_page;
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
$userfile=explode(".", $file_name);
}
$smcode = "$smileprefix$userfile[0]$smileprefix";
$smurl = "smilies/$file_name";
$smhidden = "0";
$res = mysql_query("INSERT INTO ibwf_smilies SET id='".$startid."', scode='".$smcode."', imgsrc='".$smurl."', hidden='".$smhidden."'");
$startid = $startid + 1;
$total = $total + filesize($file_name);
}
}
echo "
";
echo "
";
echo "
";
echo "
<a href="../index.php?action=admincp&sid=$sid">";
echo "AdminCP</a>
";
echo "
";
closedir($dp);
}
}
echo "<a href="../index.php?action=main&sid=$sid">";
echo "Home</a>";
echo "
";
echo "</card>";
}
else
{
addonline(getuid_sid($sid),"Lost in forums!","");
echo "<card id="main" title="Kiss Forum">";
echo "
";
echo "Nothing for you!
";
echo "<a href="../index.php?action=main&sid=$sid">";
echo "Home</a>";
echo "
</card>";
}
?>
</wml>
Script read all smilies in folder. Jast put ID from where wish to start importing smilies.
Smilie code is derived from file name without extension. You must define prefix for smilie.
Example _ for smilie code or ***** for smilie
Script by default use smilies/ folder on your lavalair forum.
Sorry on my bad english!