News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

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

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

Previous topic - Next topic

larry1123

Quote from: feline on July 03, 2013, 04:36:49 PM
Quote from: larry1123 on July 03, 2013, 02:13:22 AM
Will this mod be updated for 2.0.4, when I tried to install the forum could no longer connect the the DB.
We have just upload the new release 1.41 for SMF 2.0.4 in the mod area ...
Wow just my luck, I post and then you update lol.

jan.van.gent

I managed to repair the forum.

Issues when installing the mod from scratch:

The modification of ./Sources/Subs-Db-mysql.php
function smf_db_replacement__callback($matches)
{
global $db_callback, $user_info, $db_prefix;

list ($values, $connection) = $db_callback;

if (!is_resource($connection))
db_fatal_error();

if ($matches[1] === 'db_prefix')
return $db_prefix;

if ($matches[1] === 'query_see_board')
return $user_info['query_see_board'];

if ($matches[1] === 'query_wanna_see_board')
return $user_info['query_wanna_see_board'];


replace with:

function smf_db_replacement__callback($matches)
{
global $db_callback, $user_info, $db_prefix;

list ($query, $values, $connection) = $db_callback;

// subforums db_callback.
if(($subvar = SubForums_dbcallback($matches, $query)) !== null)
return $subvar;


Fails (I had to do it manually after installation)

And also in ./Sources/Subs-Db-postgresql.php

function smf_db_replacement__callback($matches)
{
global $db_callback, $user_info, $db_prefix;

list ($values, $connection) = $db_callback;

if (!is_resource($connection))
db_fatal_error();

if ($matches[1] === 'db_prefix')
return $db_prefix;

if ($matches[1] === 'query_see_board')
return $user_info['query_see_board'];

if ($matches[1] === 'query_wanna_see_board')
return $user_info['query_wanna_see_board'];


replace by

function smf_db_replacement__callback($matches)
{
global $db_callback, $user_info, $db_prefix;

list ($query, $values, $connection) = $db_callback;

// call the subforums db_callback.
if(($subvar = SubForums_dbcallback($matches, $query)) !== null)
return $subvar;

fails to work with the installer.

When I changed this manually, the forum is accessible again. But the admin/subforum manager still doesn't work:
Unable to load the 'Subforums/Subforums' template.
While the correct files are in the correct folder...

larry1123

Quote from: jan.van.gent on July 08, 2013, 04:11:49 AM
Unable to load the 'Subforums/Subforums' template.

I got the same error on the Admin page, without any forum accesses problems.

feline

if you use the latest release from Github ...
Check if the Template on the path /Themes/default/SubForums/Subforums.template.php

jan.van.gent

Quote from: feline on July 09, 2013, 05:13:12 PM
if you use the latest release from Github ...
Check if the Template on the path /Themes/default/SubForums/Subforums.template.php

As i said: yes I have the 1.41 release.
And yes that .php file is in the subforums folder.

Larry1123 seems to have exactly the same issue...  ;)

feline

I just make a test install of SubForums 1.41 on a fresh SMF 2.0.4.
No problems .. all works as well ...

majoka

I have created testing sub-domain(hxxp:testing.bimmerfoto.be/ [nonactive]) but it's not calling the main forum (hxxp:www.bimmerfoto.be/forum/ [nonactive])
All settings is correct in admin see attached screen shot.

Should we have to move hxxp:www.bimmerfoto.be/forum/ [nonactive] on root directory ?
Or we need made changes in .htaccess file?

feline


majoka

Yes, i have created the domain alias for hxxp:testing.bimmerfoto.be [nonactive]

feline

you are sure? a domain alias is not the same as a subdomain !!
a subdomain points to a folder on your server, a domain alias points to nothing..

epro79

When I changed this manually, the forum is accessible again. But the admin/subforum manager still doesn't work:
Unable to load the 'Subforums/Subforums' template.

feline

Ok .. I found the problem ..
Open the file /Sources/SubForums/SubforumsAdmin.php in a editor (like notepad++)
Find the lines (~ 280):

// load template
loadTemplate('Subforums/Subforums');
loadLanguage('Subforums/Subforums');


Replace with:

// load template
loadTemplate('SubForums/Subforums');
loadLanguage('SubForums/Subforums');


Now all works.
Alternately you can download the updated archive and copy the one file to your server...

crazyearner

Quote from: feline on July 21, 2013, 07:41:21 AM
Ok .. I found the problem ..
Open the file /Sources/SubForums/SubforumsAdmin.php in a editor (like notepad++)
Find the lines (~ 280):

// load template
loadTemplate('Subforums/Subforums');
loadLanguage('Subforums/Subforums');


Replace with:

// load template
loadTemplate('SubForums/Subforums');
loadLanguage('SubForums/Subforums');


Now all works.
Alternately you can download the updated archive and copy the one file to your server...

Have already tried to update this and still getting Unable to load the 'Subforums/Subforums' template.

Have also tried to install manually and also done updates and started from fresh only to get same error.

vitormcs


luuuciano

No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).


luuuciano

PMxSubforums + smf upgraded to 2.0.8 generating database error
reported here: http://portamx.com/3413/pmxsubforums-smf-upgraded-to-2-0-8-generating-database-error/

Dirty fix until a better solution, revert line 66 to the regular one
pmxforumed:
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)) .'
'. (isset($modSettings['subforums'][$_SERVER['SERVER_NAME']]) ? 'ORDER BY b.board_order' : ''),


regular:
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),

This is related to this new code http://custom.simplemachines.org/mods/index.php?mod=3865 added to 2.0.8??
Something is colliding? any idea?
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Arantor

Essentially she's just doing what the mod does anyway by forcing a board order.

I'd say that PMx has to change on this one ;)
Holder of controversial views, all of which my own.


feline

We will make a fix soon as possible ...

Hj Ahmad Rasyid Hj Ismail

#159
I find that the fixing that need to be done for the time being is not with subforums mod but with changes made by SMF upgrade itself. I have tested it only to fix upgrade via package manager but not via full upgrade. It may or may not be the same.

If you have upgraded via package manager like what I have tested, you will get the error message telling you that this was caused by subforums mod and will ask you to make full upgrade via full package. However, the issue is coming from the upgrade itself not subforums mod. Simply find the changed code and restore the original code as shown below:

Changed Code
// Decide which connection to use.
$connection = $connection == null ? $db_connection : $connection;

// Special queries that need processing.
$replacements = array(
'alter_table_boards' => array(
'~(.+)~' => '',
),
'boardindex_fetch_boards' => array(
'~(.)$~' => '$1 ORDER BY b.board_order',
),
'messageindex_fetch_boards' => array(
'~(.)$~' => '$1 ORDER BY b.board_order',
),
'order_by_board_order' => array(
'~(.)$~' => '$1 ORDER BY b.board_order',
),
);

if (isset($replacements[$identifier]))
$db_string = preg_replace(array_keys($replacements[$identifier]), array_values($replacements[$identifier]), $db_string);

if (trim($db_string) == '')
return false;


Original Code
// Decide which connection to use.
$connection = $connection == null ? $db_connection : $connection;


In my case I am using my sql and the changes are basically inside Subs-Db-mysql.php. But yours could be different. It could affect your Subs-Db-postgresql.php as well Subs-Db-sqlite.php files. So I restored the orginal line and deleted the add-up made by the upgrade. So far, the subforums mod is working fine after that.

This add-up is actually coming from this MySQL Board Order Fix mod by the above Captain "?" Arantor and as he stated this is to force board ordering to be correct on all versions of MySQL for SMF 2.0.x (fixes MyISAM on MySQL 5.6+ and InnoDB in general) which is not needed nor necessary in the implementation of subforums though may be to other forums.

To quote his own words:
QuoteThis is a quick and dirty fix that will force board ordering to be correct on all versions of MySQL for SMF 2.0.x (fixes MyISAM on MySQL 5.6+ and InnoDB in general)

There is a slight performance hit but it should be correct in all cases involving the board index.

This code is all under the same licence as SMF's own code - 3-clause BSD - since it's almost directly borrowed from the PostgreSQL code and spliced into the MySQL code ;D

By the way, we do not fix what is not broken by itself. But we fix what made it broken unless there is no way to do so. ;)

Hopefully, feline can overcome this so that we don't have to undo even a tiny part of any smf upgrade like this suggestion does.

Advertisement: