Can Anyone ?

Started on the old forum in September 2008 · view the original in the archive · old links redirect here

6 replies · 882 views · started 18 years ago · 1 min read

2 participants
darkdesire Senior · 250 posts #1

Can anyone code a file to read smilies and automatically insert the relevent info into the database or even just display the relevent lines to copy and paste to the sql query eg:

INSERT INTO ibwf_smilies VALUES(1, '(ICON1)', '../smilies/ICON1.gif', '0'); INSERT INTO ibwf_smilies VALUES(2, '(ICON2)', '../smilies/ICON2.gif', '0');

etc...

Im sure this would be a great help to a great many people on here if anyone could code it

:p:p:p

Guest #2

I will be able to code such a Program.

Give me some ideas on how you want it to work.

Guest #3

Here try this its a unloader that should insert smilies to database at the same time throw it together so let me no if it works it might need some touching up

Attachments: main.php
Guest #4

ps there might be a few errors lol nothing to bad i hope

darkdesire Senior · 250 posts #5

sorted it using wapbuddy lol

:p:p:p

Guest #6

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!

Anshul Senior · 296 posts #7

thanks for the code 😉

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close