Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
peace
Worker
Worker



Joined: Mar 11, 2004
Posts: 209

PostPosted: Mon Dec 13, 2004 7:56 pm Reply with quote

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) Embarassed


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 
View user's profile Send private message
peace







PostPosted: Tue Dec 14, 2004 11:25 am Reply with quote

was it a hard question Sad
 
TheosEleos
Life Cycles Becoming CPU Cycles



Joined: Sep 18, 2003
Posts: 960
Location: Missouri

PostPosted: Tue Dec 14, 2004 4:42 pm Reply with quote

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! 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
peace







PostPosted: Tue Dec 14, 2004 5:38 pm Reply with quote

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 Crying or Very sad
 
TheosEleos







PostPosted: Tue Dec 14, 2004 5:43 pm Reply with quote

What error are you getting?
 
peace







PostPosted: Tue Dec 14, 2004 7:24 pm Reply with quote

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 Sad
 
TheosEleos







PostPosted: Tue Dec 14, 2004 7:34 pm Reply with quote

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

PostPosted: Tue Dec 14, 2004 8:32 pm Reply with quote

>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. 
View user's profile Send private message
peace







PostPosted: Wed Dec 15, 2004 6:19 am Reply with quote

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");


Sad
 
TheosEleos







PostPosted: Wed Dec 15, 2004 1:54 pm Reply with quote

include("modules/$Admins_Area/index.php");

Delete that line completely. It is redundant for the way are doing this module.
 
peace







PostPosted: Wed Dec 15, 2004 2:26 pm Reply with quote

Thank you Theos
it worked now i have not any error ( for now Mr. Green )

appreciate
 
TheosEleos







PostPosted: Wed Dec 15, 2004 2:28 pm Reply with quote

Glad to help!
 
peace







PostPosted: Wed Dec 15, 2004 3:00 pm Reply with quote

yes you did much ty Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©