WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • Bug, output_filter, WB 2.8.2RC2
  • Print
Pages: [1]   Go Down

Author Topic: Bug, output_filter, WB 2.8.2RC2  (Read 6047 times)

Offline Xagone

  • Posts: 482
  • Gender: Male
  • Developper
    • Xagone Inc
Bug, output_filter, WB 2.8.2RC2
« on: December 22, 2011, 10:21:46 PM »
when loading a template, you see a js file called that is not linked right

something like
<script src="/home/user/website/js/mdcr.js" type="text/javascript"></script>

it's because of line 116 throught in filter-routine.php in output-filter module.

this code does not work :
Code: [Select]
$script = str_replace('\\', '/', dirname(__FILE__)).'/js/mdcr.js';
if(is_readable($script)) {
$scriptLink = '<script src="'.$script.'" type="text/javascript"></script>';
$regex = '/(.*)(<\s*?\/\s*?head\s*>.*)/isU';
$replace = '$1'.$scriptLink.'$2';
$content = preg_replace ($regex, $replace, $content);
$output_filter_mode |= pow(2, 2); // n | 2^2
}

so to "repair" the problem, i've added the line
Code: [Select]
$script = str_replace(dirname(__FILE__),WB_URL.'/modules/output_filter',$script);right after
Code: [Select]
if(is_readable($script)) {witch gives
Code: [Select]
$script = str_replace('\\', '/', dirname(__FILE__)).'/js/mdcr.js';
if(is_readable($script)) {
$script = str_replace(dirname(__FILE__),WB_URL.'/modules/output_filter',$script);
$scriptLink = '<script src="'.$script.'" type="text/javascript"></script>';
$regex = '/(.*)(<\s*?\/\s*?head\s*>.*)/isU';
$replace = '$1'.$scriptLink.'$2';
$content = preg_replace ($regex, $replace, $content);
$output_filter_mode |= pow(2, 2); // n | 2^2
}
Logged
Xagone Inc. (formerly VotreEspace)
http://xagone.com/

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • Bug, output_filter, WB 2.8.2RC2
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2