
Super Admin

Posts: 64
Joined: 20-10-2011
|
I find the output of geshi_bbcode_include.php to small. It's only 400 pixels width. Here I describe where to find and how to expand the output.
Take a look of an example created on this site with expanded pixels.
header.php Use googleapis as a CDN
Go to your bbcode directory and edit geshi_bbcode_include.php
This is the original geshi_bbcode_include.php
GeSHi: PHP<?php /*-------------------------------------------------------+ | PHP-Fusion Content Management System | Copyright (C) 2002 - 2009 Nick Jones | http://www.php-fusion.co.uk/ +--------------------------------------------------------+ | Filename: geshi_bbcode_include.php | Author: Wooya | Fixed: slawekneo +--------------------------------------------------------+ | This program is released as free software under the | Affero GPL license. You can redistribute it and/or | modify it under the terms of this license which you | can read by viewing the included agpl.txt or online | at www.gnu.org/licenses/agpl.html. Removal of this | copyright header is strictly prohibited without | written permission from the original author(s). +--------------------------------------------------------*/ if (!defined("IN_FUSION")) { die("Access Denied"); } if (preg_match("/\/forum\//i", FUSION_REQUEST )) global $data; include_once(INCLUDES."bbcodes/geshi/geshi.php"); preg_match_all("#\[geshi=(.*?)\](.*?)\[/geshi\]#si",$text,$matches,PREG_PATTERN_ORDER ); for($i=0; $i<count($matches[1]); $i++) { $lines = explode("\n", $matches[2][$i]); //replace problematic characters $search = array("\\", """, "'", "\", """, "'", "<", ">", "&"); $replace = array("\\\\", "\"", "'", "\\", "\"", "\'", "<", ">", "&"); $geshi = new GeSHi($input, $matches[1][$i]); $geshi -> set_header_type(GESHI_HEADER_PRE); $geshi -> set_overall_style('font-family:\'Courier New\', Courier; font-size:12px;'); $geshi -> set_link_styles(GESHI_LINK, 'font-weight:bold;'); $geshi -> set_link_styles(GESHI_HOVER, 'background-color: #f0f000;'); $geshi -> enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); $geshi -> set_footer_content($locale['bb_geshi_info']); $geshi -> set_footer_content_style('font-family:Verdana,Arial,sans-serif;color:#808080;font-size:9px;font-weight:bold;background-color:#f0f0ff;border-top: 1px solid #d0d0d0;padding:2px;width:400px'); if (preg_match("/\/forum\//i", FUSION_REQUEST ) && isset($data['post_id'])) { $geshi_save = "<a href='".INCLUDES."bbcodes/geshi_bbcode_save.php?thread_id=".$_GET['thread_id']."&post_id=".$data['post_id']."&code_id=".$i."'><img src='".INCLUDES."bbcodes/images/geshi_save.png' alt='".$locale['bb_geshi_save']."' title='".$locale['bb_geshi_save']."' style='border:none' /></a> "; } else { $geshi_save = ""; } $text2 = "<div class='tbl-border tbl2' style='width:400px'>".$geshi_save."<strong>GeSHi: ".$geshi->get_language_name()."</strong></div><div class='tbl-border tbl1' style='width:400px;height:auto;white-space:nowrap;overflow:auto;background-color:#ffffff;'><code style='white-space:nowrap'>".$geshi->parse_code()."</code></div>"; } else { for ($i=0;$i < $ccount;$i++) { if (preg_match("/\/forum\//i", FUSION_REQUEST ) && isset($data['post_id'])) { $geshi_save = "<a href=\'".INCLUDES."bbcodes/geshi_bbcode_save.php?thread_id=".$_GET['thread_id']."&post_id=".$data['post_id']."&code_id=".$i."\'><img src=\'".INCLUDES."bbcodes/images/geshi_save.png\' alt=\'".$locale['bb_geshi_save']."\' title=\'".$locale['bb_geshi_save']."\' style=\'border:none\' /></a> "; } else { $geshi_save = ""; } $text = preg_replace("#\[geshi=(.*?)\](.*?)\[/geshi\]#sie", "'<div class=\'tbl-border tbl2\' style=\'width:400px\'>".$geshi_save."<strong><i><u>".$locale['bb_geshi_parser1'].":</u></i> ".$locale['bb_geshi_parser2'].":</strong></div><div class=\'tbl-border tbl1\' style=\'width:400px;white-space:nowrap;overflow:auto\'><code style=\'white-space:nowrap\'>'.formatcode('\\2').'</code></div>'", $text); } } } ?>
Parsed in 0.016 seconds, using GeSHi 1.0.8.10
Find all style=\'width:400px instances and replace them with for example style=\'width:550px
Now it looks like this.
GeSHi: PHP<?php /*-------------------------------------------------------+ | PHP-Fusion Content Management System | Copyright (C) 2002 - 2009 Nick Jones | http://www.php-fusion.co.uk/ +--------------------------------------------------------+ | Filename: geshi_bbcode_include.php | Author: Wooya | Fixed: slawekneo +--------------------------------------------------------+ | This program is released as free software under the | Affero GPL license. You can redistribute it and/or | modify it under the terms of this license which you | can read by viewing the included agpl.txt or online | at www.gnu.org/licenses/agpl.html. Removal of this | copyright header is strictly prohibited without | written permission from the original author(s). +--------------------------------------------------------*/ if (!defined("IN_FUSION")) { die("Access Denied"); } if (preg_match("/\/forum\//i", FUSION_REQUEST )) global $data; include_once(INCLUDES."bbcodes/geshi/geshi.php"); preg_match_all("#\[geshi=(.*?)\](.*?)\[/geshi\]#si",$text,$matches,PREG_PATTERN_ORDER ); for($i=0; $i<count($matches[1]); $i++) { $lines = explode("\n", $matches[2][$i]); //replace problematic characters $search = array("\\", """, "'", "\", """, "'", "<", ">", "&"); $replace = array("\\\\", "\"", "'", "\\", "\"", "\'", "<", ">", "&"); $geshi = new GeSHi($input, $matches[1][$i]); $geshi -> set_header_type(GESHI_HEADER_PRE); $geshi -> set_overall_style('font-family:\'Courier New\', Courier; font-size:12px;'); $geshi -> set_link_styles(GESHI_LINK, 'font-weight:bold;'); $geshi -> set_link_styles(GESHI_HOVER, 'background-color: #f0f000;'); $geshi -> enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); $geshi -> set_footer_content($locale['bb_geshi_info']); $geshi -> set_footer_content_style('font-family:Verdana,Arial,sans-serif;color:#808080;font-size:9px;font-weight:bold;background-color:#f0f0ff;border-top: 1px solid #d0d0d0;padding:2px;width:550px'); if (preg_match("/\/forum\//i", FUSION_REQUEST ) && isset($data['post_id'])) { $geshi_save = "<a href='".INCLUDES."bbcodes/geshi_bbcode_save.php?thread_id=".$_GET['thread_id']."&post_id=".$data['post_id']."&code_id=".$i."'><img src='".INCLUDES."bbcodes/images/geshi_save.png' alt='".$locale['bb_geshi_save']."' title='".$locale['bb_geshi_save']."' style='border:none' /></a> "; } else { $geshi_save = ""; } $text2 = "<div class='tbl-border tbl2' style='width:550px'>".$geshi_save."<strong>GeSHi: ".$geshi->get_language_name()."</strong></div><div class='tbl-border tbl1' style='width:550px;height:auto;white-space:nowrap;overflow:auto;background-color:#ffffff;'><code style='white-space:nowrap'>".$geshi->parse_code()."</code></div>"; } else { for ($i=0;$i < $ccount;$i++) { if (preg_match("/\/forum\//i", FUSION_REQUEST ) && isset($data['post_id'])) { $geshi_save = "<a href=\'".INCLUDES."bbcodes/geshi_bbcode_save.php?thread_id=".$_GET['thread_id']."&post_id=".$data['post_id']."&code_id=".$i."\'><img src=\'".INCLUDES."bbcodes/images/geshi_save.png\' alt=\'".$locale['bb_geshi_save']."\' title=\'".$locale['bb_geshi_save']."\' style=\'border:none\' /></a> "; } else { $geshi_save = ""; } $text = preg_replace("#\[geshi=(.*?)\](.*?)\[/geshi\]#sie", "'<div class=\'tbl-border tbl2\' style=\'width:550px\'>".$geshi_save."<strong><i><u>".$locale['bb_geshi_parser1'].":</u></i> ".$locale['bb_geshi_parser2'].":</strong></div><div class=\'tbl-border tbl1\' style=\'width:550px;white-space:nowrap;overflow:auto\'><code style=\'white-space:nowrap\'>'.formatcode('\\2').'</code></div>'", $text); } } } ?>
Parsed in 0.017 seconds, using GeSHi 1.0.8.10
This works for other bbcodes as well. For example code_bbcode_include.php, php_bbcode_include.php and many others.
Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
|