blank
blank
home
:: archives

:: categories

:: wp plugins

hosted by xg3
powered by wp
navigation by wp-dtree
bloggersg
badbehavior
© 2008, silpstream

Wednesday, 21st June 2006

:: WordPress-Scriptaculous

Introduction

With a whole new set of coders releasing plugins that use scriptaculous, I thought I'd write a plugin to make the whole installation easier for users. I know I found it easier to install WordPress Widgets support with it!

This is plugin makes no changes to the original scriptaculous files. It merely puts them in your folder and adds the relevant links in the 'head' area of your pages so that the correct files can be loaded by the browser.

It also makes an addition to the WordPress options table so that other plugin coders can check for the existance of scriptaculous on your WordPress installation, and notify you if it is missing. This option can be checked by using:

get_option('wp_scriptaculous_installed');

It is a native WordPress function and will return true if WP-Scriptaculous is installed and false if it is not. Read the notes below for more information.

Changes are made to your .htaccess file so that any calls for the scriptaculous files are directed to the right place. As such it should be nearly idiot proof and you won't have to change a thing after the install.

My other plugin WP-dTree makes use of this plugin. Go check it out!

Download

WP-Scriptaculous version 1.6.1 has been downloaded 4382 times!

Installation

1. Extract the files and transfer the 'wp-scriptaculous' folder to your plugins folder.
2. Make sure that your .htaccess file is writable (permissions set to 666).
3. Log into your admin panel and click on 'Activate'.

If you need to know how to set the .htaccess file, or find out if you even have one, please read the documentation on the topic here and here. If you don't have the file or it is not writable then this plugin will bomb!!!

Once you have installed this you may want to check your other plugins to turn off their calls to the scriptaculous files on your pages. Most plugin authors provide documentation on how to do this for their plugins.

Notes

WP-Scriptaculous makes changes to your .htaccess file. It will add in rules to redirect any calls to the scriptaculous files to the right place. This is done in a similar fashion to how WordPress uses mod_rewrite for Permalinks. It should in no way interfere with WordPress though, so don't worry.

I've also added in tow fields to the option table in the WordPress database. They are 'wp_scriptaculous_installed' and 'wp_scriptaculous_version', and can be checked for by using the WordPress function 'get_option()'. This can be added to the activate protion of a plugin to check for scriptaculous availability and version before allow the plugin to install, thus saving a user from fumbling around. For example:


add_action('activate_your_plugin.php','your_plugin_activate');
function your_plugin_activate() {
  if ( get_option('wp_scriptaculous_installed') &&
   ( get_option('wp_scriptaculous_version') >= 161 ) ) {
    DO PLUGIN ACTIVATION
  } else {
    DO NOT ACTIVATE PLUGIN
    SEND ERROR TO INSTALL WP-Scriptaculous
  }
}


get_option('wp_scriptaculous_version') returns an integer number to make it easier for you to do a check within the 'if' statement. Thus version '1.6.1' would return '161'. I'll keep updating this plugin as newer versions of scriptaculous is released.

I hope that this plugin helps other coders by making it easier for their users to install their Scriptaculous enabled plugins.


:: comments
Mon, 25th September 2006

Hi,

I’ve uploaded scriptaculous to my site runnig wordpress but I just cannot see it under my plugin list.

TKS
AG


:: andrea
Sat, 07th October 2006

Thanks for this great plugin.

The install was perfect and did everything you said (excellent). My site is still under construction but I’m getting close to launching (http://www.aconservativecentrist.com). The final pages with the most recent styling and with the current editorial, has yet to be uploaded. The site has a WordPress Blog (address below).

I notice you said that your plugin helped you to install widgets. This has been a nagging problem for me. I can install widgets and move them around the sidebar. However, I can’t configure any of them which make widgets unusable for me.

Since my site is still under construction there is no rush, but I was hoping you would provide more information on how to use your plugin to install widgets in WordPress.

It would be a great help to me.

Thanks again for the plugin and for any help you might provide.
Tony


:: Tony Perraglia
Wed, 18th October 2006

Andrea,
This works in the background so you don’t see anything in you admin panel. If you have plugins that require scriptaculous, then this plugin make sure that everything is installed properly.


:: silpstream
Wed, 18th October 2006

Tony,
It doesn’t help me install widgets, it allows for the properfuntionality that I need for widgets to work. Configuration of the widgets is a function of what the widget author allows. If they didn’t create the configuration options then you are out of luck unless you want to hack their code.


:: silpstream
Thu, 14th December 2006

mhm … altough worpress instalation is so easy - even for noobie as me I went trough that process easy.


:: Antyki
Sun, 18th February 2007

Thanks for plugin.


:: Hayal
Thu, 22nd February 2007

This plugin is awesome!!! it also solves the drag & drop problem with the widgets in wordpress 2.1


:: Felipe