Shared Forum Mod

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

Previous topic - Next topic

arez

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

arez


Neol


$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?

Goosemoose

Zeri, are you talking about in the non-joomla version?

Neol

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.

arez

the tpversion should not be different from the smf standalone one becuse tp doesnt supply the mod with variables  

ShopHRM

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

Neol

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.

arez

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

Goosemoose

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.

Neol

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.

arez


Neol

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.

Neol

#213
My SMF+TP version of Shared Forum Mod is near completion. You can read about it here.

Let's not hijack this topic anymore -- after all, it is about the Joomla+SMF version. :)

Goosemoose

Cool! Glad to hear you've got it working!  

MarkJ

#215
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


Goosemoose

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.

MarkJ

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

MarkJ

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.


Advertisement: