1
sabahan
Division by Zero - xLanguage
  • 2011/9/18 3:59

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


my site is throwing random blank page in main page and certain module page..i have this error since long time ago..but only now reporting this here..

i thought it was my hoster server issue

i enabled debug ..this error is displayed

Quote:

Warning: Division by zero in file /home/portal_users/xxx/xxx_data/caches/smarty_compile/05d3d339-xlanguage-mytheme-default^%%D6^D6E^D6E59BDD%%db%3Axlanguage_block.html.php line 27
Warning: Division by zero in file /home/portal_users/xxx/xxx_data/caches/smarty_compile/05d3d339-xlanguage-mytheme-default^%%D6^D6E^D6E59BDD%%db%3Axlanguage_block.html.php line 27


this is line 27
if ($this->_foreach['lang_it']['iteration'] % $this->_tpl_vars['block']['number'] == 0): ?>|endif; ?>


this is the whole file xlanguage_block.html
/* Smarty version 2.6.26, created on 2011-09-18 11:25:04
         compiled from db:xlanguage_block.html */ 
?>

if ($this->_tpl_vars['block']['display'] == 'images' || $this->_tpl_vars['block']['display'] == 'text'): ?>
    $this->_tpl_vars['block']['languages']; if (!is_array($_from) && !is_object($_from)) { settype($_from'array'); }$this->_foreach['lang_it'] = array('total' => count($_from), 'iteration' => 0);
if (
$this->_foreach['lang_it']['total'] > 0):
    foreach (
$_from as $this->_tpl_vars['lang']):
        
$this->_foreach['lang_it']['iteration']++;
?>
        echo $this->_tpl_vars['block']['url']; ?>
echo $this->_tpl_vars['lang']['name']; ?>
" title="echo $this->_tpl_vars['lang']['desc']; ?>
">
        if ($this->_tpl_vars['block']['display'] == 'images'): ?>
            echo $this->_tpl_vars['lang']['image']; ?>
" alt="echo $this->_tpl_vars['lang']['desc']; ?>
"
            if ($this->_tpl_vars['block']['selected'] != $this->_tpl_vars['lang']['name']): ?> 
                style="MozOpacity: .8; opacity: .8; filter:Alpha(opacity=80);"
            endif; ?>
            />
        else: ?>
        echo $this->_tpl_vars['lang']['desc']; ?>

        endif; ?>
        
        if ($this->_foreach['lang_it']['iteration'] % $this->_tpl_vars['block']['number'] == 0): ?>|endif; ?>
    endforeach; endif; unset($_from); ?>
else: ?>
                onChange="if(this.options[this.selectedIndex].value.length >0 )    { window.document.location=this.options[this.selectedIndex].value;}"
    >
    $this->_tpl_vars['block']['languages']; if (!is_array($_from) && !is_object($_from)) { settype($_from'array'); }$this->_foreach['lang_it'] = array('total' => count($_from), 'iteration' => 0);
if (
$this->_foreach['lang_it']['total'] > 0):
    foreach (
$_from as $this->_tpl_vars['lang']):
        
$this->_foreach['lang_it']['iteration']++;
?>
        echo $this->_tpl_vars['block']['url']; ?>
echo $this->_tpl_vars['lang']['name']; ?>

            if ($this->_tpl_vars['block']['selected'] == $this->_tpl_vars['lang']['name']): ?>selectedendif; ?>
        >echo $this->_tpl_vars['lang']['desc']; ?>

    endforeach; endif; unset($_from); ?>
    
endif; ?>




How to fix this

Im using
Quote:

xlanguage 3.11
XOOPS Version XOOPS 2.5.2
PHP Version 5.3.6
mySQL Version 5.1.56
Server API cgi-fcgi
OS Linux
safe_mode Off
register_globals Off
magic_quotes_gpc On
allow_url_fopen Off
fsockopen On
post_max_size 8M
max_input_time 60
output_buffering
max_execution_time 30
memory_limit 32M
file_uploads On
upload_max_filesize 5M


2
trabis
Re: Division by Zero - xLanguage
  • 2011/9/18 11:21

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


in xlanguage_block.html try use this code:
<div style="text-align: center; margin-left: auto; margin-right: auto;">
<{if 
$block.display eq "images" OR $block.display eq "text"}>
    <{foreach 
item=lang name=lang_it from=$block.languages}>
        <
a href="<{$block.url}><{$lang.name}>" title="<{$lang.desc}>">
        <{if 
$block.display eq "images"}>
            <
img src="<{$lang.image}>" alt="<{$lang.desc}>"
            
<{if $block.selected != $lang.name}> 
                
style="MozOpacity: .8; opacity: .8; filter:Alpha(opacity=80);"
            
<{/if}>
            />
        <{else}>
        <{
$lang.desc}>
        <{/if}>
        a>
        <{if 
$block.number &&  $smarty.foreach.lang_it.iteration $block.number eq 0}>
        <
br />
        <{/if}>
    <{/foreach}>
<{else}>
    <
select name="selectlang"
            
onChange="if(this.options[this.selectedIndex].value.length >0 )    { window.document.location=this.options[this.selectedIndex].value;}"
    
>
    <{foreach 
item=lang name=lang_it from=$block.languages}>
        <
option value="<{$block.url}><{$lang.name}>" 
            
<{if $block.selected eq $lang.name}>selected<{/if}>
        ><{
$lang.desc}>option>
    <{/foreach}>
    select>
<{/if}>
div>


3
sabahan
Re: Division by Zero - xLanguage
  • 2011/9/18 11:42

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


the error notice is gone..

thank you trabis

i will monitor my website if there are any random blank page

im having this problem in two different website with two different hoster

TQ

Login

Who's Online

398 user(s) are online (57 user(s) are browsing Support Forums)


Members: 0


Guests: 398


more...

Donat-O-Meter

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

Latest GitHub Commits