1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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

Discussion in 'Other Resources [Archive]' started by twhiting9275, Dec 3, 2010.

  1. twhiting9275

    twhiting9275 Active Member

    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.
     

    Attached Files:

    Tize, AL-Fareed, Rob Fritz and 16 others like this.
  2. Weiyan

    Weiyan Well-Known Member

    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')");
     
    Tize and twhiting9275 like this.
  3. Peggy

    Peggy Well-Known Member

    Good stuff Tom!
     
    Tize likes this.
  4. Floris

    Floris Guest

    Wow, great resource :) I am going to use this. It would allow me to get imports done with custom smileys. Excellent++;
     
  5. twhiting9275

    twhiting9275 Active Member

    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!
     
    Weiyan likes this.
  6. twhiting9275

    twhiting9275 Active Member

    File updated once again. You can now run this multiple times, say when you add more smilies, and only new ones will be imported.
     
  7. Travis

    Travis Active Member

    I'm confused as to what I need to change in this line:
    Code:
    $smiliepath="path/to/your/smilies/from/xenforo";
    in Vars.php. I have uploaded my Smilies to http://www.ncisaddict.com/smilies.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Try changing it to just smilies:

    PHP:
    $smiliepath="smilies";
     
    Teddy Scott and Travis like this.
  9. Travis

    Travis Active Member

    Thanks Brogan,it works! I didn't think it would be as simple as that :oops:
     
  10. twhiting9275

    twhiting9275 Active Member

    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.
     
  11. Peggy

    Peggy Well-Known Member

    You did a fine job of making it very simple Tom. Thanks so much!
     
    twhiting9275 likes this.
  12. Travis

    Travis Active Member

    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. twhiting9275

    twhiting9275 Active Member

    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.
     
  14. Travis

    Travis Active Member

    The adolf hasn't been picked up (the image). I was testing with that one image before I unzipped the folders. :(
     
  15. twhiting9275

    twhiting9275 Active Member

    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!
     
  16. Travis

    Travis Active Member

    No Luck! :( I really don't know what I am doing wrong :( I deleted the smiley and the smiley_import.php. I then re-downloaded it from the first post here and added just smiley_import.php. I then uploaded the image and ran the script.Still,the image does not show up :(

    EDIT:I think I have worked it out. It is looking for the image in http://www.ncisaddict.com/forum/smilies,when I have it installed at http://www.ncisaddict.com/smilies.
     
  17. Travis

    Travis Active Member

    Works Now after moving that file!(See my last edit!)
     
  18. twhiting9275

    twhiting9275 Active Member

    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.
     
  19. Travis

    Travis Active Member

    Yeah,I know. It's late here and I wasn't thinking :oops:. Oh well,fixed now!
     
  20. manik

    manik Member

    Friends where can i find a nice set of emoticons for a light background ?
     

Share This Page