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
Hi-Jack
New Member
New Member


Joined: Jan 09, 2004
Posts: 7

PostPosted: Fri Jan 09, 2004 3:46 pm Reply with quote Back to top

But i tried modifying it and did no succeed.
Then again, i have no knowledge of PhP.

Is there any way one can load a "block" as "module".
I mean, convert a block to a module.

Here is the code from a block autohtml i wish to use as a module autohtml:

*************************************************************<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com) */
/*
Only registered users can see links on this board!
Get registered or login to the forums!
*/
/* */
/* 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. */
/************************************************************************/
/* AUTOHTML (+PDF) v. 2.0 for PHP-NUKE */
/* Copyright (c) 2003 by Roberto Beltrame (webmaster@php-proxima.com) */
/*
Only registered users can see links on this board!
Get registered or login to the forums!
*/
/************************************************************************/
/* Switch menu: */
/* made by Martial Boissonneault © 2001-2003
Only registered users can see links on this board!
Get registered or login to the forums!
*/
/************************************************************************/
if (eregi("block-autohtml.php",$_SERVER[PHP_SELF])) {
Header("Location: ../index.php");
die();
}
/**** search user theme **********************/
global $ThemeSel;
get_theme();
/**** style for switch menu ******************/
$content .= "<style type=\"text/css\">
.menuOut { cursor:pointer; margin:7px; border:1px solid #000000; padding:2px; text-align:left; }
.menuOver { cursor:pointer; margin:7px; border:1px solid #000000; padding:2px; text-align:left; }
.submenu { padding-left:15px;}
.submenu a { text-decoration:none; font-weight:bold;}
.submenu a:hover { text-decoration:none; font-style:oblique; font-weight:bold;}
</style>";
/*********************************************/
$content .="
<script type=\"text/javascript\">
/*
Script made by Martial Boissonneault © 2001-2003
Only registered users can see links on this board!
Get registered or login to the forums!

This script may be used and changed freely as long as this msg is intact
Visit
Only registered users can see links on this board!
Get registered or login to the forums!
for more free scripts and tutorials.
*/
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById(\"cont\").getElementsByTagName(\"DIV\");
if(el.style.display == \"none\"){
for (var i=0; i<ar.length; i++){
ar[i].style.display = \"none\";
}
el.style.display = \"block\";
}else{
el.style.display = \"none\";
}
}
}
function ChangeClass(menu, newClass) {
if (document.getElementById) {
document.getElementById(menu).className = newClass;
}
}
</script>";
/*document.onselectstart = new Function(\"return false\");*/


$patterns[0] = "/.htm/";
$patterns[1] = "/.html/";
$patterns[2] = "/.pdf/";
$patterns[3] = "/_/";
$replacements[0] = "";
$replacements[1] = "";
$replacements[2] = "";
$replacements[3] = " ";

$handle_main=opendir('autohtml');
while ($file_title = readdir($handle_main)) {
if ((!ereg("[.]",$file_title))) {
$title_title=ereg_replace("_", " ", $file_title);
$menucount++; $menuid="menu".$menucount; $submenu="sub".$menucount;
$img="folder.gif";
$content .= "<div id=\"cont\">\n";
$content .= "<p id=\"".$menuid."\" class=\"menuOut\" onclick=\"SwitchMenu('".$submenu."')\" onmouseover=\"ChangeClass('".$menuid."','menuOver')\" onmouseout=\"ChangeClass('".$menuid."','menuOut')\"><img src=\"autohtml/".$img."\" alt=\"\" border=\"0\">&nbsp;&nbsp;".$title_title."</p>\n";
$content .="</div>\n";
$content .="<span class=\"submenu\" id=\"".$submenu."\" style=\"display:none;\">\n";
$handle_sub=opendir('autohtml/'.$file_title);
while ($file_sub = readdir($handle_sub)) {
if (ereg("(.)+\\.(htm$|html$|pdf$)",$file_sub)) {
if (ereg("(.)+\\.(pdf$)",$file_sub)) {
$href="<a href=\"autohtml/".$file_title."/".$file_sub."\">";
$img="pdf.gif";
} else {
$href="<a href=\"autohtml.php?filename=".$file_title."/".$file_sub."\">";
$img="html.gif";
}
$sub_title=preg_replace($patterns, $replacements, $file_sub);
$content .="<img src=\"autohtml/".$img."\" alt=\"\" border=\"0\">&nbsp; ".$href."".$sub_title."</a><br/>\n";
}
}
closedir($handle_sub);
$content .="</span>\n";
}
}
closedir($handle_main);


?>
*************************************************************

I'm prepaired to pay a little fee for whoever makes it work.
This comes from Autohtml version 2.

I'd like to use it but we have so many docs that a block, is just not good enough to show all the topics we write about.

(it does not look hard, i'm just to dumb to do it)

Thanks alot in advance.
View user's profile Send private message
Raven
Site Admin/Owner


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

PostPosted: Sat Jan 10, 2004 12:10 am Reply with quote Back to top

Create a folder called 'autohtml' and place it in modules folder. Then, copy and paste this code in index.php in the modules/autohtml folder.
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com) */
/* 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. */
/************************************************************************/
/* AUTOHTML (+PDF) v. 2.0 for PHP-NUKE */
/* Copyright (c) 2003 by Roberto Beltrame (webmaster@php-proxima.com) */
/* http://www.php-proxima.com */
/************************************************************************/
/* Switch menu: */
/* made by Martial Boissonneault © 2001-2003 http://getElementById.com/ */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}

$module_name = basename(dirname(__FILE__));

$index = 1;

include("header.php");
OpenTable();

/**** search user theme **********************/
global $ThemeSel;
get_theme();
/**** style for switch menu ******************/
$content .= "<style type=\"text/css\">
.menuOut { cursor:pointer; margin:7px; border:1px solid #000000; padding:2px; text-align:left; }
.menuOver { cursor:pointer; margin:7px; border:1px solid #000000; padding:2px; text-align:left; }
.submenu { padding-left:15px;}
.submenu a { text-decoration:none; font-weight:bold;}
.submenu a:hover { text-decoration:none; font-style:oblique; font-weight:bold;}
</style>";
/*********************************************/
$content .="
<script type=\"text/javascript\">
/*
Script made by Martial Boissonneault © 2001-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById(\"cont\").getElementsByTagName(\"DIV\");
if(el.style.display == \"none\"){
for (var i=0; i<ar.length; i++){
ar[i].style.display = \"none\";
}
el.style.display = \"block\";
}else{
el.style.display = \"none\";
}
}
}
function ChangeClass(menu, newClass) {
if (document.getElementById) {
document.getElementById(menu).className = newClass;
}
}
</script>";
/*document.onselectstart = new Function(\"return false\");*/


$patterns[0] = "/.htm/";
$patterns[1] = "/.html/";
$patterns[2] = "/.pdf/";
$patterns[3] = "/_/";
$replacements[0] = "";
$replacements[1] = "";
$replacements[2] = "";
$replacements[3] = " ";

$handle_main=opendir('autohtml');
while ($file_title = readdir($handle_main)) {
   if ((!ereg("[.]",$file_title))) {
      $title_title=ereg_replace("_", " ", $file_title);
      $menucount++; $menuid="menu".$menucount; $submenu="sub".$menucount;
      $img="folder.gif";
      $content .= "<div id=\"cont\">\n";
      $content .= "<p id=\"".$menuid."\" class=\"menuOut\" onclick=\"SwitchMenu('".$submenu."')\" onmouseover=\"ChangeClass('".$menuid."','menuOver')\" onmouseout=\"ChangeClass('".$menuid."','menuOut')\"><img src=\"autohtml/".$img."\" alt=\"\" border=\"0\">&nbsp;&nbsp;".$title_title."</p>\n";
      $content .="</div>\n";
      $content .="<span class=\"submenu\" id=\"".$submenu."\" style=\"display:none;\">\n";
      $handle_sub=opendir('autohtml/'.$file_title);
      while ($file_sub = readdir($handle_sub)) {
         if (ereg("(.)+\\.(htm$|html$|pdf$)",$file_sub)) {
            if (ereg("(.)+\\.(pdf$)",$file_sub)) {
               $href="<a href=\"autohtml/".$file_title."/".$file_sub."\">";
               $img="pdf.gif";
            } else {
               $href="<a href=\"autohtml.php?filename=".$file_title."/".$file_sub."\">";
               $img="html.gif";
            }
            $sub_title=preg_replace($patterns, $replacements, $file_sub);
            $content .="<img src=\"autohtml/".$img."\" alt=\"\" border=\"0\">&nbsp; ".$href."".$sub_title."</a><br/>\n";
         }
      }
      closedir($handle_sub);
      $content .="</span>\n";
   }
}
closedir($handle_main);


echo $content;
CloseTable();
include("footer.php");
?>
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Hi-Jack
New Member
New Member


Joined: Jan 09, 2004
Posts: 7

PostPosted: Sat Jan 10, 2004 2:38 am Reply with quote Back to top

Hi Raven,

This is great.
Thank you very much.

I just made a little donation to thank you.

(we do support people helping others, that's what we are all about
at MpegPlayer and this little mod, will help us a long way!)

Regards.
View user's profile Send private message
Hi-Jack
New Member
New Member


Joined: Jan 09, 2004
Posts: 7

PostPosted: Sat Jan 10, 2004 3:25 am Reply with quote Back to top

Oops...
Does not seem to work fine...
A little error...

When i use the links, the menu shows up as it should but it also shows in the Survey block?

Could you stille have a look?
Only registered users can see links on this board!
Get registered or login to the forums!

(documents in Menu)

Thanks and sorry for the burden...
View user's profile Send private message
Hi-Jack
New Member
New Member


Joined: Jan 09, 2004
Posts: 7

PostPosted: Sat Jan 10, 2004 7:48 am Reply with quote Back to top

Hey Raven,

After a few hours (how stupid can i be) i found the problem.
Seems like the autohtml index file was using $content as variable and the survey declares the same $content as global.
I changed the $content into $DocContent and everything works fine now.

Thanks again.
View user's profile Send private message
Raven
Site Admin/Owner


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

PostPosted: Sat Jan 10, 2004 9:03 am Reply with quote Back to top

Thanks so much! Just got up and saw your messages. Glad you figured it out.
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-2008 by Raven
Proud to be listed at Lobo Links Web Directory

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 Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum