Iincluding a HTML file and its links in a PHP-Nuke module

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Iincluding a HTML file and its links in a PHP-Nuke module
lando305
CZ Newbie
lando305 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 19, 2004
0.00 posts per day
Posts: 6
Points: 286
   
I understand how to do it but can i do it when links are in a subfolder?
for example:

thisone.htm
would be like
<a href="modules.php?name=MY_MODULE&amp;page=thisone.html">
and then edit the index.php and add -->
$ACCEPT_FILE['thisone.html'] = 'thisone.html';

However this doesn't seem to work with a file, lets say:
house/index.html If i would the same process i would do

<a href="modules.php?name=MY_MODULE&amp;page=house/index.html">
and then edit the index.php and add -->
$ACCEPT_FILE['house/index.html '] = 'house/index.html' ;
But this doesn't work...Can any one please help me?Thank you



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Try something like this:



$subdirectory = "subdirectory/";

$pagename = $ACCEPT_FILE[$page];
$pagename .= "$subdirectory$ACCEPT_FILE[$page];




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Iincluding a HTML file and its links in a PHP-Nuke modul
lando305
CZ Newbie
lando305 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 19, 2004
0.00 posts per day
Posts: 6
Points: 286
   
in the index.php file right?...But lets say i have multiple links like:
house/index.html
car/html
fam/html

i should go into the index.php and add:

$subdirectory = "house/";

$pagename = $ACCEPT_FILE[$page];
$pagename .= "$subdirectory$ACCEPT_FILE[$page];

$subdirectory = "car/"; //does it work like java where the variable gets a new value here

$pagename = $ACCEPT_FILE[$page];
$pagename .= "$subdirectory$ACCEPT_FILE[$page];



Back to top Reply with quote
#4   re: Iincluding a HTML file and its links in a PHP-Nuke modul
lando305
CZ Newbie
lando305 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 19, 2004
0.00 posts per day
Posts: 6
Points: 286
   
i dont get it...look at the index.php for my page, the files are in subfolders for example the first would be [ Register or login to view links on this board. ] and so on....

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
$index = 0;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");

$ACCEPT_FILE['MadHouse/index.html'] = '/MadHouse/index.html';
$ACCEPT_FILE['Video/index.html'] = '/Video/index.html';
$ACCEPT_FILE['JoeVeras/index.html'] = '/JoeVeras/index.html';
$ACCEPT_FILE['Sept19/index.html'] = '/Sept19/index.html';
$ACCEPT_FILE['Millenium/index.html'] = '/Millenium/index.html';
$ACCEPT_FILE['WisinYYandel/index.html'] = '/WisinYYandel/index.html';
$ACCEPT_FILE['BabyRastaYGringo/index.html'] = '/BabyRastaYGringo/index.html';
OpenTable();
include("http://www.MYSITEHERE.com//eventpics.htm");
CloseTable();
include("footer.php");
?>

How would i change this?



Back to top Reply with quote
#5   re: Iincluding a HTML file and its links in a PHP-Nuke modul
lando305
CZ Newbie
lando305 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 19, 2004
0.00 posts per day
Posts: 6
Points: 286
   
include("http://www.MYSITE.com//eventpics.htm");

is a TYPO, its actually

include("http://www.MYSITE.com/eventpics.htm");



Back to top Reply with quote
#6   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Try something like this,

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
$index = 0;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");

$ACCEPT_FILE['MadHouse/index.html'] = '/MadHouse/index.html';
$ACCEPT_FILE['Video/index.html'] = '/Video/index.html';
$ACCEPT_FILE['JoeVeras/index.html'] = '/JoeVeras/index.html';
$ACCEPT_FILE['Sept19/index.html'] = '/Sept19/index.html';
$ACCEPT_FILE['Millenium/index.html'] = '/Millenium/index.html';
$ACCEPT_FILE['WisinYYandel/index.html'] = '/WisinYYandel/index.html';
$ACCEPT_FILE['BabyRastaYGringo/index.html'] = '/BabyRastaYGringo/index.html';
OpenTable();

$php_ver = phpversion();
$php_ver = explode(".", $php_ver);
$phpver = "$php_ver[0]$php_ver[1]";
if ($phpver >= 41) {
    $page = $_GET['page'];
} else {
    $page = $HTTP_GET_VARS['page'];
}

$pagename = $ACCEPT_FILE[$page];

if (!isSet($pagename)) $pagename = "eventpics.htm";

include("http://www.MYSITEHERE.com/$pagename");

CloseTable();
include("footer.php");
?>


If that doesnt work then you will need to assign a variable for each subdirectory and just have one accept file as index.html then pass that variable before each one.



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#7   re: Iincluding a HTML file and its links in a PHP-Nuke modul
lando305
CZ Newbie
lando305 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 19, 2004
0.00 posts per day
Posts: 6
Points: 286
   
Oh ok I understand thanks...that makes sense...i think that should work if this doesn't...I'll let u know



Back to top Reply with quote
#8   re: Iincluding a HTML file and its links in a PHP-Nuke modul
lando305
CZ Newbie
lando305 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 19, 2004
0.00 posts per day
Posts: 6
Points: 286
   
Ok, it worked!!! Thanks, I appreciate it.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum