Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Feedback/Suggestions
Author Message
draxx
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

PostPosted: Wed May 27, 2009 1:16 am Reply with quote

Just being sure to suggest this be added to the list.

To display the same set of blocks on all the pages is too much.

The blocks by module hack adds 1 sql table, changes 5 lines of code, and does a half way decent job of it. The administration panel of the hack needs some work.

Adding this hack changes the level of this CMS and takes it into a new and broader realm.
 
View user's profile Send private message
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Wed May 27, 2009 2:51 am Reply with quote

I would love to see the code Wink
 
View user's profile Send private message Visit poster's website MSN Messenger
draxx







PostPosted: Wed May 27, 2009 2:32 pm Reply with quote

Install.txt:

Manual set up:


How to proceed :

Make a safety backup of your mainfile.php
Generate "MySQL" tables by helping yourself with your PhpMyAdmin or another SQL base manager Launch the MySQL.sql request.
Copy the WB_BlocksManager files :

blocks_manager.php to /admin/modules
case.blocks_manager.php to /admin/case
links.blocks_manager.php to /admin/links
wb_blocksmanager.gif to /images/admin/

Search for "function blocks($side) in your mainfile.php file.
Insert the "$name" inside "global" of your function blocks($side)
for example: global $storynum, $prefix, $multilingual, $currentlang, $db, $admin, $user, $name;

Search for $side = $pos; in the function blocks($side) file from the file mainfile.php
Erase or hide the following lines helping yourself with
forexample : // $sql = "SELECT bid, bkey, title, content, url, blockfile, view, expire, action, subscription FROM ".$prefix."_blocks WHERE bposition='$pos' AND active='1' $querylang ORDER BY weight ASC";

Insert the following lines:
if (isset($name)) {
$sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view, b.expire, b.action, b.subscription FROM ".$prefix."_blocks b, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='$name' AND m.bposition='$pos' AND b.active='1' $querylang ORDER BY m.weight ASC";
} else {
$sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view, b.expire, b.action, b.subscription FROM ".$prefix."_blocks b WHERE b.bposition='$pos' AND b.active='1' $querylang ORDER BY b.weight ASC";
}


At the end of /admin/language menu, add the following lines

lang-english.txt -> lang-english.php
lang-french.txt -> lang-french.php

Caution !

Check table's prefix (*), "mysql.sql uses "nuke"
 
draxx







PostPosted: Wed May 27, 2009 2:34 pm Reply with quote

I followed those instructions then I uploaded the admin files it was that simple.

Then I hacked at the admin function a bit because ... well it needs some work Smile

I would love to see a pro fix the admin function. It would then totally rock. It orders blocks by clicking arrows (the old way) - the new way of ordering blocks is MUCH better and far more efficient.

I have 138 blocks. Some blocks appear only on one page of the site.
 
ToolBox
Regular
Regular



Joined: Mar 16, 2005
Posts: 74

PostPosted: Wed May 27, 2009 8:56 pm Reply with quote

We have to think about a new approach.

First,

Simply put some codes such as

if ($module_name == "Forums")
{
........
}

is actually lazy and stupid in some senses.

Whenever new modules come up in community, expanding two side blocks is such hard-wired codes in theme-pack, or at the beginning of module file (such as moules/your-module/index.php).

This method is not actually good.
$index_file or define('INDEX_FILE', true) is not enough either.

My suggestion is simple for nuke admins but never simple for coders.

we need two constants: INDEX_FILE_LEFT, INDEX_FILE_RIGHT.
then, in every theme, we can put left constant with "if else " ladder to wrap around blocks(left).
Also, we can put right constant with "if else" ladder to wrap around blocks(right) in your theme.

Next, in your modules.php file, you will get two flag value from your DB such as collapse_left and collapse right. Then, based on these values you may decide left- and right-block collpasing.

With this idea, we can expand and shrink adaptively based on modules.
Therefore, modules X blocks are possible by expanding this idea.

In admin CP, you many change admin/modules/modules.php file

as follows:

http://www.nukekorea.net/modules/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=5939&g2_serialNumber=1

To some extension, we can change the following effect based on this method as well:

1. different size of blocks (left - right different size) and controllable by admin CP
example:
Code:


function themesidebox($title, $content)
{
   global $block_dir, $block_counter, $blockWidthLeft, $blockWidthRight;

   if ($block_dir == 0)
   {
      $blockWidth = $blockWidthLeft;
   }
   else
   {
      $blockWidth = $blockWidthRight;
   };
   
    echo "<table cellspacing='1' cellpadding='1' width='".$blockWidth."px' style='border: 1 solid #BFBFBF;' />";
      echo "<tr>";
         echo "<th align='left' style='border-bottom: 1 solid #2F2F2F;' />";
            echo $title;
         echo "</td>";
      echo "</tr>";
      echo "<tr>";
         echo "<td height='20' style='background: #e7e7e7;' />";
            echo $content;
         echo "</td>";
      echo "</tr>";
   echo "</table>";
   echo "<br />";
}; // end of function


2. module-dependent blocks, side-collapsing, different sizes, and specific blocks.

Second,
The most important idea beyond there is "permission" for modules and "permission" for blocks.
This permission will make your site users stratify in a highly efficient way.

I gave up to writing the rest of ideas and how to implement.
Only what I would like to say on this discussion is that the best way is not to change codes at hand, but to change the codes to control processes behind the back-end.


Last edited by ToolBox on Wed May 27, 2009 9:22 pm; edited 5 times in total 
View user's profile Send private message
draxx







PostPosted: Wed May 27, 2009 9:17 pm Reply with quote

Hey Toolbox - arent you supposed to be fixing NukeC for me ???
 
ToolBox







PostPosted: Wed May 27, 2009 9:24 pm Reply with quote

draxx wrote:
Hey Toolbox - arent you supposed to be fixing NukeC for me ???
Haven't you had anybody to sweep out the errors?
Oh my god.

Ok. Let me bring my classified package in this weekend days.
I am out of town now.
 
ToolBox







PostPosted: Wed May 27, 2009 9:26 pm Reply with quote

By the way, this is critical one: phpBB2 does not accept URL style image reference. Only direct images and url work.

I failed to embed my screen capture.
Simply click on the image to look at.

Also, I think I unlearned a lot about phpBB2 because I left area51 (not bbtonuke) four years ago.
 
draxx







PostPosted: Wed May 27, 2009 9:35 pm Reply with quote

ToolBox wrote:
draxx wrote:
Hey Toolbox - arent you supposed to be fixing NukeC for me ???
Haven't you had anybody to sweep out the errors?
Oh my god.

Ok. Let me bring my classified package in this weekend days.
I am out of town now.


Oh my god... yes ... please do and THANKS! Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Feedback/Suggestions

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©