News:

Wondering if this will always be free?  See why free is better.

Main Menu

Split Forum Mod

Started by dougiefresh, May 27, 2014, 07:55:49 AM

Previous topic - Next topic

JerzyLS

Index should be generated immediately.
But if it don't generating your index, this is content of mine.

<?php
require_once('[path to your forum root on the server]');
?>


QuoteIf I want to change any setting now, it won't work (even for some core stuff like  "Default time format" ).

I just reported it above - try to clear the cache or disable it.

dougiefresh

#461
@garyee: I'm sorry I haven't been able to reply sooner, as my work schedule has been hectic.  I didn't think that anyone would try to change the primary subforum's location, so I didn't protect against that possibility.... 

Attached is a replacement Subs-SplitForumHooks.php file that you need to place in your forum's Sources folder.  This SHOULD restore the default paths to the subforum tree array, fixing any issues caused by you changing the primary forum's path/URL....

Quote from: JerzyLS on April 27, 2016, 04:51:53 AM
Quote from: garyee on April 26, 2016, 07:06:30 AM
If I want to change any setting now, it won't work (even for some core stuff like  "Default time format" ).
I just reported it above - try to clear the cache or disable it.
I've seen this issue happen with my localhost forum, even with a plain vanilla install (no mods installed), and can't understand why this issue occurs....  I've fixed it temporarily by changing the permissions back to what they should be, but for some reason, they get changed back to a read-only status....  I would suggest changing your permissions on the cache folder to 0644 (I think that's proper) and seeing if it makes a difference.

dougiefresh

Quote from: dougiefresh on April 29, 2016, 09:18:31 AM
Quote from: JerzyLS on April 27, 2016, 04:51:53 AM
Quote from: garyee on April 26, 2016, 07:06:30 AM
If I want to change any setting now, it won't work (even for some core stuff like  "Default time format" ).
I just reported it above - try to clear the cache or disable it.
I've seen this issue happen with my localhost forum, even with a plain vanilla install (no mods installed), and can't understand why this issue occurs....  I've fixed it temporarily by changing the permissions back to what they should be, but for some reason, they get changed back to a read-only status....  I would suggest changing your permissions on the cache folder to 0644 (I think that's proper) and seeing if it makes a difference.
I wrote a quick and not-so-dirty mod to attempt to fix this reported situation.  It's available on my website here: SMF 2.0.x Cache Fix v1.0.....

Adrek

did anyone tried to make it work with Tapatalk?
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

garyee

Hello,

I am currently using your split forum Mod and it is working nicely so far, very nice mod!
Today I ran into a problem with the management of the registration agreements.
I have one main and one child forum and German(-utf8) & English are installed.

1. If there is no agreement.txt or if the agreements files have the wrong name, the select box for the languages is not displayed
(which the user doesn't see if the files are having the right names.) It would be better to generate the select box depending on the installed languages instead of existing files.

2. Php is looking for the agreement files with a wrong name in:"
ManageRegistration.php:201
if (file_exists($boarddir . '/' . $agree . $lang['filename'] . '.txt'))

results in looking for: "pathToForum/agreement.ForumNameLanguage.txt" ("/var/www/vhosts/example.com/agreement.forum1german-utf8.txt")
or "pathToForum/agreementLanguage.txt" (/var/www/vhosts/example.com/agreementgerman-utf8.txt) for the parentForum.

I fixed this by adding a "." after $agree, because that is what php is looking for in line 222

3. The same for:
Register.php: 122 & 123

dougiefresh

Quote from: phantomm on May 08, 2016, 07:55:50 AM
did anyone tried to make it work with Tapatalk?
Sorry about the lateness of my reply.  I haven't tried to make it work with Tapatalk, no....

Quote from: garyee on May 26, 2016, 02:56:30 AM
Hello,

I am currently using your split forum Mod and it is working nicely so far, very nice mod!
Today I ran into a problem with the management of the registration agreements.
I have one main and one child forum and German(-utf8) & English are installed.

1. If there is no agreement.txt or if the agreements files have the wrong name, the select box for the languages is not displayed
(which the user doesn't see if the files are having the right names.) It would be better to generate the select box depending on the installed languages instead of existing files.

2. Php is looking for the agreement files with a wrong name in:"
ManageRegistration.php:201
if (file_exists($boarddir . '/' . $agree . $lang['filename'] . '.txt'))

results in looking for: "pathToForum/agreement.ForumNameLanguage.txt" ("/var/www/vhosts/example.com/agreement.forum1german-utf8.txt")
or "pathToForum/agreementLanguage.txt" (/var/www/vhosts/example.com/agreementgerman-utf8.txt) for the parentForum.

I fixed this by adding a "." after $agree, because that is what php is looking for in line 222

3. The same for:
Register.php: 122 & 123
Sorry about the lateness of my reply.  I've fixed bug #2 and #3 on your list.  Regarding bug #1, the mod only modifies the code so that each subforum has it's own set of agreements....  Although I probably should look at the code that generates subforums further, as I'm not sure that all agreements are duplicated if they are not present....

Adrek

I made few tweaks in TT files and it works nice with mobile app :) I will later post instructions 'how to' if someone is interested.
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

garyee

Hi,

one other thing...

I would want to create a forum with the subforum and they will have the same categories and the same boards.
Thing is, if I want to move a Topic to another board, I can not differentiate between the forum-boards and the subforum-boards.
Would it be possible to prepend the Forum-name on the category-names in the dropdown list where one can chose whereto move the topic to?
I tried working around with dummy boards ... but it is just not right :)

garyee

Hi,
I created a quick mod for the purpose described in the last post (Forum Title in Topic Move-Select), would be nice, if you could integrate it into yours.
http://pastebin.com/nHGYqbVj [nofollow]

dougiefresh

Quote from: phantomm on June 01, 2016, 03:07:11 PM
I made few tweaks in TT files and it works nice with mobile app :) I will later post instructions 'how to' if someone is interested.
Are the tweaks related to this mod?  If so, I would be interested in seeing them.

Quote from: garyee on June 06, 2016, 05:32:31 AM
Hi,
I created a quick mod for the purpose described in the last post (Forum Title in Topic Move-Select), would be nice, if you could integrate it into yours.
http://pastebin.com/nHGYqbVj
Sorry I haven't been around lately.  Life has been hell lately....

Cool beans about your mod!  I'll integrate it into this mod for you!  Thank you!

Tair

Hi everybody!

Is it possible to limit Latest Post from BoardIndex.template.php to show only this subforum's posts ?

Same for usersonline stats and statistic section of  BoardIndex.template.php ?

dougiefresh

Uploaded v1.34 - June 12th, 2016
o SMF 2.0: Fixed issue in MoveTopic.php where destination boards weren't limited to that subforum.
o Added error checking to make sure removal of subforum tree elements doesn't generate errors.
o Added code to always "fix" primary forum URLs and path using defaults in Settings.php.
o Removed ability to change path and URL for primary forum (subforum # 0).
o Fixed issue so that the Alias Boards operations are ignored if it isn't installed.




@Everybody:  I apologize for the lengthy absense.  Life has been hell recently and I've just been trying to keep my head above the water.....

Quote from: garyee on June 06, 2016, 04:50:48 AM
I would want to create a forum with the subforum and they will have the same categories and the same boards.
Thing is, if I want to move a Topic to another board, I can not differentiate between the forum-boards and the subforum-boards.
Would it be possible to prepend the Forum-name on the category-names in the dropdown list where one can chose whereto move the topic to?
I tried working around with dummy boards ... but it is just not right :)
I fixed the mentioned issue within the mod by limiting the destination boards like I did throughout the rest of the forum.  Thank you for bringing it to my attention!

Quote from: Tair on June 12, 2016, 05:05:47 PM
Is it possible to limit Latest Post from BoardIndex.template.php to show only this subforum's posts ?

Same for usersonline stats and statistic section of  BoardIndex.template.php ?
I wasn't aware that this was an issue.  Let me look into these issues.....

Tair

#472
Quote from: dougiefresh on June 12, 2016, 06:54:07 PM
I wasn't aware that this was an issue.  Let me look into these issues.....

Thx alot.

Also found 1 more question - if someone enter Register page in subforum - forum opens primary forum Register page

Also:

Just uninstalled 1.33 and installed 1.34, got 500'th server error:

[13-Jun-2016 02:55:32] PHP Parse error:  syntax error, unexpected ')' in /var/www/forums/data/www/forums/test/Sources/Subs-SplitForumHooks.php on line 82

after i removed ) :

[13-Jun-2016 02:59:43] PHP Parse error:  syntax error, unexpected ';' in /var/www/forums/data/www/forums/test/Sources/Subs-SplitForumHooks.php on line 94


also error at

[13-Jun-2016 03:10:14] PHP Parse error:  syntax error, unexpected ';' in /var/www/forums/data/www/forums/test/Sources/ManageSplitForum.php on line 148


dougiefresh

Uploaded v1.35 - June 18th, 2016
o Fixed several syntax errors found by Tair.




@Tair:  Thank you for pointing out those programming bugs!  They have been fixed for this version!

Quote from: Tair on June 12, 2016, 07:34:27 PM
Also found 1 more question - if someone enter Register page in subforum - forum opens primary forum Register page
Go into the Subforums page under Settings and uncheck the box beside Redirect registration to Primary Forum.  That should fix that error....  Let me know if it doesn't!  Thanks!

Tair

#474
Quote from: dougiefresh on June 18, 2016, 07:18:36 PM
Uploaded v1.35 - June 18th, 2016
o Fixed several syntax errors found by Tair.




@Tair:  Thank you for pointing out those programming bugs!  They have been fixed for this version!

Quote from: Tair on June 12, 2016, 07:34:27 PM
Also found 1 more question - if someone enter Register page in subforum - forum opens primary forum Register page
Go into the Subforums page under Settings and uncheck the box beside Redirect registration to Primary Forum.  That should fix that error....  Let me know if it doesn't!  Thanks!

Thx for the reply, registration on subforum seems fixed.
Anyway when i updated from 1.33 to 1.35 there were some problems to update Register.php

Fixed it manualy.

Got 1 more error:

Text "$agree = 'agreement' . ($forumid == 0 ? '' : '.forum' . $forumid);" appeared on the top of registration page (with agreement) on subforum, same for registration settings page in Admin section of main forum.


Also i got test forum for testing, had there 1.33, uninstalled it and installed 1.35

When i try to create 1 more subforum (currently there 0 subforums) - i receive such an error "The specified subforum ID has already been used. Please select another ID number."

Tair

#475
And btw
errors still here:
[19-Jun-2016 19:43:49] PHP Notice:  Undefined variable: forumdir in /var/www/forums/data/www/forums/test/www/Sources/Subs-SplitForumHooks.php on line 43
[19-Jun-2016 19:43:49] PHP Notice:  Undefined variable: forumdir in /var/www/forums/data/www/forums/test/www/Sources/Subs-SplitForumHooks.php on line 76


fixed that by adding forumdir for subforum string in settings php.

Btw maybe its better to hold all variables in table instead of setting.php?

like table prefix_splitsettings


p.s.

QuoteGot 1 more error:

Text "$agree = 'agreement' . ($forumid == 0 ? '' : '.forum' . $forumid);" appeared on the top of registration page (with agreement) on subforum, same for registration settings page in Admin section of main forum.

fixed that also. By some strange reason during update this code appeared on the top of Register.php and ManageRegistration.php

dougiefresh

Thank you, Tair, for all of your bug reports!

Quote from: Tair on June 19, 2016, 05:35:02 AM
Thx for the reply, registration on subforum seems fixed.
Good to hear!

Quote from: Tair on June 19, 2016, 05:35:02 AM
Anyway when i updated from 1.33 to 1.35 there were some problems to update Register.php.

Text "$agree = 'agreement' . ($forumid == 0 ? '' : '.forum' . $forumid);" appeared on the top of registration page (with agreement) on subforum, same for registration settings page in Admin section of main forum.
Update XML file from v1.35 to v1.36 fixes this issue....

Quote from: Tair on June 19, 2016, 05:35:02 AM
When i try to create 1 more subforum (currently there 0 subforums) - i receive such an error "The specified subforum ID has already been used. Please select another ID number."
Hmmm....  I'll look at the code again.

Quote from: Tair on June 19, 2016, 12:45:09 PM
[19-Jun-2016 19:43:49] PHP Notice:  Undefined variable: forumdir in /var/www/forums/data/www/forums/test/www/Sources/Subs-SplitForumHooks.php on line 43
[19-Jun-2016 19:43:49] PHP Notice:  Undefined variable: forumdir in /var/www/forums/data/www/forums/test/www/Sources/Subs-SplitForumHooks.php on line 76

fixed that by adding forumdir for subforum string in settings php.
Duplicated and fixed for next version.

Quote from: Tair on June 19, 2016, 12:45:09 PM
Btw maybe its better to hold all variables in table instead of setting.php?

like table prefix_splitsettings
Disagree, because workload of database increases by doing so.  Although I guess I could cache the results of the database query....

Quote from: Tair on June 19, 2016, 12:45:09 PM
Quote from: Tair on June 19, 2016, 05:35:02 AM
Text "$agree = 'agreement' . ($forumid == 0 ? '' : '.forum' . $forumid);" appeared on the top of registration page (with agreement) on subforum, same for registration settings page in Admin section of main forum.
fixed that also. By some strange reason during update this code appeared on the top of Register.php and ManageRegistration.php
Issue has been fixed.

Adrek

Thank you for updates :)

few errors:
MoveTopic.php :
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat AND c.forumid = {int:forumid}))
it should be:
LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat AND c.forumid = {int:forumid})

but still all boards are visible on the list (categories from other subforums are hidden), so I made few edits:
Code (Find) Select

SELECT b.id_board, b.name, b.child_level, c.name AS cat_name, c.id_cat

Code (Add after) Select

, c.forumid


Code (Find) Select

AND b.redirect = {string:blank_redirect}

Code (Add after) Select

AND b.redirect = {string:blank_redirect}
AND c.forumid = {int:forumid}


and it seems that boards are filtered correctly now :)
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

jjsmith

Hello dougiefresh,

I noticed in two places where posts are listed, but clicking them shows I don't have access.

- when not logged in - on our forum Home page - scrolling to the bottom and clicking "View the most recent posts on this forum" ...
This shows all posts, including sister sites, even if the post is on a split forum that i don't have access to.

- when logged in - clicking 'show unread posts since last visit'...
This also shows new posts on split forums that I don't have access to

In both cases, when I click the post, I get a message that I don't have access to the post, so that's good.  But it's confusing that the post is in the list.

Is that expected - that the posts show in the list?  Or have I not installed/configured correctly?

Thanks,
Josh

garyee

@jjsmith: What version of the mod are you using? I couldn't recreate the problem with 1.35 ... so maybe if you update (and make the changes phantomm listed)

Okay I got 1.35 working now. If anyone is interested ... I created a mod, to (re-)enable moving topics between subforums (with enhanced titles in the move-selectbox) and also disables the "you are not allowed error message".

While working on the mod I recognized that you have to be really careful when configuring your system, there are several places where one has to put in URLs, don't mess them up.
(Like for example if you start one with https and another with http, there will be some faulty behavior somewhere!

Greetz
Garyee

Advertisement: