News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Shared Forum Mod

Started by Goosemoose, January 06, 2006, 03:04:39 AM

Previous topic - Next topic

Mr. Doug

Quote from: Goosemoose on November 27, 2006, 12:51:17 PM
cpttripps, this mod basically splits up one forum to look like multiple forums. You could use it, but you would need to figure out a few things to separate themes and such. If you search there are a few other threads on sharing just users.

Thanks for the answer Goosemoose.

I haven't been able to find one that doesn't involve Joomla/Mambo. I'm running out of combinations of "users share database forums".

Anyone know one off the top of their head that'll work?
--
Doug Hardman
doug (at) puttertalk (dot) com

Goosemoose

Look at the first post on page 10 of this thread by smoothify.

ormuz

Is this mod still working for the last versions?

ShopHRM

I have read and read and read though this and still cant make sence of how I can just make it so when a user sign up from my homepage domain forum they are automatically registered for all the subdomain forums. I am new to building sites and I have never heard of mambo or smf bridge or any of that. I understand the codes that have to be modified in the files like any other mod, but i know nothing of joomla/mambo or entering code in php myadmin. I read smoothify's method and I still dont know. All I want is to have a user sign up for one page and be signed up for them all.

ormuz

I'm trying to make this work too, I think u should remove the default bridge link, and create menus with the new links...

Flying Drupalist

Quote from: smoothify on October 23, 2006, 08:41:00 PM
Thanks for this mod! - its going to be really helpful for me...

However i'm not going to be using joomla, and want the forums to be on different domains.

I found an easy way to modify the mod to do this without the CMF bridge.

instead of using the forum name as a parameter, you just store the (sub)domain name you want the category to be on. ( i added a domain field to the smf_forums table)

e.g - main forums at  forums.mysite.com 
subforums at forums.subsite.com

I enter a record  with catList of 2 and domain of forums.subsite.com

then instead of the mod in the Load.php file on the first page of the thread i entered (same position):
    if(!isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
$domain = $_SERVER['SERVER_NAME'];
        $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE domain = '$domain'", __FILE__, __LINE__);
    $row_forumList = mysql_fetch_assoc($forumList);
        $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
  }


the SERVER_NAME gets the current domain, and then looks up to find which categories to display in the same way. This way you don't need to carry a request parameter around, and don't need the CMF bridge.

There may be some changes needed on the templates to make things clearer, but first test for me seems to work. (i'm new to SMF - just seeing if it meets my needs)

Would appreciate someone more knowledgeable to test and comment  ;)

Thanks again for the mod!

Ben


Is this the only thing you have to do? Alter one file? I don't see how this is going to get the databases together...

Goosemoose

ormuz, that is correct. Check out my site as an example http://www.goosemoose.com

ShopHRM, all the forums are really ONE forum that looks like multiple forums. If you currently have multiple forums (separate database and directories, you would have to combine them).

salim

Hi Goosemoose,

First of all its awesome mod.
Secondly, I went through all pages and understand what to do and how to do... eventhough i didnt test it yet.

See currently my client is running 3 different live phpBB forums for 3 different languages (English, French and Arabic) and I am using one of the converter available in `SMF Download` area to convert all his data from phpBB to SMF1.1RC3.

So I end up with 3 different DBs plus 3 different forum's folder. Now I need yours or someone advise to guide me how to achieve this... like 1 db, 1 folder, all share users.

or if you can guide me which param i have to change for combining all three dbs.

Sorry for such a post but I am totaly new to MySQL and PHP.

Salim
The second half of a man's life is made up of nothing but the habits he has acquired during the first half. - Fyodor Dostoevsky

Hotel

I have no experince in php but i do not have the joomla bridge and my fourme all way ends up going back to themain page not the forum page but i was wondering could you do it whith a cokie ???

PS I do not have and cannot get sub domians as my main site  is on the only one :D

salim

Hi all,

I must say, its wonderful mod.

Im posting little information, i dont know ... maybe someone find it useful but it works perfectly. I did little more searching and found a topic about merging phpBB forums not SMF1.1RC3, which was my actual concern to merge 3 databases together, but suggestion was found in following link...
http://www.simplemachines.org/community/index.php?topic=130379.0

In that post they give a link to phpBB support forum, link is as following...
http://www.phpbb.com/phpBB/viewtopic.php?t=203648&postdays=0&postorder=asc&start=0 [nofollow]
Its a lengthy topic but in short there are two solution which depends on phpBB version, so in short page 1 and page 5 are useful, but do read whole topic.

so I had to merge 3 databases [i use codes from page 1 since phpBB version was quite old] and then use converter to convert all boards, categories, members, etc... and then I used multiple forum method (which Goosemoose introduce). Like add new table with same prefix and sort out which forumName with particular categories id. In my case it was

forumName    catLink
english         14,15,...
french          9,10,...
arabic          2,3,....

and replace some codes in `Load.php` and `BoardIndex.php` (both files were found in `/Sources` dir). Then create the links as suggested. I found people asking `howto` add last param in your URL, well I do this..
See when u install smf_bridge you get your URL something like...

http://domain.com/index.php?option=com_smf&Itemid=xxx [nofollow]
(xxx is something unique and auto generated by joomla, so just look for xxx digits).

Then in backend when u create new link in a menu, select `Link - URL` and there select `Name` text and put your desire name and in `Link` text put something like...

index.php?option=com_smf&Itemid=xxx&forum=yyy
(yyy should match whatever you put in `forumName` column in your database)

In my case it is
For English Version:
index.php?option=com_smf&Itemid=xx&forum=english

For Arabic Version:
index.php?option=com_smf&Itemid=xx&forum=arabic

For French Version:
index.php?option=com_smf&Itemid=xx&forum=french

It was perfectly working fine until I click arabic forum and all text and categories coming from database was perfect (ie in arabic) but my default language was english still, iso didnt change, direction didnt from right to left. In short it took me almost 12 hrs straight to figure it out. And solution to it was very simple. All I have to do was add `lang` param in my custom URL and everything works perfectly.

Example:
For English Version:
index.php?option=com_smf&Itemid=xx&forum=english&lang=en

For Arabic Version:
index.php?option=com_smf&Itemid=xx&forum=arabic&lang=ar

For French Version:
index.php?option=com_smf&Itemid=xx&forum=french&lang=fr

So now I will be uploading my content to original website running inshaAllah.
And yes, as I have notice, Goosemoose always ask for URL to live site, same again my original website reside within intranet, not internet but soon inshaAllah i will be posting URL for everyone to look at it.

Thanks for great mod.
Salim
The second half of a man's life is made up of nothing but the habits he has acquired during the first half. - Fyodor Dostoevsky

SilentShade

#170
Hi everybody.
First of all big respect to Goosemoose, Oristo & others supporting this mod. I did everything like the first post said... it seems to work from the first look, but there are these warnings showing up:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/doctorbo/www/site2/public_html/community/en/Sources/Subs.php on line 322

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 531

Notice: Undefined variable: user_info in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 532

Notice: Undefined index: query_see_board in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 532
there is a code from this place in Load.php:
// Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
      $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);
      echo $forumList; // my code to see the result
      $row_forumList = mysql_fetch_assoc($forumList);  // line 531
      $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';     
   }

I tried to echo the result, to see if function db_query is working correctly with this query string. It returns nothing. However a similar code in BoardIndex.php does return the resource id. How can i fix this?

Using SMF 1.1.1, Joomla 1.0.12 with Oristo's SMF->Joomla bridge v 1.1.6

Neol

Quote from: SilentShade on January 05, 2007, 08:12:04 PM
// Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
      $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);
      echo $forumList; // my code to see the result
      $row_forumList = mysql_fetch_assoc($forumList);  // line 531
      $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';     
   }

I tried to echo the result, to see if function db_query is working correctly with this query string. It returns nothing. However a similar code in BoardIndex.php does return the resource id. How can i fix this?

Using SMF 1.1.1, Joomla 1.0.12 with Oristo's SMF->Joomla bridge v 1.1.6

What is displayed when using the following code instead?

// Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
      $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);
      $row_forumList = mysql_fetch_assoc($forumList);  // line 531
      print_r ($forumList); // my code to see the result
      $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';     
   }


SilentShade

Still displays Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/doctorbo/www/site2/public_html/community/en/Sources/Subs.php on line 320

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 531

Notice: Undefined variable: user_info in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 533

Notice: Undefined index: query_see_board in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 533

and $forumList doesn't contain anything..
From BoardIndex.php $forumList contains resource id "Resource id #55", same as when i use "echo" command.

Neol


SilentShade

#174
My Recent Posts link work fine with current code "$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';", however i get xml parse error with code described in "Reply #111".
The problem is that db_query function doesn't accept a query $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__); from Load.php file. I temporarily change db_query function to native php mysql_query() as
$forumList = mysql_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'");, and it did work, showed me valid resource id. But still i get a warning:Undefined index: query_see_board I wonder why only Load.php shows those warnings, maybe i need to define some globals?

Neol

#175
It's best to use db_query(), which is essentially a wrapper for mysql_query(), but is more secure (or so I've read). See if this works:

Replace:
$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);

with:
$request_forum = $_REQUEST[forum];
$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = $request_forum", __FILE__, __LINE__);


The adapted code in Reply #111 works in my forum, which was SMF 1.1 RC2 and is now 1.1 RC3. I don't know about 1.1.1 compatibility, though. See if the change above works for you.

Quote from: SilentShade on January 17, 2007, 09:47:30 AM
But still i get a warning:Undefined index: query_see_board I wonder why only Load.php shows those warnings, maybe i need to define some globals?

What is the complete error, with filename and line number? What code is within 5 lines above and 5 lines below that line?

Gobo

ohh I see u need joomla for this :(

I dont really like joomla too much to be honest...so I guess no joint boards for me :(

Neol

Quote from: akulion on January 18, 2007, 11:50:08 AM
ohh I see u need joomla for this :(

I dont really like joomla too much to be honest...so I guess no joint boards for me :(

It is possible to achieve the same effect without Joomla! integration. See Reply #135 (page 10) by smoothify.

Gobo


SilentShade

Quote from: olti on January 18, 2007, 02:26:45 AM
It's best to use db_query(), which is essentially a wrapper for mysql_query(), but is more secure (or so I've read). See if this works:

Replace:
$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'", __FILE__, __LINE__);

with:
$request_forum = $_REQUEST[forum];
$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = $request_forum", __FILE__, __LINE__);


The adapted code in Reply #111 works in my forum, which was SMF 1.1 RC2 and is now 1.1 RC3. I don't know about 1.1.1 compatibility, though. See if the change above works for you.

Quote from: SilentShade on January 17, 2007, 09:47:30 AM
But still i get a warning:Undefined index: query_see_board I wonder why only Load.php shows those warnings, maybe i need to define some globals?

What is the complete error, with filename and line number? What code is within 5 lines above and 5 lines below that line?
Warnings are still the same :(

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/doctorbo/www/site2/public_html/community/en/Sources/Subs.php on line 321

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 539

Notice: Undefined index: query_see_board in /home/doctorbo/www/site2/public_html/community/en/Sources/Load.php on line 541


here is a nearby code from Load.php

      if(!empty($_REQUEST['forum']) && !isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic']))
   {
$request_forum = $_REQUEST['forum'];
      $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = $request_forum", __FILE__, __LINE__);
//      $forumList = mysql_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$_REQUEST[forum]'");
//      print_r ($forumList);
// echo "<br />";
      $row_forumList = mysql_fetch_assoc($forumList);
//     print_r ($row_forumList['catList']);
      $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
//      print_r ($query_see_board);
   }

i tried already to put some globals there.. didn't work either.. i don't really understand, why the same code works from BoardIndex.php, and dosen't work from Load.php.???
maybe i better send you a link via pm, so you can check it out on live site? :)
Thanks again.

Advertisement: