1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tip: SQL query to create bigger default smilies set

Discussion in 'XenForo Questions and Support' started by CyclingTribe, Apr 19, 2012.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    The current default install of XF 1.1.2 installs a limited set of smilies, despite more smilies being available in the filesystem.

    If you want to add the "additional" smilies without doing it manually, just truncate your xf_smilies table and run this query (NOTE: this method does NOT use a spritesheet!)

    Code:
    CREATE TABLE IF NOT EXISTS `xf_smilie` (
      `smilie_id` int(10) unsigned NOT NULL auto_increment,
      `title` varchar(50) NOT NULL,
      `smilie_text` text NOT NULL,
      `image_url` varchar(200) NOT NULL,
      `sprite_mode` tinyint(3) unsigned NOT NULL default '0',
      `sprite_params` text NOT NULL,
      PRIMARY KEY  (`smilie_id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=36 ;
    
    INSERT INTO `xf_smilie` (`smilie_id`, `title`, `smilie_text`, `image_url`, `sprite_mode`, `sprite_params`) VALUES
    (1, 'Smile', ':)\n:-)', 'styles/default/xenforo/smilies/smile.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (2, 'Wink', ':wink:', 'styles/default/xenforo/smilies/wink.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (3, 'Frown', ':(', 'styles/default/xenforo/smilies/frown.png', 0, ''),
    (4, 'Mad', ':mad:', 'styles/default/xenforo/smilies/mad.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (5, 'Confused', ':confused:', 'styles/default/xenforo/smilies/confused.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:-40;s:1:"y";i:-21;}'),
    (6, 'Cool', ':cool:', 'styles/default/xenforo/smilies/cool.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (7, 'Stick Out Tongue', ':p\n:P', 'styles/default/xenforo/smilies/tongue.png', 0, ''),
    (8, 'Big Grin', ':D', 'styles/default/xenforo/smilies/biggrin.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:-20;s:1:"y";i:0;}'),
    (9, 'Eek!', ':eek:', 'styles/default/xenforo/smilies/eek.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (10, 'Oops!', ':oops:', 'styles/default/xenforo/smilies/redface.png', 0, ''),
    (11, 'Roll Eyes', ':rolleyes:', 'styles/default/xenforo/smilies/rolleyes.png', 0, ''),
    (12, 'Alien', ':alien:', 'styles/default/xenforo/smilies/alien.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (13, 'Barefoot', ':barefoot:', 'styles/default/xenforo/smilies/barefoot.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (14, 'Cautious', ':cautious:', 'styles/default/xenforo/smilies/cautious.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (15, 'Coffee', ':coffee:', 'styles/default/xenforo/smilies/coffee.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (16, 'Cry', ':cry:', 'styles/default/xenforo/smilies/cry.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (17, 'Evil', ':evil:', 'styles/default/xenforo/smilies/devilish.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (18, 'Geek', ':geek:', 'styles/default/xenforo/smilies/geek.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (19, 'Giggle', ':giggle:', 'styles/default/xenforo/smilies/giggle.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (20, 'Love', ':love:', 'styles/default/xenforo/smilies/inlove.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (21, 'Laugh', ':laugh:', 'styles/default/xenforo/smilies/laugh.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (22, 'Ninja', ':ninja:', 'styles/default/xenforo/smilies/ninja.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (23, 'Not worthy', ':notworthy:', 'styles/default/xenforo/smilies/notworthy.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (24, 'O_o', ':o_o:', 'styles/default/xenforo/smilies/O_o.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (25, 'Poop', ':poop:', 'styles/default/xenforo/smilies/poop.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (26, 'Funny', ':roflmao:', 'styles/default/xenforo/smilies/roflmao.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (27, 'Sick', ':sick:', 'styles/default/xenforo/smilies/sick.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (28, 'Sleep', ':zzzz:', 'styles/default/xenforo/smilies/sleep.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (29, 'Sneaky', ':sneaky:', 'styles/default/xenforo/smilies/sneaky.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (30, 'Speechless', ':speechless:', 'styles/default/xenforo/smilies/speechless.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (31, 'Thumbs down', ':thumbsdown:', 'styles/default/xenforo/smilies/thumbsdown.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (32, 'Thumbs Up', ':thumbsup:', 'styles/default/xenforo/smilies/thumbsup.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (33, 'Unsure', ':unsure:', 'styles/default/xenforo/smilies/unsure.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (34, 'Whistling', ':whistling:', 'styles/default/xenforo/smilies/whistling.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}'),
    (35, 'x3', ':x3:', 'styles/default/xenforo/smilies/x3.png', 0, 'a:4:{s:1:"w";i:18;s:1:"h";i:18;s:1:"x";i:0;s:1:"y";i:0;}');
    
     
    ChemicalKicks likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Note that you will have to edit and save one of the smilies to update the cache.
     
    CyclingTribe and ragtek like this.
  3. Kevin

    Kevin Well-Known Member

    If anybody wants the spritesheet version, check here.
     
    CyclingTribe likes this.

Share This Page