obey-robots.txt
View Thread
BBcodes add all kinds of functions to your CMS. But they are not all ways coded optimal. So here you can find modifications and post new BBcodes to.
Are you going to use it?
Yes Yes 100%[1 Vote]
No No 0%[0 Votes]
Total Votes : 1
 Print Thread
Just 400px to small for geshi_bbcode and others
Fusioneer
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
Download source  GeSHi: PHP
  1. <?php
  2. /*-------------------------------------------------------+
  3. | PHP-Fusion Content Management System
  4. | Copyright (C) 2002 - 2009 Nick Jones
  5. | http://www.php-fusion.co.uk/
  6. +--------------------------------------------------------+
  7. | Filename: geshi_bbcode_include.php
  8. | Author: Wooya
  9. | Fixed: slawekneo
  10. +--------------------------------------------------------+
  11. | This program is released as free software under the
  12. | Affero GPL license. You can redistribute it and/or
  13. | modify it under the terms of this license which you
  14. | can read by viewing the included agpl.txt or online
  15. | at www.gnu.org/licenses/agpl.html. Removal of this
  16. | copyright header is strictly prohibited without
  17. | written permission from the original author(s).
  18. +--------------------------------------------------------*/
  19. if (!defined("IN_FUSION")) { die("Access Denied"); }
  20.  
  21. if (preg_match("/\/forum\//i", FUSION_REQUEST)) global $data;
  22.  
  23. unset($lines);
  24. unset($ccount);
  25. unset($matches);
  26. include_once(INCLUDES."bbcodes/geshi/geshi.php");
  27. preg_match_all("#\[geshi=(.*?)\](.*?)\[/geshi\]#si",$text,$matches,PREG_PATTERN_ORDER);
  28. for($i=0; $i<count($matches[1]); $i++) {
  29. $lines = explode("\n", $matches[2][$i]);
  30. if (count($lines)<200) {
  31. $input = str_replace('','',str_replace('','', str_replace('', '', stripslashes($matches[2][$i]))));
  32. //replace problematic characters
  33. $search = array("\\", """, "'", "\", """, "'", "<", ">", "&");
  34. $replace = array("\\\\", "\"", "'", "\\", "\"", "\'", "<", ">", "&");
  35. $input = str_replace($search,$replace, $input);
  36. $geshi = new GeSHi($input, $matches[1][$i]);
  37. $geshi -> set_header_type(GESHI_HEADER_PRE);
  38. $geshi -> set_overall_style('font-family:\'Courier New\', Courier; font-size:12px;');
  39. $geshi -> set_link_styles(GESHI_LINK, 'font-weight:bold;');
  40. $geshi -> set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
  41. $geshi -> enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
  42. $geshi -> set_footer_content($locale['bb_geshi_info']);
  43. $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');
  44. if (preg_match("/\/forum\//i", FUSION_REQUEST) && isset($data['post_id'])) {
  45. $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>&nbsp;&nbsp;";
  46. } else {
  47. $geshi_save = "";
  48. }
  49. $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>";
  50. $text = str_replace($matches[0][$i], $text2, $text);
  51. } else {
  52. $ccount = substr_count($text, "[geshi=");
  53. for ($i=0;$i < $ccount;$i++) {
  54. if (preg_match("/\/forum\//i", FUSION_REQUEST) && isset($data['post_id'])) {
  55. $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>&nbsp;&nbsp;";
  56. } else {
  57. $geshi_save = "";
  58. }
  59. $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);
  60. }
  61. }
  62. unset($lines);
  63. }
  64. ?>
  65.  
Parsed in 0.093 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.
Download source  GeSHi: PHP
  1. <?php
  2. /*-------------------------------------------------------+
  3. | PHP-Fusion Content Management System
  4. | Copyright (C) 2002 - 2009 Nick Jones
  5. | http://www.php-fusion.co.uk/
  6. +--------------------------------------------------------+
  7. | Filename: geshi_bbcode_include.php
  8. | Author: Wooya
  9. | Fixed: slawekneo
  10. +--------------------------------------------------------+
  11. | This program is released as free software under the
  12. | Affero GPL license. You can redistribute it and/or
  13. | modify it under the terms of this license which you
  14. | can read by viewing the included agpl.txt or online
  15. | at www.gnu.org/licenses/agpl.html. Removal of this
  16. | copyright header is strictly prohibited without
  17. | written permission from the original author(s).
  18. +--------------------------------------------------------*/
  19. if (!defined("IN_FUSION")) { die("Access Denied"); }
  20.  
  21. if (preg_match("/\/forum\//i", FUSION_REQUEST)) global $data;
  22.  
  23. unset($lines);
  24. unset($ccount);
  25. unset($matches);
  26. include_once(INCLUDES."bbcodes/geshi/geshi.php");
  27. preg_match_all("#\[geshi=(.*?)\](.*?)\[/geshi\]#si",$text,$matches,PREG_PATTERN_ORDER);
  28. for($i=0; $i<count($matches[1]); $i++) {
  29. $lines = explode("\n", $matches[2][$i]);
  30. if (count($lines)<200) {
  31. $input = str_replace('','',str_replace('','', str_replace('', '', stripslashes($matches[2][$i]))));
  32. //replace problematic characters
  33. $search = array("\\", """, "'", "\", """, "'", "<", ">", "&");
  34. $replace = array("\\\\", "\"", "'", "\\", "\"", "\'", "<", ">", "&");
  35. $input = str_replace($search,$replace, $input);
  36. $geshi = new GeSHi($input, $matches[1][$i]);
  37. $geshi -> set_header_type(GESHI_HEADER_PRE);
  38. $geshi -> set_overall_style('font-family:\'Courier New\', Courier; font-size:12px;');
  39. $geshi -> set_link_styles(GESHI_LINK, 'font-weight:bold;');
  40. $geshi -> set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
  41. $geshi -> enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
  42. $geshi -> set_footer_content($locale['bb_geshi_info']);
  43. $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');
  44. if (preg_match("/\/forum\//i", FUSION_REQUEST) && isset($data['post_id'])) {
  45. $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>&nbsp;&nbsp;";
  46. } else {
  47. $geshi_save = "";
  48. }
  49. $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>";
  50. $text = str_replace($matches[0][$i], $text2, $text);
  51. } else {
  52. $ccount = substr_count($text, "[geshi=");
  53. for ($i=0;$i < $ccount;$i++) {
  54. if (preg_match("/\/forum\//i", FUSION_REQUEST) && isset($data['post_id'])) {
  55. $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>&nbsp;&nbsp;";
  56. } else {
  57. $geshi_save = "";
  58. }
  59. $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);
  60. }
  61. }
  62. unset($lines);
  63. }
  64. ?>
  65.  
Parsed in 0.027 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!
 
Jump to Forum
New Thread Post Reply
Use BBcode or HTML to refer to; 'Just 400px to small for geshi_bbcode and others'
BBcode:
HTML: