'default.gif','bmp'=>'img.gif','doc'=>'doc.gif','gif'=>'img.gif','gz'=>'zip.gif','jpeg'=>'img.gif','jpg'=>'img.gif','pdf'=>'pdf.gif','png'=>'img.gif','txt'=>'txt.gif','xls'=>'xls.gif','zip'=>'zip.gif');
$bb_attachments['icons']['url']=bb_get_option('uri').trim(str_replace(array(trim(BBPATH,"/\\"),"\\"),array("","/"),dirname(__FILE__)),' /\\').'/icons/';
$bb_attachments['icons']['path']=rtrim(dirname(__FILE__),' /\\').'/icons/';
$bb_attachments['title']="
"; // text, html or image to show on topic titles if has attachments
$bb_attachments['max']['php_upload_limit']=0; // in bytes, internal php upload limit - only edit if you know what you are doing
$bb_attachments['status']=array("ok","deleted","failed","denied extension","denied mime","denied size","denied count","denied duplicate","denied dimensions");
$bb_attachments['errors']=array("ok","uploaded file exceeds UPLOAD_MAX_FILESIZE in php.ini","uploaded file exceeds MAX_FILE_SIZE in the HTML form",
"uploaded file was only partially uploaded","no file was uploaded","temporary folder missing","failed to write file to disk","file upload stopped by PHP extension");
$bb_attachments['db']="bb_attachments"; // $bbdb->prefix."attachments"; // database name - force to "bb_attachments" if you need compatibility with an old install
// really stop editing!
if (!is_bb_feed()) {
function bb_attachments_active() {static $is_topic; return isset($is_topic)?$is_topic:$is_topic=in_array(bb_get_location(),array('topic-page','topic-edit-page','forum-page'));}
if (bb_attachments_active() || isset($_GET['new']) || !empty($_FILES) || strpos($_SERVER['QUERY_STRING'],'bb_attachments')!==false || (defined('BB_IS_ADMIN') && BB_IS_ADMIN)) {
include('bb-attachments-init.php');
}
if (!bb_attachments_active() && $bb_attachments['title']) {
add_filter('topic_title', 'bb_attachments_title',200);
function bb_attachments_title( $title ) {
global $bb_attachments, $topic;
if ($bb_attachments['title'] && isset($topic->bb_attachments) && intval($topic->bb_attachments)>0) {
$title=$title.$bb_attachments['title'];
}
return $title;
}
} // is_topic
if ($bb_attachments['style']) {
add_action('bb_head', 'bb_attachments_add_css'); // add css if present (including Kakumei 0.9.0.2 LI fix!)
function bb_attachments_add_css() { global $bb_attachments; echo ''."\n";} // inject css
}
} // is_bb_feed
?>