Browsed by
Month: May 2015

Recursive install of a plugin to WordPress blogs

Recursive install of a plugin to WordPress blogs

I’ve had occasion recently to install a plugin on over 100 existing WordPress ePortfolio sites. The users themselves were unaware of the change and did not have to do anything to activate the new plugin. The plugin itself is fairly simple ‘Allow SWF Upload‘. This plugin overrides get_allowed_mime_types to allow Shockwave files to be uploaded. I found directly altering wp-includes/functions.php and removing the unset call for $t[‘swf’] didn’t work as WordPress put this straight back when I logged in so…

Read More Read More

Handling NOSCRIPT alternatives in php code

Handling NOSCRIPT alternatives in php code

I have started to build a timetable page for current students which should give them the option of viewing today’s timetable or this week’s timetable on a stand alone page. To facilitate this I’ve added an HTML facility to the timetable web service I use to get the data. Up ’til now it’s just returned XML which has to be parsed and displayed in whatever host code calls it but I want ready made HTML. Because the timetable data source…

Read More Read More

Handling database changes in Moodle module upgrade

Handling database changes in Moodle module upgrade

As I work on updated versions of Moodle modules I have found some difficulty in changing the default values of fields. The symptoms of this were successful module upgrades but that the default field values in the database had not changed. This turned out to be a result of my lack of understanding of the module upgrade process. Here is an example taken from the corepack module table which is used to store statutory course information in our Moodle system:…

Read More Read More

Shifting database connections to mysqli_* from mysql_*

Shifting database connections to mysqli_* from mysql_*

As the php.net site informs us, the mysql_connect() and similar functions are now deprecated and will be removed in a later version of php. I will be upgrading the live LearnNet and ePortfolio servers over summer so I decided to stay ahead of any potential future issues by updating all of my own application and Moodle plugin code to the new mysqli functions (Which stands for MySql Improved Extension). mysql_connect() Here’s a quick, incomplete version of how database connections have…

Read More Read More