Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Running two forum by one vanilla package

edited May 2007 in Vanilla 1.0 Help
Hi, Can any one tell me how can i run two(2) forum by same (one 1) vanilla package. Can it be done? Please help !

Comments

  • If you want both vanillas to use the same user table, but have separate discussions, categories, etc. then yes, this is sort-of built in.

    First—as always—make a backup of all files and the database.
    1. Rename all your existing database LUM_ tables to start something like LUM2_ (yes, including the user table)
    2. Add $Configuration['DATABASE_TABLE_PREFIX'] = 'LUM2_'; to your original forum&#8217s conf/settings.php file. (Note that by default Vanilla expects the user table to always be LUM_User, so nobody will be able to log in at this point.)
    3. Upload a second copy of Vanilla in its own folder on your server.
    4. Run through the install procedure for the second Vanilla.
    5. Delete (drop) the LUM_User table (the fresh one just installed), and rename your LUM2_User table back to LUM_User. (Members can now log in to either old or new forum.)
    6. Double check your role tables (LUM_Role and LUM2_Role) to make sure they match, IDs and all. (could cause some confusing wierdness if they don&#8217t.)
    If you want to have separate users for each forum, stop after you complete step 4 and instead add $DatabaseTables['User'] = 'LUM2_User'; to your old forum&#8217s conf/database.php file to tell Vanilla to use that user table instead of the freshly installed one. The new Vanilla will still point to the fresh users table.

    Last (and optional) thing to do is check out the settings.php file again, and you can point some of the paths to the other vanilla install and delete the files belonging to that Vanilla install. I wouldn't recommend doing this for the extensions path, as some extensions expect to always be inside the extensions folder of the current install (for stylesheets, images and scripts that the extension may link to.)
  • if you rename everything to lum2 then, do a new installation (recreating lum) then drop user table for lum1 & rename lum2 back to lum 1 doesnt that mean that the new installation now has the users assigned to it but the old installation has messed up because it's missing lum2_users or even if it's searching for lum1 it's not going to be able to utilise lum2? ;S How does it all work? Please clarify. Thanks.
  • Vanilla treats LUM_User differently.

    All tables are looked up with the $Configuration['DATABASE_TABLE_PREFIX'] (wich is set to "LUM_" by default) at the start of the table name, except for the user table. That table is looked up in whole with the value of$DatabaseTables['User'] (which is set to "LUM_User" by default.)

    LUM_User is a little special on purpose, so that two installs of Vanilla can easily share the user table.

    So if you wanted to move one vanilla install to make room for another that doesn't share the user table, you would have to change both the prefix to "LUM2_" and change the $DatabaseTables['User'] to "LUM2_User".

    Clear as mud?
  • Ah so.. all the tables are looked up by <prefix><tablename> except user. So for new installation <prefix2><tablename> do a fresh install, drop the user table and rename the user table back to it's origional name. So because the user table is looked up in a in a special way the prefix won't really matter meaning that lum2 can still function. Got ya :)
  • I will try it out pals
  • ToivoToivo New
    edited May 2007
    Or just create different entrance pages? yoursite.com/basketball_fans yoursite.com/soccer_lovvers http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=60
  • Ok I have tried he u said. 1> Install new vanilla package in my local server. 2> I renamed all the tables to lum1_<table>, except “lum_user”. 3> Next I added “$Configuration['DATABASE_TABLE_PREFIX'] = 'LUM1_';” line to “conf/settings.php” file. 4> Before installing another vanilla new package, I thought for a try. I run the it and here I got this message : --------------------------------------------------------------------------------------------- A fatal, non-recoverable error has occurred Technical information (for support personel): Error Message An error occurred while attempting to retrieve the requested user. Affected Elements UserManager.GetSessionDataById(); The error occurred on or near: Table 'mroftalp_irn.lum_role' doesn't exist --------------------------------------------------------------------------------------------------------- That has gone wrong ! Please help me !
  • Have you got any extensions running?
  • edited May 2007
    That's weird, it looks like Vanilla isn't using your LUM1_ prefix, but still uses lum_. Are you sure the upload of /conf/settings.php went well?

    Edit: It could also be the CategoryRoles extension, which doesn't seem to use the table prefixes set, and just uses "lum_role" no matter what.
  • Rename user table aswell. You dont want that being over written and losing you're data. rename install drop table rename table back to lum_user.
  • Actually losing data isnt an issue since (presumably) he doesnt have any on this fresh install, but you're right about changing the name since the installer will probably refuse to install with the table in place...
  • how i do it in other way
  • File: setup/installer.php

    // Starts after 94
    $DBPass = ForceIncomingString('DBPass', ''); $DBPrefix = ForceIncomingString('DBPrefix', 'LUM_'); $Username = ForceIncomingString('Username', '');

    // Line 225
    $TableToCompare = str_replace($DBPrefix, '', $TableToCompare);
    // Starts new line 253

    // If the prefix has been changed, change the prefixes if ($DBPrefix != $Configuration['DATABASE_TABLE_PREFIX']) { $CurrentQuery = str_replace($Configuration['DATABASE_TABLE_PREFIX'], $DBPrefix, $CurrentQuery); }

    // Starts new line 282
    if ($DBPrefix != $Configuration['DATABASE_TABLE_PREFIX']) { $DBManager->DefineSetting("DATABASE_TABLE_PREFIX", $DBPrefix, 1); }

    // Starts new line 495
    <li> <label for=\"DBPrefix\">Database Prefix</label> <input type=\"text\" id=\"DBPrefix\" name=\"DBPrefix\" value=\"".FormatStringForDisplay($DBPrefix, 1)."\" /> </li>

    File: library/Framework/Framework.Functions.php

    function GetTableName($Key, &$TableCollection, $Prefix) { if ($Key == "User") { if($Key != 'LUM_' && substr($TableCollection[$Key], 0, 4) == 'LUM_') { return $Prefix.substr($TableCollection[$Key], 4); } else { return $TableCollection[$Key]; } } else { return $Prefix.$TableCollection[$Key]; } }
  • thank for the help !
This discussion has been closed.