Ignore:
Timestamp:
07/06/08 08:55:55 (4 years ago)
Author:
hverton
Message:

more fixed to the code block fold-out. Style sheet adjusted, line numbers right-aligned, made sure the options line under the block is the same width as the code block

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/forum_functions_include.php

    r1526 r1527  
    330330 
    331331function _parseubb_codeblock($matches) { 
    332     global $codeblocks, $blockcount, $current_message, $raw_color_blocks; 
     332    global $codeblocks, $blockcount, $current_message, $raw_color_blocks, $locale; 
    333333 
    334334    // empty code block? 
     
    364364    $id = count($codeblocks); 
    365365    ++$blockcount; 
    366     $link = "<img src='".THEME."images/panel_on.gif' alt='' title='Toggle full code view' name='b_code_".$blockcount."' onclick=\"javascript:flipOverflow('code_".$blockcount."')\" />"; 
    367     $link .= "<div class='side' style='display:inline;'> <a href='".BASEDIR."getfile.php?type=fc&amp;forum_id=".$current_message['forum_id']."&amp;thread_id=".$current_message['thread_id']."&amp;post_id=".$current_message['post_id']."&amp;id=".$id."' title='download this ".$matches[1]." code'>download</a> </div>"; 
    368     $codeblocks[] = array(" 
    369     <div id='box_code_".$blockcount."' class='codecontainer'> 
    370     <table class='codeblock' cellpadding='0' cellspacing='0'> 
    371         <tr style='padding:0px;margin:0px;'> 
    372             <td class='codenr'>".$ln."</td> 
    373             <td class='code'>".$matches[2]."</td> 
    374         </tr> 
    375     </table> 
    376     </div>".$link." 
    377     ", $matches[1]); 
     366    $link = "<table class='codecontainer' style='border:0px;'><tr><td align='left'><a href='".BASEDIR."getfile.php?type=fc&amp;forum_id=".$current_message['forum_id']."&amp;thread_id=".$current_message['thread_id']."&amp;post_id=".$current_message['post_id']."&amp;id=".$id."' title='".sprintf($locale['583'],$matches[1])."'>".$locale['584']."</a></td><td align='right'><img src='".THEME."images/right.gif' alt='' title='".$locale['582']."' name='b_code_".$blockcount."' onclick=\"javascript:flipOverflow('code_".$blockcount."')\" /></td></tr></table>"; 
     367    $codeblocks[] = array("<div id='box_code_".$blockcount."' class='codecontainer'><table class='codeblock' cellpadding='0' cellspacing='0'><tr style='padding:0px;margin:0px;'><td class='codenr'>".$ln."</td><td class='code'>".$matches[2]."</td></tr></table></div>".$link, $matches[1]); 
    378368    return "{**@".($id)."@**}"; 
    379369} 
     
    427417    $rawmsg = parseubb($rawmsg); 
    428418    // convert any newlines to html <br> 
     419    $rawmsg = str_replace("\r\n\r\n", "\r\n", $rawmsg); 
    429420    $rawmsg = nl2br($rawmsg); 
     421     
    430422 
    431423    // re-insert the saved code blocks 
Note: See TracChangeset for help on using the changeset viewer.