Shared Forums for SMF 2.0

Started by simmaster, July 07, 2009, 05:55:31 AM

Previous topic - Next topic

simmaster

Demo: Before / After (category ID #1)


Link to Mod

Please note:
There is yet another bug in the install script that causes db_create_table to fail and continue installation. When installation is complete, please run this code in phpMyAdmin or wait for the next patch.

CREATE TABLE `{db_prefix}forums` (
`forum_name` VARCHAR( 255 ) NOT NULL ,
`cat_list` VARCHAR( 255 ) NOT NULL
);
INSERT INTO {db_prefix}forums (forum_name, cat_list) VALUES ("one", "1");

Remember to replace {db_prefix} with whatever your database prefix is.


Shared Forums for SMF 2.0
Created by simmaster07
Original concept by Goosemoose and Orstio

This mod allows you to add shared forums to your website. You can split your one large forum into smaller, separate forums and access them with a simple URL tweak. For example, if you assign the category IDs 1,2,3,5,8 to the forum name "fibonacci," you can access this page by changing the url to http://mysite.com/index.php?forum=fibonacci (changing mysite.com to wherever your site is and fibonacci to whatever the forum name is.) Using the power of PHP arrays, you can create an unlimited amount of forums divided by an unlimited amount of categories by splitting them with spaced colons ( : ).

The code was modified to work with SMF 2.0 and adds a section in the Modifications panel to add your shared forums.

EXAMPLE:

Forum Names:  math : stuff : cows : smf
Category IDs: 1,2,5 : 3,4 : 6,7 : 8,9


The forum "math" will be assigned to categories 1, 2 and 5 and would be found at ?forum=math (without rewriting) or /forum,math with rewriting.

NOTE: It is unclear if this mod is compatible with PortaMX, SimplePortal or EZPortal! This is a beta. Use at your own risk!

CHANGELOG / TO-DO

+ 7/1/2009 - Original release
  + Code now SMF 2.0 compatible
  + Area in admin panel for control
  + Wireless compatible
+ 7/6/2009 - Release to Mod Site
  + Fixes
    + Replaced several database queries with more proper database queries
+ 7/7/2009 - Emergency patch
  + Fixes
    + Fixes fatal installation bug
  ! Features
     ! Now has $smcFunc['db_free_result'] to avoid memory hogging
 
~ TO-DO
  ~ Shared forums have separate titles
  ~ Shared forums have individual settings, members, admins, etc.
  ~ Modules (existing modifications that are modified for shared forums)
  ~ Improved admin panel
  ~ Shared forums have separate permissions (admin panel and frontend)
  ~ Not much else but bugfixes

Eliana Tamerin

Whoa, color me pink here. This is an impressive feature list. Be sure to shout it to the heavens when it's ready to be downloaded, I'd certainly like to test this out, and test it with SimplePortal.

Though, as a correction, TinyPortal is not yet compatible with SMF 2.0, so the portal softwares you should be warning against are SimplePortal, PortaMX and EZPortal.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Angelotus

Cool mod, after trying to install got this error, and the install stopped:

Duplicate entry 'sharedforum_catarray' for key 1
File: /customers/weeklyfun.nl/weeklyfun.nl/httpd.www/forum/Packages/temp/install.php
Line: 8


Eliana Tamerin

Quote from: Angelotus on July 07, 2009, 10:51:26 AM
Cool mod, after trying to install got this error, and the install stopped:

Duplicate entry 'sharedforum_catarray' for key 1
File: /customers/weeklyfun.nl/weeklyfun.nl/httpd.www/forum/Packages/temp/install.php
Line: 8


Did you notice the warning in bold on top of the post and in the mod description?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

simmaster

#5
This would've been a lot easier if my test server hadn't stopped responding and my main site's host had crashed. I'm probably the luckiest person in the world. :P

heinandar

LOL........Nice Mod ..
I'm hoping for smf 1.1.9 also
I also need this mod.

simmaster

Quote from: heinandar on July 07, 2009, 01:21:27 PM
LOL........Nice Mod ..
I'm hoping for smf 1.1.9 also
I also need this mod.
This mod is just a conversion of some code from 1.1 to 2.0, but I will add new features in the future.
Original topic


simmaster

Almost ready for a finished release here (I hope)

simmaster

Shared Forums 0.8 Emergency Patch Release
CHANGELOG:
+ Fixes fatal installation bug
+ Now has $smcFunc['db_free_result'] to avoid memory hogging

Groundhog

Hi simmaster07

I'm looking forward to trying this out but I got this message after installing and also when trying to apply the changes in the "Miscellaneous" section. I used the latest update for the mod.

Database Error
Table '******_smf1.smf_forums' doesn't exist
File: /home/******/public_html/home/Sources/ManageSettings.php
Line: 2061


Is there something I can do here to sort the problem?

Thanks

Angelotus

Quote from: Eliana Tamerin on July 07, 2009, 11:05:17 AM
Quote from: Angelotus on July 07, 2009, 10:51:26 AM
Cool mod, after trying to install got this error, and the install stopped:

Duplicate entry 'sharedforum_catarray' for key 1
File: /customers/weeklyfun.nl/weeklyfun.nl/httpd.www/forum/Packages/temp/install.php
Line: 8


Did you notice the warning in bold on top of the post and in the mod description?

That is not an answer! Offcourse I saw the warning, so what?
Anyway, I will try it out some time later...

Eliana Tamerin

That meant that the mod was not safe to use. You should not have expected any success when you tried. The mod author warned you, and you ignored it, what's your complaint?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Angelotus

Eliana, I'm trying to be rude and have no complaints. I was just telling the author what problems I run into while installing this mod. Nothing more, nothing less.

Eliana Tamerin

Do you still have the issue now that he's had time to fix it?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

simmaster

#16
Quote from: Groundhog on July 08, 2009, 02:31:34 AM
Hi simmaster07

I'm looking forward to trying this out but I got this message after installing and also when trying to apply the changes in the "Miscellaneous" section. I used the latest update for the mod.

Database Error
Table '******_smf1.smf_forums' doesn't exist
File: /home/******/public_html/home/Sources/ManageSettings.php
Line: 2061


Is there something I can do here to sort the problem?

Thanks
Looks like db_create_table isn't working properly. I'll probably have to replace db_create_table with db_query in the meantime until I can get it working properly (just as an emergency fix).
Quote from: Angelotus on July 08, 2009, 08:46:02 AM
Eliana, I'm trying to be rude and have no complaints. I was just telling the author what problems I run into while installing this mod. Nothing more, nothing less.
Yes, but the mod was marked unsafe due to an installation glitch, which is what you experienced, so I was completely aware of the issue in the first place. ;)
I don't know what's wrong with this code, especially since it's based off of what I found in SleePy's pastebin... plus, it was working fine for me. :-[

// Create the forums table
$columns_to_insert = array(
array('name' => 'forum_name', 'type' => 'varchar', 'size' => 255, 'null' => 0, 'auto' => 0),
array('name' => 'cat_list', 'type' => 'varchar', 'size' => 255, 'null' => 0, 'auto' => 0)
);

$smcFunc['db_create_table']
(
'{db_prefix}forums', // Table name
$columns_to_insert
);

EDIT: PHP hates me. :P
EDIT (yet again): Why won't you make the table!!

Angelotus

O, sorry I wasn't aware of that, or didn't read to well. Eliana: sorry for the mistake. And bu the way: I ment: I'm NOT trying to be rude ;D ;D ;D
Have tried to install the newer version. It works.

simmaster

Shared Forums 0.8 Emergency Patch Release 2
+ Defined an index so db_create_table would not fail.

Eliana Tamerin

No harm no foul. Now let's just enjoy the mod. ;)
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Advertisement: