1
BCdudes
Re: PHP5 and Xoops
  • 2008/3/10 17:12

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


Thats cool

I think I kind of solved it, by salvaging stuff from this thread:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=57404&forum=28&post_id=253680#forumpost253680

I guess my PHP is 5.2, maybe thats why.


But now with another site that i am trying to fix (same problem), i am getting this:

Fatal errorCall to undefined function xoops_gethandler() in /home/marjanmc/public_html/navtravels.com/include/common.php on line 92


I tried to recopy common.php, ..etc.., but i dunno wut the problem is, i removed the xlanguage "api" statement from common.php, useless.

Please advice.



2
BCdudes
Re: PHP5 and Xoops
  • 2008/3/10 14:20

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


Ok

So you are absolutely correct, one of my 2.0.13.2 sites was still working. The problem was the xlanguage module (more specifically, the common.php edit that points to its api) which is on many sites, but not this particular one.

I tried to update the module to v3, it was useless. Any ideas how to fix it ? maybe there's an alternative module for languages around?

Secondly, about updating to 2.0.18.1, is there an update patch? or is it just a mere copy-across sort of scenario ?

regards



3
BCdudes
PHP5 and Xoops
  • 2008/3/10 13:25

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


Hi all

recently, my host moved me over to PHP5, this caused all my XOOPS 2.0.13.2 sites to stop working and to show a blank page. Mambo sites were fine, and other HTML/PHP scripts were ok.

Can you please shed some light on how i can fix that as soon as possible ?


regards
BCdudes



4
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/12/13 23:01

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


What you can do (Provided that you have the same number of modules in both ur languages) is create mock modules with:
index.php
logo.gif
xoops_version.php

and then in index.php, u can put an if clause to check the language, and if lang is "en", it would take you to module " Games", and if language is "fr", it would take you to module "Romance", for e.g.: (my php is crap, so this code has a 99% chance of NOT working, but you get the idea)

if ($xoopsConfig['language'] == 'en') { 

<
SCRIPT language="JavaScript">
<!--
window.location="http://www.site.com/modules/[color=CC0000]Games/[/color]";
//-->
</SCRIPT>

  } 

if (
$xoopsConfig['language'] == 'fr') { 

<
SCRIPT language="JavaScript">
<!--
window.location="http://www.site.com/modules/[color=CC0000]Romance/[/color]";
//-->
</SCRIPT>  }


Something like that, I am not the expert.

So this way, you can change the modules for the different languages, but as i said, you will have to have the same number of modules for this method to work...


my methods are usually simple and crap and inefficient, but they do the job , for me at least



5
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/12/13 16:13

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


you can test the following method,

open your theme.html file, and edit one of the images this way for eg:

<img src="http://yoursite.com/[en]imageEN.jpg[/en][ar]imageDE.jpg[/ar]"> </img>

this usually works , i have tried it on a couple of different sites, and if it works, then you can also insert lang tags to specify which block template files to be used. or rather which CSS to use (u can make two CSS files, style.css and styleAR.css to change the blocks orientation..etc..), i am not so sure about the content of the blocks, but there must be a way, but i just dont know it. sorry.



6
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/12/13 15:45

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


I think this looks alright

if (!defined("XOOPS_ROOT_PATH")) {
    die(
"XOOPS root path not defined");
}

// Ensure charset setting
if (!headers_sent()) {
    
header('Content-Type:text/html; charset='._CHARSET);
}

$GLOBALS['xoopsLogger']->context "core";

// Get blocks
$block_handler =& xoops_gethandler('block');
$block_handler->assignBlocks();

$GLOBALS['xTheme']->checkCache();
[
color=993300]/////////////////// Add the new code here ?/////////////////// 
if ($xoopsConfig['language'] == 'lang1') { 
   
$xoopsConfig['theme_set']='theme1'
  } 
if (
$xoopsConfig['language'] == 'lang2') { 
   
$xoopsConfig['theme_set']='theme2'
  }
/////////////////// [/color]
if (!isset($GLOBALS['xoopsOption']['template_main'])) {
    include 
XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
    
$xoopsTheme['thename'] = $GLOBALS['xoopsConfig']['theme_set'];
}
$GLOBALS['xoopsLogger']->context "module";
?>


If not, try this:

if (!defined("XOOPS_ROOT_PATH")) {
    die(
"XOOPS root path not defined");
}

// Ensure charset setting
if (!headers_sent()) {
    
header('Content-Type:text/html; charset='._CHARSET);
}

$GLOBALS['xoopsLogger']->context "core";

// Get blocks
$block_handler =& xoops_gethandler('block');
$block_handler->assignBlocks();

$GLOBALS['xTheme']->checkCache();

if (!isset(
$GLOBALS['xoopsOption']['template_main'])) {
    include 
XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
    
$xoopsTheme['thename'] = $GLOBALS['xoopsConfig']['theme_set'];
}
$GLOBALS['xoopsLogger']->context "module";


[
color=993300]/////////////////// Add the new code here ?/////////////////// 
if ($xoopsConfig['language'] == 'lang1') { 
   
$xoopsConfig['theme_set']='theme1'
  } 
if (
$xoopsConfig['language'] == 'lang2') { 
   
$xoopsConfig['theme_set']='theme2'
  }
/////////////////// [/color]

?>



I am not really familiar with 2.2.x, as for getting your blocks to disappear automatically with the new language, its a bit difficult i think, because each block operates independantly, and the method described in only relates to switching the layout (CSS files, images..etc..), but not the contents or the blocks.

To what I understand, you will need to add new lang tags in every single block, and add the new language to all module "language" folder !

Sorry about that, maybe someone else would help you.



7
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/12/13 14:35

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


Yes, the theme will completely change due to the language selection.

The block styles will change, but the content+location of the blocks will not change due to the language.

What you can do however, you can put different contents in the block when it goes to a different language, for example:

[en] this block is for the date and time and other information [/en] [fr] Je ne parle pas le francais [/fr]

or try using empty tags, like:
[en] this is my info in english that i dont want in german [/en] [de] [/de]

this was, when you switch to "de", the content becomes empty .

but you cant make blocks disappear on theme change, because blocks are dealt with in the mySQL db, not at the theme level.

regards



8
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/11/29 20:23

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


Yes, I know, here it is:

Edit "header.php" in the root folder
and insert this code:

if ($xoopsConfig['language'] == '[b][color=FF0000]lang1[/color][/b]') { 
   
$xoopsConfig['theme_set']='[b][color=FF0000]theme1[/color][/b]'
  } 
if (
$xoopsConfig['language'] == '[b][color=11FF11]lang2[/color][/b]') { 
   
$xoopsConfig['theme_set']='[b][color=11FF11]theme2[/color][/b]'
  } 
if (
$xoopsConfig['language'] == '[b][color=1111FF]lang3[/color][/b]') { 
   
$xoopsConfig['theme_set']='[b][color=1111FF]theme3[/color][/b]'
  } 
if (
$xoopsConfig['language'] == '[b]lang4[/b]') { 
   
$xoopsConfig['theme_set']='[b]theme4[/b]'
  } 
.
.
.
.


insert the code before this line (at about line 30)
include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';



9
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/11/29 17:59

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


I would, maybe when i come to design the next site, I have done 3 multilingual sites so far, 2 of them i used the long method (crap, believe me), and 1 i used this new method which (to be honest) i think is quicker than all.

but i ll try your method, and if i run into any troubles i ll PM u, cheers man.



10
BCdudes
Re: Different Theme for Each Language, Script
  • 2006/11/29 17:41

  • BCdudes

  • Just popping in

  • Posts: 27

  • Since: 2006/8/31


is this fa.css specific to your theme? or is it generic, and wut template did you use (is it the style.css available in most themes , or ?)




TopTop
(1) 2 3 »



Login

Who's Online

163 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 163


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits