ToolBox
Regular


Joined: Mar 16, 2005
Posts: 74
|
Posted:
Thu Jun 04, 2009 8:06 pm |
|
The present post is a sort of random thought which may be useful to those who seek for fresh air in their nuke sites.
Foot Note:
This post is one of blog stories which I am wiring up to prepare fully-integrated WordPress Blog module into NUKE.
Do you think your site users are becoming bored by your too much static visuals and user-interface components in phpnuke-based screen? Probably they are, or probably not.
Just put a tiny change on your site which always appears in the same dresses. The front-end of most phpnuke has blocks which are overused or abused from the point of user-interface research and human information processing (They are much lazier than we think). However, blocks are inevitably necessary. If so, let us try to put a really tiny change on them.
The primary question raised in here is “do we have to use the same width of blocks on both right and left sides?” Personally, that’s very bad because different size of left and right group of blocks might be perceived to users as different groups of information (this is a sort of natural mapping in human user interface).
Now, look at your theme-pack file, theme.php
Try to follow the codes first and experiment what is going on;
Code:
#
# ------- [ OPEN ] --------
#
<nuke-root>/themes/YOUR-THEME/theme.php
#
# ------ [ FIND ] ----------
#
Function OpenTable()
#
# ------ [ BEFORE, ADD ] ---------
#
$block_dir = 0;
$block_counter = 0;
$leftBlockWidth = 160;
$rightBlockWidth = 210;
|
Those four variables are in global span to define block direction, numbering every block on both sides, different width of blocks on the right and left.
Now, find blocks(“left”) function call. And add add the fillowing codes
Code:
#
# ------- [ FIND ] ----------
#
Blocks(“left”);
|
Around the function efined in mainfile.php, add the following codes to indicate left side is processing in theme.php. Therefore,
Code:
#
# -------- [ FIND ] ------------
#
themeHeader()
{
#
# -------- [ AFTER ,ADD ] -------
#
global $block_dir, $block_counter;
global $leftBlockWidth, $rightBlockWidth;
$block_dir = 0;
$block_counter = 0;
|
Now, find the code block in real theme.php
Code:
echo "<td valign='top' width='160' style='padding: 0 4 0 0; ' />";
if (defined('INDEX_FILE2'))
{
blocks("left");
};
|
Add indicator before this function call
And change the <td> tag with the variable size of left block as follows:
Code:
$bwidth = $leftBlockWidth;
echo "<td valign='top' width='".$bwidth."' style='padding: 0 4 0 0; ' />";
$block_dir=0;
|
Right blocks are rendered in ThemeFooter() function, so that put some minor changes on there too.
Code:
#
# ------ [ FIND ] ---------
#
Function ThemeFooter()
{
#
# ------ [ AFTR, ADD ] -------
#
global $block_dir;
global $leftBlockWidth, $rightBlockWidth;
$block_dir = 1;
|
Now, actual rendering of blocks happens in ThemeSideBox() function and with those four global variables, the function will recognize
1. block direction (you can numbering blocks)
2. block coloring in different shading (funny effect)
3. block width
Now, in the function, if $block_dir is set to 0, then it will rendered on the left side. Otherwise, it appears on the right side.
Therefore,
Code:
#
# ------- [ FIND ] --------------
#
function themesidebox($title, $content)
{
#
# ------- [ ADD, AFTER ] --------------
#
$bwidth = 0;
if ($block_dir == 0)
{
$bwidth = $leftBlockWidth;
}
else
{
$bwidth = $rightBlockWidth;
};
|
When $bwidth, a temporal local variable is determined by block direction (0 or 1), you will change <td> tag by
Code:
Width=’”.$bwidth.”’
|
I think some of you know this, others may be not.
So far, I don’t see such different blocks in most phpnuke theme-pack.
To get fresh air, I tipped up a funny code.
As I told, this is for fun. Don't be serious. However, as long as you want to render blocks in different size, different color, or different light height in each side, it might work. |
|
|
abracadaver
New Member


Joined: Mar 05, 2009
Posts: 5
Location: Texas
|
Posted:
Tue Jun 16, 2009 11:44 am |
|
Have you tried AutoTheme? It uses templates for your blocks so every block on a page can be completely different and different on every page. You also have unlimited block positions, not just left, right and center. You can define your own areas for blocks and theme them however you wish. You can also have the same blocks in different positions on different pages. Much more, but that's a quick summary of the block features.
There's a slim users guide, and you can download the free GPL version and play with it. There is a patch that needs to be applied for RN.
http://www.spidean.com/
Thanks!
-Shawn |
|
|