Ok, so this is long, poorly thought out, and I haven't really been following this thread, so if I take more away from the conversation than I offer, just let me know and I shut up... *grin*
Personally, I think I would prefer to run each of those seperately so that you can pull info (like errors) out after the query...
Something like this (though it doesn't test the results):
Code: Select all
$queries = array();
array_push($queries,"ALTER TABLE {$serendipity['dbPrefix']}guestbook ( CHANGE name name varchar(100) )");
array_push($queries,"ALTER TABLE {$serendipity['dbPrefix']}guestbook ( CHANGE body text )");
array_push($queries,"ALTER TABLE {$serendipity['dbPrefix']}guestbook ( CHANGE timestamp datestamp )");
foreach ($queries as $query) {
$sql = serendipity_db_schema_import($query);
}
Ok, for images I did this in linklist:
I set up a configuration option. If this is true it uses the plugin folder, otherwise it uses the default template folder:
Code: Select all
case 'imgdir':
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_LINKS_IMGDIR);
$propbag->add('description', PLUGIN_LINKS_IMGDIR_BLAHBLAH);
$propbag->add('default', 'true');
break;
Then, somewhere before the output I set the folder based on the configuration
Code: Select all
$imgdir = $this->get_config('imgdir');
if ($imgdir) {
$imgdir = $serendipity['baseURL'].'plugins/'.$plugin_dir;
} else {
$imgdir = $serendipity['baseURL'].'templates/default';
}
But I did this before we had smarty, so I really should change this to also test the current template using serendipity_getTemplateFile somehow.
(I'll have to think about that.)
The permalink thing is probably easiest to see in the contactform plugin... look for the permalink configuration setting, and the interaction with the "selected" function.