PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  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
porcupinepc
Involved
Involved


Joined: Sep 20, 2003
Posts: 261
Location: Schumacher, Ontario CANADA

PostPosted: Sat Nov 01, 2003 9:10 am Reply with quote Back to top

I would like to add a link to my site under "Navigation". I want it called "Prices" or something like that. Once the user click it, they go to a forum on my site that has the requested pricing. How is this done.?

Joe
Porcupine PC / The Great White North Trading Post
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Raven
Site Admin/Owner


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

PostPosted: Sat Nov 01, 2003 11:13 am Reply with quote Back to top

Example of Adding HTML Links to Main Menu

Find the following line of code in the block-Modules.php file found in the subfolder called blocks:
Code:
 
$content .= "<strong><big>&nbsp;</big></strong>\&nbsp;<a href=\"index.php\">"._HOME."</a><br>\n";

And add this line after it:
Code:
$content .= "<strong><big>&nbsp;</big></strong>&nbsp;<a href=\"LINK\">LINK NAME</a><br>\n";

Of course modify the "LINK" to the URL you wish, and the "LINK NAME" to the name of the hyperlink.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
porcupinepc
Involved
Involved


Joined: Sep 20, 2003
Posts: 261
Location: Schumacher, Ontario CANADA

PostPosted: Sat Nov 01, 2003 11:17 am Reply with quote Back to top

thanks again Raven!

Best Regards

Joe
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
porcupinepc
Involved
Involved


Joined: Sep 20, 2003
Posts: 261
Location: Schumacher, Ontario CANADA

PostPosted: Sat Nov 01, 2003 11:29 am Reply with quote Back to top

raven:

I cant seem to locate the lines you mentioned. here is my block-Modules.php
Code:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Modified by Gaylen Fraley to use Select box instead of regular block */
/* Cleaned up code by StephanL - Thanks!                                */
/************************************************************************/
/************************************************************************/
if (eregi("block-Modules.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

global $prefix, $db, $admin;

    $ThemeSel = get_theme();
    if (file_exists("themes/$ThemeSel/module.php")) {
   include("themes/$ThemeSel/module.php");
   if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
       $def_module = $default_module;
   } else {
       $def_module = "";
   }
    }

    $sql = "SELECT main_module FROM ".$prefix."_main";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $main_module = $row[main_module];

    /* If the module doesn't exist, it will be removed from the database automaticaly */

    $sql = "SELECT title FROM ".$prefix."_modules";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
   $title = $row[title];
   $a = 0;
   $handle=opendir('modules');
   while ($file = readdir($handle)) {
           if ($file == $title) {
      $a = 1;
       }
   }
   closedir($handle);
   if ($a == 0) {
       $db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
   }
    }

/* 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 .= "<OPTION VALUE=\"index.php\"><big>&middot;</big>&nbsp;"._HOME."</OPTION>";
    $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>";
       }
   }
    }

    /* 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>";
   $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>";
   $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";
   }
    }
?>






Joe
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Raven
Site Admin/Owner


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

PostPosted: Sat Nov 01, 2003 11:33 am Reply with quote Back to top

If you are using a Site Navigation mod, you might use this line
Code:
$content .= "<OPTION VALUE=\"index.php\"><big>&middot;</big>&nbsp;"._HOME."</OPTION>";
I gave the code for the standard mod that comes with Nuke.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
porcupinepc
Involved
Involved


Joined: Sep 20, 2003
Posts: 261
Location: Schumacher, Ontario CANADA

PostPosted: Sat Nov 01, 2003 11:39 am Reply with quote Back to top

On my block-Modules, do you know exactly where this line should be inserted?
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Raven
Site Admin/Owner


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

PostPosted: Sat Nov 01, 2003 11:42 am Reply with quote Back to top

Right after the line I referenced in my previous post. I took that right out of your example.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
porcupinepc
Involved
Involved


Joined: Sep 20, 2003
Posts: 261
Location: Schumacher, Ontario CANADA

PostPosted: Sat Nov 01, 2003 12:03 pm Reply with quote Back to top

Very weird. Nothing shows up under Site Navigation.

Joe
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Raven
Site Admin/Owner


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

PostPosted: Sat Nov 01, 2003 8:17 pm Reply with quote Back to top

Find this code
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 .= "<OPTION VALUE=\"index.php\"><big>&middot;</big>&nbsp;"._HOME."</OPTION>";
and modify it to this, substituting your own links
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 .= "<OPTION VALUE=\"index.php\"><big>&middot;</big>&nbsp;"._HOME."</OPTION>";
   $content .= "<OPTION VALUE=\"forums.html&file=viewtopic&p=439#439\"><big>&middot;</big>&nbsp;"."YOUR POST"."</OPTION>";
Note that your link to your forums may/will be different than mine.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
porcupinepc
Involved
Involved


Joined: Sep 20, 2003
Posts: 261
Location: Schumacher, Ontario CANADA

PostPosted: Sat Nov 01, 2003 8:27 pm Reply with quote Back to top

whew!!!! finally we got this one fixed. Now that was a challenge.

Thanks again raven! You just won "Tech Support Person Of The Year" award!

Joe
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
nb1
Regular
Regular


Joined: Mar 03, 2005
Posts: 92
Location: OZ

PostPosted: Sat May 20, 2006 1:57 pm Reply with quote Back to top

what do I need to change To get the home link to show With the one I added It's not a module but a link
Code:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/
/*              Customised by Raven for use on his site                 */
/*                           2005 Raven                                 */
/*      http://ravenphpscripts.com -- http://ravenwebhosting.com        */
/************************************************************************/

//if (eregi("block-Modules.php", $_SERVER['SCRIPT_NAME'])) {
if ( !defined('BLOCK_FILE') ) {
    Header("Location: index.php");
    die();
}

global $prefix, $db, $admin, $nukeurl;

$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
   include("themes/$ThemeSel/module.php");
   if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
      $def_module = $default_module;
   } else {
      $def_module = "";
   }
}

$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];

/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
   $title = stripslashes($row2['title']);
   $a = 0;
   $handle=opendir('modules');
   while ($file = readdir($handle)) {
      if ($file == $title) {
      $a = 1;
      }
   }
   closedir($handle);
   if ($a == 0) {
      $db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
   }
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
   $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] != "") {
         $row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
         $mid = intval($row4['mid']);
         $mod_uname = ereg_replace("_", " ", $modlist[$i]);
         if ($mid == "") {
            $db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
         }
      }
   }
   $content  = "<br /><a href=\"index.php\" title=\"Home\"><b>Home:</b></a><br />";
   $content  = "<br /><a href=\"guistuff.php\" title=\"Web Tools\"><b>Web Tools:</b></a><br />";
   $content .= "<select class=\"mymodulesselectbox\" size=\"1\" name=\"name\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">";
   $content .= "<option>Select</option>";
   $result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
   while ($row3 = $db->sql_fetchrow($result3)) {
      $m_title = stripslashes($row3['title']);
      $custom_title = $row3['custom_title'];
      $view = intval($row3['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) {
            $selected = '';
            $content .= "<option value=\"modules.php?name=$m_title\">&middot;&nbsp;$m_title2</option>";
         }
      }
   }
   $content .= "</select><br />";
?>
raven's block-Modules with rwsRavenNuke76_v2.02.02
Code:
$content  = "<br /><a href=\"index.php\" title=\"Home\"><b>Home:</b></a><br />";
$content  = "<br /><a href=\"guistuff.php\" title=\"Web Tools\"><b>Web Tools:</b></a><
the is the line i added
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mercman
Regular
Regular


Joined: Nov 29, 2006
Posts: 64
Location: TN, USA

PostPosted: Fri Dec 28, 2007 12:09 pm Reply with quote Back to top

BUMP

Raven can you tell us where to place this line (BTW, I corrected it to show the mid-dot):
Code:

$content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"LINK\">LINK NAME</a><br>\n";

in your site navigation block so it shows up in the drop-down list please?
Site nav block code (as I have it):
Code:

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/*         Additional security & Abstraction layer conversion           */
/*                           2003 chatserv                              */
/*      http://www.nukefixes.com -- http://www.nukeresources.com        */
/************************************************************************/
/*              Customised by Raven for use on his site                 */
/*                           2005 Raven                                 */
/*      http://ravenphpscripts.com -- http://ravenwebhosting.com        */
/************************************************************************/

//if (eregi("block-Modules.php", $_SERVER['SCRIPT_NAME'])) {
if ( !defined('BLOCK_FILE') ) {
    Header("Location: index.php");
    die();
}

global $prefix, $db, $admin, $nukeurl;

$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/module.php")) {
   include("themes/$ThemeSel/module.php");
   if (is_active("$default_module") AND file_exists("modules/$default_module/index.php")) {
      $def_module = $default_module;
   } else {
      $def_module = "";
   }
}

$row = $db->sql_fetchrow($db->sql_query("SELECT main_module FROM ".$prefix."_main"));
$main_module = $row['main_module'];

/* If the module doesn't exist, it will be removed from the database automaticaly */
$result2 = $db->sql_query("SELECT title FROM " . $prefix . "_modules");
while ($row2 = $db->sql_fetchrow($result2)) {
   $title = stripslashes($row2['title']);
   $a = 0;
   $handle=opendir('modules');
   while ($file = readdir($handle)) {
      if ($file == $title) {
      $a = 1;
      }
   }
   closedir($handle);
   if ($a == 0) {
      $db->sql_query("DELETE FROM ".$prefix."_modules WHERE title='$title'");
   }
}
/* If you copied a new module is the /modules/ directory, it will be added to the database */
   $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] != "") {
         $row4 = $db->sql_fetchrow($db->sql_query("SELECT mid FROM ".$prefix."_modules WHERE title='$modlist[$i]'"));
         $mid = intval($row4['mid']);
         $mod_uname = ereg_replace("_", " ", $modlist[$i]);
         if ($mid == "") {
            $db->sql_query("INSERT INTO ".$prefix."_modules VALUES (NULL, '$modlist[$i]', '$mod_uname', '0', '0', '1')");
         }
      }
   }
   $content  = "<br /><a href=\"http://www.merc-man.net/nuke\" title=\"Home\"><b><u>Return Home</u></b></a><br /><br>";
   $content .= "<select class=\"mymodulesselectbox\" size=\"1\" name=\"name\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">";
   $content .= "<option>Select</option>";
   $result3 = $db->sql_query("SELECT title, custom_title, view FROM " . $prefix . "_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' ORDER BY custom_title ASC");
   while ($row3 = $db->sql_fetchrow($result3)) {
      $m_title = stripslashes($row3['title']);
      $custom_title = $row3['custom_title'];
      $view = intval($row3['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) {
            $selected = '';
            $content .= "<option value=\"modules.php?name=$m_title\">&middot;&nbsp;$m_title2</option>";
         }
      }
   }
   $content .= "</select><br /><br>";
?>


Thanks! Smile
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


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

PostPosted: Fri Dec 28, 2007 1:18 pm Reply with quote Back to top

Make it an <option></option>.

One place would be after this line $content .= "<option>Select</option>";

Another would be before this line $content .= "</select><br /><br>";
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
mercman
Regular
Regular


Joined: Nov 29, 2006
Posts: 64
Location: TN, USA

PostPosted: Fri Dec 28, 2007 2:06 pm Reply with quote Back to top

Hmm..
I've placed this:
Code:

$content .= "<option><strong><big>&middot;</big></strong>&nbsp;<a href=\"http://gallery.merc-man.net\">Gallery</a><br>\n</option>";

after the line $content .= "<option>Select</option>";

It shows up nicely, but the hyperlink doesn't do anything.
What did I miss?
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


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

PostPosted: Fri Dec 28, 2007 10:52 pm Reply with quote Back to top

You missed making it an option statement like the other ones. Here is the format $content .= "<option value=\"modules.php?name=$m_title\">&middot;&nbsp;$m_title2</option>";

So, yours would need to look something like $content .= "<option value=\"LINK\">&middot;&nbsp;LINK NAME</option>";
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
mercman
Regular
Regular


Joined: Nov 29, 2006
Posts: 64
Location: TN, USA

PostPosted: Fri Dec 28, 2007 11:34 pm Reply with quote Back to top

Raven, you're the best!
Works like a charm!
Thank you!
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


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

PostPosted: Sat Dec 29, 2007 12:05 am Reply with quote Back to top

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