Language images in Forum in PHP-Nuke 7.4/7.3
Date: Friday, August 13 @ 04:42:11 CEST
Topic: Bug Fixes


I think to have found a little bug into phpBB port to PHP-Nuke with the language images of the forum.
Here how I have fixed the problem.

I also make a little patch to make the forum HTML4.01 compliant, read all...

While I was developing the theme for my site I found what I think to be a bug into che porting of phpBB to PHP-Nuke. I'm not 100% sure of this but to make my and other themes function properly I had to do a patch to a file of phpBB.

This "bug" does not permit the correct loading of the language images of phpBB ported to PHP-Nuke, if you select a language different from english into your portal the forum would be translated but the images used to make a new post or reply does not.

I've tested this on PHP-Nuke 7.3 and 7.4, but I think the bug should be present also in previous version. I have NOT tested the standalone versione of phpBB.


Here what I did:

The file to be patched is : html/includes/functions.php

You have to search for the line ALL ON THE SAME LINE:


$img_lang = ( file_exists(@phpbb_realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english';


(about at line 356 in Nuke 7.4 and line 377 in Nuke 7.3)

Comment out that line and substitute with this:


$img_lang = ( file_exists(@phpbb_realpath($current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english';


Now the forum would load the correct language image from the correct directory of the theme, surly if them are present, in case language file is not available it will continue loading the english one.


-----


And now a little patch if you want to make the forum HTML4.01 compliant, or at least try to make it so.

You have to patch the file : html/includes/sessions.php

You have to search for the funtions "append_sid" and "admin_sid" int othe file and patch by adding a line before the last "return $url" like below.


function append_sid($url, $non_html_amp = false)
[...]
$url = str_replace("&", "&a mp;", $url);
return $url;
}

function admin_sid($url, $non_html_amp = false)
[...]
$url = str_replace("&", "&a mp;", $url);
return($url);
}

Remove the space in "&a mp;"


Whit this patch the forum would contruct the link using the specification of HTML4.01

I'd like to know if someone could test this infos and check them. Thanks.






This article comes from NukeCops
http://www.nukecops.com

The URL for this story is:
http://www.nukecops.com/modules.php?name=News&file=article&sid=2662