https://www.icyphoenix.com/viewtopic.php?f=28&t=6831 ----------------------------------- TopoMotoV3X Tue 05 Jan, 2010 02:01 How To Allow Download After Reply ----------------------------------- Hello everyone, I'm updating my forum to the new version, and I want to bring back all the changes I had in version 1.2.0.27c, this is the first change adjusted for the version 1.3.0.53 :mryellow: This is an edit function to hide the download and thus encourage the user to respond if he wants to download the file. [hr] [b]Go to: [color=red][i]/includes/[/i][/color][/b] File: [color=deepskyblue][i]bbcode.php[/i][/color] Search: [code linenumbers=false]$lang['xs_bbc_hide_message_explain'] = 'This message is hidden, you have to answer this topic to see it.';[/code] Replace with: [code linenumbers=false]$lang['xs_bbc_hide_message_explain'] = 'Protected file, you must respond to the discussion for download.';[/code] Find and delete: [code linenumbers=false]$html = '
' . $lang['xs_bbc_hide_message'] . ':
';[/code] [hr] [b]Go to: [i][color=red]/language/lang_english[/color][/i][/b] File: [i][color=deepskyblue]lang_bbcb_mg.php[/color][/i] Search: [code linenumbers=false] 'xs_bbc_hide_message' => 'Hidden Message', 'xs_bbc_hide_quote_message' => 'Quoted Hidden Message, which is still hidden.', 'xs_bbc_hide_message_explain' => 'Sorry, but you must be registered and also post a reply to view this message.',[/code] Replace with: [code linenumbers=false] 'xs_bbc_hide_message' => 'Hidden Message', 'xs_bbc_hide_quote_message' => 'Quoted Message, Download Error.', 'xs_bbc_hide_message_explain' => 'Sorry, Must send a reply to download this file.',[/code] [hr] [b]Upload these two images to: [color=red][i]/images/bbcb_mg/images/gif[/i][/color][/b] [img]http://www.hellomotorazrforum.com/images/bbcb_mg/images/gif/hide.gif[/img] calling: hide.gif [img]http://www.hellomotorazrforum.com/images/bbcb_mg/images/gif/hide1.gif[/img] calling: hide1.gif [hr] [b] Go to: [color=red][i]/language/lang_english[/i][/color][/b] File: [color=deepskyblue][i]lang_bbcb_mg.php[/i][/color] Search: [code linenumbers=false]'bbcb_mg_highlight' => 'Highlight',[/code] After add: [code linenumbers=false]'bbcb_mg_hide' => 'Hide a Download',[/code] Search: [code linenumbers=false]$js_lang['s_phpbbmod_help'] = 'phpBB Mod Template';[/code] After add: [code linenumbers=false]$js_lang['s_hide_help'] = 'Add link to hide: Hidden Message: Sorry, but you must be registered and also post a reply to view this message. ';[/code] [hr] [b]Go to:[color=red][i] /language/lang_english[/i][/color][/b] File: [color=deepskyblue][i]bbcb_mg.php[/i][/color] Search: [code linenumbers=false]'L_BBCB_MG_HIGHLIGHT' => $lang['bbcb_mg_highlight'],[/code] After add: [code linenumbers=false]'L_BBCB_MG_HIDE' => $lang['bbcb_mg_hide'],[/code] Search: [code linenumbers=false]'L_HIGHLIGHT_HELP' => $lang['s_highlight_help'][/code] After add: [code linenumbers=false]'L_HIDE_HELP' => $lang['s_hide_help',[/code] [hr] [b]Go to: [color=red][i]templates/common/js[/i][/color][/b] File: [color=deepskyblue][i]bbcb_mg.js[/i][/color] Search: [code linenumbers=false]var Td = 0;[/code] After add: [code linenumbers=false]var Hide = 0;[/code] Search: [code linenumbers=false]'[highlight=]','[/highlight]',[/code] After add: [code linenumbers=false]'Hidden Message: Sorry, but you must be registered and also post a reply to view this message. ',[/code] Search: [code linenumbers=false]function BBCbold()[/code] Add first: [code linenumbers=false]function BBChide() { var txtarea = document.post.message; if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; if (theSelection != '') { document.selection.createRange().text = "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "; document.post.message.focus(); return; } } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { //mozWrap(txtarea, "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "); mozInsert(txtarea, "Hidden Message: Sorry, but you must be registered and also post a reply to view this message. "); return; } if (Hide == 0) { ToAdd = "[hide]"; document.post.hide_img.src = bbcb_mg_img_path + "hide1" + bbcb_mg_img_ext; Hide = 1; } else { ToAdd = "[/hide]"; document.post.hide_img.src = bbcb_mg_img_path + "hide" + bbcb_mg_img_ext; Hide = 0; } PostWrite(ToAdd); }[/code] [hr] [b]Go to: [color=red][i]templates/default[/i][/color][/b] File: [color=deepskyblue][i]bbcb_mg.tpl[/i][/color] Search: [code linenumbers=false]{L_BBCB_MG_HIGHLIGHT}[/code] After add: [code linenumbers=false]{L_BBCB_MG_HIDE}[/code] [b]Result:[/b] [img]http://www.icyphoenix.com/files/images/3404/2010_01_05_013722.png[/img] [img]http://www.icyphoenix.com/files/images/3404/re2.png[/img] [img]http://www.icyphoenix.com/files/images/3404/re3.png[/img] I hope it is to your liking :) Regards TopoMotoV3X ----------------------------------- Mighty Gorgon Sun 17 Jan, 2010 13:10 Re: Download File If You Answer. ----------------------------------- Thank you very much for sharing, I will move it to customizations forum.