Can Anyone ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can Anyone ?

    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, &#39ICON1)', '../smilies/ICON1.gif', '0');
    INSERT INTO `ibwf_smilies` VALUES(2, &#39ICON2)', '../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

    #2
    I will be able to code such a Program.

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

    Comment


      #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
      Attached Files

      Comment


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

        Comment


          #5
          sorted it using wapbuddy lol
          :p:p:p

          Comment


            #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!

            <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?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 "<p align=\"center\">";
            echo "Not logged!

            ";
            echo "<a href=\"index.php\">Login</a>";
            echo "</p>";
            echo "</card>";
            echo "</wml>";
            exit();
            }
            $uid = getuid_sid($sid);
            if(isbanned($uid))
            {
            echo "<card id=\"main\" title=\"Kiss Forum\">";
            echo "<p align=\"center\">";
            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=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
            $remain = $banto[0]- (time() );
            $rmsg = gettimemsg($remain);
            echo "Time to finish: $rmsg

            ";
            //echo "<a href=\"index.php\">Login</a>";
            echo "</p>";
            echo "</card>";
            echo "</wml>";
            exit();
            }

            //////////////////////////////////////////////////////////////////////////MAIN
            if($action=="main")
            {


            echo "<card id=\"main\" title=\"Mass Import\">";
            echo "<p align=\"center\">";
            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&amp;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&amp;sid=$sid\">";
            echo "AdminCP</a>
            ";
            echo "<a href=\"../index.php?action=main&amp;sid=$sid\">";
            echo "Home</a>";
            echo "</p>";
            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 "<p align=\"center\">";
            if($startid=="")
            {
            echo "enter id to start import

            ";
            echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
            echo "Back</a>
            ";
            }
            else
            {
            if($smileprefix=="")
            {
            echo "enter smile prefix to start import

            ";
            echo "<a href=\"index.php?action=main&amp;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) != &#39;.&#39; 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=&#39;".$startid."&#39;, scode=&#39;".$smcode."&#39;, imgsrc=&#39;".$smurl."&#39;, hidden=&#39;".$smhidden."&#39;");
            $startid = $startid + 1;
            $total = $total + filesize($file_name);
            }
            }
            echo "
            ";
            echo "</p>";
            echo "<p align=\"center\">";
            echo "

            <a href=\"../index.php?action=admincp&amp;sid=$sid\">";
            echo "AdminCP</a>
            ";
            echo "
            ";
            closedir($dp);
            }

            }

            echo "<a href=\"../index.php?action=main&amp;sid=$sid\">";
            echo "Home</a>";
            echo "</p>";
            echo "</card>";

            }

            else
            {
            addonline(getuid_sid($sid),"Lost in forums!","");
            echo "<card id=\"main\" title=\"Kiss Forum\">";
            echo "<p align=\"center\">";
            echo "Nothing for you!

            ";
            echo "<a href=\"../index.php?action=main&amp;sid=$sid\">";
            echo "Home</a>";
            echo "</p></card>";
            }

            ?>
            </wml></div>


            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!

            Comment


              #7
              thanks for the code ;)

              Comment

              Working...
              X