If you have a kaskus emoticons plugin for wordpress, but you would like to retrieve all the images in the same directory, you should appreciate this mod.
Editing your kaskus-emoticons-list.php , you should be able to substitute it by the following code:
<?php
$KEEUrl = get_option(’siteurl’) . ‘/wp-content/plugins/kaskus-emoticons/emoticons/’;
$opt = get_option(‘kaskus_emoticons’);
if ($handle = opendir(‘/(your root patch)/wp-content/plugins/kaskus-emoticons/emoticons/’)) {
$KEReplace = array ();
$contatoreemoticons=0;
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
if ($contatoreemoticons>2) {
$KEReplace[':'.$file] = ‘<img src=”‘.$KEEUrl.”.$file.’” style=”border:none;background:none;width:50px;”/>’;
}
$contatoreemoticons++;
}
closedir($handle);
}
$KEReplace2 = $KEReplace;
if(isset($opt['stat'])){
foreach($opt['stat'] as $k=>$v){
$KEReplace[$k]=”";
}
}
?>
In this way, the plugin will find any images in your /wp-content/plugins/kaskus-emoticons/emoticons folder, and associate them in the array for each image by an id, so you’ll be able to add, remove and modify anything you need just uploading the correct images in your folder.
Remeber to change (your root patch) in the absolute folder patch, in my case was:
“web/htdocs/www.rionero24ore.com/home”