Topic: table prefix in url bar

Alright, what i want to do is make a forum, that when the url is http://domain.com/forums/?forum=blah , it will load the forum in with the table prefix of blah_. Ive tried many thigns in the config.php file to try to do this, but I cant get anything to work.

Thanks in advanced.

Indocron
$theQuestion = (2*b) || !(2*b);

2 (edited by zaher 2004-10-10 00:31)

Re: table prefix in url bar

did you try this in config.php

if (isset($_GET['forum'])
  $db_prefix = $_GET['forum'];
 else
  $db_prefix = '';//the default
If your people come crazy, you will not need to your mind any more.

Re: table prefix in url bar

then it doesnt even load the page at all.. also, it needs to have the _ added to it.

Indocron
$theQuestion = (2*b) || !(2*b);

Re: table prefix in url bar

$db_prefix = $_GET['forum'] . '_';

will add the _

Re: table prefix in url bar

That won't work though. It will display the index page just fine, but no links will have the "?forum=blah".

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: table prefix in url bar

Rickard wrote:

That won't work though. It will display the index page just fine, but no links will have the "?forum=blah".

ah, yes ... there will be alot of editing needed then tongue

7

Re: table prefix in url bar

maybe set value in a cocki

If your people come crazy, you will not need to your mind any more.

Re: table prefix in url bar

Not a bad idea actually.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: table prefix in url bar

yes, i think that would be how id have to do it. ive tried making cookies many times, with no succes.. anyone mind giving a brief tutorial?

Indocron
$theQuestion = (2*b) || !(2*b);

10

Re: table prefix in url bar

First, why you need multiple database ?
coocki not work with link outside forum like EMail of subscripe members if thay subscripe in more forum database.

what about subdomains or subdirectory?.

If your people come crazy, you will not need to your mind any more.

Re: table prefix in url bar

what i want to do is offer a service like http://phpbber.com and http://phpbbforfree.com , except for PunBB. so subdomains wouldnt really work..

Indocron
$theQuestion = (2*b) || !(2*b);

12

Re: table prefix in url bar

i think you must play with .htaccess, i am not good with it, some one here must be can answer you?

If your people come crazy, you will not need to your mind any more.

Re: table prefix in url bar

no, i know a bit of .htaccess. i really dont think that any of that will help for this. i think cookies would be the best way. check to see if there is a cookie, if there is, load that forum. if not, take the one in $forum and load that one.

now i just need to know how to get cookies to work..

Indocron
$theQuestion = (2*b) || !(2*b);

14

Re: table prefix in url bar

setcookie and $_COOKIE
search for it in forum source

If your people come crazy, you will not need to your mind any more.