.ZenphotoPress_left {margin-right:1em;} .ZenphotoPress_right {margin-left:1em;}'; echo $output; } /** * Add the plugin for the tinyMCE editor * @param $plugins Plugins array * @return Updated plugins array */ function extended_editor_mce_plugins($plugins) { array_push($plugins, '-zenphotopress'); return $plugins; } /** * Add the button for the tinyMCE editor * @param buttons Buttons array * @return Updated buttons array */ function extended_editor_mce_buttons($buttons) { array_push($buttons, 'separator', 'zenphotopress'); return $buttons; } /** * Add javascript code to make tinyMCE load the plugin */ function add_tinymce_js() { $url = get_bloginfo('wpurl') . '/' . PLUGINDIR . '/zenphotopress/tinymce/'; echo 'tinyMCE.loadPlugin("zenphotopress", "' . $url . '");' . "\n"; } /** * Add javascript to make ZenphotoPress available with the plain text editor */ function add_plainTextEditor_js() { $url = get_bloginfo('wpurl') . '/' . PLUGINDIR . '/zenphotopress/tinymce'; ?> '' " . "ORDER BY ".$zenphotoorder." " . "LIMIT $limit_start,10"; $query = mysql_query($sql); $sql = "SELECT COUNT(id) " . "FROM ".$_zp_conf_vars['mysql_prefix']."images " . "WHERE albumid=".$k." AND filename<>''"; $imagesnum = mysql_query($sql); while ($image = mysql_fetch_assoc($query)) { if( $zp_mod_rewrite['value'] ) { $tumbnails .= ''.$image['name'].' '; } else { $tumbnails .= ''.$image['name'].' '; } } if( isset($tumbnails) ) { $content = str_replace('[zenphotopress]gallery='.$k.'[/zenphotopress]',$tumbnails,$content); } unset($tumbnails); } } return ($content); } } // Add actions add_action('admin_menu', array('zenphotopress','add_pages')); add_action('wp_head', array('zenphotopress','add_style')); add_action('tinymce_before_init', array('zenphotopress','add_tinymce_js')); add_filter('the_content', array('zenphotopress','MyInsertZPGallery'),2); // Add filters add_filter('mce_plugins',array('zenphotopress','extended_editor_mce_plugins'),0); add_filter('mce_buttons',array('zenphotopress','extended_editor_mce_buttons'),0); add_filter('admin_footer',array('zenphotopress','add_plainTextEditor_js')); ?>