index constant

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Joablen
Posts: 60
Joined: Sun Aug 27, 2006 3:09 am
Contact:

index constant

Post by Joablen »

Dont you all think it would be great if they would make a constant for defining the forum index so we could easily and faster change index.php to forum.php... i'de be great, it would also be better for developing new CMSs based on phpBB

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: index constant

Post by Highway of Life »

First, there are no feature requests. ;)

Second, you can create your own new "index" (or whatever you want to call it) and have the user land there "first".
By adding (or modify if exists) this line in the .htaccess file (in your phpBB root directory)

Code: Select all

DirectoryIndex mypage.php index.php
The first page you would want to appear would be "mypage.php", but if that file does not exist in the directory, the server will look for "index.php", if that does not exist, the next item is looked for... etc.

Hope that helps.
Image

Joablen
Posts: 60
Joined: Sun Aug 27, 2006 3:09 am
Contact:

Re: index constant

Post by Joablen »

i know theres no feature request i was just commenting... and that wouldn't work you would need to use mod_rewrite but that wouldn't be useful because what im saying is that by changing the costant you can change you index.php to forum.php with all the forum links being ok (directed to forum.php instead of index.php) that way you could make your index for displaying you portal having it on the same directory as phpbb...

BondGamer
Registered User
Posts: 113
Joined: Mon Dec 15, 2003 8:20 pm
Contact:

Re: index constant

Post by BondGamer »

It wouldn't be that difficult to make a MOD for this. Just would require editing links in a lot of places. The index could be forum 0.

Joablen
Posts: 60
Joined: Sun Aug 27, 2006 3:09 am
Contact:

Re: index constant

Post by Joablen »

i know... i've done it in phpBB2 but what i'm saying is that i'd be much better with a constant that defines what file is the index so you wouldn't have to look for every index.$phpEx

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: index constant

Post by Highway of Life »

Then I don't see the point of doing that???

Perhaps you could enlighten me? :?
Image

Joablen
Posts: 60
Joined: Sun Aug 27, 2006 3:09 am
Contact:

Re: index constant

Post by Joablen »

Highway of Life wrote: Then I don't see the point of doing that???

Perhaps you could enlighten me? :?


for example... if in the file constants.php there was a line that said:

Code: Select all

define('BOARD_INDEX', 'index'.$phpEx);
and all the board uses that constant to know where is the board index so that links and other stuff would be correct... and if you change that to 'forum'.$phpEx the board will change the links automatically and will save you a lot of time if you want to create a new CMS

User avatar
Eelke
Registered User
Posts: 606
Joined: Thu Dec 20, 2001 8:00 am
Location: Bussum, NL
Contact:

Re: index constant

Post by Eelke »

I think we all understand about how it would work if you use a constant instead of a hardcoded string for the index page, but I think what Highway is asking about is to elaborate a bit on this:
Joablen wrote: will save you a lot of time if you want to create a new CMS

How would having this constant help here?

I personally would like it if not just the index page, but all of the URLs used by the board were somehow customizable - e.g., so that you could get the board to use URLs such as forum.php?action=posting&f=38&p=157661 instead of posting.php?mode=quote&f=3&p=157661. (Of course, you'd still have to provide the forum.php file that would delegate stuff to the correct core files). Background: I would like to integrate phpBB 3 into a Joomla component, which would basically require something like this - albeit I simplified the example :).

I suppose this should actually be possible with some mod_rewrite magic, it would just be nice if URLs produced by the board were consistent with the actual URLs used by the site.

Joablen
Posts: 60
Joined: Sun Aug 27, 2006 3:09 am
Contact:

Re: index constant

Post by Joablen »

Eelke wrote: I think we all understand about how it would work if you use a constant instead of a hardcoded string for the index page, but I think what Highway is asking about is to elaborate a bit on this:
Joablen wrote: will save you a lot of time if you want to create a new CMS

How would having this constant help here?


for changing the index.php to forum.php or board.php so you could use a file called index.php for the CMS portal... that way you wouldn't have to use mod_rewrite or DirectoryIndex

profpete
Registered User
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

Re: index constant

Post by profpete »

And why can't the forum live in a sub-directory?

Post Reply