Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: Goosemoose on January 06, 2006, 03:04:39 AM

Title: Shared Forum Mod
Post by: Goosemoose on January 06, 2006, 03:04:39 AM
Orstio and I came up with a way to run multiple forums from 1 database, 1 directory, 1 installation. I'm running 7 forums and I only need to upgrade once, install mods once, and my users are shared :)

First the examples. Note the number of Categories that show in each, and that some are shared. some aren't.

http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,cat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,dog
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,hedgehog
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rabbit
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,ferret
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,bird

Ok, you can do it without the Mambo/Joomla bridge but it's no where near as good. We used the power of the bridge to rewrite all the links. Basically what you do is create a new table smf_forums that houses two fields, forumName and catList. Here is an example of what it could look like with 3 forums that share some categories, and have some unique. This all works off of ONE smf directory!

forumName catList
Rat 1,2,3,4
Cat 1,5,6,7
Dog 1,4,8,9

Ok so here are the steps.

1. Run this in phpMyAdmin
Code:


CREATE TABLE IF NOT EXISTS `smf_forums` (
  `forumName` text NOT NULL,
  `catList` varchar(128) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


2. Go in and add your fields like the example above forumName is the name you'll be passing in, catList are the category id's you want to display for that forum. If your prefix isn't smf_ , make sure to change it.

3. Edit Load.php

In Load.php

Find:
Code:

$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';   


Add After:
Code:

// 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);
      $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';     
   }


4. In BoardIndex.php (in Sources dir)

find:
Code:
         AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

replace with:
         AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);

5. In smf.php in the component directory for the bridge, this $myurl= line is in 4 places but slightly different each time. You can copy the same line to all 3 places without a problem.

For version 1.1x of the bridge do the following:
From
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';

To
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


From
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' ;

To
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;'
.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


-------------
In older versions of the bridge do the following to smf.php
Find:
Code:

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid. '&amp;';

and find:

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';


Replace both with:
Code:

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid. '&amp;'.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');

Find:

   $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' );

Replace with:

    $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' .  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));
----------------------------------------------

6. The following fix thanks to Kingconnor

Open "yourforumdir/Sources/BoardIndex.php" and find the following code

$result_boards = db_query (around line 71)

Add above that the following code (might look familiar)

   // Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !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);
     $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
   }

7. Create a link to your new forums! Here is an example using SEF:
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,cat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,dog

Without SEF would be like this (note I use SEF so it will switch after the first page)
http://www.goosemoose.com/index.php?option=com_smf&Itemid=118&forum=rat

Note that if you leave the forum part off you see all the boards.
Title: Re: Shared Forum Mod
Post by: chadness on January 06, 2006, 01:40:37 PM
Wow, that's incredible!  Great work!  Though, my capybara feels slighted.
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 06, 2006, 01:45:31 PM
Glad you like it. Do you really have a capybara? You should post some pictures on the forum. Those are huge! I am planning on adding quite a few more forums. I was able to add 5 additional forums in a matter of minutes which makes it so I can add more animal sections now :)
Title: Re: Shared Forum Mod
Post by: chadness on January 06, 2006, 02:14:28 PM
I don't really, I just wanted to give you a hard time. :)  I just have your standard pets, an okapi and a puffin.  Or maybe they're a dog and a cat.
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 13, 2006, 05:31:40 AM
Great mod, this is exactly what I was looking for but two things, firstly when I add the following line I get this error

Parse error: parse error, unexpected ';' in /home/revolut/public_html/components/com_smf/smf.php on line 494

Find:

   $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' );

Replace with:

    $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' .  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');

If I keep the line as it is it works fine. Is this going to be a problem?

Secondly when I access the separate forums the board order is messed up. Is there any way to resolve that?
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 13, 2006, 10:18:17 AM
I think I see what it is doing, but I don't know what to do about it. It is sorting by ID_BOARD instead of boardOrder. Is there anyway to change this?
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 13, 2006, 01:38:32 PM
I had that problem too, but I thought it was just me. You have to add an order by desc command into load.php. I'll look it up and post it in a few minutes.

I'll have to look into the other error, I had no problem with it. You do want all the updates in there otherwise certain things won't work right.
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 13, 2006, 02:24:14 PM
Well it does seem to be working without that part fine. So unless I run into problems I'm not too worried.  But I do have all the latest versions of everything. :)

I will await they code for the sorting of the boards.  :)

Thanks for your help.
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 14, 2006, 02:54:18 AM
I upgraded the bridge to 1.1.2 and still have the same problem, but it works fine if I don't change it the last part.

Any luck on the board sort?
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 14, 2006, 04:44:46 PM
Yup!

Open up BoardIndex.php in your sources directory:

find:
         AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

replace with:
         AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 14, 2006, 05:37:13 PM
Thanks for all your help!, It's working great now! :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 14, 2006, 05:47:55 PM
Fixed the other problem too, and updated the first post. The line you were having a problem with should have ended )); rather than ); Make sure to update it, it is important!
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 16, 2006, 02:54:55 AM
Thanks That is working too now! :)
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 23, 2006, 05:15:13 PM
Another question....How did you get the SMF login to go to the correct forum?  Everytime someone logs in on SMF and not the Joomla it shows all the boards.
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 23, 2006, 07:08:08 PM
I have a redirect in index.php that automatically redirects when used if the access is not from a mobile phone. I'll get the code for you in a bit as I'm on a different machine right now.
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 24, 2006, 02:30:30 AM
Cool! Thanks for your help
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 24, 2006, 03:06:07 PM
Sorry it took me so long, I got caught up at work last night.

Open up index.php

Find:
if (!defined('WIRELESS'))
   define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

Add after:
if (!WIRELESS && empty($_REQUEST['option'])){   
   header('Location: http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat');
}

Obviously change the link to the joomla page you want to redirect them to.
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 25, 2006, 07:45:23 AM
Thanks, I'll be adding that right away! :)
Title: Re: Shared Forum Mod
Post by: SeaOfSin on January 25, 2006, 10:58:47 PM
Well, I managed to get it working. I had a bit of a problem with uploading avatars for some reason but managed to get that working to. but anyway thanks for your help! :)
Title: Re: Shared Forum Mod
Post by: Slavick on February 11, 2006, 01:22:47 PM
ok and how do I do this witout joomla? just curious
Title: Re: Shared Forum Mod
Post by: SeaOfSin on February 19, 2006, 03:29:30 PM
At a guess, don't do the part that invovles smf.php and change this

if (!defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

Add after:
if (!WIRELESS && empty($_REQUEST['option'])){   
header('Location: http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat');
}

to

if (!WIRELESS && empty($_REQUEST['option'])){   
header('Location: http://www.goosemoose.com/forum/index.php?forum=rat');
Title: Re: Shared Forum Mod
Post by: Goosemoose on February 19, 2006, 04:37:40 PM
Sorry I didn't respond earlier. Sea of Sin is on the right track. You'd also have to get a way for all the links on the current page to add the ?forum=rat or whatever.  It's only a few lines to try it out. I'd say go for it and see how it works.
Title: Re: Shared Forum Mod
Post by: Slavick on February 19, 2006, 04:40:44 PM
Thanks alot for the reply, and its forgiven  :P i'll try it out the next morning and play arround with it.

thanks
Title: Re: Shared Forum Mod
Post by: Laure on March 17, 2006, 07:53:20 PM
I can add tabs for the forum to the menu bar but how do i get them to be 'active' after they have been clicked on?
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 18, 2006, 11:46:39 PM
What do you mean by active? If you add tabs just make them link to the new forum url.
Title: Re: Shared Forum Mod
Post by: kingconnor on March 21, 2006, 04:34:55 AM
Hi all, great work on this simple workaround! Is there a way to get a whole forum theme to be changed depending on the "forumName"?
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 21, 2006, 03:53:06 PM
You could play around with the code the displays the theme and search for the 'forum' variable (i.e. forum=='cat' .) I haven't tried it but it should work without a problem. I'm not sure which file changes the theme but if you ask in general board someone should know.
Title: Re: Shared Forum Mod
Post by: kingconnor on March 22, 2006, 05:38:26 AM
Quote from: Goosemoose on March 21, 2006, 03:53:06 PM
You could play around with the code the displays the theme and search for the 'forum' variable (i.e. forum=='cat' .) I haven't tried it but it should work without a problem. I'm not sure which file changes the theme but if you ask in general board someone should know.

Thanks for the quick reply I will get on and do that. I might put an extra field in the smf_forum to make it a little more versatile. Just thought you should know that if a user uses the Collapsible function all the categories appear. I have just removed that function for now.

Thanks again
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 22, 2006, 01:05:21 PM
Yeah I did notice that too. I haven't had a chance to look at the code that creates the collapsable boards. Basically you would just need to make sure the code there matches the code changed in Load.php. If you find it let me know, I'm really strapped for time right now.
Title: Re: Shared Forum Mod
Post by: kingconnor on March 22, 2006, 06:01:37 PM
Just letting people know this is how to associate a theme with each separate forum. Please bear with me I'm a newbie to php

Step1: Create a new field in the smf_forums table called forumTheme and set to int.

Step 2: in the new field you have created (forumTheme) put the ID_THEME number you wish to associate with the forum (found in smf_themes table)

Step 3: Open up index.php under the root of your forum. Find line number 148 should be loadTheme(); replace with:

$database->setQuery( "SELECT DISTINCT forumTheme
                    FROM #__smf_forums
                    WHERE forumName='".$_REQUEST['forum']."'");
                   
$forumTheme = $database->loadResult();
   
loadTheme($forumTheme);

Quote from: Goosemoose on March 22, 2006, 01:05:21 PM
Yeah I did notice that too. I haven't had a chance to look at the code that creates the collapsable boards. Basically you would just need to make sure the code there matches the code changed in Load.php. If you find it let me know, I'm really strapped for time right now.

Yep I will check it out at some point and let you all know.

Regards

da king  ;D
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 22, 2006, 08:50:16 PM
Very nice! Can you also give us your website so people can check out the usage of the mod? :)
Title: Re: Shared Forum Mod
Post by: kingconnor on March 23, 2006, 03:20:22 PM
Quote from: Goosemoose on March 22, 2006, 08:50:16 PM
Very nice! Can you also give us your website so people can check out the usage of the mod? :)

I will of course :D I'm developing it locally at the moment I will upload it to our web servers later on the month. Right if your interested this is the solution to the collapsible problem

Step 1: Open "yourforumdir/Sources/BoardIndex.php" and find the following code

$result_boards = db_query (around line 71)

Step 2: Add above this the following code (might look familiar)

   // Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !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);
     $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")'; 
   }


Thats it as far as I know.
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 23, 2006, 08:17:03 PM
Thanks. I updated the first post to reflect your fix.
Title: Re: Shared Forum Mod
Post by: Laure on March 25, 2006, 02:07:21 PM
about the tabs, make it 'active', where it has the lighter color and looks like a tab (like Forum on the menubar above), what do I need to do to make the tabs i added for the different forums do that?
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 26, 2006, 03:57:47 PM
Hi Laure,
I see what you're saying now. I'm sure if you post in the general forum someone whose done this with other items could help you. You'd basically need to check what $_REQUEST[forum] is equal to and change the color based on that.
Title: Re: Shared Forum Mod
Post by: Killian on April 12, 2006, 11:27:09 AM
this works great.  Any idea on how to get "?forum=rat or whatever" added to all of the links for those of us not using Joomla?
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 12, 2006, 08:22:36 PM
Hi Killian,
I don't see a really simple way, although there may be one. The joomla bridge acts as a buffer and adds the code onto it. To get that last part you could probably use javascript as the buffer instead. I don't have tons of time right now or I'd help figure it out. Hopefully someone else can!
Title: Re: Shared Forum Mod
Post by: lifeisunfair on April 13, 2006, 05:59:26 PM
first i'd like to thank all who put their work teoghter and made this alt.

few questions in the new 1.13 brige there is no line such as

$myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' );

Replace with:

    $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' .  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));


also, when ever i make a reply/newpost i get return'd to domain.com/forum and not domain.com/mambo

anyway to fix this?
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 13, 2006, 08:58:58 PM
Look for a very similar line, Orstio probably changed the spacing. You'd have to ask him about the second question, hopefully he checks this thread ;)
Title: Re: Shared Forum Mod
Post by: lifeisunfair on April 14, 2006, 05:02:49 PM
also, anything to change when facing "hacking attempt" message when using configuration menu on mambo?
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 14, 2006, 09:49:13 PM
You definately shouldn't be seeing that. The backend mambo menu is telling you that? Sounds like it could be a bridge problem you'd need to let Orstio know about.
Title: Re: Shared Forum Mod
Post by: Random on April 22, 2006, 12:59:02 PM
Quote from: lifeisunfair on April 13, 2006, 05:59:26 PM
first i'd like to thank all who put their work teoghter and made this alt.

few questions in the new 1.13 brige there is no line such as

$myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' );

Replace with:

    $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' .  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));




I have the same problem, and can't find a similar line to change?  Can anyone please point me in the right direction?  :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 22, 2006, 05:43:34 PM
Search for $myurl = sefReltoAbs and see if thats there and post the line here. If not let me know and I'll install the new bridge and check it out. I haven't had time to do that yet.
Title: Re: Shared Forum Mod
Post by: Random on April 22, 2006, 07:17:59 PM
I had a look, there is no $myurl = sefReltoAbs at all.  There is:

$sefurl = sefReltoAbs(substr($nonsefurl, strlen($mosConfig_live_site) + 3, strlen($nonsefurl) - strlen($mosConfig_live_site) - 4));


or a
Quote$mainframe->addCustomHeadTag( '<link rel="prev" href="'. ( $mosConfig_sef == 1 ? sefReltoAbs($myurl.

And possibly a few others.  Which section of the smf file should I be searching? :)

Thanks :)
Title: Re: Shared Forum Mod
Post by: Random on April 25, 2006, 04:52:30 PM
Or... is it possible to get a copy of the previous version of the bridge anywhere?  I'd really love to get this working :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 25, 2006, 09:11:21 PM
Try changing this in ob_mamboxfix:
From
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';

To
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


And this in integrate_redirect
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' ;

To
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;'
.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));


Let me know if it works so I can post it as an official fix.
Title: Re: Shared Forum Mod
Post by: Random on April 26, 2006, 03:03:13 PM
Sorry to be really stupid ;D but where do I find those?  ???  Thanks  :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 26, 2006, 08:44:42 PM
No problem. I should have pointed it out. They should be in the smp.php, the same file you found the other items. Just do a search for the actual code I posted, don't worry about the ob_mambofix and such, those are just the function names.
Title: Re: Shared Forum Mod
Post by: Random on April 27, 2006, 02:01:13 PM
Thanks, I'll have a look at it tonight and see if I can get it working :)
Title: Re: Shared Forum Mod
Post by: Random on April 27, 2006, 05:06:07 PM
*Sigh* having trouble getting my ftp to work to upload the file, soon as it does I'll let you know if it works :)  Is there only one of each of those lines, or is there more than one and they all need changing? :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 27, 2006, 05:41:21 PM
I believe there is only one of each, but double check just to make sure ;)
Title: Re: Shared Forum Mod
Post by: Random on April 27, 2006, 05:47:08 PM
Thanks, it'll give me something to do while I wait for my host to fix the ftp ;D  For some reason, as far as I can see it's forgotten I own the only two folders I want to access!  I can upload to anywhere else.  ::)

*edit* I found 3 of the first one and only one of the second :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 27, 2006, 08:57:01 PM
Ok, let me know if it works once you upload it.
Title: Re: Shared Forum Mod
Post by: Random on April 28, 2006, 04:18:07 AM
Ok, this is odd.  For some reason I can't access the com_smf folder in components to upload the new smf.php file to it.  I was blaming my host, so bought some cheap webspace last night and reinstalled the whole lot from scratch.... went to upload the file again, I can't access that folder on the new host either?  Seems like the user for that folder is different to the user on all my other folders.  Have I done something really stupidly wrong here, can't believe it did it twice?  ???
Title: Re: Shared Forum Mod
Post by: Random on April 28, 2006, 09:35:29 AM
Ok, figured that out, I just hadn't realised how Joomla worked, I used it to change permissions on the folders and everything works again ;D

But.... I'm getting this error when I try to go to the forum once I add that code
Quote
Parse error: parse error, unexpected ')' in /home/xxxxx/public_html/test/joomla/components/com_smf/smf.php on line 728

.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));

Which I think is this line.... which is the second half of this

$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;'
.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));


:)
Title: Re: Shared Forum Mod
Post by: Random on April 28, 2006, 10:10:30 AM
Also, when I try to set each to a different theme adding the code to index.php, I get this error:

QuoteFatal error: Call to a member function setQuery() on a non-object in /fpgs/fpgshttpd/random/sf/board/index.php on line 148

I must have missed something there too, this is hard work ;D
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 28, 2006, 01:47:15 PM
Sorry, extra ) in there. Try this:

$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;'
.  (isset($_REQUEST['forum']) ? 'forum=' . $_REQUEST['forum']. '&amp;' : '');
Title: Re: Shared Forum Mod
Post by: Random on April 28, 2006, 01:57:43 PM
Brilliant, that seems to work perfectly, thanks! :)

Don't suppose you'd have any idea on the theme question above?  :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 29, 2006, 04:17:32 PM
I updated the first post with changed for 1.1x versions of the bridge.
Title: Re: Shared Forum Mod
Post by: tracilynnb on May 14, 2006, 09:31:19 PM
Anyone know why I would get this error?

Unknown table 'c' in where clause
File: /home/public_html/forum/Sources/Recent.php
Line: 101
Title: Re: Shared Forum Mod
Post by: Goosemoose on May 15, 2006, 03:04:11 AM
Hmm, Recent.php isn't touched. Can you post whats around line 101 in Recent.php?
Title: Re: Shared Forum Mod
Post by: tracilynnb on May 15, 2006, 07:00:27 AM
Here is line 101

LIMIT $showlatestcount", __FILE__, __LINE__);

Could it have something to do with having the most recent posts at the top of the forum?

EDITED TO ADD : I have just tested the link on a page other than the index of the forum (component/option,com_smf/Itemid,141/forum,digital/topic,38840.msg510691/topicseen,topicseen#msg510691)  and it works OK
Title: Re: Shared Forum Mod
Post by: tracilynnb on May 15, 2006, 07:36:38 AM
OK, I just disabled the Recent Posts Bar and it works, but I would like to have the recent posts at the top. I am using the Portal Blue theme - SMF 1.1 RC2
Title: Re: Shared Forum Mod
Post by: Goosemoose on May 15, 2006, 09:52:31 PM
You'd have to copy the code from the recent posts into the code you put into the joomla tempalte.
Title: Re: Shared Forum Mod
Post by: dmoore70 on May 18, 2006, 10:14:10 AM
Sorry for the newbie question ....

I've successfully implemented this mod. And the URL's amended with forum=test are working as desired. However, I'm wondering how I auto-generate those URL's in a Joomla menu.

I set a menu item and then choose "Edit Menu Item :: Component", correct?

But how do I add that form=test to the query string? Does it involve that parameters box?

Thanks!!

--Dave

Title: Re: Shared Forum Mod
Post by: tracilynnb on May 19, 2006, 12:10:27 PM
Quote from: Goosemoose on May 15, 2006, 09:52:31 PM
You'd have to copy the code from the recent posts into the code you put into the joomla tempalte.

I added it to the Joomla template and it doesn't make a difference {adds the words Recent posts to the very top of the page}. The error is the same. It works fine when I view all forums, just not when I add the forum,xxxx at the end of the URL...
Title: Re: Shared Forum Mod
Post by: Goosemoose on May 19, 2006, 10:36:46 PM
Tracy, since you are using a custom template and mod it's definately changing how things work. Id suggest removing the other mod, getting this to work, then look at reinstalling the other mod.

Dmoore, you just create a menu 'url' link then manually type in the address :) Glad to hear it's working, if you get a chance give us a link so others can see how you use it.
Title: Re: Shared Forum Mod
Post by: tracilynnb on May 21, 2006, 03:00:37 PM
Quote from: Goosemoose on May 19, 2006, 10:36:46 PM
Tracy, since you are using a custom template and mod it's definately changing how things work. Id suggest removing the other mod, getting this to work, then look at reinstalling the other mod.

I haven't installed any other mod. It is the Recent Posts bar that is included with the core SMF.
This hack doesn't work (at least for me) with the Recent Posts bar activated, the default SMF theme (or any theme), wrapped in Joomla.
Title: Re: Shared Forum Mod
Post by: Goosemoose on May 21, 2006, 05:43:33 PM
Does it work with the Recent Posts bar deactivated?
Title: Re: Shared Forum Mod
Post by: tracilynnb on May 21, 2006, 07:11:02 PM
Quote from: Goosemoose on May 21, 2006, 05:43:33 PM
Does it work with the Recent Posts bar deactivated?

Yes it does...
Title: Re: Shared Forum Mod
Post by: tracilynnb on June 01, 2006, 10:39:10 AM
Quote from: tracilynnb on May 14, 2006, 09:31:19 PM
Anyone know why I would get this error?

Unknown table 'c' in where clause
File: /home/public_html/forum/Sources/Recent.php
Line: 101

Any insight to this problem? I am assming I need to add some code to Recent.php?

I notice also when you follow the link Show unread posts since last visit it shows the posts from EVERY forum.
Title: Re: Shared Forum Mod
Post by: tracilynnb on June 03, 2006, 12:29:02 PM
Another *bug* I noticed with this mod is if a user enters the wrong password and are redirected to the login form, when they do successfully login they are directed to the main forum index showing ALL forums. This can be a little confusing for members that may frequent forums that are at the bottom of the list.  :o

Great mod though and so simple to maintain my forums!

Thanks guys! :D
Title: Re: Shared Forum Mod
Post by: tracilynnb on June 10, 2006, 10:45:19 AM
Quote from: kingconnor on March 22, 2006, 06:01:37 PM
Just letting people know this is how to associate a theme with each separate forum. Please bear with me I'm a newbie to php

Step1: Create a new field in the smf_forums table called forumTheme and set to int.

Step 2: in the new field you have created (forumTheme) put the ID_THEME number you wish to associate with the forum (found in smf_themes table)

Step 3: Open up index.php under the root of your forum. Find line number 148 should be loadTheme(); replace with:

$database->setQuery( "SELECT DISTINCT forumTheme
                    FROM #__smf_forums
                    WHERE forumName='".$_REQUEST['forum']."'");
                   
$forumTheme = $database->loadResult();
   
loadTheme($forumTheme);

Which version of SMF is this for? I get the error mentioned above on 1.1 RC2

Fatal error: Call to a member function setQuery() on a non-object in /fpgs/fpgshttpd/random/sf/board/index.php on line 148

Title: Re: Shared Forum Mod
Post by: Goosemoose on June 10, 2006, 03:06:09 PM
Try replacing #__smf_forums with your actual table name (it might just be smf_forums)
Title: Re: Shared Forum Mod
Post by: tracilynnb on June 10, 2006, 03:51:42 PM
Thanks for the reply, but I still get this error :(

Fatal error: Call to a member function on a non-object in /home/public_html/forum/index.php on line 154
Title: Re: Shared Forum Mod
Post by: Goosemoose on June 11, 2006, 03:01:41 PM
Again, this must have something to do with the recent posts settings. I've instaled this mod on many RC2 forums without a problem. What is 10 lines above and below 154 in that file?
Title: Re: Shared Forum Mod
Post by: tracilynnb on June 11, 2006, 03:58:50 PM
Quote from: Goosemoose on June 11, 2006, 03:01:41 PM
Again, this must have something to do with the recent posts settings. I've instaled this mod on many RC2 forums without a problem. What is 10 lines above and below 154 in that file?

Here is the code in index.php lines 143-164:

// Special case: session keep-alive.
if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
die;

// Load the user's cookie (or set as guest) and load their settings.
loadUserSettings();

// Load the current board's information.
loadBoard();

// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)

   
loadTheme();

// Check if the user should be disallowed access.
is_not_banned();

// Load the current user's permissions.
loadPermissions();



My forum is installed in a different database than Joomla, maybe that's the trouble???
Everything else works as it should - just the recent posts and this template change is giving me trouble. I have recent posts shut off at the moment.

Another question, if you don't mind... is there a way to filter recent unread posts across forums...  For example on your site if you were on the "rats" forums, when you select Show unread posts since last visit, you would only see the unread posts from the "rats" forums and not all the others?
Title: Shared Forum Mod::additional forums
Post by: 2kreative on June 20, 2006, 12:53:10 PM
I was reading through this psot to see if this was addressed...



After you've bridged your forums..what is the process to add an additional forum to be bridged?
I'm using joomla 1.08 btw
Title: Re: Shared Forum Mod
Post by: Goosemoose on June 20, 2006, 10:23:51 PM
All you need to do to create addional forums is edit the smf_forums table and add a new row with the numbers of the categories. This is exactly like you did originally. It's easiest using phpMyAdmin or a similar program
Title: Re: Shared Forum Mod
Post by: 2kreative on July 05, 2006, 02:31:12 PM
Question

I'm looking into instituting this on my portal and have a couple questions that deal with administration and functionality.

1) Our all forums controled by 1 admin back end? Or could you have an admin backend for each forum?

2) When setting up the additinal forums (I currently have 1 and want to add a few more)..does the fact that you have to define the number of categories in phpmyadmin impede your ability to change this number later..and does it affect the other forums?

3) can board rank be forum specific? (post attained ranks as well as non post member groups)


Title: Re: Shared Forum Mod
Post by: 2kreative on July 06, 2006, 12:33:17 PM
Another follow up question...

Could I  create a forum and then port user's topics, pms , etc into this from another smf forum (on a different server)?
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 06, 2006, 09:46:30 PM
2kreative,
1) All forums are controlled by one backend admin panel.
2) Adding additional forums later is very easy and just requires adding a new row to the table in phpmyadmin.
3) Board rank would be the same across all forums, although you could still add people into multiple groups if needed.
4) You can do this, but it's a lot of manual work. I've detailed it earlier in this thread.
Title: Re: Shared Forum Mod
Post by: 2kreative on July 10, 2006, 01:00:39 PM
Thx for the feedback goose..that help wiht my decision...

btw
Do all of the forums have to share the same header?
Title: Re: Shared Forum Mod
Post by: tracilynnb on July 11, 2006, 03:33:30 PM
Quote from: tracilynnb on June 11, 2006, 03:58:50 PM
Another question, if you don't mind... is there a way to filter recent unread posts across forums...  For example on your site if you were on the "rats" forums, when you select Show unread posts since last visit, you would only see the unread posts from the "rats" forums and not all the others?

Does anyone have any ideas? My users are getting quite annoyed that they have to wade through posts that are not related to the forum they participate in. If anyone can give me any hints, I would greatly appreciate it.

I may even take a run at it myself... as I am sure it would be useful for others using this mod...
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 11, 2006, 09:23:04 PM

Quote from: tracilynnb on June 11, 2006, 03:58:50 PM
Another question, if you don't mind... is there a way to filter recent unread posts across forums...  For example on your site if you were on the "rats" forums, when you select Show unread posts since last visit, you would only see the unread posts from the "rats" forums and not all the others?

It shouldn't be too hard, I'm just swamped right now. You basically need to add another join to the query that makes sure the posts are part of the forums listed in the current forum. Hopefully someone else can jump in and help you out.

Quote from: 2kreative on July 10, 2006, 01:00:39 PM
Thx for the feedback goose..that help wiht my decision...

btw
Do all of the forums have to share the same header?

By default they do, but it would be easy to set up several and change them based on the current forum. I do this myself as my rat forum as a different logo that loads, and the others don't.
Title: Re: Shared Forum Mod
Post by: c2h5oh on July 27, 2006, 09:42:56 AM
I'm just wondering.. is it possible to have one of the forums displayed in other domain? (and no, 301 redirect is not an option :P)
I'd just love to have all the forums displayed as categories in mydomain.com (bridged & wrapped) + each of them in sub1.mydomain.com, sub2.mydomain.com etc1 not bridge or wrapped (or wrapped but with joomla template containing the forum only it it is a must).

Can it be done, or should I ask: can someone tell me how to do that?

Basically I'm running a number of forums based on SMF and phpBB and I'd like to merge them into one, but leaving them as unchanged for users as possible (and loosing content on 14 PR3-5 domains is definitely not a good thing :P)
Title: Re: Shared Forum Mod
Post by: Neol on July 27, 2006, 10:09:56 AM
If I want to have this forums each one in different subdomains? Is this possible?

Asked above :D
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 27, 2006, 01:35:12 PM
Sure you could do it. All I think it would require is for you to point each subdomain to your smf folder, then link to the forum you want based on that subdomain.
i.e. smf is installed in /home/domains/petforum.com/public_html/smf
You have main domain petforum.com, with 3 subdomains, cat,rat, dog.
Make http://cat.petforum.com , http://rat.petforum.com, http://dog.petforum.com all point to /home/domains/petforum.com/public_html/, then link to each forum using http://cat.petforum.com/smf/index.php?forum=cat
http://rat.petforum.com/smf/index.php?forum=rat
and so on... Let me know if this works for you.
Title: Re: Shared Forum Mod
Post by: c2h5oh on July 28, 2006, 06:18:41 AM
Well, that's not exactly what I had in mind. I'd rather have cat forum accessible as http://cat.petforum.com (not /smf/whatever/) and if I did it your way I'd still have SMF wrapped in Joomla site and that's what I want to have for the main site only.

what I want to have:
www.mydomain.com -> joomla site with bridged smf forum including all subforums
sub1.mydomain.com -> SMF subforum only (no bridge, or at least joomla not visible)
sub2.mydomain.com -> ...

Just an idea - If there was a way to make SMF Bridge work with Open-SEF and bridge it to more than one Joomla installation (which should work) it could be done by creating component alias making the bridge accessible as www.domain.com/
Title: Re: Shared Forum Mod
Post by: Neol on July 28, 2006, 10:47:37 AM
I have another question for you Goosemoose. Is it possible te split the current forum that I have into differnt forums and to have my multiforum 1 database, 1 directory, 1 installation?!

Thanks.
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 28, 2006, 12:58:15 PM
Olti,
Yes, that's exactly what this mod does :)
Title: Re: Shared Forum Mod
Post by: farren on July 29, 2006, 09:18:05 PM
HI,
I have tried to install this mod but when I try to used this url:
http://localhost/joomla/index.php?option=com_smf&Itemid=27&forum=EXPERTS

I have this error message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND FIND_IN_SET(c.ID_CAT, "2,6,7,8,24,11") AND FIND_IN_SET(c.ID_CAT, "2,6,7,8,24' at line 18
Fichier: c:\wamp\www\SMF\Sources\BoardIndex.php

I used MySQL 5.0.22, Joomla 10.0.10, SMF 1.1RC2 and Bridge 1.1.5

Somebody could help me? I don't found the problem

Thanks
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 30, 2006, 12:04:51 AM
Can you post the code around line 18 in your BoardIndex.php please. What theme are you using?
Title: Re: Shared Forum Mod
Post by: farren on July 30, 2006, 06:41:55 AM
I used my own theme based on the classic theme (Classic YaBB SE Theme) installed with the SMF 1.1RC2 and with very few modification.
Most of same are in css and few in php files(index.template.php, MessageIndex.template.php and setting.french.php
=> Theme_modification.zip (http://www3.keohosting.net/ontheroad/download/theme_modification.zip))


Here the boardindex.php but it is the normal boardindex.php of RC2 with only the line modify by this mods.

// Show the board index!
function BoardIndex()
{
global $txt, $scripturl, $db_prefix, $ID_MEMBER, $user_info, $sourcedir;
global $modSettings, $context, $settings;

// For wireless, we use the Wireless template...
if (WIRELESS)
$context['sub_template'] = WIRELESS_PROTOCOL . '_boardindex';
else
loadTemplate('BoardIndex');

// Remember the most recent topic for optimizing the recent posts feature.
$most_recent_topic = array(
'timestamp' => 0,
'ref' => null
);

// Added for the multiple forum mod
if(!empty($_REQUEST['forum']) && !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);
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
}

// Find all boards and categories, as well as related information.  This will be sorted by the natural order of boards and categories, which we control.
$result_boards = db_query("
SELECT
c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.description,
b.numPosts, b.numTopics, b.ID_PARENT, IFNULL(m.posterTime, 0) AS posterTime,
IFNULL(mem.memberName, m.posterName) AS posterName, m.subject, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName," . ($user_info['is_guest'] ? "
1 AS isRead, 0 AS new_from" : "
(IFNULL(lb.ID_MSG, 0) >= b.ID_MSG_UPDATED) AS isRead, IFNULL(lb.ID_MSG, -1) + 1 AS new_from,
c.canCollapse, IFNULL(cc.ID_MEMBER, 0) AS isCollapsed") . ",
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, m.ID_MSG,
IFNULL(mods_mem.ID_MEMBER, 0) AS ID_MODERATOR, mods_mem.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}collapsed_categories AS cc ON (cc.ID_CAT = c.ID_CAT AND cc.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mods_mem ON (mods_mem.ID_MEMBER = mods.ID_MEMBER)
WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);


just for your information (I don't know if that can help you), I do my test under the last version of WAMP server 5

Thanks for your help
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 30, 2006, 05:54:06 PM
Did you install the mod manually? That's not right, that code should be in Load.php not BoardIndex.php.
Title: Re: Shared Forum Mod
Post by: farren on July 30, 2006, 06:02:30 PM
Here the manual procedure found at the beginning of this topic.
Quote from: Goosemoose on January 06, 2006, 03:04:39 AM
6. The following fix thanks to Kingconnor

Open "yourforumdir/Sources/BoardIndex.php" and find the following code

$result_boards = db_query (around line 71)

Add above that the following code (might look familiar)

   // Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !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);
     $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
   }

here the code I have added on my boardindex.php
// Added for the multiple forum mod
if(!empty($_REQUEST['forum']) && !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);
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
}


but you ask me if I have installed it manually, that means I can found an install mods file?
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 31, 2006, 02:26:25 AM
Hmm, forgot about that step. Try it without that first and see if it works.
Title: Re: Shared Forum Mod
Post by: farren on July 31, 2006, 01:49:14 PM
Thanks GooseMoose,
since I have added DisableQuotedPrintable = 1 in smf_settings everything is ok.

But Still have a problem.
I have wrappe SMF in Joomla but when I do an answer or create a new topics after I have clicked on send, The forum is in full page and joomla has dissappeared. It was due to the url used for the return : http://localhost/SMF/index.php...... and not http://localhost/joomla/index.php?option=com_smf&Itemid=27&forum=LOST......

I have the same problem if I try to delete a post or move it.

Could you help me?
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 31, 2006, 06:13:57 PM
Farren: That will be a general smf bridge question, and shouldn't be related to this mod. Create a new post on this board and someone will help you.
Title: Re: Shared Forum Mod
Post by: farren on July 31, 2006, 06:45:03 PM
I have finally found the solution here : http://www.simplemachines.org/community/index.php?topic=99329.0 (http://www.simplemachines.org/community/index.php?topic=99329.0)

It is a wonderfull mods and exactly why I want to have on my site.

Thanks Goosemoose.
Title: Re: Shared Forum Mod
Post by: Goosemoose on August 01, 2006, 01:43:19 AM
No problem farren. Post your site when you're down so other people can check out the mod in use :)
Title: Re: Shared Forum Mod
Post by: Neol on August 20, 2006, 04:13:01 AM
Quote from: Goosemoose on July 11, 2006, 09:23:04 PM

Quote from: tracilynnb on June 11, 2006, 03:58:50 PM
Another question, if you don't mind... is there a way to filter recent unread posts across forums...  For example on your site if you were on the "rats" forums, when you select Show unread posts since last visit, you would only see the unread posts from the "rats" forums and not all the others?

It shouldn't be too hard, I'm just swamped right now. You basically need to add another join to the query that makes sure the posts are part of the forums listed in the current forum. Hopefully someone else can jump in and help you out.

Quote from: 2kreative on July 10, 2006, 01:00:39 PM
Thx for the feedback goose..that help wiht my decision...

btw
Do all of the forums have to share the same header?

By default they do, but it would be easy to set up several and change them based on the current forum. I do this myself as my rat forum as a different logo that loads, and the others don't.

Goosemoose, would you please tell us how did you implement the above 2 features (unread posts since last visit just for the forum where the user is logged in, and different headers for different forums) in your site?

For unread posts, I looked at Recent.php in the Sources directory for SMF 1.1 RC2 and it seems that the way it is normally done in the original code (for all of the forum) is through the function UnreadTopics (starts around line 428). It does mention using the parameter 'boards'; I think it can be used like this:

http://www.simplemachines.org/community/index.php?action=unread;boards=1,2,5;start=0

Using this kind of URL, you can see unread posts/topics only for specific boards (1, 2 and 5 in this example) which is just what tracilynnb and I need to implement.

In the example presented by Goosemoose in the first post of this topic, the "Dog" forum consists of boards 1, 4, 8, and 9. So the above link would be (I think):

http://www.goosemoose.com/index.php?option=com_smf&Itemid=118&forum=dog&action=unread;boards=1,4,8,9;start=0

The question is: How can we make SMF generate the link on the fly, so that the URL contains board numbers for the specific forum the user is logged in?

Or, the function UnreadTopics could be patched to also use the 'forum' parameter, in order to get and display unread posts only for that forum, for example through JOIN commands; this way, it wouldn't be necessary to use the 'boards' URL parameter.

Any help?
Title: Re: Shared Forum Mod
Post by: Goosemoose on August 20, 2006, 04:52:13 AM
olti,
The different headers is pretty easy. I just have an if statement that checks what forum is being visited then display the code I want. For example, the rat forum has a logo in the header that the other forums don't have. I used the following code which makes sure that we are looking at the rat forum:

// If we are on the rat forum show it's logo
echo '
</td>';
if(isset($_REQUEST['forum']) && $_REQUEST['forum'] == 'rat'){
echo '
<td color="#000000" bgcolor="#F6F6F6" height="88"><img src="http://www.goosemoose.com/rfc/Themes/default/images/ratsrulelogo.jpg" width="306.18" height="87.48"/></td>
';
}


I will play around with the unread topics a bit. I thought I had figued it out, but it's not playing along. Remember you actually list categories so you want something similar to
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat/action,unread/c,1,31
Title: Re: Shared Forum Mod
Post by: Neol on August 20, 2006, 05:52:33 AM
Goosemoose, thanks for the reply! In which file did you put the code for the different header, and where in the file?

As for the unread posts/topics issue, I agree that it has to do with categories rather than boards. I stand corrected. :) I'm really looking forward to a solution.

Title: Re: Shared Forum Mod
Post by: Neol on August 20, 2006, 06:28:29 AM
About unread topics: I think a way might be to fetch which categories belong to a forum (using the smf_forums table), then which boards belong to each category, then to extract unread posts for each board, and finally display them all (unread posts for the boards in categories of the forum).

Or, existing code could be reused to combine unread topics for the first category of the forum + unread posts for the second category + 3rd + ... = unread posts for the forum, using foreach (perhaps just like in the code for boards).

The code for the function UnreadTopics in Recent.php could be a good starting point. What do you think?

If I may ask, in what way is the code you developed not playing along?
Title: Re: Shared Forum Mod
Post by: Goosemoose on August 20, 2006, 02:54:52 PM
The code for the headers is in your themes index.template.php. Exactly where you put the code depends on what changes you want to make. Search for the word header and you will find the right area. Then it's just a matter of playing around until you get the right spot. Make sure to back up the original file first ;)

The unread posts is a matter of me working on it at 3am. If I have some time I'll play with it later today.
Title: Re: Shared Forum Mod
Post by: tracilynnb on August 20, 2006, 04:04:34 PM
Looking forward to a solution for this as well - thanks ;)
Title: Re: Shared Forum Mod
Post by: Neol on August 22, 2006, 01:49:06 AM
Goosemoose, I have some questions about your code in page 1:

1) Wouldn't it be more appropriate if $forumList and $row_forumList were named $catList and $row_catList, respectively? I ask this question because the value of $forumList is set to the contents of the catList field in the smf_forums table.

2) Shouldn't $forumList be freed with the following (both in Load.php and BoardIndex.php, just before the closing } of the if construct)?
mysql_free_result($forumList);

3) Before checking if $_REQUEST['forum'] is empty, shouldn't we check if it is set first? Or does empty() do that too?
if (isset($_REQUEST['forum']) && !empty($_REQUEST['forum']) && ...
Title: Re: Shared Forum Mod
Post by: Neol on August 22, 2006, 03:26:52 AM
Quote from: Goosemoose on August 20, 2006, 04:52:13 AM
Remember you actually list categories so you want something similar to
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat/action,unread/c,1,31

To display unread topics for the currently logged in forum only, I used the fix thanks to Kingconnor and used implode(). I also added the mysql_free_result() statement that I suggested in the previous post.

ADDED INFO: The code below also works for "Show new replies to your posts", which are displayed only for the currently logged-in forum.

I don't know if (dare I say) my code is correct, safe or secure, so use it at your own risk. I have only tested it locally, and I wrote it just a few minutes ago, so I haven't done any extensive tests. Corrections, comments etc. are very welcome, desired in fact!

Basically, the function UnreadTopics() in Recent.php checks - among other things - if categories are specified in the URL; if yes, it displays unread topics for those categories only (I got this hint from Goosemoose; see the quoted example). The check starts in Recent.php at the following line:
elseif (!empty($_REQUEST['c']))

So, what we need to do is set the value of the $_REQUEST['c'] variable to the list of categories for the currently logged in forum. That's what the code below does.

Open Recent.php in the Sources directory and find the line:
// Are we specifying any specific board?

Add just above that the following code:
// Added for the multiple forum mod
if(!empty($_REQUEST['forum']) && !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);
// $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
$_REQUEST['c'] = implode(',', $row_forumList);
mysql_free_result($forumList);
}


Goosemoose, can you check if this piece of code is correct? Also, I don't know why the line below doesn't work (I commented it out in the code above), or even if it's needed or not:
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';

If I leave the line above intact (as in the original code in page 1), an error message appears when I click on the unread posts link:

(http://img201.imageshack.us/img201/6595/dberroral4.png)

I have to comment out the line in order for Show unread posts since last visit to work.
Title: Re: Shared Forum Mod
Post by: Neol on August 22, 2006, 06:10:20 AM
It seems that the live (not the test) forum is having the same problem as tracilynnb since yesterday.

Reply #59 - http://www.simplemachines.org/community/index.php?topic=64492.msg579037#msg579037

Possible cause: a new theme was installed yesterday.

On the other hand, the test forum in localhost is loaded with the default theme and runs fine, but some part of the code didn't work when I reused it to create the unread topics filter. See my last post above. Specifically, only when I commented out the line below in Recent.php did the test forum work fine:

$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';

Can someone explain why is that line necessary? What is supposed to happen if I leave it out? Specifically, which table is c supposed to represent and why can't the rest of the code seem to find it?

My test forum in localhost is a "rat, cat, dog" forum, created from scratch exactly for the purpose of trying out the mod.
Title: Re: Shared Forum Mod
Post by: tracilynnb on August 23, 2006, 11:03:15 AM
Quote from: olti on August 22, 2006, 03:26:52 AM
Quote from: Goosemoose on August 20, 2006, 04:52:13 AM
Remember you actually list categories so you want something similar to
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat/action,unread/c,1,31

To display unread topics for the currently logged in forum only, I used the fix thanks to Kingconnor and used implode(). I also added the mysql_free_result() statement that I suggested in the previous post.

I don't know if (dare I say) my code is correct, safe or secure, so use it at your own risk. I have only tested it locally, and I wrote it just a few minutes ago, so I haven't done any extensive tests. Corrections, comments etc. are very welcome, desired in fact!

Basically, the function UnreadTopics() in Recent.php checks - among other things - if categories are specified in the URL; if yes, it displays unread topics for those categories only (see the quoted example from Goosemoose). The check starts in Recent.php at the following line:
elseif (!empty($_REQUEST['c']))

So, what we need to do is set the value of the $_REQUEST['c'] variable to the list of categories for the currently logged in forum. That's what the code below does.

Open Recent.php in the Sources directory and find the line:
// Are we specifying any specific board?

Add just above that the following code:
// Added for the multiple forum mod
if(!empty($_REQUEST['forum']) && !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);
// $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
$_REQUEST['c'] = implode(',', $row_forumList);
mysql_free_result($forumList);
}


Goosemoose, can you check if this piece of code is correct? Also, I don't know why the line below doesn't work (I commented it out in the code above), or even if it's needed or not:
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';

If I leave the line above intact (as in the original code in page 1), an error message appears when I click on the unread posts link:

(http://img201.imageshack.us/img201/6595/dberroral4.png)

I have to comment out the line in order for Show unread posts since last visit to work.

Thank you for this mod! I have tried it on my forum and it works great. :D

I still have the error when displaying the recent topics at the top of the forum, and have it shut off as well.
Title: Re: Shared Forum Mod
Post by: Neol on August 23, 2006, 05:00:39 PM
Quote from: tracilynnb on August 23, 2006, 11:03:15 AM
Thank you for this mod! I have tried it on my forum and it works great. :D

I still have the error when displaying the recent topics at the top of the forum, and have it shut off as well.

You can try changing the $user_info... line in the original code from Goosemoose, both in Load.php and BoardIndex.php, as below:

$user_info['query_see_board'] .= ' AND FIND_IN_SET(b.ID_CAT, "' . $row_forumList['catList'] . '")';

Instead of c.ID_CAT in the original mod code, the above line contains b.ID_CAT.

Try it and see if it solves your problem with the Recent Posts Bar. I don't know if this is the correct way to do it, though. Use it at your own risk.
Title: Re: Shared Forum Mod
Post by: farren on August 23, 2006, 07:24:30 PM
HI
I have a little problem with this mod but only under FireFox.
When I click on menu shortcut to go on a specific forum I am disconnected and I need to put again my password. If I used the normal way to go to the forum (with all categorie visible), I don't have this problem.

With IE and Opera all is fine and this mods works perfectly.

Do you have an idea?

url (french web site) : www.series-vo.com

Thanks
Title: Re: Shared Forum Mod
Post by: Neol on August 23, 2006, 07:46:44 PM
farren, are you talking about the original mod code by Goosemoose, or the changes by me?

P.S. tracilynnb and others, I changed my last post. I tested the changes live and they seem to work.
Title: Re: Shared Forum Mod
Post by: farren on August 24, 2006, 05:37:20 PM
the original code by goosemoose.
Title: Re: Shared Forum Mod
Post by: Random on August 24, 2006, 07:54:08 PM
Has anyone tried upgrading to either RC2-2 or RC3 with this mod?  I see there is a security issue to be fixed, but I'm a little worried about breaking the whole setup! ;D
Title: Re: Shared Forum Mod
Post by: Neol on August 24, 2006, 08:27:24 PM
Quote from: Random on August 24, 2006, 07:54:08 PM
Has anyone tried upgrading to either RC2-2 or RC3 with this mod?  I see there is a security issue to be fixed, but I'm a little worried about breaking the whole setup! ;D

I have tried upgrading RC2 to RC3 (in my test site in localhost) and applying the mod afterwards. This setup worked fine after some of the modifications I posted earlier in this thread. No custom themes though, no other mods or whatever.

A quick question: What is RC2-2? EDIT: Nevermind, I found out.
Title: Re: Shared Forum Mod
Post by: manuelap on August 25, 2006, 01:41:19 AM
Quote from: Goosemoose on January 06, 2006, 03:04:39 AM

5. In smf.php in the component directory for the bridge, this $myurl= line is in 4 places but slightly different each time. You can copy the same line to all 3 places without a problem.

For version 1.1x of the bridge do the following:
From
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';

To
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


From
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' ;

To
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;'
.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


-------------
In older versions of the bridge do the following to smf.php
Find:
Code:

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid. '&amp;';

and find:

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';


Replace both with:
Code:

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid. '&amp;'.  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');

Find:

   $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' );

Replace with:

    $myurl = sefReltoAbs(basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' .  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : ''));
----------------------------------------------


I did all the steps in implementing this mod, but just could not find the location of the above code in my smf.php

For some reason my first Boards opens nicely (not showing all other Boards), but whenever I try to call another board it displays no other board.... It displays one other board but that is not the correct board.

Also, I get an error message in the recent topics module "Error fetching Recent Topics: 1109 Unknown table 'c' in where clause".

I have a wrapped forum using SMF 1.1 RC2 in combination with SMF Joomla brigde 1.1.4.2.

I really would like to see this feature implemented without any flaws in my forum very soon, so if anyone is willing to assist me (even on a paid basis) and provide me with all the details how to reproduce these changes myself, I will be more than happy....
Title: Re: Shared Forum Mod
Post by: Neol on August 25, 2006, 02:56:53 AM
Quote from: manuelap on August 25, 2006, 01:41:19 AM
Also, I get an error message in the recent topics module "Error fetching Recent Topics: 1109 Unknown table 'c' in where clause".

The 1109 error message happened in my live forum lately. I resolved it by changing the mod code. See if my fix (reply #111 (http://www.simplemachines.org/community/index.php?topic=64492.msg694947#msg694947) in this page) works for you.
Title: Re: Shared Forum Mod
Post by: manuelap on August 25, 2006, 06:07:25 AM
Thank you Olti, for that hack for the recent topics module. It indeed works now.

Still leaves me with the problem of other forums but my first one vanishing.... So if anyone knows the trick, let me know
Title: Re: Shared Forum Mod
Post by: Neol on August 25, 2006, 07:20:44 AM
Quote from: manuelap on August 25, 2006, 06:07:25 AM
Thank you Olti, for that hack for the recent topics module. It indeed works now.

Still leaves me with the problem of other forums but my first one vanishing.... So if anyone knows the trick, let me know

I'm glad it worked for you! However, that particular change was rather about mod code in Load.php and BoardIndex.php. I don't use that line in Recent.php, I have commented it out in fact.

Additionally, you also can use my other fix for Recent Posts. See reply #108.

About the vanishing forums problem: You have to change smf.php in order for the mod to work. I can't find Bridge 1.1.4.2 for download (so that I could check the code) and the developers ask us not to redistribute. Try following my directions:

When selecting the first line mentioned by Goosemoose (so that you can copy and search for it in the code), don't select the space before the $ sign. That line is preceded by a tab in smf.php, at least in 1.1.5. Select starting from the $ sign (the first character) onward. Here's the first line again (without the preceding space):

$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';

It appears 3 times in smf.php of 1.1.5; change it to:
$myurl = $mosConfig_live_site . '/' . basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $Itemid . '&amp;'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');




The second line:
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' ;

appears 2 times in smf.php of 1.1.5; change each instance to:
$myurl = basename($_SERVER['PHP_SELF']) . '?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;' . (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


Of course, upgrading to Joomla! 1.0.10 and Bridge 1.1.5 (or even 1.1.6) isn't such a bad idea... although you'd better have a backup and make sure the upgrade doesn't break anything. I haven't tested the mod on 1.1.6, though. Maybe I will soon.
Title: Re: Shared Forum Mod
Post by: manuelap on August 25, 2006, 07:37:56 AM
There is no way I can find a download copy of 1.1.5

Not 1.1.6 since I am using 1.1rc2 and do not intend to switch to 1.1rc3 soon... Anyone can provide me with a clean copy?
Title: Re: Shared Forum Mod
Post by: Neol on August 25, 2006, 07:50:35 AM
Did you try my other instructions above?
Title: Re: Shared Forum Mod
Post by: manuelap on August 25, 2006, 07:57:01 AM
I can not find any line in smf.php starting with $myurl

This is my smf.php file

<?php

/* tabstop=4 tabreplace=space */

/**

* Joomla-SMF Forum

*

* This file performs the main integration of the forum

*

* LICENSE: This program is free software; you can redistribute it and/or

* modify it under the terms of the GNU General Public License

* as published by the Free Software Foundation; either version 2

* of the License, or (at your option) any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

* GNU General Public License for more details.



* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*

* @category    Component

* @package     com_joomla_smf_forum

* @author      Cowboy <ross@joomlahacks.com>

* @author      Wolverine <wolverine@themofoclan.com>

* @copyright   (C) JoomlaHacks.com. All rights reserved.

* @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL

* @version     $Id: smf.php 137 2006-06-04 01:30:55Z joshualross $

* @revision    $LastChangedRevision: 137 $

* @date        $LastChangedDate: 2006-06-03 21:30:55 -0400 (Sat, 03 Jun 2006) $

* @file        $HeadURL: http://scm.joomla.org/svn/repos/joomla-smf_1_1/smf.php $

* @link        http://www.JoomlaHacks.com

* @since       File available since Release 1.0

*

* Visit JoomlaHacks.com for more Joomla Hacks!

*/

// no direct access

defined( '_VALID_MOS' ) or die( 'Restricted access' );



//1.1.4-5 Increased allowed memory usage

@ini_set('memory_limit', '16M');

$action = mosGetParam($_GET, 'action', '');

if (!empty($action)) {

    if(strpos($action, "unread") !== false) {

        global $user_settings;

      $_SESSION['ID_MSG_LAST_VISIT'] = $user_settings['ID_MSG_LAST_VISIT'];

    }

    if(strpos($action, "activate") !== false) {

        /**

         * Include the SMF Login language file

         */

        global $mosConfig_lang, $mosConfig_live_site, $txt;

        if (file_exists($smf_path.'/Themes/default/languages/Login.'.$mosConfig_lang.'.php')) {

            include_once($smf_path.'/Themes/default/languages/Login.'.$mosConfig_lang.'.php');

        } else {

            include_once($smf_path.'/Themes/default/languages/Login.english.php');

        }

        echo "<script>  alert(\"".$txt['activate_success']."\"); window.location = \"".$mosConfig_live_site."\";</script>\n";

    }

}



if (!defined('_SMF_')) {

    /**#@+

     * Constants

     */

    /**

     * _SMF_

     */

    define ('_SMF_', pack('H*',"3c62722f3e4a6f6f6d6c6120427269646765206279203c6120687265663d22687474703a2f2f7777772e4a6f6f6d6c614861636b732e636f6d22207469746c653d224a6f6f6d6c614861636b732e636f6d22207461726765743d225f626c616e6b223e4a6f6f6d6c614861636b732e636f6d3c2f613e"));

    /**#@-*/

}



/**

* Include Joomla-SMF configurations

*/

require_once($mosConfig_absolute_path.'/administrator/components/com_smf/config.smf.php');

/**

* Include Joomla-SMF functions

*/

require_once($mosConfig_absolute_path.'/administrator/components/com_smf/functions.smf.php');



if (strcmp(mosGetParam($_POST, 'option', ''), 'login') == 0 || strcmp(mosGetParam( $_POST, 'op2', '' ), 'login') == 0) {

    return;

}



global $database, $mosConfig_live_site, $mosurl, $Itemid, $modSettings;



if (strcmp($action, "profile2") == 0) {

   updateMOSfromSMF(mosGetParam($_REQUEST, 'userID', ''), mosGetParam($_REQUEST, 'realName', ''), mosGetParam($_REQUEST, 'emailAddress', ''), mosGetParam($_REQUEST, 'passwrd2', ''));

}



// no joomla/mambo session then remove SMF session

if($my->id <= 0) {

   doSMFLogout();

}



error_reporting(0);



//1.1.01-1 using mosGetParam caused unformatted garble

if (!isset($_SESSION['MH_WARNING'])) {

    $_SESSION['MH_WARNING'] = NULL;

}

if ($_SESSION['MH_WARNING'] == NULL) {

     ob_start();

     chdir($smf_path);

     /**

      * Include SMF index.php

      */

     include('index.php');

     chdir($mosConfig_absolute_path);

     $buffer = ob_get_contents();

     ob_end_clean();

     ob_end_flush();

     ob_flush();

     flush();

} else {

     $buffer = $_SESSION['MH_WARNING'];

     unset($_SESSION['MH_WARNING']);

     unset($MH_WARNING);

}



if (isset($context['page_title'])) {

     $mainframe->SetPageTitle($context['page_title']);

     $mainframe->prependMetaTag('description', $context['page_title'].'.');

     $keywords = implode(", ", str_word_count($context['page_title'], 1));

     $mainframe->prependMetaTag( 'keywords', $keywords);

     unset($keywords, $str);

}



fixMamboUrls($buffer, $mosurl);



if (defined(pack('H*',"5f534d46315f"))) {

    echo $buffer;

    unset($buffer);

}



if (strcmp($wrapped, 1) != 0 && strcmp(mosGetParam($_REQUEST, 'task', ''), "register") != 0) {

   exit;

}



global $options;

$req_action = mosGetParam($_REQUEST, 'action', '');



if ((!empty($options['display_quick_reply']) && strcmp($req_action,"quotefast") == 0)

     || strcmp($req_action, "printpage") == 0

     || strcmp($req_action, "findmember") == 0 ) {

    exit;

}



?>
Title: Re: Shared Forum Mod
Post by: Neol on August 25, 2006, 08:13:00 AM
That is a JoomlaHacks variant. Sorry but I can't help you with that one. It's not the official SMF Bridge 1.1.4.2 from Simple Machines!


Title: Re: Shared Forum Mod
Post by: manuelap on August 25, 2006, 08:15:36 AM
I will  try to get my hands on the official bridge, install it and follow your instructions.....
Title: Re: Shared Forum Mod
Post by: Goosemoose on August 29, 2006, 04:21:39 AM
To back up what olti said, this mod will not work with the joomla hacks bridge. Orstios bridge is the only bridge we support.
Title: Re: Shared Forum Mod
Post by: Neol on August 30, 2006, 03:40:11 AM
Goosemoose, I've noticed a problem with your mod and (I think) OpenSEF 2.0.0 RC5 SP2: the Quote button in a topic doesn't work. It works in the "most recent posts" page, though. Any ideas?

It looks like OpenSEF rewrites the Quote button link, and the resulting link is invalid (it redirects me to the top of the page); don't ask me why, I'm clueless about that. I'm thinking of modifying the link in Display.php (am I correct?) to make it similar to the Quote link in "most recent posts".
Title: Re: Shared Forum Mod
Post by: Goosemoose on August 31, 2006, 09:08:22 PM
Olti, I have the same problem but I don't use OpenSEF. I thought it was due to the outdated version of the bridge I'm running though.
Title: Re: Shared Forum Mod
Post by: Neol on September 02, 2006, 01:42:03 PM
Quote from: Goosemoose on August 31, 2006, 09:08:22 PM
Olti, I have the same problem but I don't use OpenSEF. I thought it was due to the outdated version of the bridge I'm running though.

Then maybe it's a bug in code or configuration of either Joomla or the bridge. Upgrading to Joomla 1.0.11 didn't hep in my site, either.

UPDATE: Ken of OpenSEF mentions that it appears to be the fault of Orstio's bridge:
http://www.open-sef.org/component/option,com_smf/Itemid,164/topic,2557.msg9022/,#msg9022
Title: Re: Shared Forum Mod
Post by: Neol on September 03, 2006, 04:49:34 AM
Quote from: Goosemoose on August 31, 2006, 09:08:22 PM
Olti, I have the same problem but I don't use OpenSEF. I thought it was due to the outdated version of the bridge I'm running though.

I noticed that Quote does work on Goosemoose.com forums.
Title: Re: Shared Forum Mod
Post by: Goosemoose on September 03, 2006, 02:37:49 PM
It works in a normal reply, but not a quick reply on goosemoose.com forums.
Title: Re: Shared Forum Mod
Post by: Neol on September 04, 2006, 12:50:07 AM
Quote from: Goosemoose on September 03, 2006, 02:37:49 PM
It works in a normal reply, but not a quick reply on goosemoose.com forums.

Well, the quote button doesn't work at all in my shared forum, even with SEO disabled in Joomla. It does work in the "most recent topics" page, and also in "unshared" forum mode.

Did you have this problem before, and if yes, would you please tell me how you solved it?
Title: Re: Shared Forum Mod
Post by: EvilGeneral on September 04, 2006, 02:34:58 PM
Hi,

I have 3 forums with 3 different themes and i need to share user and private messages, but not the usergroups.
And... i need a new different theme to personalize Profile and Private Messages page layout too.

My project like this:

(http://img393.imageshack.us/img393/421/newforumhe8.gif)

Soo... Shared Forum Mod can do that?
Someone can help me? ;]

Thx.

EvilGeneral

PS: Sorry, but my english is bad and i have serious trouble to discuss this solution with brazilian developers =|
Title: Re: Shared Forum Mod
Post by: Goosemoose on September 06, 2006, 09:33:57 PM
This mod would get you most of the way. Your usergroups would be shared, but people can always belong to more than one membergroups anyways. You'd basically have to detect what forum they were on (discussed earlier in the thread) and change the page theme based on that. Shouldn't be too hard, and definately possible.

Olti, I haven't made any changes regarding quotes that I can think of. I'll let you know if I find anything.
Title: Re: Shared Forum Mod - possible solution for different domains..
Post by: 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
Title: Re: Shared Forum Mod
Post by: Goosemoose on October 24, 2006, 01:16:57 PM
Awesome. There have been quite a few requests to do this without joomla. Let us know once you have a site up that we can test out.
Title: Re: Shared Forum Mod
Post by: Mr. Doug on November 27, 2006, 11:25:31 AM
Thanks for everyone's help on this mod, but is there an easier way to have one forum use the "users" table from another forum?

I don't want everything else on the same database, just sharing the users table so people have one login.

Or is it not that simple?

Title: Re: Shared Forum Mod
Post by: DenDen60 on November 27, 2006, 11:44:39 AM
This mod seems to be very good if not excellent. I am using SMF and Tiny Protal. Can this mod work with those 2. If not, does anyone know of a mod that would do this?

I am managing several forums right now and I share the user database between instances but I have to install for each forum an instance of SMF and an instance of TP.

Denis

Title: Re: Shared Forum Mod
Post by: Goosemoose on November 27, 2006, 12:51:17 PM
denden60, you can try smoothify's method above. It is for people who aren't using the bridge.

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.
Title: Re: Shared Forum Mod
Post by: tasnet on November 29, 2006, 06:00:14 AM
Hi

This mod is perfect for what we are looking to do

Before I start working on it can I confirm that this will still work with 1.1 RC3 and the bridge version 1.1.6.

I am only asking as the original post was some time ago.

Many thanks for the great work

Tasnet
Title: Re: Shared Forum Mod
Post by: Goosemoose on November 29, 2006, 12:46:43 PM
it should work fine. I've seen others using the same combo
Title: Re: Shared Forum Mod
Post by: tasnet on December 01, 2006, 02:10:52 PM
Sorry to keep this post going  ;)  but I need to save the little amount of hair I have left and need to ask for some guidance/help

I have copied all the lines needed into the different folders and was getting a few parsing errors, which I have sorted but now I am left with:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND FIND_IN_SET(c.ID_CAT, "3,24,25,26,27,28,29,30,31")
AND b.childLevel <= 1 OR' at line 18
File: /home/j/public_html/smf1/Sources/BoardIndex.php
Line: 86


the line in question is:
AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);

I only get the error if I add the name of the forum on the link ie
index.php?option=com_smf&Itemid=31&forum=Design

If i dont add the name at the end (forum= ) it shows the whole forum.

I am using SMF 1.1 RC3 and bridge 1.1.6.

I have seen that someone else had a similar issue but was resolved but removing the step where you add

   // Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !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);
     $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
   }

to boardindex.php, but its the same result with that section added or not

I will add the code around the line in question to see if there is an issue missed

QuoteLEFT JOIN {$db_prefix}members AS mods_mem ON (mods_mem.ID_MEMBER = mods.ID_MEMBER)
      WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);

   // Run through the categories and boards....
   $context['categories'] = array();
   while ($row_board = mysql_fetch_assoc($result_boards))
   {

Many thanks in advance

Tasnet
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 01, 2006, 11:16:32 PM
Make sure you have the Recent Posts Bar disabled, you can also try setting DisableQuotedPrintable = 1 in your smf_settings.
Title: Re: Shared Forum Mod
Post by: tasnet on December 02, 2006, 06:38:29 AM
Thanks for the reply Goosemoose

Unfortunatly i have tried those already.

I am guessing it must be something local, but I will keep trying

Many thanks
Title: Re: Shared Forum Mod
Post by: cody on December 04, 2006, 06:18:32 PM
Im having this problem too though onlywhen I am logged onto the forum.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND FIND_IN_SET(c.ID_CAT, "1,6,7")
AND b.childLevel <= 1 ORDER BY c.catOrder' at line 18
File: /home/*****/*****/elmwood-rpg.com/forum/Sources/BoardIndex.php
Line: 84


I am using SMF 1.1 Final and and bridge 1.1.6
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 04, 2006, 09:30:44 PM
Try taking out the ORDER BY c.catOrder and see if it shows up (though out of order).
Title: Re: Shared Forum Mod
Post by: cody on December 04, 2006, 09:41:37 PM
that was one of the first things I did, and it didn't fix the problem.

this is what it said when I did.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND FIND_IN_SET(c.ID_CAT, "1,6,7")
AND b.childLevel <= 1b.boardOrder ASC' at line 18
File: /home/*****/*****/elmwood-rpg.com/forum/Sources/BoardIndex.php
Line: 84
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 04, 2006, 10:25:47 PM
Are you using the default theme? Did you disable the recent posts setting?
Title: Re: Shared Forum Mod
Post by: cody on December 04, 2006, 10:26:50 PM
Im not using the default theme, and what (and where) recent posts setting.
Title: Re: Shared Forum Mod
Post by: DenDen60 on December 05, 2006, 02:34:34 PM
Quote from: Goosemoose on November 27, 2006, 12:51:17 PM
denden60, you can try smoothify's method above. It is for people who aren't using the bridge.

But would I be able to have a different "look and feel" for each forum and each instance of TP? For me that's very important

Thanks

DenDen60
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 05, 2006, 02:57:01 PM
You could, but you'd have to do some customization yourself. I posted some code a few pages back on how to determine which forum you are on, you could load a theme based on that variable.
Title: Re: Shared Forum Mod
Post by: DenDen60 on December 05, 2006, 05:43:55 PM
Quote from: Goosemoose on December 05, 2006, 02:57:01 PM
You could, but you'd have to do some customization yourself. I posted some code a few pages back on how to determine which forum you are on, you could load a theme based on that variable.

Thank's will that work with TP as well? In your opinion of course.

Thanks

DenDen60
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 05, 2006, 07:10:21 PM
It should, but I really haven't looked at TP enough to know for sure. You could always setup a second site and test it out.
Title: Re: Shared Forum Mod
Post by: cody on December 06, 2006, 06:26:27 PM
So I am pretty sure the recent posts is disabled, what else can I do to try and fix this?
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 06, 2006, 08:12:25 PM
When I get some time this weekend I'll look at it. I'm sure the code of 1.1Final must have changed enough to break this. Are you running TinyPortal by any chance?
Title: Re: Shared Forum Mod
Post by: cody on December 06, 2006, 08:17:29 PM
No.
Title: Re: Shared Forum Mod
Post by: cody on December 13, 2006, 04:51:52 PM
Any idea why this isnt working for me yet?
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 13, 2006, 07:04:37 PM
Not yet. I'm finishing up my Integrated Chat mod for 1.1 Final, then I'll look at this mod.
Title: Re: Shared Forum Mod
Post by: Neol on December 14, 2006, 05:35:25 AM
Goosemoose, please see if you can make an installable mod (through Package Manager). I guess smf.php has to be modified separately, since it's part of the bridge, not the forum.

An optional visual interface for setting up subforums would also be very welcome...
Title: Re: Shared Forum Mod
Post by: Mr. Doug on December 19, 2006, 02:17:15 PM
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?
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 20, 2006, 02:16:45 AM
Look at the first post on page 10 of this thread by smoothify.
Title: Re: Shared Forum Mod
Post by: ormuz on December 26, 2006, 12:47:55 PM
Is this mod still working for the last versions?
Title: Re: Shared Forum Mod
Post by: ShopHRM on December 28, 2006, 04:09:31 PM
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.
Title: Re: Shared Forum Mod
Post by: ormuz on December 28, 2006, 09:34:20 PM
I'm trying to make this work too, I think u should remove the default bridge link, and create menus with the new links...
Title: Re: Shared Forum Mod
Post by: Flying Drupalist on December 30, 2006, 07:37:57 PM
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...
Title: Re: Shared Forum Mod
Post by: Goosemoose on December 31, 2006, 12:50:50 AM
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).
Title: Re: Shared Forum Mod
Post by: salim on December 31, 2006, 05:52:20 PM
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
Title: Re: Shared Forum Mod
Post by: Hotel on December 31, 2006, 06:20:59 PM
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
Title: Re: Shared Forum Mod
Post by: salim on January 02, 2007, 03:19:01 PM
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
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
(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
Title: Re: Shared Forum Mod
Post by: SilentShade on January 05, 2007, 08:12:04 PM
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
Title: Re: Shared Forum Mod
Post by: Neol on January 09, 2007, 09:03:28 AM
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'] . '")';     
   }

Title: Re: Shared Forum Mod
Post by: SilentShade on January 13, 2007, 03:08:44 AM
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.
Title: Re: Shared Forum Mod
Post by: Neol on January 16, 2007, 04:28:25 AM
Try this:

Reply #111 (http://www.simplemachines.org/community/index.php?topic=64492.msg694947#msg694947) in page 8.

Title: Re: Shared Forum Mod
Post by: SilentShade on January 17, 2007, 09:47:30 AM
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?
Title: Re: Shared Forum Mod
Post by: Neol 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?
Title: Re: Shared Forum Mod
Post by: Gobo 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 :(
Title: Re: Shared Forum Mod
Post by: Neol on January 18, 2007, 08:36:13 PM
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) (http://www.simplemachines.org/community/index.php?topic=64492.msg780659#msg780659) by smoothify.
Title: Re: Shared Forum Mod
Post by: Gobo on January 18, 2007, 08:43:00 PM
thanks ill check it out
Title: Re: Shared Forum Mod
Post by: SilentShade on January 22, 2007, 05:41:45 PM
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.
Title: Re: Shared Forum Mod
Post by: SilentShade on January 22, 2007, 06:05:25 PM
Fixed! Thanks everybody helping. The problem was in my hands :P This shared forum mode code, was put in between of two functions, while $user_info array is built in first function loadUserSettings(). After moving this code inside the function, everything is working like a charm. :) sorry for disturbance.
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 24, 2007, 10:48:30 PM
Hi SilentShade,
Thanks for clarifying that! Did you put it there because my directions weren't clear enough, or was it just a mistake? I'd like to explain the instructions better if I need to.
Title: Re: Shared Forum Mod
Post by: perplexed on January 26, 2007, 09:44:12 AM
Quote from: Goosemoose on January 06, 2006, 03:04:39 AM
Orstio and I came up with a way to run multiple forums from 1 database, 1 directory, 1 installation. I'm running 7 forums and I only need to upgrade once, install mods once, and my users are shared :)

First the examples. Note the number of Categories that show in each, and that some are shared. some aren't.

http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,cat
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,dog
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,hedgehog
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,rabbit
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,ferret
http://www.goosemoose.com/component/option,com_smf/Itemid,118/forum,bird

Ok, you can do it without the Mambo/Joomla bridge but it's no where near as good. We used the power of the bridge to rewrite all the links. Basically what you do is create a new table smf_forums that houses two fields, forumName and catList. Here is an example of what it could look like with 3 forums that share some categories, and have some unique. This all works off of ONE smf directory!

forumName catList
Rat 1,2,3,4
Cat 1,5,6,7
Dog 1,4,8,9
[snipped]

I was wondering if anyone can explain how to do this without using joomla or other cms bridge. I just want to have 3 separate forums linked together and one user database.  I have one forum now with lots of members, so I would like them to be able to go directly to the two new ones without having to register or login again.  Also what the implications or problems with doing this might be.  (I don't know anything about sql dbs so please go slowly, I dont really understand the above post as it is :( )  If this is in the wrong section, please move or redirect me.
~thanks :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 27, 2007, 02:53:28 AM
Hi Perplexed, please go back a few pages, how to do this was already explained.
Title: Re: Shared Forum Mod
Post by: Neol on January 28, 2007, 04:50:04 AM
Quote from: Goosemoose on December 13, 2006, 07:04:37 PM
Not yet. I'm finishing up my Integrated Chat mod for 1.1 Final, then I'll look at this mod.

I read that you have finished it, right? Well, not exactly finished (software almost never are), but it seems the new version works on 1.1 Final. So...

Quote from: olti on December 14, 2006, 05:35:25 AM
Goosemoose, please see if you can make an installable mod (through Package Manager). I guess smf.php has to be modified separately, since it's part of the bridge, not the forum.

An optional visual interface for setting up subforums would also be very welcome...

I know, I know... I'm trying to rush you. :P
Title: Re: Shared Forum Mod
Post by: SilentShade on January 28, 2007, 03:53:42 PM
Quote from: Goosemoose on January 24, 2007, 10:48:30 PM
Hi SilentShade,
Thanks for clarifying that! Did you put it there because my directions weren't clear enough, or was it just a mistake? I'd like to explain the instructions better if I need to.
First of all i really appreciate your work to make such a nice mod. Thank you! :)
In your first post you have instruction:
Quote from: Goosemoose
3. Edit Load.php

In Load.php

Find:
Code:

$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';   


Add After:
Code:

// 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);
      $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';     
   }
Well everything is right, but the function ends after this string $user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';    thats why i messed up this a little.. Maybe just add a reminder that you have to add "shared forum mod" code INSIDE the function to make it work :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 29, 2007, 09:30:45 PM
Hi SilentShade,
Thanks for the tip, but I'm a bit confused. The code says to find the first line, then add the 2nd bit after it. If you do that then you'd be fine.
Title: Re: Shared Forum Mod
Post by: perplexed on January 30, 2007, 09:33:47 AM
Quote from: Goosemoose on January 27, 2007, 02:53:28 AM
Hi Perplexed, please go back a few pages, how to do this was already explained.
lol thanks I read that but I am still a little unsure.  thanks anyway
Title: Re: Shared Forum Mod
Post by: ShopHRM on February 19, 2007, 08:39:56 PM
I am having trouble with this

1. Run this in phpMyAdmin
Code:


CREATE TABLE IF NOT EXISTS `smf_forums` (
  `forumName` text NOT NULL,
  `catList` varchar(128) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



i have a dreamhost account and there is a spot where i can enter phpmyadmin but i dont see a place to add that code anywhere
Title: Re: Shared Forum Mod
Post by: Goosemoose on February 20, 2007, 03:23:03 AM
Look for a sql button.
Title: Re: Shared Forum Mod
Post by: ShopHRM on February 20, 2007, 10:42:50 AM
thanks, got that figured, i seem to have everything setup but i have an issue

this is my homepage

http://www.mytestsite.hfxgaming.com/

if you click on the forum button it brings you to the forum i made when creating the bridge

http://www.mytestsite.hfxgaming.com/index.php?option=com_smf&Itemid=26

and here are the 2 links i made through this tutorial

http://www.mytestsite.hfxgaming.com/index.php?option=com_smf&Itemid=118&forum=dale
http://www.mytestsite.hfxgaming.com/index.php?option=com_smf&Itemid=118&forum=chip

as you can see there are no catagories or forums, what did i do wrong?


also just so i am clear what are the catlist numbers for


Title: Re: Shared Forum Mod
Post by: Goosemoose on February 20, 2007, 01:53:33 PM
The catlist numbers are the numbers of the categories you want to show up for each forum. You will need to add your category numbers into the database for it to work. If you look at the link to each category on your forum you can figure out what each number is. That will fix your empty forum problem.
Title: Re: Shared Forum Mod
Post by: ShopHRM on February 20, 2007, 03:30:18 PM
got it all figured out, now i just need to figure out how to have different themes for each page :)
Title: Re: Shared Forum Mod
Post by: ShopHRM on February 20, 2007, 11:01:34 PM
Quote from: kingconnor on March 22, 2006, 06:01:37 PM
Just letting people know this is how to associate a theme with each separate forum. Please bear with me I'm a newbie to php

Step1: Create a new field in the smf_forums table called forumTheme and set to int.

Step 2: in the new field you have created (forumTheme) put the ID_THEME number you wish to associate with the forum (found in smf_themes table)

Step 3: Open up index.php under the root of your forum. Find line number 148 should be loadTheme(); replace with:

$database->setQuery( "SELECT DISTINCT forumTheme
                    FROM #__smf_forums
                    WHERE forumName='".$_REQUEST['forum']."'");
                   
$forumTheme = $database->loadResult();
   
loadTheme($forumTheme);

Quote from: Goosemoose on March 22, 2006, 01:05:21 PM
Yeah I did notice that too. I haven't had a chance to look at the code that creates the collapsable boards. Basically you would just need to make sure the code there matches the code changed in Load.php. If you find it let me know, I'm really strapped for time right now.

Yep I will check it out at some point and let you all know.

Regards

da king  ;D


I saw someone else get an error for this but i couldnt find the fix so I will ask again, I tried this and I got this error

Fatal error: Call to a member function setQuery() on a non-object in /home/.maren/mytestsite/mytestsite.hfxgaming.com/forum/index.php on line 150


I tried to change "FROM #__smf_forums" to "FROM smf_forums" but i get the same error.

I am using smf 1.1.2 with smf_1-1_joomla_1-0-x_bridge_1-1-7 and Joomla_1.0.12-Stable-Full_Package
Title: Re: Shared Forum Mod
Post by: arez on February 22, 2007, 08:38:41 AM
i have tried to get this to work without the bridge (following instructions on the forst post and the first post on page #10 ) but i just dont get it . maybe iam missing something ..... could someone help me out with this?

/edit

its also not the best thing to store the info about the borads in the domain/subdomain. maybe this could work together with the "costom actions" mod so we can have ...index.php?action=dogforum  to redirect to the categories releated to dogs
Title: Re: Shared Forum Mod
Post by: Neol on February 22, 2007, 01:53:10 PM
I want to know how to use the mod without Joomla. I'm thinking of using SMF with TinyPortal.

Anyone got the mod working with TP?
Title: Re: Shared Forum Mod
Post by: arez on February 22, 2007, 02:21:08 PM
i got tp, too and i think the main problem is that the mod on the first page uses the system of the bridge to write the url and carry the variables for the forum
Title: Re: Shared Forum Mod
Post by: Goosemoose on February 23, 2007, 02:46:31 AM
There was a post on how to carry the variables without joomla in this thread. You will have to look around for it. A few people have modified this and gotten it to work well for them. You might want to pm them if you have any problems and ask them to answer your question here so that other may benefit. All my experiences were in using this with Joomla sites as that's all I run now!
Title: Re: Shared Forum Mod
Post by: Neol on February 23, 2007, 03:21:07 AM
Quote from: Goosemoose on February 23, 2007, 02:46:31 AM
There was a post on how to carry the variables without joomla in this thread.

You mean the first post of page 10?
http://www.simplemachines.org/community/index.php?topic=64492.msg780659#msg780659

Well, the poster used subdomains for that. Although subdomains are useful, not everyone can/may/will use them.

I'm trying to make the mod work with TP using actions. If I find a solution (even a partial one), I'll post it.
Title: Re: Shared Forum Mod
Post by: arez on February 23, 2007, 05:37:03 AM
there is a solution on tp forums but i didnt get it to work....

Quote from: latinlives on February 22, 2007, 12:44:36 PM
List of changes.

index.php one for each forum name.
line 334 'forumname' => array('BoardIndex.php', 'BoardIndex'),


Load.php, you have to add &&($_GET['action'] == 'forumname') for each forum that you put up
line 527
//SHARED FORUM MOD
if(!isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])  &&isset($_REQUEST['action']) &&($_GET['action'] == 'forumname')){
$sharedforummod = $_GET['action'];
        $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$sharedforummod'", __FILE__, __LINE__);
    $row_forumList = mysql_fetch_assoc($forumList);
        $user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';
  }


Changing the linktree to the right forum doesnt work, and I have not had a chance to try and get it to work yet....
line 547
        // Start the linktree off empty..not quite, have to insert forum
if ($_GET['action'] == 'forumname') {$context['linktree'] = array(array('url' => $scripturl . '?action=forumname', 'name' => 'ForumName'));}

else
     $context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum'));



The database side is set up the same as it is in the shared forum mod for Joomla/SMF
Title: Re: Shared Forum Mod
Post by: arez on February 23, 2007, 05:58:10 AM
iam also a bit confused how the mysql tables should look like because in smf_forums i got 2 fields. one with the name of the forum and nothing else and one catlist with the category ids i want to have in there but how foes the script know that the catlist with the categories 1,2,4 belong to forum A and not to forum B  ? there is nothing that lins those two tables
Title: Re: Shared Forum Mod
Post by: arez on February 24, 2007, 08:25:12 AM
anyone?
Title: Re: Shared Forum Mod
Post by: Neol on February 24, 2007, 03:42:49 PM

$sharedforummod = $_GET['action'];

$forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$sharedforummod'", __FILE__, __LINE__);


The $sharedforummod variable gets the action URL parameter value. The query selects the category list that belongs to the forum name indicated by $sharedforummod.

That's how the original mod operates too (see the first post in this topic).

However, the code by latinlives is not very dynamic: every time you add, delete or modify forum names, you have to insert them in the code by hand. Later I will post a modification that gets the forum names from the database, instead from code in Load.php.

I'm a bit puzzled by the code that should be inserted in index.php though. Anyone knows a way to make it more dynamic and efficient?
Title: Re: Shared Forum Mod
Post by: Goosemoose on February 24, 2007, 11:04:37 PM
Zeri, are you talking about in the non-joomla version?
Title: Re: Shared Forum Mod
Post by: Neol on February 25, 2007, 03:24:06 AM
Quote from: Goosemoose on February 24, 2007, 11:04:37 PM
Zeri, are you talking about in the non-joomla version?

I'm talking about the TP version.
Title: Re: Shared Forum Mod
Post by: arez on February 25, 2007, 10:15:01 AM
the tpversion should not be different from the smf standalone one becuse tp doesnt supply the mod with variables  
Title: Re: Shared Forum Mod
Post by: ShopHRM on February 25, 2007, 02:19:39 PM
Quote from: ShopHRM on February 20, 2007, 11:01:34 PM
Quote from: kingconnor on March 22, 2006, 06:01:37 PM
Just letting people know this is how to associate a theme with each separate forum. Please bear with me I'm a newbie to php

Step1: Create a new field in the smf_forums table called forumTheme and set to int.

Step 2: in the new field you have created (forumTheme) put the ID_THEME number you wish to associate with the forum (found in smf_themes table)

Step 3: Open up index.php under the root of your forum. Find line number 148 should be loadTheme(); replace with:

$database->setQuery( "SELECT DISTINCT forumTheme
                    FROM #__smf_forums
                    WHERE forumName='".$_REQUEST['forum']."'");
                   
$forumTheme = $database->loadResult();
   
loadTheme($forumTheme);

Quote from: Goosemoose on March 22, 2006, 01:05:21 PM
Yeah I did notice that too. I haven't had a chance to look at the code that creates the collapsable boards. Basically you would just need to make sure the code there matches the code changed in Load.php. If you find it let me know, I'm really strapped for time right now.

Yep I will check it out at some point and let you all know.

Regards

da king  ;D


I saw someone else get an error for this but i couldnt find the fix so I will ask again, I tried this and I got this error

Fatal error: Call to a member function setQuery() on a non-object in /home/.maren/mytestsite/mytestsite.hfxgaming.com/forum/index.php on line 150


I tried to change "FROM #__smf_forums" to "FROM smf_forums" but i get the same error.

I am using smf 1.1.2 with smf_1-1_joomla_1-0-x_bridge_1-1-7 and Joomla_1.0.12-Stable-Full_Package

anyone know how to fix this?? :S
Title: Re: Shared Forum Mod
Post by: Neol on March 01, 2007, 01:59:46 AM
Quote from: arez on February 25, 2007, 10:15:01 AM
the tpversion should not be different from the smf standalone one becuse tp doesnt supply the mod with variables 

But we don't even have a working mod for standalone SMF! The first post in page 10 by smoothify uses subdomains... I can't (and wouldn't) use subdomains.
Title: Re: Shared Forum Mod
Post by: arez on March 01, 2007, 09:54:52 AM
sure, same with me but the question is where to store that variable... subdomains is a solution but not the best imho.. it could be an external php script that "collects" those boards for displaying but i think thats not a good solution,aswell
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 02, 2007, 01:04:54 AM
If someone wants to take up the project of editing it to work go for it. There's no reason it couldn't be stored in the database with a variable being passed in. My mod was for joomla/smf and multiple forums and unfortunately I do not have enough time to continue onto other projects.
Title: Re: Shared Forum Mod
Post by: Neol on March 02, 2007, 01:43:21 AM
Quote from: Goosemoose on March 02, 2007, 01:04:54 AM
If someone wants to take up the project of editing it to work go for it. There's no reason it couldn't be stored in the database with a variable being passed in. My mod was for joomla/smf and multiple forums and unfortunately I do not have enough time to continue onto other projects.

I'll see what I can do. I'm thinking of rewriting the mod, based on the codebase of another mod, and releasing it as a package.

My primary intent is to make a mod for SMF+TP, but I guess it can be made to work in pure SMF with little or no modification. That said, I'm not going to make a Joomla+SMF version -- the existing mod seems to do the job quite well.

I'll keep you posted.
Title: Re: Shared Forum Mod
Post by: arez on March 02, 2007, 10:25:59 AM
these are great news :)
Title: Re: Shared Forum Mod
Post by: Neol on March 06, 2007, 01:38:02 PM
Most of the mod code is already written. Currently I'm stuck at converting the code 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__);
$row_forumList = mysql_fetch_assoc($forumList);
$user_info['query_see_board'] .= ' AND FIND_IN_SET(c.ID_CAT, "' . $row_forumList['catList'] . '")';     
}


I called out for help here: http://www.simplemachines.org/community/index.php?topic=155807.0

My mod uses forum names as action (rather than forum) URL parameters; also, forum names are entered in the $modSettings array rather than a database table. This allows for cleaner code, I guess.
Title: Re: Shared Forum Mod
Post by: Neol on March 16, 2007, 01:55:06 PM
My SMF+TP version of Shared Forum Mod is near completion. You can read about it here (http://www.simplemachines.org/community/index.php?topic=158330.0).

Let's not hijack this topic anymore -- after all, it is about the Joomla+SMF version. :)
Title: Re: Shared Forum Mod
Post by: Goosemoose on March 19, 2007, 04:00:34 PM
Cool! Glad to hear you've got it working!  
Title: Re: Shared Forum Mod
Post by: MarkJ on March 27, 2007, 03:15:32 PM
I have this installed now and the forums are appearing.  The problem I have though is that the urls within the board are not changing.  They are still using the mainforum urls.  Have I missed something?  You can see what I mean here:

New Forum
http://bluesplayer.co.uk/media/smf/index.php?option=com_smf&Itemid=118&forum=pro

As you can see if you click on anything you will end up back on the main forum.

Regards - Mark

Bridge: 1.1.7
Joomla: 1.0.12
SMF: 1.1.2

Title: Re: Shared Forum Mod
Post by: Goosemoose on March 29, 2007, 09:31:20 PM
URL's within a post won't change. If you search through the main bridge thread FAQ Kindred posted a method of mine to change URL's within threads via phpMyAdmin.
Title: Re: Shared Forum Mod
Post by: MarkJ on April 02, 2007, 10:04:10 AM
Hi Goosemoose

I have found this:

http://www.simplemachines.org/community/index.php?topic=81152.msg541379#msg541379

He mentions this:

UPDATE smf_messages SET `body` = replace(`body`,"http://www.yoursite.com/forum/index.php?","http://www.yoursite.com/mambo/index.php?option=com_smf&Itemid=##&")


Isn't that just to do with messages though? But if you look at my forum here:

http://bluesplayer.co.uk/media/smf/index.php?option=com_smf&Itemid=118&forum=daoc

All the urls are still using the old mainboard url - including the categories and boards etc.

Regards - Mark
Title: Re: Shared Forum Mod
Post by: MarkJ on April 03, 2007, 05:39:40 AM
Darn I had it working ok all along.  I was using the wrong url from Joomla.  Great modification and now working a treat  :).

Well done Goosemoose.
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 03, 2007, 12:54:59 PM
Hehe, glad to hear it was working ok. :)
Title: Re: Shared Forum Mod
Post by: MarkJ on April 03, 2007, 09:11:55 PM
Hi

Another problem has reared it's ugly head though after the Shared Forum mod - recentpost urls.  I don't think this looks hard to fix but the urls that is uses are off the mainboard and not the urls of the Shared Forum Categoies.  I was using this code:

<?php

$array 
ssi_recentTopics(5, array(2,243,244,245,246,247,248,249,250
), 'array');

foreach (
$array as $recent)
{
  
$subject html_entity_decode($recent['subject']);
  if (
strlen($subject) > 150)
    
$subject htmlentities(substr($subject0150)) . '...';
  else
    
$subject $recent['subject'];
echo 
' Subject: <a target="_top" href="'$recent['href'], '" title="Board: '$recent['board']['name'], ' - Poster: '$recent['poster']['name'], '">'$subject'</a>
Forum: '
$recent['board']['link'], ' '$recent['new'] ? '<a target="_top" href="' $scripturl '?topic=' $recent['topic'] . '.from' $recent['newtime'] . ';topicseen#new"><img src="' $settings['images_url'] . '/' $context['user']['language'] . '/new.gif" alt="' $txt[302] . '" border="0" /></a>' ''' Poster: ',$recent['poster']['name'],'
<br/><hr color="#C0C0C0" size="1">'
;
}

?>


Is it possible to use the new Joomla urls for the above?

Regards - Mark
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 05, 2007, 12:52:35 PM
I'm sure it's possible but I haven't seen an easy way since the url's are being generated from another file. I've just left it as is and it really hasn't caused any problems on my site.
Title: Re: Shared Forum Mod
Post by: MarkJ on April 05, 2007, 01:31:52 PM
I notice that the Latest Post at the bottom of the forums is ok.  The url is correct.  I am wondering whether it can be adjusted so that it displays say 5 latest post urls along with the name of the poster etc just like the Recentpost code I previously used.  Would be indeal?
Title: Re: Shared Forum Mod
Post by: Goosemoose on April 07, 2007, 02:55:24 PM
Where exactly are you looking at? Can you give me a link?
Title: Re: Shared Forum Mod
Post by: MarkJ on April 07, 2007, 03:39:02 PM
Well I have 7 forums now using the Shared Forum Mod and I have stopped direct access to the main forum with a redirect.  If you look at my Gaming Forum at the very bottom - Forum Stats - Latest Post - you will see that it shows part of the latest post for Gaming only.  The same is on the other Forums.  The ideal solution would be to be able to use that code with SSi so I could post 5 latest posts inside my Gaming section.  Here is the Gaming forum link:

http://bluesplayer.co.uk/home/index.php?option=com_smf&Itemid=26&forum=daoc
Title: Re: Shared Forum Mod
Post by: MarkJ on April 08, 2007, 11:05:56 AM
I used this code:
Quote
if (!WIRELESS && empty($_REQUEST['option'])){   
   header('Location: http://bluesplayer.co.uk/home/index.php?option=com_content&task=view&id=22&Itemid=');
}

To redirect users from the main board but I found out my character recognition (Visual verification) on registering stopped working?
Title: Re: Shared Forum Mod
Post by: Iomega0318 on May 10, 2007, 07:45:15 PM
I am just curious, and have read every post in this thread lol.. Does anyone have the edits for this to work without Joomla, I tried the edit in that one post here and it did not work...
Title: Re: Shared Forum Mod
Post by: MarkJ on May 10, 2007, 08:20:25 PM
QuoteI am just curious, and have read every post in this thread lol.. Does anyone have the edits for this to work without Joomla, I tried the edit in that one post here and it did not work...

Are you refering to the complete mod?  Working a treat on my site.

This is my forum:
http://bluesplayer.co.uk/media/smf/

Try the top menu links to the different forums - Arcade, Computers etc.  If this is what you are trying to achieve I can help perhaps though Goosemoose really is the one you need to chat too.  I will though state exactly how I did it on my forum for you. 

Regards - Mark
Title: Re: Shared Forum Mod
Post by: Goosemoose on May 10, 2007, 11:37:48 PM
Iomega, check out http://www.simplemachines.org/community/index.php?topic=158330.msg1041585#msg1041585
Title: Re: Shared Forum Mod
Post by: Iomega0318 on May 11, 2007, 05:42:08 AM
Quote from: MarkJ on May 10, 2007, 08:20:25 PM
QuoteI am just curious, and have read every post in this thread lol.. Does anyone have the edits for this to work without Joomla, I tried the edit in that one post here and it did not work...

Are you refering to the complete mod?  Working a treat on my site.

This is my forum:
http://bluesplayer.co.uk/media/smf/

Try the top menu links to the different forums - Arcade, Computers etc.  If this is what you are trying to achieve I can help perhaps though Goosemoose really is the one you need to chat too.  I will though state exactly how I did it on my forum for you. 

Regards - Mark
Kind of but you are using Joomla too are you not? I don't use nor want to use Joomla..
Quote from: Goosemoose on May 10, 2007, 11:37:48 PM
Iomega, check out http://www.simplemachines.org/community/index.php?topic=158330.msg1041585#msg1041585
Yes I took a look at that one and it seems it was made for SMF+TP and I don't use nor want to use TP lol, I get a few errors when I try and install it and I am guessing they are just because I don't have TP
Title: Re: Shared Forum Mod
Post by: Sarge on May 11, 2007, 06:30:55 AM
Quote from: Iomega0318 on May 11, 2007, 05:42:08 AM
Quote from: Goosemoose on May 10, 2007, 11:37:48 PM
Iomega, check out http://www.simplemachines.org/community/index.php?topic=158330.msg1041585#msg1041585
Yes I took a look at that one and it seems it was made for SMF+TP and I don't use nor want to use TP lol, I get a few errors when I try and install it and I am guessing they are just because I don't have TP

I'm the author of that mod, and yes, it is made for SMF+TP simply because the easiest way to add links to subforums would be through a TP block. But TP is not inherently necessary for the mod to work.

If you tell me where should the mod add links/buttons to the subforums, I can make a SMF-only version for you.
Title: Re: Shared Forum Mod
Post by: Iomega0318 on May 11, 2007, 08:16:35 AM
Perhaps adding a mouse over drop down menu called Forums on the link bar with the Home Help Search buttons, is that possible? Perhaps right after the Home button, have it go Home Forums Help.. Does that make since? Also thanx for the quick reply, I posted in your topic what errors I was getting
Title: Re: Shared Forum Mod
Post by: Sarge on May 11, 2007, 08:24:26 AM
Quote from: Iomega0318 on May 11, 2007, 08:16:35 AM
Perhaps adding a mouse over drop down menu called Forums on the link bar with the Home Help Search buttons, is that possible?

It is possible, and in fact that's what I'd like. I just don't know how to do it. :)
Title: Re: Shared Forum Mod
Post by: Iomega0318 on May 11, 2007, 08:34:19 AM
lol, well I can look into how to make it I just don't know where the code would go or how to make it work lol, let me jump around for a bit and see if I can find some coding for ya, then you can make it all work smoothly :)
Title: Re: Shared Forum Mod
Post by: Sarge on May 11, 2007, 08:44:03 AM
Let's continue in the other topic. :)
http://www.simplemachines.org/community/index.php?topic=158330.msg1088333#msg1088333
Title: Re: Shared Forum Mod
Post by: Hotel on June 13, 2007, 02:42:55 AM
how to do it whith mambo this works for me bu no garentes
find in smf.php
$myurl = $configuration->get('mosConfig_live_site') . '/index.php?option=com_smf&amp;Itemid=' . $Itemid . '&amp;';
and replace whtih
$myurl = $configuration->get('mosConfig_live_site') . '/index.php?option=com_smf&amp;Itemid=' . $Itemid . '&amp;'
      . (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


find
$myurl = 'index.php?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;';
replace whith
$myurl = 'index.php?option=com_smf&amp;Itemid=' . $_REQUEST['Itemid'] . '&amp;'
      .  (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&amp;' : '');


my site is harry.dayfamilyweb.com
Title: Re: Shared Forum Mod
Post by: ilvjuliet on June 17, 2007, 07:22:32 AM
smf is new to me.I just want to integrate one  smf forum to one joomla.
What should I do?
Title: Re: Shared Forum Mod
Post by: Sarge on June 18, 2007, 02:04:29 AM
Quote from: ilvjuliet on June 17, 2007, 07:22:32 AM
smf is new to me.I just want to integrate one  smf forum to one joomla.
What should I do?

Use the bridge. :) Check out the sticky topics in this board.
Title: Re: Shared Forum Mod
Post by: Dejv on July 11, 2007, 02:14:19 PM
Hi,

I need to use more forums on different domains sharing the same database but with different default theme because of fixed google api key in each BoardIndex.template.php, and other templates...
Using this mod, can I choose for each forum version from where the default theme should load?
I hope this is what I am looking for  :)

Thanks a lot,
David
Title: Re: Shared Forum Mod
Post by: Goosemoose on July 12, 2007, 12:05:20 AM
Hi Dejv,
It will work for you but it will require some work on your part. First, the domains would have to be hosted on the same server and be able to all access the same mysql database. You can write a few lines of code to detect the current domain and change the template depending on which one it is. I would also set up symlinks so that each domain actually uses the same smf folder.
Title: Re: Shared Forum Mod
Post by: perplexed on August 03, 2007, 12:08:39 PM
I would like to try this mod but first I would have to merge a couple of separate forums together, as this sounds like a much easier option than maintaining three separate ones.  Can anyone direct me on how to achieve that?

thanks
Title: Re: Shared Forum Mod
Post by: Sarge on August 03, 2007, 10:09:38 PM
Quote from: perplexed on August 03, 2007, 12:08:39 PM
I would like to try this mod but first I would have to merge a couple of separate forums together, as this sounds like a much easier option than maintaining three separate ones.  Can anyone direct me on how to achieve that?

I think a few members are working on a merge script. I will let you know if I see any stable results.
Title: Re: Shared Forum Mod
Post by: ormuz on September 06, 2007, 01:55:54 PM
Is this hack working with mambo and the last versions of smf, mambo and the bridge?
Title: Re: Shared Forum Mod
Post by: ormuz on September 09, 2007, 12:11:18 PM
Bump, is this working with joomla 1.012 bridge 1.1.7 and smf 1.1.3 ?

EDIT: yes!
Title: Re: Shared Forum Mod
Post by: Mr. Jinx on October 02, 2007, 11:53:54 AM
Shared forum mod without the joomla bridge (tested with smf 1.1.4)

Some people in this topic asked how to use this great mod on SMF forums without the joomla bridge. I have written a small howto for those without the bridge.
This mod is completely based on Goosemoose (http://www.simplemachines.org/community/index.php?topic=64492.msg445526#msg445526)'s mod and the idea from smoothify (http://www.simplemachines.org/community/index.php?topic=64492.msg780659#msg780659), with some small enhancements.
You will have to use subdomains, this might be a problem for some people, but it works very nice.

HOWTO

1. Install your forum on a subdomain, for example forum.yoursite.com
This will be you *main* forum with all categories visible.

2. Create a subdomain for every forum you want, this subdomain should point to forum.yousite.com (no redirects)

3. Run this in phpMyAdmin

CREATE TABLE IF NOT EXISTS `smf_forums` (
  `forumName` text NOT NULL,
  `catList` varchar(128) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

warning: if you forum prefix is not "smf_" change it in the above code!

4. Manually add the following fields to the table you just created:
Example:
forumNamecatList
x.yoursite.com1,2,3,10
y.yoursite.com4,5,6,10
z.yoursite.com7,8,9,10
.. so for every domain you can specify the categories.
In this example, domain x.yoursite.com shows category 1,2,3 and 10.
domain y.yoursite.com shows category 4,5,6,10.
As you can see, category 10 is visible for both domains.

5. Edit Load.php

Find:

$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';

Add After:

// Added for the multiple forum mod
  if(!isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
$domain = $_SERVER['SERVER_NAME'];
        $forumList = db_query("SELECT catList FROM {$db_prefix}forums WHERE forumName = '$domain'", __FILE__, __LINE__);
    $row_forumList = mysql_fetch_assoc($forumList);
        $user_info['query_see_board'] .= ' AND FIND_IN_SET(b.ID_CAT, "' . $row_forumList['catList'] . '")';
  }


6. In BoardIndex.php (in Sources dir)
find:

AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

replace with:

AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);


find:

$result_boards = db_query (around line 71)"

Add above that the following code

   // Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !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);
     $user_info['query_see_board'] .= ' AND FIND_IN_SET(b.ID_CAT, "' . $row_forumList['catList'] . '")';
   }


7. Edit Settings.php
find:

$boardurl = '

replace the complete line with

$boardurl = 'http://' . $_SERVER['SERVER_NAME'];


warning: Everytime you modify your settings in the admin web interface (Admin > Server Settings > Core Configuration) the $boardurl variable will be overwritten by SMF. So don't forget to change this everytime you update de core configuration.

8. Modify feauture configuration
This step is optional. If you want your users to stay online on all forums, you'll have to change the following settings:

Admin > Server Settings > Feature Configuration >  Enable local storage of cookies = DISABLED
Admin > Server Settings > Feature Configuration >  Use subdomain independent cookies = ENABLED

That should be it!
Title: Re: Shared Forum Mod
Post by: Simbyte on October 29, 2007, 09:55:38 AM
Wow, that's exactly what I looked for.

I'll try out soon:)
Title: Re: Shared Forum Mod
Post by: Iomega0318 on November 02, 2007, 04:00:48 PM
Awesome! I have been wanting to do this for a long time..
I will try it out later tonight and see how it all works out..
Title: Re: Shared Forum Mod
Post by: Jacque on November 03, 2007, 12:37:22 PM
I've been searching for something like this too.   I gave it a try, and ended up with this error message on loading the main or any subdomain forums:

Unknown table 'c' in where clause
File: /home/jacquedu/public_html/forums/Sources/Recent.php
Line: 102

I did make a new database to test this by importing a backup of my existing one, I have no clue if it makes a difference or not, but I would hope one could do it that way.

Thanks for everyones contributions on this mod!!

Jacque
Title: Re: Shared Forum Mod
Post by: Sarge on November 03, 2007, 12:46:52 PM
Quote from: Jacque on November 03, 2007, 12:37:22 PM
I've been searching for something like this too.   I gave it a try, and ended up with this error message on loading the main or any subdomain forums:

Unknown table 'c' in where clause
File: /home/jacquedu/public_html/forums/Sources/Recent.php
Line: 102

Try this (reply #111 on page 6):
http://www.simplemachines.org/community/index.php?topic=64492.msg694947#msg694947
Title: Re: Shared Forum Mod
Post by: Jacque on November 03, 2007, 01:05:37 PM
Quote from: Sarge on November 03, 2007, 12:46:52 PM
Quote from: Jacque on November 03, 2007, 12:37:22 PM
I've been searching for something like this too.   I gave it a try, and ended up with this error message on loading the main or any subdomain forums:

Unknown table 'c' in where clause
File: /home/jacquedu/public_html/forums/Sources/Recent.php
Line: 102

Try this (reply #111 on page 6):
http://www.simplemachines.org/community/index.php?topic=64492.msg694947#msg694947

Sarge! That worked perfectly, thank you! 

And thanks again to every contributer for this mod.  I'm sure i'll have more questions, but for right now.. wow.  Just what I've been looking for.

Jacque
Title: Re: Shared Forum Mod
Post by: chippa on November 07, 2007, 02:15:30 AM
i'm stuck on point 4

Quote4. Manually add the following fields to the table you just created:
Example:
forumName   catList
x.yoursite.com   1,2,3,10
y.yoursite.com   4,5,6,10
z.yoursite.com   7,8,9,10
.. so for every domain you can specify the categories.
In this example, domain x.yoursite.com shows category 1,2,3 and 10.
domain y.yoursite.com shows category 4,5,6,10.
As you can see, category 10 is visible for both domains.

have created the table, _forums

and it has the fields forumname and catlist in it. but i am unsure  as to how i add the extra information into it regarding the subdomains and which categories they point to.

any help?
Title: Re: Shared Forum Mod
Post by: Mr. Jinx on November 07, 2007, 04:00:58 PM
In step 1 you've setup your basic forum right?
You will have to make the different categories in that forum.
In each category you can make different boards. This is just some standard SMF stuff.

If you look at the link to a category, you will see it has a unique number.
This is the number you have to specify in 'catlist'. You simply insert this in you mysql table along with the desired subdomain.

Title: Re: Shared Forum Mod
Post by: chippa on November 08, 2007, 06:26:14 PM
yeah, i have created the categories. i can see their numbers, have also created the subdomains. what im unsure about is how to actually add that data into the mysql table.

also
Quotethis subdomain should point to forum.yousite.com (no redirects)

does this mean that when creating the subdomains that the document root should be the folder that the forum is installed in?

Title: Re: Shared Forum Mod
Post by: Mr. Jinx on November 08, 2007, 07:55:18 PM
Quote from: chippa on November 08, 2007, 06:26:14 PM
does this mean that when creating the subdomains that the document root should be the folder that the forum is installed in?

It depends on what control panel you use how they call it.
I've used direct admin, and there you can make "domain pointers". So when you installed your forum on the domain forum.domain.com you would make a domain pointer xyz.domain.com pointing to forum.domain.com. You could also make a CNAME.
Title: Re: Shared Forum Mod
Post by: chippa on November 08, 2007, 07:59:26 PM
ok, ill play with that one and see what i come up with...

still unsure about how to add the correct data to the mysql database though.

sorry about the ignorance, i know bits and pieces, but some stuff i need my hand held for a bit.
Title: Re: Shared Forum Mod
Post by: Fatherguido on December 01, 2007, 10:04:24 AM
Is it possible to have each instance with a different theme? As an example if I were to divide by different types of pets -

when someone went to

dog.allaboutpets.com   could they see a dog related theme
cat.allaboutpets.com    a cat related, etc?
Title: Re: Shared Forum Mod
Post by: capnken on December 31, 2007, 08:59:43 AM
Nice work by everybody who has been poking at this. Following the non-Joomla install explained by Mr. Jinx in reply 244 works great, but can someone confirm whether the tweak in reply 111 to restrict posts in Recent Posts to the boards defined by subdomains works with 1.1.4? I've made those modifications, but obviously it's not working for me or I wouldn't be posting this.

In plain English, I have boards restricted by subdomain, and I need to have ?action=recent and ?action=unread only show posts from boards visible in the subdomain restriction. Disabling those actions isn't a viable option for me.

I'd also like to implement a similar restriction for Search, Latest Posts by Member, etc., but those are issues to tackle after I've resolved the bigger Recent and Unread issues.
Title: Re: Shared Forum Mod
Post by: Simbyte on January 06, 2008, 03:46:48 PM
Hello,

I've got a question:

The domain isn't at the same space as the forum files.

So the subdomain forum.domain.com leads to filespace.com/SMF

Now you say "this subdomain should point to forum.yousite.com (no redirects)"


Do I have to point it to filespace.com/SMF or to  forum.domain.com?


Yours Simbyte
Title: Re: Shared Forum Mod
Post by: Simbyte on February 05, 2008, 08:16:59 PM
No one's got an idea? Or haven't I described the problem properly?
Title: Re: Shared Forum Mod
Post by: Sarge on February 06, 2008, 01:51:03 AM
Quote from: Simbyte on January 06, 2008, 03:46:48 PM
Do I have to point it to filespace.com/SMF or to  forum.domain.com?

Why not try both? :)
Title: Re: Shared Forum Mod
Post by: Hotel on March 29, 2008, 12:04:17 AM
Quote from: ShopHRM on February 20, 2007, 11:01:34 PM
Quote from: kingconnor on March 22, 2006, 06:01:37 PM
Just letting people know this is how to associate a theme with each separate forum. Please bear with me I'm a newbie to php

Step1: Create a new field in the smf_forums table called forumTheme and set to int.

Step 2: in the new field you have created (forumTheme) put the ID_THEME number you wish to associate with the forum (found in smf_themes table)

Step 3: Open up index.php under the root of your forum. Find line number 148 should be loadTheme(); replace with:

$database->setQuery( "SELECT DISTINCT forumTheme
                    FROM #__smf_forums
                    WHERE forumName='".$_REQUEST['forum']."'");
                   
$forumTheme = $database->loadResult();
   
loadTheme($forumTheme);

Quote from: Goosemoose on March 22, 2006, 01:05:21 PM
Yeah I did notice that too. I haven't had a chance to look at the code that creates the collapsable boards. Basically you would just need to make sure the code there matches the code changed in Load.php. If you find it let me know, I'm really strapped for time right now.

Yep I will check it out at some point and let you all know.

Regards

da king  ;D


I saw someone else get an error for this but i couldnt find the fix so I will ask again, I tried this and I got this error

Fatal error: Call to a member function setQuery() on a non-object in /home/.maren/mytestsite/mytestsite.hfxgaming.com/forum/index.php on line 150


I tried to change "FROM #__smf_forums" to "FROM smf_forums" but i get the same error.

I am using smf 1.1.2 with smf_1-1_joomla_1-0-x_bridge_1-1-7 and Joomla_1.0.12-Stable-Full_Package
I also get that  error is there a fix for it??
Title: Re: Shared Forum Mod
Post by: kai920 on June 08, 2008, 04:53:37 AM
Has anyone used this mod with Mambo?
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on July 26, 2008, 06:28:47 PM
I did... But I stop... It is very much working perfectly...
Title: Re: Shared Forum Mod
Post by: Hotel on October 31, 2008, 10:27:39 PM
is there any chance of a smf 2.0 version of this?
Title: Re: Shared Forum Mod
Post by: Kindred on November 03, 2008, 07:39:09 AM
since there is no longer an SMF/Joomla bridge....    I doubt it.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on November 03, 2008, 08:11:40 AM
Quote from: Hotel on October 31, 2008, 10:27:39 PM
is there any chance of a smf 2.0 version of this?
Well, I am not so sure about this. The coding is different in 2.0. So I am not sure whether this is possible though I am interested to try.
Title: Re: Shared Forum Mod
Post by: Simbyte on November 03, 2008, 09:44:16 AM
I would be very interested in that, too. The Shared Forum Mod is a very important part of my forum. Without it, I can't switch to SMF 2.0.
Title: Re: Shared Forum Mod
Post by: Kindred on November 03, 2008, 01:29:20 PM
Quote from: Kindred on November 03, 2008, 07:39:09 AM
since there is no longer an SMF/Joomla bridge....    I doubt it.
Title: Re: Shared Forum Mod
Post by: Simbyte on November 03, 2008, 03:35:55 PM
I don't use joomla in my old version either, I just use this system to separate the different areas of a very big forum.
Title: Re: Shared Forum Mod
Post by: Kindred on November 03, 2008, 04:28:51 PM
Well, THIS mod was designed for bridged systems....   and so.........
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 26, 2009, 07:16:52 PM
I'll be looking at this again soon as I'm about to switch to 2.0. There is a Joomla/SMF mod again using JFusion as I'm sure you guys know.
Title: Re: Shared Forum Mod
Post by: Orstio on January 27, 2009, 12:16:29 AM
You'd be better off looking at SJSB, and updating the Shared Forum mod for 2.0. 
Title: Re: Shared Forum Mod
Post by: Goosemoose on January 27, 2009, 01:58:18 AM
I'll check that out then, thanks Orstio.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on January 27, 2009, 04:49:00 PM
SJSB is still alpha...
Title: Re: Shared Forum Mod
Post by: ilwoody on January 27, 2009, 04:52:38 PM
That alpha state is more valuable than a lot of BETA around ;)
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on January 27, 2009, 04:54:33 PM
Yeah... it works well though... I used both JFusion & SJSB in one site
Title: Re: Shared Forum Mod
Post by: Ronny on January 30, 2009, 02:30:49 PM
I love SJSB very much, even in alpha state :-)
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 03, 2009, 11:45:57 AM
I sure like to attempt shared forum mod using sjsb with smf 1.1.7. Hopefully nothing much changed. But I have to understand nicholas view.php first. He created for almost each and every main menu action. Plus, I am not even a coder.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 03, 2009, 02:37:16 PM
Anyone want to try this mod on SJSB + smf 1.1.7?

I do this and the Shared Forum Mod works in Joomla 1.5.9 using SJSB + smf 1.1.7.

First follow all instructions at post #1 except step #5 (orstio, goosemoose & Kingconnor).

Edit as per post #111 (sarge)

Find at around line 182 in administrator/components/com_smf/helper.php:
return 'index.php?option=com_smf&Itemid='.$Itemid;

Change to:
return 'index.php?option=com_smf&Itemid='.$Itemid.'&forum='.$_REQUEST['forum'];

Thanks to orstio, goosemoose, Kingconnor, sarge, ilwoody and all others for this.

Good luck!
Title: Re: Shared Forum Mod
Post by: FidelGonzales on February 05, 2009, 01:25:00 PM
Quote from: Simbyte on November 03, 2008, 09:44:16 AM
I would be very interested in that, too. The Shared Forum Mod is a very important part of my forum. Without it, I can't switch to SMF 2.0.

That's the problem with mods that are not heavily supported and able to adapt to newer versions.

Since you are using it, what is the practical application and significance of such a mod? I see some benefit but do not quite grasp it. Thanks.
Title: Re: Shared Forum Mod
Post by: Orstio on February 06, 2009, 11:43:15 PM
QuoteSince you are using it, what is the practical application and significance of such a mod?

The practical application is to keep completely separate forums for different genres of discussion.

Goosemoose's pet site is a prime example -- He has separate forums for each type of pet, each with their own unique boards.  There are also general boards that appear in all forums simultaneously.

So, it's like having one login for multiple forums, and dog owners don't have to have their page cluttered up with cat boards and vice versa.
Title: Re: Shared Forum Mod
Post by: FidelGonzales on February 07, 2009, 11:02:56 PM
Quote from: Orstio on February 06, 2009, 11:43:15 PM

The practical application is to keep completely separate forums for different genres of discussion.

Goosemoose's pet site is a prime example -- He has separate forums for each type of pet, each with their own unique boards.  There are also general boards that appear in all forums simultaneously.

So, it's like having one login for multiple forums, and dog owners don't have to have their page cluttered up with cat boards and vice versa.

Thank you for your response.

I looked at this yesterday and saw that in spite of how large the forum was, it was very well organized, due in great part to the referenced mod. Once I understood what I had previously overlooked, I was impressed. Great work.

Thanks again.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 11, 2009, 08:40:12 AM
Quote from: ahrasis on February 03, 2009, 02:37:16 PM
Anyone want to try this mod on SJSB + smf 1.1.7?

I do this and the Shared Forum Mod works in Joomla 1.5.9 using SJSB + smf 1.1.7.

First follow all instructions at post #1 except step #5 (orstio, goosemoose & Kingconnor).
Quote from: ahrasis on February 03, 2009, 11:45:57 AM
I sure like to attempt shared forum mod using sjsb with smf 1.1.7. Hopefully nothing much changed. But I have to understand nicholas view.php first. He created for almost each and every main menu action. Plus, I am not even a coder.
Edit as per post #111 (sarge)

Find at around line 182 in administrator/components/com_smf/helper.php:
return 'index.php?option=com_smf&Itemid='.$Itemid;

Change to:
return 'index.php?option=com_smf&Itemid='.$Itemid.'&forum='.$_REQUEST['forum'];


It also works with 1.1.8. Just to note that SJSB doesn't support 1.1.x anymore. But all the latest com, mod and plugin works with warnings! (Can be turned off if you want). I used SJSB 1.0.9b smf mod for that. I attach that here for those who need it.

I will post the link for sample later. Use it with care (always back up) as SJSB bridge is still alpha.
Title: Re: Shared Forum Mod
Post by: ~Killer~ on February 13, 2009, 04:07:12 PM
Mmm, I can't seem to do this at all, can someone help me?
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 15, 2009, 06:47:53 PM
What do you need my friend?
Title: Re: Shared Forum Mod
Post by: ~Killer~ on February 16, 2009, 05:10:30 AM
What do I need? I need it done to my forums, thats what, I don't feel comfortable doing it myself on my main forum when I can't even do it on a test forum. I'm using 2.0 BETA 4, it is compatible with that isn't it? Please say yes ;'( (On the test forum I used 1.1.8).
Title: Re: Shared Forum Mod
Post by: Kindred on February 16, 2009, 02:34:30 PM
I do not think it has been upgraded to 2.0 yet.
Title: Re: Shared Forum Mod
Post by: Goosemoose on February 16, 2009, 04:36:34 PM
Quote from: FidelGonzales on February 05, 2009, 01:25:00 PM
Quote from: Simbyte on November 03, 2008, 09:44:16 AM
I would be very interested in that, too. The Shared Forum Mod is a very important part of my forum. Without it, I can't switch to SMF 2.0.

That's the problem with mods that are not heavily supported and able to adapt to newer versions.

Since you are using it, what is the practical application and significance of such a mod? I see some benefit but do not quite grasp it. Thanks.

The shared forum mod was heavily support but it relied on the Joomla bridge which was pulled so it could not continue to be developed. Now that SJSB is heading in the same direction it's a possibility to get it going again.
Title: Re: Shared Forum Mod
Post by: Goosemoose on February 16, 2009, 04:38:32 PM
Ahrasis, nice job and thanks for picking this up. It'll be a few weeks before I can start looking at a 2.0 port so if anyone is up to the task, feel free :)
Title: Re: Shared Forum Mod
Post by: ~Killer~ on February 16, 2009, 05:18:29 PM
Lol, don't expect me to jump across for the coding side of this, I need this for 2.0 BETA 4 (m'eh, RC1 aswell, but thats not my main forum), and it installed for me, please look into it ASAP, I really need this :'(
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 17, 2009, 09:28:38 AM
Quote from: ~Killer~ on February 16, 2009, 05:18:29 PM
Lol, don't expect me to jump across for the coding side of this, I need this for 2.0 BETA 4 (m'eh, RC1 aswell, but thats not my main forum), and it installed for me, please look into it ASAP, I really need this :'(
If you need help of setting this mod up with smf 2.0 b4 or rc1, I could not help you. I can only help you in doing this with smf 1.1.x. The SJSB must be used to bridge between Joomla 1.5.9 and smf 1.1.x.

But you can use Jfusion together to synchronize user between smf and joomla as SJSB is not ready for that yet.

I am trying to prepare this mod in a package but has yet to complete it. My knowledge is really limited and I am referring to other Mods as guidelines.
Title: Re: Shared Forum Mod
Post by: ~Killer~ on February 17, 2009, 10:15:13 AM
Whats SJSB by the way? And as said in the OP, you don't need Joomla...

I can't wait a few weeks :'(
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 17, 2009, 10:29:52 AM
Err... If you dont use Joomla you may go for other related mods but this surely is not for you. The OP said so.
Title: Re: Shared Forum Mod
Post by: ~Killer~ on February 17, 2009, 11:23:40 AM
The OP said "Ok, you can do it without the Mambo/Joomla bridge but it's no where near as good." - You can still use it without...
Title: Re: Shared Forum Mod
Post by: FidelGonzales on February 17, 2009, 02:30:54 PM
BRIDGE COMPONENT PAGE
http://www.youpokeme.com/sjsb/

GOOGLE CODE PAGE
http://code.google.com/p/sjsb/

JOOMLA EXTENSIONS PAGE
http://extensions.joomla.org/extensions/5388/details
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 17, 2009, 03:18:03 PM
Quote from: ~Killer~ on February 17, 2009, 11:23:40 AM
The OP said "Ok, you can do it without the Mambo/Joomla bridge but it's no where near as good." - You can still use it without...
Yes, that what it says which means it cannot be use without Mambo/Joomla bridge (or its equivalent i.e. in this case SJSB). I am so sorry.
Title: Re: Shared Forum Mod
Post by: ~Killer~ on February 17, 2009, 05:48:03 PM
Quote from: ahrasis on February 17, 2009, 03:18:03 PM
Quote from: ~Killer~ on February 17, 2009, 11:23:40 AM
The OP said "Ok, you can do it without the Mambo/Joomla bridge but it's no where near as good." - You can still use it without...
Yes, that what it says which means it cannot be use without Mambo/Joomla bridge (or its equivalent i.e. in this case SJSB). I am so sorry.

What do you mean?
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on February 18, 2009, 08:13:19 AM
This mod is originally meant for Mambo/Joomla with smf supported bridge user. That means you must have smf bridged with either Mambo or Joomla for it to work. The supported bridge to Joomla is already stopped but it has been updated to work with Mambo. However, if you use unsupported bridge of SJSB you can still successfully implement this mod too as per my explanation.

The current latest available combination are:
1. SMF 1.1.8 + Mambo 4.6.5 (using official smf bridge).
2. SMF 1.1.8 + Joomla 1.5.9 (using SJSB bridge).

Other then that, I do not know. You can try Sarge Shared Forum Mod at http://www.simplemachines.org/community/index.php?topic=158330.0 (http://www.simplemachines.org/community/index.php?topic=158330.0) which uses TP+SMF combination or Pedja Multidomain SMF forum mod at http://www.simplemachines.org/community/index.php?topic=171340.0 (http://www.simplemachines.org/community/index.php?topic=171340.0).
Title: Re: Shared Forum Mod
Post by: Mr. Jinx on March 30, 2009, 02:43:38 PM
Quote from: ahrasis on February 17, 2009, 03:18:03 PM
Yes, that what it says which means it cannot be use without Mambo/Joomla bridge (or its equivalent i.e. in this case SJSB). I am so sorry.
It can be used without mambo/joomla, however this was for smf 1.1.4
Don't know if it's still working because I'm not using it anymore:
http://www.simplemachines.org/community/index.php?topic=64492.msg1260265#msg1260265
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on June 26, 2009, 11:57:32 PM
I guess I was wrong. It can be done standalone without Joomla/Mambo... I read your previous post. Impressive. Though I never try it before. Just, curious how it works? Any demo site?
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on March 12, 2010, 05:16:42 AM
I think this mod has been replaced by Multiple Forum Mod which runs as standalone rather than bridged with Joomla or other CMS.

The mod is here: http://custom.simplemachines.org/mods/index.php?mod=2137
Its support is here: http://www.simplemachines.org/community/index.php?topic=349954.0

It works almost the same.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on March 17, 2010, 07:46:21 AM
Quote from: Abu Fahim Ismail on March 12, 2010, 05:16:42 AM
I think this mod has been replaced by Multiple Forum Mod which runs as standalone rather than bridged with Joomla or other CMS.

The mod is here: http://custom.simplemachines.org/mods/index.php?mod=2137
Its support is here: http://www.simplemachines.org/community/index.php?topic=349954.0

It works almost the same.

However, I really think that this mod is much more superior. I have found the files needed to do modifications to apply this mod on SMF 2.0 RC3 as a standalone. But it is not working. May be somebody can help me out here.

I will list the modifications that I attempted:

1.  Install forum
- On a subdomain, for example forum1.yoursite.com. This will be you *main* forum with all categories visible. (by Mr. Jinx)


2. Create a subdomain
- For every forum you want, this subdomain should point to forum1.yoursite.com (no redirects) (by Mr. Jinx)


3. Run phpMyAdmin
(Goosemoose note: If your prefix isn't smf_ , make sure to change it.)

CREATE TABLE IF NOT EXISTS `smf_forums` (
  `forumName` text NOT NULL,
  `catList` varchar(128) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



4. Creating / Inserting data.
(This category must exist i.e. already created.)

forumName catList
forum1.yoursite.com 1,2,3,4
forum2.yoursite.com 1,5,6,7
forum3.yoursite.com 1,4,8,9


5. Modifications

5.1 Load.php
Find:
$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.member_groups) != 0 OR FIND_IN_SET(', $user_info['groups']) . ', b.member_groups) != 0' . (isset($user_info['mod_cache']) ? ' OR ' . $user_info['mod_cache']['mq'] : '') . ')';
Add After:
// Added for the multiple forum mod
     if(!isset($_REQUEST['action']) && !isset($_REQUEST['board']) &&!isset($_REQUEST['topic'])){
      $domain = $_SERVER['SERVER_NAME'];
           $forumList = db_query("SELECT catList FROM {db_prefix}forums WHERE forumName = '$domain'", __FILE__, __LINE__);
          $row_forumList = mysql_fetch_assoc($forumList);
           $user_info['query_see_board'] .= ' AND FIND_IN_SET(b.ID_CAT, "' . $row_forumList['catList'] . '")';
     }


5.2 - Subs-BoardIndex.php
A. Find:
// Find all boards and categories, as well as related information.  This will be sorted by the natural order of boards and categories, which we control.
Add Before:
   // Added for the multiple forum mod
    if(!empty($_REQUEST['forum']) && !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);
     $user_info['query_see_board'] .= ' AND FIND_IN_SET(b.ID_CAT, "' . $row_forumList['catList'] . '")';
   }


B. Find:
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),

Replace:
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)) . ' ORDER BY "{db_prefix}categories.cat_order", b.board_order ASC',

5.3 Settings.php
B. Find:
$boardurl = '.....';
Replace:
$boardurl = 'http://' . $_SERVER['SERVER_NAME'];


6. Modify Feature Configuration
(Mr. Jinx note: This step is optional. If you want your users to stay online on all forums, you'll have to change the following settings:)

Admin > Server Settings > Feature Configuration >  Enable local storage of cookies = DISABLED
Admin > Server Settings > Feature Configuration >  Use subdomain independent cookies = ENABLED


I have tried and it makes no affect. Please feel free to point and correct any mistakes. Thanks.

Maybe, the standalone domain name is not working well. I will try with bridged version later.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on March 18, 2010, 07:19:02 AM
I have made several attempts for the standalone with several results.

I manage to get all domains reading but get the only specific categories appear.

I also have made references to several other mods i.e. Multidomain SMF forum http://www.simplemachines.org/community/index.php?topic=171340.0 and Multiple Forum Mod http://custom.simplemachines.org/mods/index.php?mod=2137.

All I can say based on my experiment is that this mod and Multidomain SMF forum needs some further modifications to suit SMF 2.0 RC3. Multiple Forum Mod (package mod), however, works with minor problems i.e. you must manually enter data at MySQL/MyPhpAdmin. (I dont care much about manual entry as this what this mod was at the beginning)

If anybody modified this and tried with success, do share. Cheers.
Title: Re: Shared Forum Mod
Post by: Kasp on March 18, 2010, 01:48:07 PM
i uploaded a file that i modified of the original multi_foum_mod

can be found at

http://www.simplemachines.org/community/index.php?topic=349954.msg2538812#msg2538812
Title: Re: Shared Forum Mod
Post by: ~DS~ on March 18, 2010, 01:59:38 PM
Multiple  Forum Mod is much more simple and friendly IMO.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on March 18, 2010, 06:02:54 PM
I missed that post. Thanks a lot.
Title: Re: Shared Forum Mod
Post by: kingkingston on March 29, 2010, 04:44:56 AM
Quote from: Dismal Shadow on March 18, 2010, 01:59:38 PM
Multiple  Forum Mod is much more simple and friendly IMO.
yes it is but there are some flaws in it
Title: Re: Shared Forum Mod
Post by: ~DS~ on March 29, 2010, 04:47:56 AM
Quote from: kingkingston on March 29, 2010, 04:44:56 AM
Quote from: Dismal Shadow on March 18, 2010, 01:59:38 PM
Multiple  Forum Mod is much more simple and friendly IMO.
yes it is but there are some flaws in it
What is? Would you reconsidering using this? Shared Forum isn't even a mod.
Title: Re: Shared Forum Mod
Post by: kingkingston on March 29, 2010, 04:53:35 AM
Quote from: Dismal Shadow on March 29, 2010, 04:47:56 AM
Quote from: kingkingston on March 29, 2010, 04:44:56 AM
Quote from: Dismal Shadow on March 18, 2010, 01:59:38 PM
Multiple  Forum Mod is much more simple and friendly IMO.
yes it is but there are some flaws in it
What is? Would you reconsidering using this? Shared Forum isn't even a mod.
I don't mind using this mod, it is a great mod for different reasons but it just has a few little things that need to be fixed
Title: Re: Shared Forum Mod
Post by: luismanson on May 08, 2010, 05:09:06 PM
this wont work with RC3, right?
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on May 10, 2010, 04:21:16 AM
Quote from: luismanson on May 08, 2010, 05:09:06 PM
this wont work with RC3, right?
No, not yet... Nobody is taking over to make it work for SMF 2.0 RC3. I know of one mod that try to package this into mod but was aborted. I never really had a chance to look into it.
Title: Re: Shared Forum Mod
Post by: Kindred on May 10, 2010, 08:12:39 AM
this will never be made for 2.0, since this mod is dependent on the smf/joomla bridge... which is discontinued.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on May 11, 2010, 10:53:49 AM
Quote from: Kindred on May 10, 2010, 08:12:39 AM
this will never be made for 2.0, since this mod is dependent on the smf/joomla bridge... which is discontinued.
There is a mod within this mod that make it possible as a standalone. I really believe that there is a packaged mod on this which was aborted. I will forward this later.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on May 11, 2010, 11:24:46 AM
This is it. Shared Forums for SMF 2.0 http://custom.simplemachines.org/mods/index.php?mod=1936

Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on August 08, 2010, 09:21:00 PM
I have successfully done this with SMF 2.0 RC3. It is a multiple / sub domain shared forum mod. Categories can be shared.

However, I need to do some more testing. What I need?

1. I need to create a function that can create the required database tables.

2. I also need to create a function / set up a menu in admin control panel that would allow inserting data directly to the created table.

If anybody can guide me on this, I will package this mod for SMF 2.0 RC3.
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on September 21, 2010, 06:17:02 AM
I have forwarded the ideas to PortaMX and they have developed a very good mod for this and it is called a subforums mod. Those who are in need of this mod may request it from PortaMX (feline). They will release their beta soon an d it will also be packed together with PortaMX Portal mod.
Title: Re: Shared Forum Mod
Post by: feline on September 21, 2010, 01:52:35 PM
We have this mod developed yesterday for a wide open testing purpose.
You find more informations and download on http://portamx.com/topic_2008.0.html

Fel
Title: Re: Shared Forum Mod
Post by: Hj Ahmad Rasyid Hj Ismail on September 21, 2010, 02:46:35 PM
Great news! I will try this latest one soonest.