WordPress.org

Forums

wp_grins (11 posts)

  1. Agara
    Member
    Posted 10 years ago #

    I want to know "how to use wp_grins"

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    What is it you are stuck on ?
    And with which version of WP ?

  3. lokrin
    Member
    Posted 10 years ago #

    I've a question - Is there anyway to sort the grins? I'm not sure what order they are appearing in, but it is always the same order but not the one listed in vars.php or in the smilie directory itself.

    I have a lot of smilies and would like to group them in things like

    standard smilies
    flags
    computer
    etc

    (or, possibly just alphabetize them)

    btw - using wp1.5

    Thanks

    :) <- What? No smilies here? :P

  4. jennmiller
    Member
    Posted 10 years ago #

    I know this is an old topic, but has anyone come up with a way to sort smilies (grins) yet? I've been searching, but I have no idea how to change the output or array or whatever we need to do.

  5. maryafernanda
    Member
    Posted 10 years ago #

    I also would like to know if there's a way to sort grins... I've grins from different styles, and I'd like to separate them in groups...

  6. Alex King
    Member
    Posted 10 years ago #

    They are sorted in ascending alphanumeric order (php default) by abbreviation.

  7. maryafernanda
    Member
    Posted 10 years ago #

    Mine are not... For example, I have an icon named :Jsomething: listed before an icon named :Asomething: ...

  8. Mark (podz)
    Support Maven
    Posted 10 years ago #

    I think Alex means like this ?
    http://akizuki.org/wp-images/smilies/

  9. maryafernanda
    Member
    Posted 10 years ago #

    Th e smilies don't get sorterd by the actual :code: neither by the name of the file itself ("icon.gif"). As you may see at my comments page (http://akizuki.org/2005/05/09/poster-gof), they really don't get sorted in any particular order....

  10. lbessant

    Posted 10 years ago #

    Actually, they *do* get sorted. Just not in a way that makes a lot of sense[1]. If you look in vars.php, below the smilies array, you will see this block of code:

    // sorts the smilies' array
    if (!function_exists('smiliescmp')) {
    function smiliescmp ($a, $b) {
    if (strlen($a) == strlen($b)) {
    return strcmp($a, $b);
    }
    return (strlen($a) > strlen($b)) ? -1 : 1;
    }
    }
    uksort($wpsmiliestrans, 'smiliescmp');

    Looks to me like it's sorting first by the *length* of the string, then alphabetically for strings of the same length. Looking at my smilies confirms that this is what is happening.

    I'm going to try commenting out the sort, and seeing what happens....

    EDIT: Yup. Commenting out that block causes the smilies to be displayed in the order they are listed in vars.php. So for anyone who wants them in a particular order, editing the list should do the job. (This was with 1.5.1)

    [1] To me, anyway

  11. maryafernanda
    Member
    Posted 10 years ago #

    Thanks lbessant! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags