• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Massive Smiley Importer

#1
SMILEY IMPORT - A fast and effective way to import all of your smilies into your XF Forum. A few steps to this
#1 - Unzip your smileys on your pc into their own folder. Rename any duplicates as necessary
#2 - upload all of your smileys (they must be named uniquely) into any web accessible folder on your server
#3 - upload all files in this archive where you uploaded the smileys
#4 - edit the vars.php file to be appropriate for your settings
#5 - call smiley_import.php (ie: http://www.yourforumname.com/smileys/smiley_import.php)
#6 - go into your admin panel -> smileys and edit one of your smileys. It doesn't matter which one, just edit and save it (even if you made no changes). This will rebuild the cache

This was written as a very quick hack to allow multiple smiley imports as opposed to doing them one by one. The php script automatically replaces _ with a space and adds the necessary colons to the beginning and end before inserting it into the database. This is automatically determined by filename.

This isn't really an "addon" per se, just a quick hack / resource until an easier way to do this gets put into place officially, or through an addon.
 

Attachments

Weiyan

Well-known member
#2
Thanks a lot.

I modified one line in the smiley_import.php

from:
PHP:
$query=$db->sql_query("INSERT into xf_smilie VALUES(NULL, '$imgname', '$imgicon', 'smilies/$image')");
to:
PHP:
$query=$db->sql_query("INSERT into xf_smilie VALUES(NULL, '$imgname', '$imgicon', '$smiliepath/$image')");
 
F

Floris

Guest
#4
Wow, great resource :) I am going to use this. It would allow me to get imports done with custom smileys. Excellent++;
 
#5
Thanks a lot.

I modified one line in the smiley_import.php

from:
PHP:
$query=$db->sql_query("INSERT into xf_smilie VALUES(NULL, '$imgname', '$imgicon', 'smilies/$image')");
to:
PHP:
$query=$db->sql_query("INSERT into xf_smilie VALUES(NULL, '$imgname', '$imgicon', '$smiliepath/$image')");
I could have sworn I put that in there, guess not.
Download modified to reflect that, should work pefectly now, without that edit. Thanks for pointing that out!
 
#10
Thanks Brogan,it works! I didn't think it would be as simple as that :oops:
I tried to make it as simple as possible, and Brogan got it right on. If your smilies are just off your domain (like mine are), all you need is "smilies" in there. If they're somewhere else, just point to them. This is only used so the importer knows where to link them.
 

Travis

Active member
#12
I am having a problem. It installs the smilies fine,but in the admin cp and the actual forum,the images do not show up. Am I doing something wrong? Here is what I am doing:
  1. Upload Smilie to ncisaddict.com/smilies
  2. Open ncisaddict.com/smilies/smiley_importer.php
  3. Go to Admin CP and edit a Smilie and save it
  4. Smiley exists,but no images show up.
 
#13
I am having a problem. It installs the smilies fine,but in the admin cp and the actual forum,the images do not show up. Am I doing something wrong? Here is what I am doing:
  1. Upload Smilie to ncisaddict.com/smilies
  2. Open ncisaddict.com/smilies/smiley_importer.php
  3. Go to Admin CP and edit a Smilie and save it
  4. Smiley exists,but no images show up.
From what I can see, you haven't unzipped the smilies before uploading them?
This importer doesn't unzip them for you, they need to exist in the directory unzipped. It looks like you have adolf in there which should show in smilies, but the others need to be unzipped.

The importer looks for files of type png, gif and jpg and throws them into the database, which it should have done with adolf.
 
#15
The adolf hasn't been picked up (the image). I was testing with that one image before I unzipped the folders. :(
Try re-downloading the package and upload just smiley_import.php . It looks like you're using a version that's a bit older and may have a few issues. There was an issue with paths, and I cleaned up the import file. Make sure you delete the adolf smiley from the database first!
 
#18
Looking at it, that makes perfect sense, the script is doing exactly what it's supposed to.
The forum automatically appends it's path to everything, so /smileys would be expected in your case, like /forum/smileys.
 

Travis

Active member
#19
Looking at it, that makes perfect sense, the script is doing exactly what it's supposed to.
The forum automatically appends it's path to everything, so /smileys would be expected in your case, like /forum/smileys.
Yeah,I know. It's late here and I wasn't thinking :oops:. Oh well,fixed now!