Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorSarah
    • CommentTimeFeb 24th 2008
     permalink
    I get this error after I enabled the emoticons plugin...

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'plugin_emoticons_filter' was given in /fp-includes/core/core.wp-plugin-interface.php on line 54

    What can I do to get rid of the error?
    •  
      CommentAuthorlaborix
    • CommentTimeFeb 24th 2008
     permalink
    Hi,
    one question please. Do you have following folder with the emoticons images?

    "fp-content/emoticons"

    If not, so it is possible that you get this error. The emoticons plugin have no images and don't add this folder by default. If you want to use the emoticons, you must search by your own for this images copy it in this folder and add then in your "common.css" of your theme this line:

    /* = for emoticons only ===== */
    #main img.emoticon { margin: 0 }


    So it work by me with FP 0.703.6 and SVN#76 :)
    •  
      CommentAuthorSarah
    • CommentTimeFeb 24th 2008 edited
     permalink
    Actually I do have a folder named emoticons under fp-content already. Plus, I do have that code in the css. So what else is there to it??

    This is just the bottom selection from the Plugin Config in Admin Panel:

    );

    add_filter( 'the_content', 'plugin_emoticons_filter' );

    ?>

    Did I put that in correctly??
    •  
      CommentAuthorlaborix
    • CommentTimeFeb 24th 2008 edited
     permalink
    Here my plugin code. Can you compare this with our emoticons plugin code?
    <?php
    /*
    Plugin Name: emoticons
    Plugin URI: http://www.flatpress.org/
    Description: Adds emoticons to FlatPress
    Author: NoWhereMan
    Version: 1.0
    Author URI: http://www.nowhereland.it/
    */

    /*
    put your imgs in FP_CONTENT/emoticons/
    (tipically FP_CONTENT is fp-content/ )
    */

    define('EMOTICONS_DIR', FP_CONTENT . 'emoticons/');

    /* now please notice how I follow this naming convention: */
    function plugin_emoticons_filter($string) {
    static $EMOTICONS = array(
    ':)' => 'fp_smile.gif', // of course format can be whatever; I use PNGs
    ':(' => 'fp_sad.gif', // these are the images you have in fp-content/emoticons/
    ';)' => 'fp_wink.gif', // you can put multiple shortcuts for the same
    ':D' => 'fp_bigsmile.gif',
    ':oops:' => 'fp_redface.gif',
    ':eek:' => 'fp_eek.gif',
    ':roll:' => 'fp_rolleyes.gif',

    // etc etc
    );

    $ed = EMOTICONS_DIR;

    foreach ($EMOTICONS as $emo => $img) {
    $string = str_replace(
    " $emo ", /* replace one of the codes defined above,
    when *sourrounded by spaces* */
    "<img src=\"{$ed}{$img}\" class=\"emoticon\" alt=\"{$emo}\" />", /* with the <img> tag */
    $string
    );
    }
    return $string;

    }

    /* and now, don't forget to register to the hook */
    add_filter( 'the_content', 'plugin_emoticons_filter' );
    /* if you want it in comments too */
    add_filter( 'comment_text', 'plugin_emoticons_filter' );

    ?>


    The images named in the code are imaginary, there are my own names :D


    Edit://
    If you want to use this emoticons, you need two space before and behind the ":)" smiley.
    •  
      CommentAuthorSarah
    • CommentTimeFeb 24th 2008
     permalink
    Uh, that does not quite help much :/ I do not think any of that will get rid of the warning. The warning is found in the preview box when want to edit an entry. I can ensure our emoticons plugin file is exactly the same except for the smiley names.
    •  
      CommentAuthorlaborix
    • CommentTimeFeb 24th 2008
     permalink
    Which version of FP do you use? And how is the plugin code named? Did it work in your blog and does only appear if you want to edit this entry?

    My emoticon plugin is named "plugin.emoticons.php". I have tested your problem with FP 0.703.6 and SVN#76, but I can't get the same failure case as you have :(

    Can you do following?

    - disable the plugin (SVN??)
    - clear cache with an ftp program (also hidden files if available)
    - copy and paste my code in the file "plugin.emoticons.php"
    - get sure that that images in the specified folder
    - activate the plugin (SVN??)

    Try again to edit your entry.
    •  
      CommentAuthorSarah
    • CommentTimeFeb 24th 2008 edited
     permalink
    I do not use SVN. I use the latest version of FP. The plugin is named plugin.emoticons.php. It do not work both on blog and upon edit. I still see those ugly warning lines on the page while the plugin is activated.

    How do I clear cache with an ftp program? I have FireFTP.
    Can you tell me how and/or where to put in the Plugin Config in Admin Panel in order to register to the hook??

    Is there something wrong with the file mentioned in the warning?? I think this is the line but I'm not quite sure:

    } else {
    $the_args = $all_args;
    }

    $string = call_user_func_array($function_name, $the_args);

    I don't know if that tells anything. I'm getting pissed and I can't use emoticons at all.
    •  
      CommentAuthorlaborix
    • CommentTimeFeb 24th 2008
     permalink
    Login in FP, the switch to the Admin panel and click on "Plugins". A text box" will appear. Please add two slashs before the 'emoticons' entry.

    Then connect to your URL with your FTP program, login and switch to fp-content. There is a folder named "cache". Go into it and mark all files to delete. Finished.

    Then copy and past my code in your "plugin.emtoicons.php" and transfer this with your FTP program to fp-plugins in the folder "emoticons". Overwrite your first "plugin.emoticons.php".

    Check all images named in the "plugin.emoticons.php" if they are in the folder "emoticons" found in the "fp-content" folder.

    Now remove the two slashs in the Admin panel for the plugin "emoticons". Make sure that you use following syntax:
    ...

    'searchbox',
    'blockparser',
    //'headstuff',
    'emoticons',
    );
    ...


    This is only a snippset of my plugin configuration. I have copy and paste the "blockparser" entry and change it to "emoticons". Press "save" and logout.

    Then clear all cookies and the cache in your browser. Reload your Blog and login again, now all should work fine (I hope)...
    •  
      CommentAuthorSarah
    • CommentTimeFeb 24th 2008
     permalink
    Yay it's working! However, I had to use the code from Wiki instead of your code because it gave me an error. And to be honest, I am an idiot! I put this:

    add_filter( 'the_content', 'plugin_emoticons_filter' );

    instead of this:

    'emoticons',

    so, i am sorry for taking so much of your time but you finally gave me an example and that got me thinking "what the hell was i thinking?!"