Simple Code Box DownloadMOD-Title: Simple Code Box Download
MOD-Version: 0.0.1
MOD-Author: 4seven
Request by: BenecoreRequest post: http://www.phpbb.com/community/viewtopi ... #p13149859MOD-Description: Provides a txt download link of codebox content after clicking [SELECT ALL]
phpBB-Version: phpBB 3.0.x
phpBB-Languages: en
phpBB-Styles: prosilver
Features:- Download of [ code ] box content as txt file
- By click on [SELECT ALL] the txt file is made
- The file is temporary generated, so near zero disk space
- Successfull tested with FF, Chrome, Opera and Safari
- Less edits and minimalistic design
- No mass file generating
- Xhtml 1.0. strict
Exceptions/Known Bugs:- The linebreaks dont work right in some IE Versions
- Infos:
http://www.google.com/search?q=download ... er+problemhttp://www.biglist.com/lists/xsl-list/a ... 00299.htmlhttp://www.codingforums.com/showthread.php?t=155570 Screens: (v.0.0.2)
Click [SELECT ALL]
Attachment:
1.png [ 1.03 MiB | Viewed 2735 times ]
Temp txt file is generated
Attachment:
2.png [ 1.03 MiB | Viewed 2735 times ]
Click on Link
Attachment:
3.png [ 1.08 MiB | Viewed 2735 times ]
Notepad++
Attachment:
4.png [ 836.67 KiB | Viewed 2735 times ]
Demo: http://4seven.bplaced.net/forum/media/viewto ... 1763#p1763Note: You have to click [SELECT ALL] before download
Instruction:downloadAttachment:
copyroot/popcontent.php >> popcontent.php
root/popcontent/*.* >> popcontent/*.*
open.htaccess
findCode:
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
after addCode:
<FilesMatch "\.(txt)$" >
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>
openstyles/prosilver/template/bbcode.html
findCode:
<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}: <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open -->
<!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->
replace withCode:
<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}: <a href="#" onclick="selectCode(this); popcontent(); return false;">{L_SELECT_ALL_CODE}</a> | <span class="popcontent">Note: Click [Select All] before download</span></dt><dd><code><!-- END code_open -->
<!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->
openstyles/prosilver/template/viewtopic_body.html
findCode:
<!-- BEGIN postrow -->
before addCode:
<!-- Simple Code Box Download / 4seven / 2012 -->
<script type="text/javascript">
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery-latest.min.js"><\/script>');
</script>
<script type="text/javascript">
// <![CDATA[
function popcontent() {
var selobj = document.getSelection();
selob = selobj.toString();
var ts = Math.round((new Date()).getTime() / 1000);
$('.popcontent').load('popcontent.php', {codetxt : selob, filnam: ts+'.txt'});
}
// ]]>
</script>
<!-- Simple Code Box Download / 4seven / 2012 -->

none

none