Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro
Author Message
angelovirgus
New Member
New Member


Joined: Aug 14, 2006
Posts: 4

PostPosted: Mon Aug 14, 2006 4:06 am Reply with quote

Hi,
i'm new in this forum and i'm italian...so, sorry for my bad english. I've a phpnuke raven76 and i'm interested to install the block manager to customize
and personalize my modules with different blocks.
Following the install guide of block manager i have to:
Quote:

- Search for $side = $pos; in the "function blocks($side) file from the file mainfile.php
- Erase or hide the following lines helping yourself with
for example (phpnuke v7.x) : // $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";
for example (phpnuke v6.x) : // $sql = "SELECT bid, bkey, title, content, url, blockfile, view FROM ".$prefix."_blocks WHERE bposition='$pos' AND active='1' $querylang ORDER BY weight ASC";





- Insert the following lines :
phpnuke v6.x
if (strlen($name) != 0) {
$name = str_replace(' ','_',$name);
$name = str_replace('%20','_',$name);

$sql = "SELECT b.bid, b.bkey, b.title, b.content, b.url, b.blockfile, b.view 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 FROM ".$prefix."_blocks b, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='admin' AND m.bposition='$pos' AND b.active='1' $querylang ORDER BY m.weight ASC";
}

phpnuke v7.x
if (strlen($name) != 0) {
$name = str_replace(' ','_',$name);
$name = str_replace('%20','_',$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, ".$prefix."_blocks_manager m WHERE b.bid=m.bid AND m.title='admin' AND m.bposition='$pos' AND b.active='1' $querylang ORDER BY m.weight ASC";
}

but in my mainfile.php i haven't this line:
Code:
$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";

instead in "$side = $pos; in the "function blocks($side)" i've these lines:

Code:
$result = $db->sql_query("SELECT * FROM ".$prefix."_blocks WHERE bposition='$pos' AND active='1' $querylang ORDER BY weight ASC");

    while($row = $db->sql_fetchrow($result)) {
        $groups = $row['groups'];
   $bid = intval($row['bid']);
   $title = stripslashes(check_html($row['title'], "nohtml"));
   $content = stripslashes($row['content']);
   $url = stripslashes($row['url']);
   $blockfile = $row['blockfile'];
   $view = intval($row['view']);
   $expire = intval($row['expire']);
   $action = $row['action'];
        $action = substr("$action", 0,1);
       $now = time();
       $sub = intval($row['subscription']);
       if ($sub == 0 OR ($sub == 1 AND !paid())) {
          if ($expire != 0 AND $expire <= $now) {
              if ($action == "d") {
                  $db->sql_query("UPDATE ".$prefix."_blocks SET active='0', expire='0' WHERE bid='$bid'");
                  return;
              } elseif ($action == "r") {
                  $db->sql_query("DELETE FROM ".$prefix."_blocks WHERE bid='$bid'");
                  return;
              }
          }
         if ($row['bkey'] == "admin") {
             adminblock();
         } elseif ($row['bkey'] == "userbox") {
             userblock();
         } elseif (empty($row['bkey'])) {
             if ($view == 0) {
               render_blocks($side, $blockfile, $title, $content, $bid, $url);
             } elseif ($view == 1 AND is_user($user) || is_admin($admin)) {
               render_blocks($side, $blockfile, $title, $content, $bid, $url);
             } elseif ($view == 2 AND is_admin($admin)) {
               render_blocks($side, $blockfile, $title, $content, $bid, $url);
             } elseif ($view == 3 AND !is_user($user) || is_admin($admin)) {
               render_blocks($side, $blockfile, $title, $content, $bid, $url);
             } elseif ($view > 3 AND in_groups($groups)) {
               render_blocks($side, $blockfile, $title, $content, $bid, $url);
             }
         }
       }
    }
ecc...

so i don't know what i've to modify. I need help, is here somebody to help me? Thanks and i hope in an your answer.
 
View user's profile Send private message
montego
Site Admin


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

PostPosted: Mon Aug 14, 2006 7:11 am Reply with quote

I have never seen this "block manager" tool before. I get concerned when something is asking you to modify core nuke code, especially mainfile.php. Please post a link to where you found this so I/we can take a look at it.

Thanks.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
angelovirgus
PostPosted: Mon Aug 14, 2006 8:31 am Reply with quote

Thank you for the answer, now i've the addon "block manager v1.1" in my site. You can download it at this address: Only registered users can see links on this board! Get registered or login!

The install instructions are in !!docs!! directory. Thanks for the help, now i wait you.
 
angelovirgus
PostPosted: Sat Aug 19, 2006 1:57 am Reply with quote

An help?
 
montego
PostPosted: Sat Aug 19, 2006 5:58 am Reply with quote

angelovirgus, my appologies. Work is kicking my butt! Sad I have not had time to look at this as yet. It is on the list...
 
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Sat Aug 19, 2006 8:25 pm Reply with quote

After looking at it, All it seems to do is tell nuke to look at another table. I would sudjest you look once more at the mainfile as the things its telling you to look for are there.

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
angelovirgus
PostPosted: Mon Aug 21, 2006 1:33 am Reply with quote

Thanks for answer. i hope that the problem is in mainfile, but i'm not sure. I think that block is very useful ( i don't know if there are alternatives for phpnuke), but i'm not a real webmaster, so i don't know where change what code. I hope will be a similar block for raven phpnuke.
 
Doulos
Life Cycles Becoming CPU Cycles


Joined: Jun 06, 2005
Posts: 626

PostPosted: Mon Aug 21, 2006 11:49 am Reply with quote

This is a very useful tool - if you want to customize each module to show different blocks.
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Mon Aug 21, 2006 6:03 pm Reply with quote

Here's what I believe is happening angelovirgus ...

The code that you are looking for in mainfile was at some point in the evolution of Nuke changed.
Code:
  The old code, as you note was:

$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";

and the newer code is:

$result = $db->sql_query('SELECT * FROM '.$prefix.'_blocks WHERE bposition=\''.$pos.'\' AND active=1 '.$querylang.' ORDER BY weight ASC');


I don't know if this happened on the transition to Ravennuke or at some previous version of Nuke and it really doesn't matter. The difference is that the programmer probably just figured "we are using most or all of the fields anyway so I will just do a select * rather than enumerating all the field."

Now it appears that the block manager software uses a different version of the blocks table called "prefix_blocks_manager" where prefix is whatever prefix you are using on your system, usually "nuke". I haven't used that software but it also must be the case that the software provides some kind of administrative screen for the "enhanced" blocks management that you mention.

So theoretically you could just modify the select * statement to point to the blocks_manager table and you'd be up and running. But of course there's a catch.

Ravennuke comes with Nukescripts group management facilities built in. And one of the things you can do with that is limit access to a block to groups of users. It adds a groups field to the blocks table to facilitate this and if you go into the administration screen on a Ravennuke system and edit a block you will see that you can restrict access to a group.

This is a case where the relative ease of writing add-ons for Nuke comes back to bite us. Unless I'm mistaken, if you use the block management software you will not have access to the Ravennuke groups facilities with your blocks and you may even wind up with an error. I can't tell that without testing it and I don't have time for that. This could be "cured" if the blocks management authors went back and retrofitted the groups capabilities into their software but without it you'll have problems.

I'll take Ezekiel's word that it's a useful facility and maybe the two of you could write up sort of functional specs for what you'd like to see and we can discuss adding it "natively" to some future version of Ravennuke. I apologize but I think that most of us who are involved in any way with Ravennuke and it's support just don't have the time to go plumbing around in the depths of add on products like this; no matter how useful we might recognize they might be.
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro

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 ©