PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
ToolBox
Regular
Regular


Joined: Mar 16, 2005
Posts: 74

PostPosted: Thu Jun 04, 2009 8:06 pm Reply with quote Back to top

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

Code:

                  $block_dir=0;


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.
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Tue Jun 16, 2009 6:28 am Reply with quote Back to top

Interesting...
View user's profile Send private message Visit poster's website
abracadaver
New Member
New Member


Joined: Mar 05, 2009
Posts: 5
Location: Texas

PostPosted: Tue Jun 16, 2009 11:44 am Reply with quote Back to top

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.
Only registered users can see links on this board!
Get registered or login to the forums!


Thanks!
-Shawn
View user's profile Send private message Visit poster's website
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 1536
Location: North Carolina

PostPosted: Tue Jun 16, 2009 11:52 am Reply with quote Back to top

AutoThemes is a nice option. Thank you for porting it to RavenNuke.

And thanks for the blocks idea Toolbox. The ability to step outside the cookie cutter layouts is a great way to make your site better.
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum