Author |
Message |
peace
Worker


Joined: Mar 11, 2004
Posts: 209
|
Posted:
Mon Dec 13, 2004 7:56 pm |
|
Hello
I have my own pages which i create they not a module or any i just switch my .html pages to .php before but they all has their own styles in them like fonts ,colours.My problem is when i or any member change theme that pages still shows in their own colours ( not fits theme style,colours)
I think if i can change that pages to modules it will solve my problem coz i dont know any better way.I see modules changed with 7.5( which im using) but i dont have any clue how can i convert my pages to modules
if someone can help ill be happy all i can do this code below ( i know i suck)
if (!stristr($_SERVER['SCRIPT_NAME'], "modules.php")) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
/**********************************/
/* Configuration */
/* */
/* You can change this: */
/* $index = 0; (right side off) */
/**********************************/
$index = 1;
$subject = "$sitename "._BLABLA.""; <--- l think this will be my module name in caps and no space ?
my page content here
include_once('footer.php');
?> |
Last edited by peace on Thu Dec 16, 2004 12:57 pm; edited 1 time in total |
|
|
 |
peace

|
Posted:
Tue Dec 14, 2004 11:25 am |
|
was it a hard question  |
|
|
|
 |
TheosEleos
Life Cycles Becoming CPU Cycles

Joined: Sep 18, 2003
Posts: 960
Location: Missouri
|
Posted:
Tue Dec 14, 2004 4:42 pm |
|
Make an index.php file with this code.
Code:
<?php
if (!eregi("modules.php", $PHP_SELF)) die ("You can't access this file directly...");
$index=1;
$module_name = basename(dirname(__FILE__));
require_once("mainfile.php");
$pagetitle = "- Join pHenyl's House!";
include("header.php");
OpenTable();
include("modules/$module_name/blablabla.html");
CloseTable();
include("footer.php");
?>
|
Change 'blablabla.html' to point to your custom html page. Place this index.php and your custom.html file into your module then activate.
Make sure that your custom.html file does not have text formatting code or it will overwrite your theme. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
 |
 |
peace

|
Posted:
Tue Dec 14, 2004 5:38 pm |
|
HelloTheosEleos
ty for the answer
but im really noob for this coding stuff
i am tryin to create only a index.page for my module ( i have not a .html page anymore )
i created an index.php page like you said
<?php
if (!eregi("modules.php", $PHP_SELF)) die ("You can't access this file directly...");
$index=1;
$module_name = basename(dirname(__FILE__));
require_once("mainfile.php");
$pagetitle = "- Join pHenyl's House!";
include("header.php");
OpenTable();
include("modules/$module_name/blablabla.html");
CloseTable();
include("footer.php");
?>
i change the lines ;
Join pHenyl's House ===> my blablapage
include("modules/$module_name/blablabla.html"); ===> include("modules/$My_Module_Name/index.php");
my text will be here
CloseTable();
include("footer.php");
?>
im having an error for the line ''my text will be here ''
you say ;
Make sure that your custom.html file does not have text formatting code or it will overwrite your theme
i didnt understand this what must i do please can you give me an example cause i was thinkin to paste my page content there  |
|
|
|
 |
TheosEleos

|
Posted:
Tue Dec 14, 2004 5:43 pm |
|
What error are you getting? |
|
|
|
 |
peace

|
Posted:
Tue Dec 14, 2004 7:24 pm |
|
Parse error: parse error, unexpected T_STRING in /home/blabla/public_html/modules/bla_bla/index.php on line 61
my line 61 contains only ===> my text will be here  |
|
|
|
 |
TheosEleos

|
Posted:
Tue Dec 14, 2004 7:34 pm |
|
Go back to my original code I posted and take out
Code:include("modules/$module_name/blablabla.html");
|
Put your text in that area and tell me what happens. |
|
|
|
 |
PHrEEkie
Subject Matter Expert

Joined: Feb 23, 2004
Posts: 358
|
Posted:
Tue Dec 14, 2004 8:32 pm |
|
>my text will be here
will not work because your PHP tag is still open.
Try:
echo"my text will be here"; |
_________________ PHP - Breaking your legacy scripts one build at a time. |
|
|
 |
peace

|
Posted:
Wed Dec 15, 2004 6:19 am |
|
Ty for answers Theeleos and phreekie
my index.php now like this
if (!stristr($_SERVER['SCRIPT_NAME'], "modules.php")) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- my Admins Area!";
include("header.php");
OpenTable();
include("modules/$Admins_Area/index.php");
echo"my page text will be here";
CloseTable();
include("footer.php");
?>
the error i had is below
Warning: main(modules//index.php): failed to open stream: No such file or directory in /home/bla/public_html/modules/Admins_Area/index.php on line 41
Warning: main(): Failed opening 'modules//index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bla/public_html/modules/Admins_Area/index.php on line 41
my page text will be here
my line 41 below( my module name will be Admins Area)
include("modules/$Admins_Area/index.php");
 |
|
|
|
 |
TheosEleos

|
Posted:
Wed Dec 15, 2004 1:54 pm |
|
include("modules/$Admins_Area/index.php");
Delete that line completely. It is redundant for the way are doing this module. |
|
|
|
 |
peace

|
Posted:
Wed Dec 15, 2004 2:26 pm |
|
Thank you Theos
it worked now i have not any error ( for now )
appreciate |
|
|
|
 |
TheosEleos

|
Posted:
Wed Dec 15, 2004 2:28 pm |
|
|
|
 |
peace

|
Posted:
Wed Dec 15, 2004 3:00 pm |
|
yes you did much ty  |
|
|
|
 |
|