PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  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
StefanL
New Member
New Member


Joined: Sep 20, 2003
Posts: 5

PostPosted: Wed Sep 24, 2003 1:50 pm Reply with quote Back to top

I have done some 'cosmetic' changes in Raven's 'Site Navigation Block'. Changes:
    * Added closing '</OPTION>' tags.
    * In Admin mode, you will now not get any error pages when you click on '--------', 'Invisible Modules' and 'Inactive Modules'.

Find in block-Modules.php:
Code:
    /* Now we make the Modules block with the correspondent links */
   $content .= "<SELECT NAME=\"name\" SIZE=\"8\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">";
   $content .= "<OPTION VALUE=\"index.php\"><big>&middot;</big>&nbsp;"._HOME;
//    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"index.php\">"._HOME."</a><br>\n";
    $sql = "SELECT title, custom_title, view FROM ".$prefix."_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
   $m_title = $row[title];
   $custom_title = $row[custom_title];
   $view = $row[view];
   $m_title2 = ereg_replace("_", " ", $m_title);
   if ($custom_title != "") {
       $m_title2 = $custom_title;
   }
   if ($m_title != $main_module) {
       if ((is_admin($admin) AND $view == 2) OR $view != 2) {
         $content .= "<OPTION VALUE=\"modules.php?name=$m_title\"><big>&middot;</big>&nbsp;$m_title2";
//      $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$m_title\">$m_title2</a><br>\n";
       }
   }
    }

    /* If you're Admin you and only you can see Inactive modules and test it */
    /* If you copied a new module is the /modules/ directory, it will be added to the database */

    if (is_admin($admin)) {
   $handle=opendir('modules');
   while ($file = readdir($handle)) {
       if ( (!ereg("[.]",$file)) ) {
      $modlist .= "$file ";
       }
   }
   closedir($handle);
   $modlist = explode(" ", $modlist);
   sort($modlist);
   for ($i=0; $i < sizeof($modlist); $i++) {
       if($modlist[$i] != "") {
      $sql = "SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'";
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $mid = $row[mid];
      if ($mid == "") {
          $db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1')");
      }
       }
   }
   $content .= "<option>--------<option>"._INVISIBLEMODULES;
//   $content .= "<option><font class=\"tiny\">"._ACTIVEBUTNOTSEE."</font>";
   $sql = "SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC";
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result)) {
       $mn_title = $row[title];
       $custom_title = $row[custom_title];
       $mn_title2 = ereg_replace("_", " ", $mn_title);
       if ($custom_title != "") {
      $mn_title2 = $custom_title;
       }
       if ($mn_title2 != "") {
      $content .= "<OPTION VALUE=\"modules.php?name=$mn_title\"><big>&middot;</big>&nbsp;$mn_title2";
      $dummy = 1;
       } else {
      $a = 1;
       }
   }

   if ($a == 1 AND $dummy != 1) {
           $content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
   }
   $content .= "<option>--------<option>"._NOACTIVEMODULES;
//   $content .= "<font class=\"tiny\">"._FORADMINTESTS."</font></center><br>";
   $sql = "SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC";
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result)) {
       $mn_title = $row[title];
       $custom_title = $row[custom_title];
       $mn_title2 = ereg_replace("_", " ", $mn_title);
       if ($custom_title != "") {
      $mn_title2 = $custom_title;
       }
       if ($mn_title2 != "") {
      $content .= "<OPTION VALUE=\"modules.php?name=$mn_title\"><big>&middot;</big>&nbsp;$mn_title2";
      $dummy = 1;
       } else {
      $a = 1;
       }
   }
   $content .= "</select>";
   if ($a == 1 AND $dummy != 1) {
           $content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
   }
    }

?>


Replace it with:

Code:
    /* Now we make the Modules block with the correspondent links */
   $content .= "<script language=\"JavaScript\">function gotoURL(dropDown) {   URL=dropDown.options[dropDown.selectedIndex].value;      if(URL.length>0) {         top.location.href = URL;       } } </script>";
   $content .= "<SELECT NAME=\"name\" SIZE=\"8\" onChange=\"gotoURL(this)\">";
//   $content .= "<SELECT NAME=\"name\" SIZE=\"8\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">";
   $content .= "<OPTION VALUE=\"index.php\"><big>&middot;</big>&nbsp;"._HOME."</OPTION>";
//    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"index.php\">"._HOME."</a><br>\n";
    $sql = "SELECT title, custom_title, view FROM ".$prefix."_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
   $m_title = $row[title];
   $custom_title = $row[custom_title];
   $view = $row[view];
   $m_title2 = ereg_replace("_", " ", $m_title);
   if ($custom_title != "") {
       $m_title2 = $custom_title;
   }
   if ($m_title != $main_module) {
       if ((is_admin($admin) AND $view == 2) OR $view != 2) {
         $content .= "<OPTION VALUE=\"modules.php?name=$m_title\"><big>&middot;</big>&nbsp;$m_title2</OPTION>";
//      $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"modules.php?name=$m_title\">$m_title2</a><br>\n";
       }
   }
    }

    /* If you're Admin you and only you can see Inactive modules and test it */
    /* If you copied a new module is the /modules/ directory, it will be added to the database */

    if (is_admin($admin)) {
   $handle=opendir('modules');
   while ($file = readdir($handle)) {
       if ( (!ereg("[.]",$file)) ) {
      $modlist .= "$file ";
       }
   }
   closedir($handle);
   $modlist = explode(" ", $modlist);
   sort($modlist);
   for ($i=0; $i < sizeof($modlist); $i++) {
       if($modlist[$i] != "") {
      $sql = "SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'";
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);

      $mid = $row[mid];
      if ($mid == "") {
          $db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1')");
      }
       }
   }
   $content .= "<OPTION VALUE=\"\">--------</OPTION><OPTION VALUE=\"\">"._INVISIBLEMODULES."</OPTION>";
//   $content .= "<option><font class=\"tiny\">"._ACTIVEBUTNOTSEE."</font>";
   $sql = "SELECT title, custom_title FROM ".$prefix."_modules WHERE active='1' AND inmenu='0' ORDER BY title ASC";
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result)) {
       $mn_title = $row[title];
       $custom_title = $row[custom_title];
       $mn_title2 = ereg_replace("_", " ", $mn_title);
       if ($custom_title != "") {
      $mn_title2 = $custom_title;
       }
       if ($mn_title2 != "") {
      $content .= "<OPTION VALUE=\"modules.php?name=$mn_title\"><big>&middot;</big>&nbsp;$mn_title2";
      $dummy = 1;
       } else {
      $a = 1;
       }
   }

   if ($a == 1 AND $dummy != 1) {
           $content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
   }
   $content .= "<OPTION VALUE=\"\">--------</OPTION><OPTION VALUE=\"\">"._NOACTIVEMODULES."</OPTION>";
//   $content .= "<font class=\"tiny\">"._FORADMINTESTS."</font></center><br>";
   $sql = "SELECT title, custom_title FROM ".$prefix."_modules WHERE active='0' ORDER BY title ASC";
   $result = $db->sql_query($sql);
   while ($row = $db->sql_fetchrow($result)) {
       $mn_title = $row[title];
       $custom_title = $row[custom_title];
       $mn_title2 = ereg_replace("_", " ", $mn_title);
       if ($custom_title != "") {
      $mn_title2 = $custom_title;
       }
       if ($mn_title2 != "") {
      $content .= "<OPTION VALUE=\"modules.php?name=$mn_title\"><big>&middot;</big>&nbsp;$mn_title2";
      $dummy = 1;
       } else {
      $a = 1;
       }

   }
   $content .= "</select>";
   if ($a == 1 AND $dummy != 1) {
           $content .= "<strong><big>&middot;</big></strong>&nbsp;<i>"._NONE."</i><br>\n";
   }
    }

?>
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 24, 2003 3:52 pm Reply with quote Back to top

Very nice indeed! I can't tell you how long ago I made that, but I quickly hacked it for my own use and then people started asking for it to the point that I just zipped it and made it availavle. Thanks! I will get this out ASAP.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
telli
New Member
New Member


Joined: Sep 24, 2003
Posts: 21

PostPosted: Wed Sep 24, 2003 5:54 pm Reply with quote Back to top

Very nice i made a similar one but my coding isnt as neat. Wish i had known someone else had one. Btw nice site raven!

Telli

Only registered users can see links on this board!
Get registered or login to the forums!

Image[/img]
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Sep 24, 2003 6:30 pm Reply with quote Back to top

telli,

Thanks and right back at ya! I really like your use of the Blacks, blues, and greys!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
StefanL
New Member
New Member


Joined: Sep 20, 2003
Posts: 5

PostPosted: Thu Sep 25, 2003 7:26 am Reply with quote Back to top

telli wrote:
Very nice

Raven wrote:
Thanks! I will get this out ASAP.


Thank you both! One more tip would be to rename the file to something like 'block-myMenu.php' and then register it under 'Block' in Admin. This will leave the original file intact.

Raven wrote:
I can't tell you how long ago I made that, but I quickly hacked it for my own use and then people started asking for it to the point that I just zipped it and made it availavle.


I know this too well! Very Happy
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Sep 25, 2003 7:29 am Reply with quote Back to top

StephanL wrote:
One more tip would be to rename the file to something like 'block-myMenu.php' and then register it under 'Block' in Admin. This will leave the original file intact.
The user can do that Wink
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
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