Author Topic: Shared Forums  (Read 577 times)

0 Members and 1 Guest are viewing this topic.

Offline Hoodie

  • New Member
  • *
  • Posts: 2
  • Karma: 0
  • Gender: Male
    • Auto Junkiez
  • SMF Version: 2.0 RC3
Shared Forums
« on: April 10, 2010, 09:04:46 PM »
Hey everyone..  I see a lot of great coders here on this site so I'm hoping that someone might be able to help me out..

What I'm trying to do is create a network of automotive websites that have a shared userbase and shared posting but have categories/boards visible based on the URL they are viewing them from..  There is already code written for SMF 1.1.x located here:

http://www.simplemachines.org/community/index.php?topic=171340.0

I've tried that out and it works great on 1.1.x..  No errors and seems the best way to do it..

Now, I want this to be done for SMF2 series so that I don't have to go back to 1.1.x theme edits and modifications..  I've been working with 2.0 since Beta 3.1 was released..

Could anyone please update the Source edits from above post to be compatible with RC3?

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13215
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Shared Forums
« Reply #1 on: April 11, 2010, 12:14:01 AM »
Better to ask the author of the post to do this as it is his code. What edits in the code do not work.

Offline Hoodie

  • New Member
  • *
  • Posts: 2
  • Karma: 0
  • Gender: Male
    • Auto Junkiez
  • SMF Version: 2.0 RC3
Re: Shared Forums
« Reply #2 on: April 12, 2010, 12:17:32 AM »
I would ask the guy who's code it is but he hasn't been on since December 28th, 2008..  I don't think he'd respond..

Anyways, after trying the manual edits, this is what is different:

: 1.1.x
Open Sources/BoardIndex.php and find
:
    AND b.childLevel <= 1" : ''), __FILE__, __LINE__);
Replace it with
:
    AND b.childLevel <= 1" : '') . " ORDER BY c.catOrder, b.boardOrder ASC" , __FILE__, __LINE__);

This is the closest thing I can find in 2.0, in Subs-BoardIndex.php:
:
            AND b.child_level >= {int:child_level}') : '
            AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),

: 1.1.x
Open Sources/Recent.php

Find function getLastPosts and within the first SQL query search for
:
   WHERE m.ID_MSG >= " . max(0, $modSettings['maxMsgID'] - 20 * $showlatestcount) . "
   AND t.ID_TOPIC = m.ID_TOPIC

Replace it with
:
   WHERE t.ID_TOPIC = m.ID_TOPIC

And the closest I can find in 2.0, Subs-Recent.php:

:
        WHERE m.id_msg >= {int:likely_max_msg}' .
            (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
            AND b.id_board != {int:recycle_board}' : '') . '
            AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
            AND t.approved = {int:is_approved}
            AND m.approved = {int:is_approved}' : '') . '

Or in Recent.php:
:
        WHERE {query_wanna_see_board}' . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? '
            AND b.id_board != {int:recycle_board}' : '') . '
            AND ml.approved = {int:is_approved}

: 1.1.x
Now, open Sources/BoardIndex.php and find
:
ORDER BY c.catOrder
And replace it with
:
ORDER BY IFNULL(dc.catOrder, c.catOrder)

That is part of the inserted code from earlier so I don't know what to do with that..

Everything else seems to install fine though..  Not sure if it's those few edits are missing or not but I'm getting a 500 Internal Server Error..
« Last Edit: April 12, 2010, 12:19:47 AM by Hoodie »

Offline bigguy

  • Site Owner
  • Administrator
  • *
  • Posts: 13215
  • Karma: 269
  • Gender: Male
  • Get'r Done
    • P.C. Tweakr
  • SMF Version: 2.0 Gold
Re: Shared Forums
« Reply #3 on: April 12, 2010, 06:50:55 AM »
I don't have time right now to look through it as I am getting ready for work. However I should have a shrt day today so I can look when I get back.

Offline Cholo

  • Global Moderator
  • *
  • Posts: 1737
  • Karma: 681
  • Gender: Male
    • The Tarheel Forum
Re: Shared Forums
« Reply #4 on: April 12, 2010, 12:27:05 PM »
Cool idea, I know I've come across people asking about this somewhere before.  I probably won't have time to look until Tuesday, sorry.