** ** This file is part of Image Upload Mod. ** ******************************************************************************** */ // Some info about your mod. $mod_title = 'Image Upload'; $mod_version = '1.2.1'; $release_date = '11-3-05'; $author = 'Max Khitrov'; $author_email = 'max@mxsoft.org'; // One or more versions of PunBB that this mod works on. The version names must match exactly! $punbb_versions = array('1.2.5', '1.2.6', '1.2.7', '1.2.8', '1.2.9', '1.2.10', '1.2.12'); // Set this to false if you haven't implemented the restore function (see below) $mod_restore = false; // This following function will be called when the user presses the "Install" button. function install() { global $db, $db_type, $pun_config; $db->query("ALTER TABLE `".$db->prefix."forum_perms` ADD `image_upload` TINYINT( 1 ) DEFAULT '0' NOT NULL"); $attach_config = array('iu_allowed_ext' => 'gif,png,jpg,jpeg', 'iu_max_width' => '1600', 'iu_max_height' => '1200', 'iu_max_size' => '524288', 'iu_thumb_width' => '100', 'iu_thumb_height' => '100', 'iu_table_cols' => '4', 'iu_max_post_images' => '20', 'iu_upload_path' => dirname(__FILE__).'/uploads/' ); foreach($attach_config AS $key => $value) { $db->query("INSERT INTO ".$db->prefix."config (conf_name, conf_value) VALUES ('$key', '".$db->escape($value)."')") or error('Unable to add column "'.$key.'" to config table', __FILE__, __LINE__, $db->error()); } $d = dir(PUN_ROOT.'cache'); while (($entry = $d->read()) !== false) { if (substr($entry, strlen($entry)-4) == '.php') @unlink(PUN_ROOT.'cache/'.$entry); } $db->close(); } // This following function will be called when the user presses the "Restore" button (only if $mod_uninstall is true (see above)) function restore() { //global $db, $db_type, $pun_config; } /***********************************************************************/ // DO NOT EDIT ANYTHING BELOW THIS LINE! // Circumvent maintenance mode define('PUN_TURN_OFF_MAINT', 1); define('PUN_ROOT', './'); require PUN_ROOT.'include/common.php'; // We want the complete error message if the script fails if (!defined('PUN_DEBUG')) define('PUN_DEBUG', 1); // Make sure we are running a PunBB version that this mod works with if(!in_array($pun_config['o_cur_version'], $punbb_versions)) exit('You are running a version of PunBB ('.$pun_config['o_cur_version'].') that this mod does not support. This mod supports PunBB versions: '.implode(', ', $punbb_versions)); $style = (isset($cur_user)) ? $cur_user['style'] : $pun_config['o_default_style']; ?>
Your database has been successfully prepared for . See readme.txt for further instructions.
Your database has been successfully restored.