News:

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

Main Menu

PMx-Subforums v1.41 (updated 03 Jul 2013t)

Started by feline, September 08, 2011, 11:48:37 AM

Previous topic - Next topic

Arantor

Quoteand as he stated this is to force board ordering which is not needed nor necessary in the implementation of subforums though may be to other forums.

If you're going to paraphrase, please take care not to give a different impression to the one originally intended.

What this mod does is forcibly do an ORDER BY on board_order. But now so too does SMF core, which is where the problem occurs, because you can't have two ORDER BY clauses written out in the query.

I had originally preferred to keep it purely a mod matter (because the simple fix would have been to uninstall my mod as the manual reworking of this mod avoids the issue) but for PMx Subforums as a whole it should possibly not try to do the ordering when SMF itself will.

Hj Ahmad Rasyid Hj Ismail

Edited and inserted full line though I have quoted the whole passage in the original post so that it will not mislead.

SaltedWeb

Hi there,
Is this compatible with 2.08 ?
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Hj Ahmad Rasyid Hj Ismail

It works but you have to do modifications as suggested in post #159 above.

feline

ahrasis, that is not the best way to solve that problem.
I have locked in the code and found the problem and a correct solution.

Because in 2.0.8 the Boardindex fetch have a new option to add a SORT BY to the query and the Subforums Mod do this also. To solve that problem, you have to edit the file Subs-Boardindex.php around line 64 ...

Find:

WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
'. (isset($modSettings['subforums'][$_SERVER['SERVER_NAME']]) &&  ? 'ORDER BY b.board_order' : ''),
array(


Replace with:

WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
array(


The replacement is the original code before the change by Subforums.

Feline

SaltedWeb

I wonder why the 2.0.8 did this upgrade , guess it was to solve something .
Thats one thing over the years I wish updates gave more details to what was fixed.
Usually it always says security, vulnerability lol  It might help developers maybe to know why the
fix was done ? 

So doing the manual modifications, wont that eventually affect mods that are being built with this in mind ?
Seems within 6 months or less new mods are built to adjust to the new updates. Why this is a fix, doesn't it
create a situation where down the road other mods may not work ?

Or am I just lost on this?
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Arantor

QuoteI wonder why the 2.0.8 did this upgrade , guess it was to solve something .
Thats one thing over the years I wish updates gave more details to what was fixed.

It was done because on MySQL (all versions under some conditions, and any version after 5.6 without fail), the board index will not be ordered properly because a trick that used to work to keep it fast doesn't work any more.

The only reason it clashes is because feline has to do the same thing in her mod but for slightly different reasons.

I did not originally want the team to include that particular fix in 2.0.8 but leave it as my mod whereupon it could have been dealt with as a case by case basis.

SaltedWeb

Hi there,

I know you didnt have to, but thanks for explaining it.
I was absent from 2010-2012 on SMF and allot changed in 2 years.
Still doing catch up.    Allot changed from when I first joined and used 1.02 LOL.
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

SaltedWeb

Feline I installed a test forum 2.05 to see how this work before I try 2.08 . is there a step by step somewhere to set this up?

Thanks
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Arantor

To be honest there aren't many people who could tell you exactly what changed and why, and since I'm the programmer who wrote what 2.0.8 was based on... seemed like the best person to give you a quick explanation on the matter.

SaltedWeb

 :)
Cool, and thank you.
Now just have to try and find some directions on this mod.
Not quite sure what they are asking you to create read the whole thread and nothing
that quite made sense. 
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Hj Ahmad Rasyid Hj Ismail

Quote from: feline on July 28, 2014, 08:22:24 AM
ahrasis, that is not the best way to solve that problem.
I have locked in the code and found the problem and a correct solution.

Because in 2.0.8 the Boardindex fetch have a new option to add a SORT BY to the query and the Subforums Mod do this also. To solve that problem, you have to edit the file Subs-Boardindex.php around line 64 ...

Find:

WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
'. (isset($modSettings['subforums'][$_SERVER['SERVER_NAME']]) &&  ? 'ORDER BY b.board_order' : ''),
array(


Replace with:

WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
array(


The replacement is the original code before the change by Subforums.

Feline
Well, it's among the options that I have that works and I certainly don't claim it as the best. ;)

Thank you for the fix feline. I guess we simply have to remove that modification line from 1.41 package then.

Hj Ahmad Rasyid Hj Ismail

Quote from: Diamondcomputer on July 28, 2014, 12:04:59 PM
Feline I installed a test forum 2.05 to see how this work before I try 2.08 . is there a step by step somewhere to set this up?

Thanks
1. Setup your forum on your main domain/subdomain.
2. Direct your domain/subdomain (for your subforums) to your forum path.
3. Install and configure your subforums settings inside admin cp.
4. If configured correctly, you should have your subforums working.

For 2.0.8, before installing:
1. Unpackage 1.41 subforums mod.
2. Remove the modification line as stated by feline.
3. Repackage it for installation.

Hopefully, it will be updated in portamx, github and smf mod page soonest.

Hj Ahmad Rasyid Hj Ismail

Quote from: Diamondcomputer on July 28, 2014, 12:03:01 PM
Hi there,

I know you didnt have to, but thanks for explaining it.
I was absent from 2010-2012 on SMF and allot changed in 2 years.
Still doing catch up.    Allot changed from when I first joined and used 1.02 LOL.

I was absent for a year myself. ;)

feline

Quote from: Diamondcomputer on July 28, 2014, 12:04:59 PM
Feline I installed a test forum 2.05 to see how this work before I try 2.08 . is there a step by step somewhere to set this up?

Thanks
You can level up your forum to 2.0.8 and then make the change I posted. That is the best way...

Arantor

Quote from: feline on July 29, 2014, 04:49:50 AM
Quote from: Diamondcomputer on July 28, 2014, 12:04:59 PM
Feline I installed a test forum 2.05 to see how this work before I try 2.08 . is there a step by step somewhere to set this up?

Thanks
You can level up your forum to 2.0.8 and then make the change I posted. That is the best way...

I agree.

This is a historic occasion, too, the two of us agreeing on something ;D

feline

Quote from: ahrasis on July 28, 2014, 08:54:03 PM
Hopefully, it will be updated in portamx, github and smf mod page soonest.
We will update the Github Repository quick as possible  ;)

SaltedWeb

Hi guys,
Thanks for the help, I ended up creating a work around menu system that will kinda do the same thing.
My fear is that this will end up having mod conflicts. I may try it on another of my sites though, so the instructions are appreciated.
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

SaltedWeb

My work around doesn't seem to be working ugg, concerned about this mod and the issues with it not working as needed.
Is there a demo to see what this looks like in action?
Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Hj Ahmad Rasyid Hj Ismail

This mod is working fine with abovementioned fix by feline.

Remove the following codes from subforuminst.xml in install folder inside the packaged 1.41 mod as it is no longer needed following 2.0.8 update/upgrade.

<file name="$sourcedir/Subs-BoardIndex.php">
<operation>
<search position="replace"><![CDATA[
WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
array(
'current_member' => $user_info['id'],
'child_level' => $boardIndexOptions['base_level'],
'blank_string' => '',
)
);
]]></search>
<add><![CDATA[
WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)) .'
'. (isset($modSettings['subforums'][$_SERVER['SERVER_NAME']]) ? 'ORDER BY b.board_order' : ''),
array(
'current_member' => $user_info['id'],
'child_level' => $boardIndexOptions['base_level'],
'blank_string' => '',
)
);
// mod for SubForums
]]></add>
</operation>
</file>


You can see it in action at alumni.sch.my, x-skda.sch.my, x-mans.sch.my etc. I will update my github for this mod.

Advertisement: