PEAK XOOPS - On and OFF Left Column in englishin japanese

On and OFF Left Column

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2005/5/13 22:15
kenchan17  企霹始   Posts: 8
初めてm投稿します。
先日Customizing XOOPSを読ませていただきました。すばらしい本で、「なるほど」と、今まで??と思っていたことが体系的に判りうれしかったです。
ところで、読ませて頂いた前に、何となく作ってしまった左コラムのオン&OFFのハックがあるので検証していただきたく投稿しています。

/xoops/header.php
の166行から次のようにします。
-----------------------------------
switch ($block_arr[$i]->getVar('side')) {
case XOOPS_SIDEBLOCK_LEFT:
//ここから入れる //
if (!isset($show_lblock)) {
$xoopsTpl->assign('xoops_showlblock', 1);
$show_lblock = 1;
}
// ここまで入れる //
$xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
break;
-------------------------------------
そして、Themesで右コラムと同様に
--------------------------------------
<!-- Display left blocks if any -->
<{if $xoops_showlblock == 1}>
<td id="leftcolumn">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{if $block.title}>
<div align=center class="blockTitle">
<{$block.title}>
</div>
<{/if}>
<div class="blockContent"><{$block.content}></div>
<{/foreach}>
</td>
<{/if}>
<!-- End left blocks loop -->
---------------------------------------------------------
とすれば、何もブロック表示させない設定をすれば左コラムは表示されません。

本を読ませていただくと、なんか危なそうですね。
Votes:1 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2005/5/14 0:11
maumed  企霹始   Posts: 9
hil...

can someone translate it into english, please?

Thanx in advance,
Mauricio
Votes:8 Average:8.75
Previous post - Next post | Parent - Children.1 | Posted on 2005/5/14 12:28
kenchan17  企霹始   Posts: 8
This is the first posting.
I just have read the book 'Customizing XOOPS', Mr.GOTO & Mr.UEMATSU wrote.
It is GREAT, I fully satisfied what I had been in trouble and I can understand systematically about XOOPS.

By the way, I have already made a hack below before I read. And I wonder the hack is all right. I want the best method if it is wrong.


Line 166 of '/xoops/header.php'
-----------------------------------
switch ($block_arr[$i]->getVar('side')) {
case XOOPS_SIDEBLOCK_LEFT:
// begin //
if (!isset($show_lblock)) {
$xoopsTpl->assign('xoops_showlblock', 1);
$show_lblock = 1;
}
// finish //
$xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
break;
-------------------------------------


And change the themes file about 'theme.html'
--------------------------------------
<!-- Display left blocks if any -->
// begin //
<{if $xoops_showlblock == 1}>
<td id="leftcolumn">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{if $block.title}>
<div align=center class="blockTitle">
<{$block.title}>
</div>
<{/if}>
<div class="blockContent"><{$block.content}></div>
<{/foreach}>
</td>
<{/if}>
<!-- End left blocks loop -->
// finish //
---------------------------------------------------------

This will make no left block if no module block on left block is set. :lol: :lol:
Votes:1 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2005/5/15 17:38
GIJOE  黎扦烦菱   Posts: 4110
hi kenchan.

At first, thank you for buying my book.

The codes looks safe enough.

But I think there are no necessity to hack header.php.
 <!-- Display left blocks if any -->
 <{if count($xoops_lblocks) > 0}>
  <td id="leftcolumn">
   <!-- Start left blocks loop -->
   <{foreach item=block from=$xoops_lblocks}>
    <{if $block.title}>
     <div align=center class="blockTitle">
      <{$block.title}>
     </div>
    <{/if}>
    <div class="blockContent"><{$block.content}></div>
   <{/foreach}>
   <!-- End left blocks loop -->
  </td>
 <{/if}>
I'm sorry that I don't check the code woks or not
Votes:1 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2005/5/16 0:54
kenchan17  企霹始   Posts: 8
Thank you for your reply.
This is much clever customizing.
Thnaks.
Votes:1 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!