GeoffM
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/computerguy.gif)
Joined: May 19, 2004
Posts: 21
Location: Bellingham, WA.
|
Posted:
Thu Apr 21, 2005 2:22 pm |
|
I have a blocks-Modules that I use on several sites It came from Dalme.com (gone long time now) I like the funcuntionality and clean appearance, and would like to use it on a new site that I'm administering.
it just so happens that the site is using P-nuk 7.6 Platinum and from what I can garner it's Navigation comes from blocks-Navigation - so is there any way to use this Code:
<?php
/************************************************************************/
/* DALME block-Modules */
/* =========================== */
/* */
/* Copyright (c) 2002 by Avery Hise avery@dalme.com */
/* http://www.dalme.com */
/* */
/* 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. */
/* */
/* DALME block-Modules v1.6a provided by http://www.dalme.com */
/* */
/************************************************************************/
if (eregi("block-Modules.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $prefix, $dbi, $admin;
//-------------MODIFY HERE TO CUSTOMIZE THE MENU------>
$mouseOver = "#cccc99"; /* Sets mouseover color */
$mouseOut = ""; /* Sets mouseout color - leave blank for background*/
$image1 = "images/arrow.gif"; /* image path relative to public root*/
$image2 = "images/barrow.gif"; /* image path relative to public root*/
$image3 = "images/oarrow.gif"; /* image path relative to public root*/
$viewSearch = "1"; /* "0" = no search -- "1" = yes search */
$dropDown = "0"; /* "0" = dropdown style -- "1" = block style */
$row2show = "5"; /* "NUMBER YOU SELECT (default is 5)" = numbers of rows visible when block style */
define ("mSECTION1","General"); /* title Menu Section 1 */
define ("mSECTION2","Community Corner"); /* title Menu Section 2 */
define ("mSECTION3","(H)yper"); /* title Menu Section 3 */
//--------END-----------END----------END------------>
$actionMenu = "onMouseOver=\"this.style.background='$mouseOver'\" onMouseOut=\"this.style.background='$mouseOut'\" style=\"cursor:pointer;cursor:hand\" onclick=\"window.location.href=";
$result = sql_query("select main_module from ".$prefix."_main", $dbi);
list($main_module) = sql_fetch_row($result, $dbi);
/* If the module doesn't exist, it will be removed from the database automaticaly */
$result = sql_query("select title from ".$prefix."_modules", $dbi);
while (list($title) = sql_fetch_row($result, $dbi)) {
$a = 0;
$handle=opendir('modules');
while ($file = readdir($handle)) {
if ($file == $title) {
$a = 1;
}
}
closedir($handle);
if ($a == 0) {
sql_query("delete from ".$prefix."_modules where title='$title'", $dbi);
}
}
/* Now we make the Modules block with the correspondent links */
/* Menu Section 1 */
$content .= "<b>".mSECTION1."</b><BR>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">\n";
$content .= "<TR $actionMenu'index.php'\"><TD><img src=$image1 BORDER=0> <a href=\"index.php\">"._HOME."</a></TD></TR>\n";
$content .= "<TR $actionMenu'topics.html'\"><TD><img src=$image1> <a href=\"topics.html\">Topics</a></TD></TR>\n";
$content .= "<TR $actionMenu'archive.html?sa=show_all'\"><TD><img src=$image1> <a href=\"archive.html?sa=show_all\">Stories</a></TD></TR>\n";
$content .= "<TR $actionMenu'downloads.html'\"><TD><img src=$image1> <a href=\"downloads.html\">Downloads</a></TD></TR>\n";
$content .= "<TR $actionMenu'links.html'\"><TD><img src=$image1> <a href=\"links.html\">Links</a></TD></TR>\n";
$content .= "<TR $actionMenu'account.html'\"><TD><img src=$image1> <a href=\"account.html\">Your Info</a></TD></TR>\n";
$content .= "</TABLE>\n";
//$content .= "<HR noShade SIZE=1>\n"; /* <hr> to separate menu */
/* Menu Section 2 */
$content .= "<b>".mSECTION2."</b><BR>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">\n";
$content .= "<TR $actionMenu'forums.html'\"><TD><img src=$image2> <a href=\"forums.html\">Forums</a></TD></TR>\n";
$content .= "<TR $actionMenu'journal.html'\"><TD><img src=$image2> <a href=\"journal.html\">Journal</a></TD></TR>\n";
$content .= "<TR $actionMenu'modules.php?name=WebChat'\"><TD><img src=$image2> <a href=\"modules.php?name=WebChat\">WebChat</a></TD></TR>\n";
$content .= "<TR $actionMenu'javascript:goShoutBOX()'\"><TD><img src=$image2> <a href=\"javascript:goShoutBOX()\">ShoutBOX</a></TD></TR>\n";
$content .= "<TR $actionMenu'modules.php?name=My_eGallery'\"><TD><img src=$image2> <a href=\"modules.php?name=My_eGallery\">Gallery</a></TD></TR>\n";
$content .= "<TR $actionMenu'modules.php?name=Classifieds'\"><TD><img src=$image2> <a href=\"modules.php?name=Classifieds\">Classifieds</a></TD></TR>\n";
$content .= "<TR $actionMenu'modules.php?name=Calendar'\"><TD><img src=$image2> <a href=\"modules.php?name=Calendar\">Events Calendar</a></TD></TR>\n";
$content .= "</TABLE>\n";
//$content .= "<HR noShade SIZE=1>\n"; /* <hr> to separate menu */
/* Menu Section 3 */
$content .= "<b>".mSECTION3."</b><BR>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">\n";
$content .= "<TR $actionMenu'modules.php?name=NSN_Downloads'\"><TD><img src=$image3> <a href=\"modules.php?name=NSN_Downloads\">Downloads</a></TD></TR>\n";
$content .= "<TR $actionMenu'modules.php?name=NSN_Web_Links'\"><TD><img src=$image3> <a href=\"modules.php?name=NSN_Web_Links\">Web Links</a></TD></TR>\n";
$content .= "<TR $actionMenu'modules.php?name=NSN_Categories'\"><TD><img src=$image3> <a href=\"modules.php?name=NSN_Categories\">Stories</a></TD></TR>\n";
$content .= "</TABLE>\n";
/* Make dropdown or block style full selection menu - NOTE: inactive modules only viewable by Admin */
if ($dropDown == 0){
$content .= "<CENTER><br><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><FORM METHOD=POST ACTION=\"modules.php\"><TD><SELECT NAME=\"name\" CLASS=\"boxcontent\" onChange=\"submit()\"><OPTION VALUE=\"\">Full Selection";
} else {
$content .= "<CENTER><br><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><FORM METHOD=POST ACTION=\"modules.php\"><TD><SELECT NAME=\"name\" CLASS=\"boxcontent\" MULTIPLE SIZE=\"$row2show\" onChange=\"submit()\"><OPTION VALUE=\"\">Full Selection";
}
$content .= "<OPTION VALUE=\"\">---------------\n";
$result = sql_query("select title, custom_title from ".$prefix."_modules where active='1' ORDER BY title ASC", $dbi);
while(list($m_title, $custom_title) = sql_fetch_row($result, $dbi)) {
$m_title2 = ereg_replace("_", " ", $m_title);
if ($custom_title != "") {
$m_title2 = $custom_title;
}
if ($m_title != $main_module) {
$content .= "<OPTION VALUE=\"$m_title\">$m_title2\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] != "") {
$result = sql_query("select mid from ".$prefix."_modules where title='$modlist[$i]'", $dbi);
list($mid) = sql_fetch_row($result, $dbi);
if ($mid == "") {
sql_query("insert into ".$prefix."_modules values (NULL, '$modlist[$i]', '', '0', '0')", $dbi);
}
}
}
$content .= "<OPTION VALUE=\"\">---------------\n";
$content .= "<OPTION VALUE=\"\">"._NOACTIVEMODULES."\n";
$content .= "<OPTION VALUE=\"\">---------------\n";
$result = sql_query("select title, custom_title from ".$prefix."_modules where active='0' ORDER BY title ASC", $dbi);
while(list($mn_title, $custom_title) = sql_fetch_row($result, $dbi)) {
$mn_title2 = ereg_replace("_", " ", $mn_title);
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
$content .= "<OPTION VALUE=\"$mn_title\">$mn_title2\n";
$a = 1;
}
if ($a != 1) {
$content .= "<OPTION VALUE=\"\">"._NONE."\n";
}
}
$content .= "</SELECT></TD></TR></FORM></TABLE></CENTER>";
/* Search feature */
if ($viewSearch == 1){
$content .= "<center><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><form action=\"search.html\" method=\"post\">";
$content .= "<br><center><input type=\"text\" onfocus=\"value=''\" value=\"Site Search\" name=\"query\" size=\"20\"></center>";
$content .= "</TD></TR></form></TABLE></center>";
} else {
return;
}
?>
|
with This: Code:
<?php
/************************************************************************/
/* TechGFX Navigation Block v.2.0.0 COPYRIGHT */
/* */
/* Copyright (c) 2004 - 2006 by http://www.techgfx.com */
/* Techgfx - Graeme Allan (goose@techgfx.com) */
/* */
/************************************************************************/
/* PHP-Nuke Platinum: Expect to be impressed COPYRIGHT */
/* */
/* Copyright (c) 2004 - 2006 by http://www.techgfx.com */
/* Techgfx - Graeme Allan (goose@techgfx.com) */
/* */
/* Copyright (c) 2004 - 2006 by http://www.conrads-berlin.de */
/* MrFluffy - Axel Conrads (axel@conrads-berlin.de) */
/* */
/* Refer to TechGFX.com for detailed information on PHP-Nuke Platinum */
/* */
/* TechGFX: Your dreams, our imagination */
/************************************************************************/
if (stristr($_SERVER['SCRIPT_NAME'], "block-Navigation.php")) {
Header("Location: ../index.php");
die();
}
global $prefix, $db, $admin, $user;
/*****************************************************/
/* Uncomment the following if you wish */
/*****************************************************/
//$mouseOver = "#000000";
//$mouseOut = "#000000";
/*****************************************************/
/* 0 = No search 1 = Yes search */
/*****************************************************/
$viewSearch = "0";
/*****************************************************/
/* 0 = Dropdown style 1 = Block style */
/*****************************************************/
$dropDown = "0";
/*****************************************************/
/* Variable declarations */
/*****************************************************/
$admcontent = "";
$actionMenu = "onMouseOver=\"this.style.background='$mouseOver'\" onMouseOut=\"this.style.background='$mouseOut'\" style=\"cursor:pointer;cursor:hand\" onclick=\"window.location.href=";
$result = $db->sql_query("select main_module from ".$prefix."_main");
list($main_module) = $db->sql_fetchrow($result);
/*****************************************************/
/* Remove module from database if does not exist */
/*****************************************************/
$result = $db->sql_query("select title from ".$prefix."_modules");
while (list($title) = $db->sql_fetchrow($result)) {
$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'");
}
}
/*****************************************************/
/* Interface with correspondent url's */
/*****************************************************/
$content = "<center><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\">";
$content .="<TR><TD class=\"info1\"><b>Main</b></TD></TR>";
$content .= "<TR><TD class=\"row1\"> <a href=\"index.php\">"._HOME."</a></TD></TR>\n";
//$content .= "<strong><big>·</big></strong> <a href=\"index.php\">"._HOME."</a><br>\n";
$sql = "SELECT mcid, mcname FROM ".$prefix."_modules_categories WHERE visible='1' ORDER BY mcid ASC";
$result2 = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result2)) {
$mcid = $row[mcid];
$mcname = $row[mcname];
if (file_exists("images/blocks/modules/".$mcname.".gif")) {
$content .="<tr><TD class=\"info1\" valign=middle> <img src=\"images/blocks/modules/".$mcname.".gif\"> <b>".$mcname."</b></td></tr>\n";
} else {
$content .="<tr><TD class=\"info1\"> <b>".$mcname."</b></td></tr>\n";
}
/*****************************************************/
/* Module - NSN Groups v.1.6.3 START */
/*****************************************************/
$sql = "SELECT title, custom_title, view, groups FROM ".$prefix."_modules WHERE active='1' AND title!='$def_module' AND inmenu='1' AND mcid='$mcid' ORDER BY custom_title ASC";
/*****************************************************/
/* Module - NSN Groups v.1.6.3 END */
/*****************************************************/
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$m_title = $row[title];
$custom_title = $row[custom_title];
$view = $row[view];
/*****************************************************/
/* Module - NSN Groups v.1.6.3 START */
/*****************************************************/
$groups = $row['groups'];
/*****************************************************/
/* Module - NSN Groups v.1.6.3 END */
/*****************************************************/
if ($custom_title != "") {
$m_title2 = $custom_title;
}
$m_title2 = ereg_replace("_", " ", $m_title2);
/*****************************************************/
/* Module - NSN Groups v.1.6.3 START */
/*****************************************************/
/*
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$content .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$m_title\">$m_title2</a></TD></TR>\n";
}
*/
if ($m_title != $main_module) {
if ($view == 0) {
$content .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$m_title\">$m_title2</a></TD></TR>\n";
} elseif ($view == 1 AND is_user($user)) {
$content .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$m_title\">$m_title2</a></TD></TR>\n";
} elseif ($view == 2 AND is_admin($admin)) {
$content .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$m_title\">$m_title2</a></TD></TR>\n";
} elseif ($view == 3 AND paid()) {
$content .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$m_title\">$m_title2</a></TD></TR>\n";
} elseif ($view > 3 AND in_groups($groups)) {
$content .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$m_title\">$m_title2</a></TD></TR>\n";
}
/*****************************************************/
/* Module - NSN Groups v.1.6.3 END */
/*****************************************************/
}
}
}
$content .= "</table></center>\n";
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\"><tr><TD class=\"info1\"> <b>".Resources."</b></td></tr></table>\n";
$content .= "<center><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\">\n";
$content .= "<TD class=\"row1\"> <a href=\"http://www.techgfx.com/\" target=_blank>TechGFX</a></TD></TR>\n";
$content .= "<TD class=\"row1\"> <a href=\"http://www.portedmods.com/\" target=_blank>PortedMods</a></TD></TR>\n";
$content .= "<TD class=\"row1\"> <a href=\"http://www.conrads-berlin.de/\" target=_blank>conrads-berlin</a></TD></TR>\n";
$content .= "</table></center>\n";
/*****************************************************/
/* Dropdown / block style selection menu creation */
/*****************************************************/
if ($dropDown == 0){
$content .= "<CENTER><br><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><FORM METHOD=POST ACTION=\"modules.php\"><TD><SELECT NAME=\"name\" onChange=\"top.location.href=this.options[this.selectedIndex].value\"><OPTION VALUE=\"\">Full Selection";
} else {
$content .= "<CENTER><br><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><FORM METHOD=POST ACTION=\"modules.php\"><TD><SELECT NAME=\"name\" MULTIPLE SIZE=\"$row2show\" onChange=\"top.location.href=this.options[this.selectedIndex].value\"><OPTION VALUE=\"\">Full Selection";
}
$content .= "<OPTION VALUE=\"\">---------------\n";
$result = $db->sql_query("select title, custom_title, view from ".$prefix."_modules where active='1' AND title!='$def_module' AND inmenu='1' ORDER BY title ASC");
while(list($m_title, $custom_title, $view) = $db->sql_fetchrow($result)) {
if ($custom_title != "") {
$m_title2 = $custom_title;
}
$m_title2 = ereg_replace("_", " ", $m_title2);
if ($m_title != $main_module) {
if ((is_admin($admin) AND $view == 2) OR $view != 2) {
$content .= "<OPTION VALUE=\"modules.php?name=$m_title\">$m_title2\n";
}
}
}
/*****************************************************/
/* If admin, display inactive modules */
/*****************************************************/
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 module exists, add to database */
/*****************************************************/
if($modlist[$i] != "") {
$result = $db->sql_query("select mid from ".$prefix."_modules where title='$modlist[$i]'");
list ($mid) = $db->sql_fetchrow($result);
if ($mid == "") {
$db->sql_query("INSERT INTO ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '', '1', '0', '1', '')");
}
}
}
$content .= "<OPTION VALUE=\"\">---------------\n";
$content .= "<OPTION VALUE=\"\">"._INVISIBLEMODULES."\n";
$content .= "<OPTION VALUE=\"\">---------------\n";
/*****************************************************/
/* If admin, display invisible modules */
/*****************************************************/
$admcontent .="</TD></TABLE><BR>";
$admcontent .= "<center><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"95%\">\n";
$admcontent .="<TR><TD class=\"info1\"> <b>"._INVISIBLEMODULES."</TD></TR>\n";
$result = $db->sql_query("select title, custom_title from ".$prefix."_modules where active='1' AND inmenu='0' ORDER BY title ASC");
while(list($mn_title, $custom_title) = $db->sql_fetchrow($result)) {
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
$mn_title2 = ereg_replace("_", " ", $mn_title2);
if ($mn_title2 != "") {
$content .= "<OPTION VALUE=\"modules.php?name=$mn_title\">$mn_title2\n";
//@RJR-Pwmg@Rncvkpwo@-@Eqratkijv@(e)@VgejIHZ.eqo
$admcontent .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$mn_title\">$mn_title2</a></TD></TR>\n";
$dummy = 1;
} else {
$a = 1;
}
}
/*****************************************************/
/* If no invisible modules, display lang variable */
/*****************************************************/
if ($a = 1 AND $dummy != 1) {
$content .= "<OPTION VALUE=\"\">"._NONE."\n";
$admcontent .= "<TR><TD class=\"row1\"> "._NONE."</TD></TR>\n";
}
$content .= "<OPTION VALUE=\"\">---------------\n";
$content .= "<OPTION VALUE=\"\">"._NOACTIVEMODULES."\n";
$content .= "<OPTION VALUE=\"\">---------------\n";
/*****************************************************/
/* If admin, display inactive modules */
/*****************************************************/
$admcontent .= "<TR><TD class=\"info1\"> <b>"._NOACTIVEMODULES."</TD></TR>\n";
$result = $db->sql_query("select title, custom_title from ".$prefix."_modules where active='0' ORDER BY title ASC");
while(list($mn_title, $custom_title) = $db->sql_fetchrow($result)) {
if ($custom_title != "") {
$mn_title2 = $custom_title;
}
$mn_title2 = ereg_replace("_", " ", $mn_title2);
if ($mn_title2 != "") {
$content .= "<OPTION VALUE=\"modules.php?name=$mn_title\">$mn_title2\n";
$admcontent .= "<TR><TD class=\"row1\"> <a href=\"modules.php?name=$mn_title\">$mn_title2</a></TD></TR>\n";
$dummy = 1;
} else {
$a = 1;
}
}
/*****************************************************/
/* If no inactive modules, display lang variable */
/*****************************************************/
if ($a = 1 AND $dummy != 1) {
$content .= "<OPTION VALUE=\"\">"._NONE."\n";
$admcontent .= "<TR><TD class=\"row1\"> "._NONE."</TD></TR>\n";
}
}
$content .= "</SELECT></TD></TR></FORM>";
$content .= $admcontent;
$content .= "</TABLE></CENTER>";
/*****************************************************/
/* Search function / feature */
/*****************************************************/
if ($viewSearch == 1){
$content .= "<center><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><form action=\"search.html\" method=\"post\">";
$content .= "<br><center><input type=\"text\" onfocus=\"value=''\" value=\"Site Search\" name=\"query\" size=\"20\"></center>";
$content .= "</TD></TR></form></TABLE></center>";
} else {
return;
}
?>
|
Secondly does Ravens Site Info Block work with 7.6 Plat with out much modification?? |
_________________ Webmaster
http://bellinghamitservices.com
http://onlinespacesims.com
http://bellinghammigthymopars.org
http://whatcomcountypagans.org
All Sites use PHP-Nuke 7.3 and up |
|
chatserv
Member Emeritus
![](modules/Forums/images/avatars/Risque/fhf215.jpg)
Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Thu Apr 21, 2005 8:04 pm |
|
If you have everything that is required for that menu then most likely the only thing you will need to change is on the second file you posted:
Code:$db->sql_query("INSERT INTO ".$prefix."_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '', '1', '0', '1', '')");
|
The number of entries should match those of the modules db table, usually you can compare it with the insert line present in the modules.php admin file. |
|
|