Shared Forum Mod

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

Previous topic - Next topic

Neol

#120
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&Itemid=' . $Itemid . '&';

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&Itemid=' . $Itemid . '&'
. (isset($_REQUEST['forum']) ? 'forum='.$_REQUEST['forum'].'&' : '');




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

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


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.

manuelap

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?

Neol

Did you try my other instructions above?

manuelap

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 <[email protected]>

* @author      Wolverine <[email protected]>

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

* @license     http://www.gnu.org/copyleft/gpl.html [nofollow] 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 [nofollow] $

* @link        http://www.joomlahacks.com [nofollow]

* @since       File available since Release 1.0

*

* Visit JoomlaHacks.com [nofollow] 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;

}



?>

Neol

#124
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!



manuelap

I will  try to get my hands on the official bridge, install it and follow your instructions.....

Goosemoose

To back up what olti said, this mod will not work with the joomla hacks bridge. Orstios bridge is the only bridge we support.

Neol

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".

Goosemoose

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.

Neol

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

Neol

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.

Goosemoose

It works in a normal reply, but not a quick reply on goosemoose.com forums.

Neol

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?

EvilGeneral

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:



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 =|

Goosemoose

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.

smoothify

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

Goosemoose

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.

Mr. Doug

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?

--
Doug Hardman
doug (at) puttertalk (dot) com

DenDen60

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


Goosemoose

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.

Advertisement: