1
xb00t
How does XOOPS render its pages?
  • 2008/2/17 3:14

  • xb00t

  • Just popping in

  • Posts: 45

  • Since: 2004/8/19


hhttp://img514.imageshack.us/img514/4724/wtfso5.jpg

Do you see that character at the top of the User Info page? It has been driving me nuts for hours now. It shows up when a page is using a non utf-8 charset (Windows-1251/cyrillic). I had a look at the source code of the page to see where it is located and it sits just before system_userinfo.html is rendered.

My question is where do I find it and why is it there? Which file is rendered right before system_userinfo.html?

2
Anonymous
Re: How does XOOPS render its pages?
  • 2008/2/17 9:22

  • Anonymous

  • Posts: 0

  • Since:


Hi,

I don't think your issue is with userinfo.php otherwise we'd all have problems.

The theme you are using is Black2 from http://2bcool.net; theme.html calls a couple of extra .html files, one being header_menu.html and the other is block_centre.html

Might be wise to check block_centre.html as theres a fair bit of code in there that might be doing what you see.

I'll take a look at the theme on my test site later; I still have it as I used it as the basis for my site's theme.

3
xb00t
Re: How does XOOPS render its pages?
  • 2008/2/17 15:12

  • xb00t

  • Just popping in

  • Posts: 45

  • Since: 2004/8/19


Thanks for the info JAVesey. Here is what I found. The actual file which calls system_userinfo.html is blockcenter.html and it holds the following code:-

$i ;
$xoops_cblocks = array() ;
if( 
is_array( @$this->_tpl_vars['xoops_ccblocks'] ) ) foreach( $this->_tpl_vars['xoops_ccblocks'] as $i => $block ) {
    
$weight $block['weight'] * 65536 $i ;
    
$block['align'] = 'cc' ;
    
$xoops_cblocks$weight ] =  $block ;
}
if( 
is_array( @$this->_tpl_vars['xoops_clblocks'] ) ) foreach( $this->_tpl_vars['xoops_clblocks'] as $i => $block ) {
    
$weight $block['weight'] * 65536 $i 16384 ;
    
$block['align'] = 'cl' ;
    
$xoops_cblocks$weight ] =  $block ;
}
if( 
is_array( @$this->_tpl_vars['xoops_crblocks'] ) ) foreach( $this->_tpl_vars['xoops_crblocks'] as $i => $block ) {
    
$weight $block['weight'] * 65536 $i 32768 ;
    
$block['align'] = 'cr' ;
    
$xoops_cblocks$weight ] =  $block ;
}
// body's weight = 100
$xoops_cblocks100 65536 49152 ] = array( 'align' => 'bd' ) ;
ksort$xoops_cblocks ) ;
array_push$xoops_cblocks , array( 'align' => 'bd' ) ) ;

$prev_align 'bd' ;
foreach( 
$xoops_cblocks as $key => $block ) {
    
$xoops_cblocks[$key]['prev_html'] = $prev_htmls$prev_align $block['align'] ] ;
    
$prev_align $block['align'] ;
}

/* foreach( $xoops_cblocks as $key => $block ) {
    echo htmlspecialchars("$key:{$block['align']}:{$block['prev_html']}")."" ;
}
exit ; */

$last array_pop$xoops_cblocks ) ;
$this->_tpl_vars['xoops_cblocks'] = $xoops_cblocks ;
$this->_tpl_vars['xoops_cblocks_terminator'] = $last['prev_html'] ;
<{/
php}>

<{foreach 
item=block from=$xoops_cblocks}>
<{
$block.prev_html}>

    <{if 
$block.align == "bd"}>

    <
div id="content">
    <{
$xoops_contents}>
    div>
    <{else}>

    <
div<{* id="cb<{$block.weight}>" *}>>
    <{if ! 
$block.title|strstr:"none"}><div class="blockTitle"><{$block.title}>div><{/if}>
    <
div class="blockContent"><{$block.content}>div>
    div>

    <{/if}>

<{/foreach}>
<{
$xoops_cblocks_terminator}>

<{else}>
    <
div id="content">
    <{
$xoops_contents}>
    div>
<{/if}>


Since I dont use any center block I assume that the only part which runs from this code is the last 5 lines. Now here is a what the page looks after being rendered where it displays that annoying character:-

...
...
...
<
div id="content">
    ?
»?
<
form name="usernav" action="user.php" method="post">

<
br /><br />

<
table width="70%" align="center" border="0">
...
...
...


The first line is that of blockcenter.html, then you have the character and then system_userinfo.html starts. So somehow between the two HTML files falls in this unwanted char. But where from?

4
Anonymous
Re: How does XOOPS render its pages?
  • 2008/2/17 16:46

  • Anonymous

  • Posts: 0

  • Since:


Quote:
xb00t wrote:

The first line is that of blockcenter.html, then you have the character and then system_userinfo.html starts. So somehow between the two HTML files falls in this unwanted char. But where from?


What happens if you delete the code that refers to block_centre.html in theme.html?

Also, what happens if you wrap all occurrences of this code:

<{$xoops_contents}>


inside an "if" statement, i.e.

<{if $xoops_contents}><{$xoops_contents}><{/if}>


Also, if you look at a recent "standard" XOOPS theme you'll see the $xoops_contents code followed by the code for the bottom centre, left and right blocks to allow use of the blocks introduced by XOOPS 2.0.14.

The Black2 theme doesn't have these blocks; it is really a XOOPS Cube theme (see the manifesto.ini.php file, for example). I'm wondering if the code you see is a result of a centre_blocks.html not allowing for XOOPS having introduced these additional blocks?

Black2 is a lovely theme but I ended up splicing it into a standard XOOPS theme.html for my site.

5
xb00t
Re: How does XOOPS render its pages?
  • 2008/2/18 20:41

  • xb00t

  • Just popping in

  • Posts: 45

  • Since: 2004/8/19


Once again I prove to myslef that things are not as complicated as first thought.

It turns out that somehow when I have edited system_userinfo.html the char has somehow snuck in between the utf-8 and ASCII encoding which I had to switch in order to edit the file. I got rid of all the return and space character where the problem was and now its gone. Hooray!

Thanks for taking the time to help me JAVesey!

6
Anonymous
Re: How does XOOPS render its pages?
  • 2008/2/18 21:19

  • Anonymous

  • Posts: 0

  • Since:


Quote:
xb00t wrote:

Once again I prove to myslef that things are not as complicated as first thought.


Things in the world of XOOPS rarely are

Quote:
xb00t wrote:

Thanks for taking the time to help me JAVesey!


But I didn't do anything to help!

Let me know if you adapt Black2 to display the bottom three block positions...... yeah, I know I could do it myself but I won't have time for a couple of weeks or so

7
xb00t
Re: How does XOOPS render its pages?
  • 2008/2/19 0:41

  • xb00t

  • Just popping in

  • Posts: 45

  • Since: 2004/8/19


Quote:
But I didn't do anything to help!

Taking the time and showing the will to help is help enough.

Login

Who's Online

301 user(s) are online (204 user(s) are browsing Support Forums)


Members: 0


Guests: 301


more...

Donat-O-Meter

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

Latest GitHub Commits