https://www.icyphoenix.com/viewtopic.php?f=28&t=3682&p=24874#p24874 ----------------------------------- KasLimon Sun 24 Feb, 2008 22:17 Download BBCode ----------------------------------- [b][u]Customization description[/u][/b] This BBCode will allow you to add links to downloads when posting. The link will look like this: [url=http://www.icyphoenix.com/dload.php?action=category&cat_id=2][img]http://www.icyphoenix.com/files/images/548/mid_a1f07e92d0a7deb385654421facc770c_downloadua3.gif[/img] You'll be able to add this with the tag [download]URL[/download] You'll also be able to set the target (by default _blank). For example [download target=_self]Download[/download]. [b][u]Installation instructions[/u][/b] [list=1][*]To download images right click on them and choose "Save image". Upload [img]http://www.icyphoenix.com/files/images/548/mid_345d85135c765e92f7e3ba1ba2cd2e63_downloadsv4kp3.gif[/img] to images/bbcb_mg/images/gif/download[b].gif[/b] (image by Danilo) Upload [img height=20]http://www.icyphoenix.com/files/images/548/mid_a1f07e92d0a7deb385654421facc770c_downloadua3.gif[/img] to images/download[b].gif[/b] (image found in [url=http://xlphs.deviantart.com/art/Download-52340608]Deviantart) [*]Apply code changes:[spoiler][code linenumbers=false] # #-----[ OPEN ]------------------------------------------ # includes/bbcode.php # #-----[ FIND ]------------------------------------------ # 'codeblock' => array( 'nested' => false, 'inurl' => false, ), # #-----[ AFTER, ADD ]------------------------------------------ # 'download' => array( 'nested' => false, 'inurl' => false, ), # #-----[ FIND ]------------------------------------------ # // OPACITY # #-----[ BEFORE, ADD ]------------------------------------------ # // DOWNLOAD if($tag === 'download') { if(empty($content) || $this->is_sig) { return $error; } if (isset($item['params']['target'])) { $target = $item['params']['target']; } else { $target = '_blank'; } $html = '' . $lang['Download'] . ''; return array( 'valid' => true, 'html' => $html ); }[/code] [b]Apply this to all languages you have installed[/b]:[code linenumbers=false]# #-----[ OPEN ]------------------------------------------ # language/lang_english/bbcb_mg.js # #-----[ FIND ]------------------------------------------ # s_posticyimage = ' # #-----[ AFTER, ADD ]------------------------------------------ # s_download_insert = 'Please write file URL'; # #-----[ FIND ]------------------------------------------ # s_smiley_creator = ' # #-----[ AFTER, ADD ]------------------------------------------ # s_download_help = 'Download: [download]URL[/download] Insert a link to a file'; # #-----[ FIND ]------------------------------------------ # '[emff]','[/emff]' # #-----[ REPLACE WITH ]------------------------------------------ # '[emff]','[/emff]', '[download]','[/download]' # #-----[ FIND ]------------------------------------------ # var ToAdd = "[url=" + enterURL + "]" + enterTITLE + ""; } PostWrite(ToAdd); } # #-----[ AFTER, ADD ]------------------------------------------ # function BBCdownload() { var FoundErrors = ''; var enterURL = prompt(s_download_insert, s_url_insert_tip); if (!enterURL) { FoundErrors += s_url_error; } if (FoundErrors) { alert(s_gen_error + FoundErrors); return; } var ToAdd = "[download]" + enterURL + "[/download]"; PostWrite(ToAdd); }[/code] [b]Apply this to all templates you have installed[/b]:[code linenumbers=false]# #-----[ OPEN ]------------------------------------------ # templates/mg_themes/bbcb_mg.tpl # #-----[ FIND ]------------------------------------------ # {L_BBCB_MG_URL} # #-----[ BEFORE, ADD ]------------------------------------------ # {L_BBCB_MG_DOWNLOAD}[/code][/spoiler] [*]Clean cache[/list] Enjoy this mod! :mricy: