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

rtwingfield

First, apologies for initially posting on the "wrong" thread (I'm still learning the protocols).  I wasn't sure if the issue involved the base SMF system, or the mod, and I'm still not.   

Regardless, I have deleted and reinstalled both the SMF-2.0.10 base (successfully) and then the  Split_Forum_Mod . . .with the same failing results.  I think this may be an installation script path issue.  On the base install, I specify, "https://archaxis.net/smf-forums", an alias, as the URL to the installed forum software. 

In my ./Apache24/httpd.conf file, I alias the system as follows:

    Alias /smf-forums/ "/usr/local/www/smf-2.0.10/"
    <Directory "/usr/local/www/smf-2.0.10/">
        Options +Includes -Indexes
        AllowOverride all
        Require all granted
        RewriteEngine On
        RewriteOptions Inherit
        DirectoryIndex index.php
    </Directory>


Notice the actual installation directory path and the alias, and the -Indexes option.

This technique is what I use regarding other applications such as phpMyAdmin, Zen-Cart, WebCalendar, etc., . . .all incorporate the MySQL database, and all work well.  Reason for this, . . .still locates the application software within the /www hierarchy but outside of the /www/vhosts level; therefore, they are only browser accessible via the http aliases.

So, the mod_install.php only displays, "Congratulations! You have successfully installed this mod!", but no, it has failed, no additional DB tables have been created, the mod's additional admin options to create sub-forums are not enabled, and the {db_prefix}log_packages table is empty.

Is your Split Forum Mod looking for "hard-coded" paths and base system naming conventions.
(. . .asking this question before I dig into the code.)

dougiefresh

I have to assume you're installing the mod via the Package Manager, correct?  Cause that's what the mod package is designed for....  It can be manually installed, but it really is a pain to do (primarily because of the number of operations)...

The mod_install.php script handles some of the "nasty" little details that are essential for setting up the subforum settings, while mod_uninstall.php attempts to clean up the forum and make it "livable" without the mod....

The db_install.php script actually handles the database additions, whereas db_uninstall.php script handles the reorganization of the categories so that they are in order first by forum ID, then category order....

The add_remove_hooks.php script inserts and removes the hooks necessary for this mod to function...

rtwingfield

With apologies, your assumption is wrong, sir.  I'm an old programmer and I started by first hauling down the tarball for the base smf_2-0-10_install.tar.gz system, and then the Split_Forum_Mod_v1.24.zip.  After first successfully installing the base system, I then unzip'ed the the latter (tar -xvf Split_Forum_Mod_v1.24.zip) into a temporary directory, looked for an instructional installation README, script, etc. and found none; consequently, preparing for battle, I moved some objects around, pointed my browser to the mod_install.php but at that point, things began to fail.

I have now used the built-in Package Manager feature and it worked as advertized . . .very smooth and easy -- my compliments!   Somewhere lost in the documentation (see my attached reading list), I was unaware of the Package Manager feature and I simply did not appreciate its significance.  If I may make a suggestion, I would clarify the significance of the Package Manager feature and increase its standout visibility in the documentation for the benefit of new first-time users.

I just lost a very good friend who was always saying, "This is going to make perfect sense . . .once I understand it.", so now I do.

BTW & FYI, I have been a user/provider of the earlier SMF Forum 1.something for several years.  That forum has been decommissioned (intended users simply refused to use it).  Wiped clean, I've started fresh with the v2.0.10 and plan to present it to a new group of users that will have no choice but to use it (policy!). 


dougiefresh

 ;D LOL!!!!  Figures!  :P  I kinda thought that you were somehow attempting a manual installation, but I had to ask...  I'm glad that the mod works for you.  Let me know if there is anything more I can help with!

rtwingfield

I cannot configure the sub-forums system to route to the requested sub-forum(s).  If I create a sub-forum/forum2,then  the SubForum Web Address (URL):  (after a refresh) displays http://https://archaxis.net/smf-forums/forum2

Notice the http://https:// syntax.  This results in rerouting via mod_rewrite?, to . . .of all things, an Error 404 - Not Found displayed on a http://www.homeimprovement.com/archaxis.net/smf-forums/forum2 website, which also includes some gratuitous advertisements. 

Regarding this, I have found this testy discussion:  http://forums.mozillazine.org/viewtopic.php?p=13394957#p13394957  . . .check it out, read JayhawksRock's  FWIW.  It'll be a cold day in hell before I ever purchase anything from homeimprovement.com.  I'd like to tear out the tonsils of the @$$hole that dreamed up this scheme   >:(

So . . .how is this rewrite scheme finding it's way in to the SplitForum scenario?  Note also that if I manually correct the query address to https://archaxis.net/smf-forums/forum2/, then only the primary base web page will be displayed.

I've attached an example copy of the SubForum settings . . .and I've salted a couple of "debug echos" in the code:


# php index.php | less

GOT HERE in ./forum2/index.php

Notice: Undefined index: SERVER_NAME in /usr/local/www/smf-2.0.10/Sources/Load.php on line 148
GOT HERE in ./Sources/Load.php:  $host=<>
Notice: Undefined index: REQUEST_URI in /usr/local/www/smf-2.0.10/Sources/Load.php on line 150


. . .what am I doing wrong?



dougiefresh

#365
You're not doing anything wrong.  I made the assumption during coding that subforums (or the primary forum) would start with http://.  So it is an issue of the correcting the mod's assumption....

Can you replace your Sources/ManageSplitForums.php file (the file with the erroneous assumption) with this attachment, then try to reconfigure the subforum settings and tell me if this fixes the issue you see?  Thanks in advance....

EDIT: If successful, this constitutes that entirety of the upgrade to v1.25....

rtwingfield

I know what is happening . . .what was wrong with my configuration assumption(s).

When the SubForum Web Address (URL): is simply specified as  archaxis.net/smf-forums/forum2 then everything will be fine.  The system will prefix http:// to the address string.

If you specify http://archaxis.net/smf-forums/forum2 then the system is still happy and nothing appears to have changed.

However, if you specify https://archaxis.net/smf-forums/forum2 then the system will still prefix http:// to the https://archaxis.net/smf-forums/forum2 string resulting in the concatenated string http://https://archaxis.net/smf-forums/forum2This will also happen if you change http:// tp https://.

. . .which will result in this piece of work http://forums.mozillazine.org/viewtopic.php?p=13394957#p13394957 that I described in my previous post.

. . .who'd a' thought?

rtwingfield

I was posting just as you posted the following:

Quote from: dougiefresh on July 04, 2015, 04:33:10 PM
You're not doing anything wrong.  I made the assumption during coding that subforums (or the primary forum) would start with http://.  So it is an issue of the correcting the mod's assumption....

Can you replace your Sources/ManageSplitForums.php file (the file with the erroneous assumption) with this attachment, then try to reconfigure the subforum settings and tell me if this fixes the issue you see?  Thanks in advance....

Certainly be glad to help with the test.  looks like it could involve a PCRE  oversight?

dougiefresh

Quote from: rtwingfield on July 04, 2015, 04:41:06 PM
looks like it could involve a PCRE  oversight?
Huh?  What's a PCRE?  Yes, I looked it up before asking.....

rtwingfield

Actually, I've NEVER thought there was anything "regular" about a REGEX or PCRE. I think "irregular" would be a better word . . .or "obtuse expression"   ;)

BTW, I just FTPd the ./Sources/ManageSplitForums.php file to the server.  I'll let you know the results of the test.

dougiefresh

Oh.... I'm getting better at regular expressions, but no, this particular problem doesn't involve regular expressions at all....

If this is successful, this constitutes that entirety of the upgrade to v1.25....

rtwingfield

There was a syntax problem with the string replace instruction.  I found it . . .the two optional replacements just needed to be "or'ed" as follows: 


221         $arr['forumdir'] = str_replace('http://', '' | 'https://', '', $arr['forumdir']);
222      // $arr['forumdir'] = str_replace('http://', '', str_replace('https://', '', $arr['forumdir']);


BTW, are you here in the US of A?   . . .and working on the 4th of July ;D

dougiefresh

Quote from: rtwingfield on July 04, 2015, 05:17:43 PM
There was a syntax problem with the string replace instruction.  I found it . . .
:o Oops...  Fixed it and attached the new version to this post.

Quote from: rtwingfield on July 04, 2015, 05:17:43 PM
the two optional replacements just needed to be "or'ed" as follows: 

221         $arr['forumdir'] = str_replace('http://', '' | 'https://', '', $arr['forumdir']);
222      // $arr['forumdir'] = str_replace('http://', '', str_replace('https://', '', $arr['forumdir']);

Pretty sure the "or" thingy doesn't work like that.   But I tried it anyway in a test script...  The php statement you gave, while technically valid, produced nothing.

Quote from: rtwingfield on July 04, 2015, 05:17:43 PM
BTW, are you here in the US of A?   . . .and working on the 4th of July ;D
Yup.  In Tennessee, USA....  I'm on vacation since the 3rd thru next week.

rtwingfield

Quote from: dougiefresh on July 04, 2015, 07:45:21 PM
Quote from: rtwingfield on July 04, 2015, 05:17:43 PM
the two optional replacements just needed to be "or'ed" as follows: 

221         $arr['forumdir'] = str_replace('http://', '' | 'https://', '', $arr['forumdir']);
222      // $arr['forumdir'] = str_replace('http://', '', str_replace('https://', '', $arr['forumdir']);

Pretty sure the "or" thingy doesn't work like that.   But I tried it anyway in a test script...  The php statement you gave, while technically valid, produced nothing.

How odd. . .?  I diff'ed the version that I "fixed" against the latest version that you attached and found the following:

# diff ManageSplitForums.php 'ManageSplitForums(1).php'
<    $arr['forumdir'] = str_replace('http://', '' | 'https://', '', $arr['forumdir']);
< // $arr['forumdir'] = str_replace('http://', '', str_replace('https://', '', $arr['forumdir']);
-
>    $arr['forumdir'] = str_replace('http://', '', str_replace('https://', '', $arr['forumdir']);


Your latest version is is identical to this afternoon's earlier version.  You can see that I commented-out the construct that was causing a syntax error and the or'ed construct is working in my installation with no complaints.

Just for chuckles and grins, I went back and reversed the commented lines
221      // $arr['forumdir'] = str_replace('http://', '' | 'https://', '', $arr['forumdir']);
222         $arr['forumdir'] = str_replace('http://', '', str_replace('https://', '', $arr['forumdir']);


and again I get the

Parse error: syntax error, unexpected ';' in /usr/local/www/smf-2.0.10/Sources/ManageSplitForums.php on line 222

. . .and of all things, what does it mean by unexpected semi-colon . . .crikey! you gott'a have one at the end of the php instruction.

My version of PHP is 5.6.10.   What are you using?  Regardless, I've gone back to the or'ed syntax and all is well.  I'll keep looking for an explanation.


. . .well, it sounds like the fireworks at the Pleasant Valley Country Club here in Little Rock, AR are over.  Hope you're having some quality time off (don't dwell on this issue).  BTW, I've worked a lot of projects in Memphis -- where in TN are you located?

dougiefresh

Uploaded v1.25 - July 6th, 2015
o Fixed code that made the assumption all subforums would start with http://.




@rtwingfield: I really don't know how I managed to miss that a second time....  I'm near Murfreesboro.

rtwingfield

I have found this comment by searching this post:
QuoteOn the Admin -> Forum -> Boards page using the primary subforum, the categories and boards are seperated by which subforum they belong to.  On secondary subforums, only those categories and boards that belong to that subforum show up.
and it works very well; however, on the Edit Membergroup -> show boards page, categories and boards  from other subforums are commingled (see the attached image).  My subforums have many identical or similar occurrences and this makes for a very difficult task to differentiate between the subforums. 

Have I overlooked an option to sort the categories and boards as subsets of the associated subforum?


dougiefresh

Quote from: rtwingfield on July 07, 2015, 05:46:52 PM
I have found this comment by searching this post:
QuoteOn the Admin -> Forum -> Boards page using the primary subforum, the categories and boards are seperated by which subforum they belong to.  On secondary subforums, only those categories and boards that belong to that subforum show up.
and it works very well; however, on the Edit Membergroup -> show boards page, categories and boards  from other subforums are commingled (see the attached image).  My subforums have many identical or similar occurrences and this makes for a very difficult task to differentiate between the subforums. 

Have I overlooked an option to sort the categories and boards as subsets of the associated subforum?
Good eye!  I completely missed that one.....  Let me see what I can do about that one....

rtwingfield

. . .you know, while you're at it, this could probably become a problem, too, if group names are not "spelled" with a prefix to identify the associated subforum.

The MPCATA (Milton Pitts Crenchaw Aviation Training Academy) are member-groups in that subforum, while all CAP* are member-groups associated with the Civil Air Patrol subforum.   (See the attached image.)

Regarding sub-setting these lists, I suspect that SELECT FROM WHERE sql queries needs their "I"s crossed and "T"s dotted.

. . .sorry to be such a pest  ;)

dougiefresh

#378
I could make those modifications, even though they involve as many as 30 source files and probably multiple template files....  Keep in mind that other mods could refer to the membergroups table, too, and those mods not understanding that certain membergroups are assigned to certain subforums might lead to undesirable results...  (Can't imagine the negative effects would be too bad, though)  I'll see what I can do....

I've got the source modified on the board listing part of the editing membergroup template.  I've got to figure out how I want to modify the template itself in order to display the subforums....

rtwingfield

First, let me thank you for your attention to this scenario.  From an  old programmer's experience, I know that you can't just toss something into a system without exhaustive testing and evaluation.

That said, I'm looking at the design of the sub-forum concept from two points of view:

1) From a maintenance and support perspective (this is the programmer talking), I like the idea of one database schema, and one application code installation.  When a new version release is available, or a modification necessary, then only one upgrade has to be installed.

2) From a marketing and sales point of view, if I am installing the system on a platform that will serve multiple entities (as in a "cloud" or what we used to call a time-sharing service bureau environment), for example, a federal agency, a regional warehouse distribution center, and a financial institution,  and each of the entities want to have their own administrator, then these administrators are going to be uncomfortable and probably "put off" when they see registered members associated with the other entity sub-forums appear in a member list.  Same thing regarding category and  boards lists, and so on.

I think you're already aware of this.

Of course I have to admit that I am not familiar with the nuances of the application code, and I haven't really explored the MySQL database schema, although I do use phpMyAdmin and I have taken a look at some of the table templates.  Never-the-less, I have invested considerable hours in learning to use the system and basically I like the visual presentation of the application.  Without changing any CSSs, I think you are suggesting that the SQL table templates (what I call a file record layout or in OS/400 speak, a data description specification) would be modified to include an additional table/row/element for forum-number.   This would become part of a primary key on each sub-forum table.  Essentially, this would represent a major system upgrade release. 

But perhaps I should have asked this first -- how do you describe or identify a "Sister Site"?

Advertisement: