Topics Filter v3.0

Started by M-DVD, October 10, 2007, 06:57:55 PM

Previous topic - Next topic


Quote from: karlbenson on May 23, 2008, 03:14:05 PM
What version were you using?
I might have still have a copy.

Note for future reference you NEED to keep a copy in order to uninstall the mod.  You can't uninstall your version with the latest version.

yes I know I need to keep a copy of it, but one cannot "predict" hard drive crashes. I had a copy of this mod stored on my "back up" drive and it was the one that crashed.

The version I am using is 2.4 which is your latest version - I thought I was using an earlier version but I was incorrect. So that tells me there is still something wrong because the 2.4 version was supposed to fix those paticular errors. One of the places this error ocurrs is on "Page 2" when I am using the topic filter on a certain board. I just checked it and this is the error I am "now" getting. (see attached image). Note that the part about the database is out of date did not appear until I upgraded to 1.1.5. The original error was only the top portion of the error in the image. I have no idea what the upgrade.php is for - and assumed that installing the upgrade via package manager did just that - upgraded it. Was I wrong? Am I suppsed to run upgrade.php in my browser or something? I was also getting that mf.subject error before I installed 1.1.5 so I know that it wont fix that part - but it looks as though I actually have two problems there now. 


ok I have gone thru each file that the mod adjusts and I cannot see any differences. Maybe you can. The error is in the MessageIndex.php so I have attached mine.

Here is the error:

Database Error: Unknown column 'mf.subject' in 'where clause'
File: /home/patriotg/public_html/Sources/MessageIndex.php
Line: 615

The error only seems to happen when someone is using the topic filter on the letters "B" and "S" and are trying to view page 2 of that section.


Hmm. Looks like a bug. Last time it was ml.subject, now mf.subject.

Try on line 605 replacing
FROM ({$db_prefix}topics AS t" . ($context['sort_by'] === 'last_poster' ? ", {$db_prefix}messages AS ml" : (in_array($context['sort_by'], array('starter', 'subject')) ? ", {$db_prefix}messages AS mf" : '')) . ')' . ($context['sort_by'] === 'starter' ? "
FROM ({$db_prefix}topics AS t" . ($context['sort_by'] === 'last_poster' ? ", {$db_prefix}messages AS ml" : "") .", {$db_prefix}messages AS mf)"
. ($context['sort_by'] === 'starter' ? "


just tried and now I am getting this:

The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
File: /home/patriotg/public_html/Sources/MessageIndex.php
Line: 615

(been gettin this one since I upgraded to 1.1.5)

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.5, while your database is at version 1.1.4. The above error might possibly go away if you execute the latest version of upgrade.php.



Undo the change above

And try this instead.

Line 609
WHERE t.ID_BOARD = $board" . ($context['sort_by'] === 'last_poster' ? "
". ( !in_array($context['sort_by'], array('starter', 'subject')) ? 'LEFT JOIN {$db_prefix}messages AS mf ON (mf.ID_MSG = t.ID_FIRST_MSG)' : '' ) ."

If that doesn't work, undo that and try this.

Line 612
". ( in_array($context['sort_by'], array('starter', 'subject')) ? str_replace('mf.subject', 'ml.subject', $letterfilter) : $letterfilter ) ."
Edit: Didn't work


tried the 1st one and got this:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}messages AS mf ON (mf.ID_MSG = t.ID_FIRST_MSG)

' at line 3
File: /home/patriotg/public_html/Sources/MessageIndex.php
Line: 616

(tried this one twice just to make sure it wasnt me not copying/pasting correctly)

Tried the second one and got this:

Unknown column 'mf.subject' in 'where clause'
File: /home/patriotg/public_html/Sources/MessageIndex.php
Line: 616


After trying the first one, you no longer had to click on any specific letters on the alpha bar before seeing the error, that error came up just by clicking on pages 2 and 3 of the area that they are happening in period (not sure if that means Also, I noticed that the error jumped from line 615 to 616 while trying those two fixes.


Sorry thats my fault for being lazy and not testing it first.
The first one I posted worked once I changed the single quotes to double quotes.

Line 609
WHERE t.ID_BOARD = $board" . ($context['sort_by'] === 'last_poster' ? "
". ( !in_array($context['sort_by'], array('starter', 'subject')) ? "LEFT JOIN {$db_prefix}messages AS mf ON (mf.ID_MSG = t.ID_FIRST_MSG)" : '' ) ."

Once, you've confirmed this works for you. I'll fix it and upload a v2.5

P.S I appreciate your assistance in helping me with this.


no problem.. thanks for helping ME to try and get it fixed. Unfortunately, after trying the latest fix, I got this:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '}messages AS mf ON (mf.ID_MSG = t.ID_FIRST_MSG)

' at line 3
File: /home/patriotg/public_html/Sources/MessageIndex.php
Line: 616


Kimmie. Sorry I'm being a moron. I posted the exact same code as before. Without changing the single quotes to double quotes.
Please try it again.


Ding Ding Ding We HAVE a winner!!!    :D :D  (and your not a moron)


2.5 - 31st May 2008
o Fixed mf.subject query error. (Thanks Kimmie)

can we add more items to AlphaNumeric filter bar?

i.e. :

... O, Ö, P, Q, R, S, Ş, T, THE, ...

would be great if it were...


Dutch translation

Quote$txt['filter_saved'] = '(Opgeslagen)';
$txt['filter_date_title'] = '=Post-Datum Filter=';
$txt['filter_date_0'] = 'Geen';
$txt['filter_date_1'] = 'Vandaag';
$txt['filter_date_2'] = 'Sinds gisteren';
$txt['filter_date_7'] = 'Afgelopen 7 dagen';
$txt['filter_date_30'] = 'Afgelopen 30 dagen';
$txt['filter_date_60'] = 'Afgelopen 60 dagen';
$txt['filter_date_90'] = 'Afgelopen 90 dagen';
$txt['filter_date_180'] = 'Afgelopen 180 dagen';
$txt['filter_date_270'] = 'Afgelopen 270 dagen';
$txt['filter_date_365'] = 'Afgelopen 365 dagen';
$txt['filter_date_366'] = 'Over 365 dagen';
$txt['filter_topics_title'] = '=Topic/Post filter=';
$txt['filter_topics_0'] = 'Geen';
$txt['filter_topics_1'] = 'Topics zonder antwoorden';
$txt['filter_topics_2'] = 'Populair topics';
$txt['filter_topics_3'] = 'Zeer populair topics';
$txt['filter_topics_4'] = 'Polls';
$txt['filter_topics_5'] = 'Gesloten topics';
$txt['filter_topics_6'] = 'Eigen topics';
$txt['filter_paginate_title'] = '=Topics per pagina=';
$txt['filter_paginate_10'] = 10 ;
$txt['filter_paginate_20'] = 20 ;
$txt['filter_paginate_30'] = 30 ;
$txt['filter_paginate_40'] = 40 ;
$txt['filter_paginate_50'] = 50 ;
$txt['filter_paginate_forumdefault'] = 'Forum standaard';
$txt['filter_paginate_perpage'] = 'Per pagina';
$txt['filter_alphanum'] = 'Sta AlphaNumeric Filter bar toe';
$txt['filter_alphanum_desc'] = 'Filter topics door begin karakter';
$txt['filter_alphanum_all'] = 'Alle';


Here's the french translation  ;D

note : é is for é

$txt['filter_saved'] = '(Sauvé)';
$txt['filter_date_title'] = '=Filtre sur age=';
$txt['filter_date_0'] = 'Aucun';
$txt['filter_date_1'] = 'Aujourdhui';
$txt['filter_date_2'] = 'depuis hier';
$txt['filter_date_7'] = '7 derniers jours';
$txt['filter_date_30'] = '30 derniers jours';
$txt['filter_date_60'] = '60 derniers jours';
$txt['filter_date_90'] = '90 derniers jours';
$txt['filter_date_180'] = '180 derniers jours';
$txt['filter_date_270'] = '270 derniers jours';
$txt['filter_date_365'] = 'Sur 1 an';
$txt['filter_date_366'] = 'plus d 1 an';
$txt['filter_topics_title'] = '=Filtre Sujets/réponses=';
$txt['filter_topics_0'] = 'Aucun';
$txt['filter_topics_1'] = 'Sujets sans réponse';
$txt['filter_topics_2'] = 'Sujets populaires';
$txt['filter_topics_3'] = 'Sujets trés populaires';
$txt['filter_topics_4'] = 'Sondages';
$txt['filter_topics_5'] = 'Sujets verrouillés';
$txt['filter_topics_6'] = 'Mes sujets';
$txt['filter_paginate_title'] = '=Sujets par page=';
$txt['filter_paginate_10'] = 10 ;
$txt['filter_paginate_20'] = 20 ;
$txt['filter_paginate_30'] = 30 ;
$txt['filter_paginate_40'] = 40 ;
$txt['filter_paginate_50'] = 50 ;
$txt['filter_paginate_forumdefault'] = 'Valeurs par défaut';
$txt['filter_paginate_perpage'] = 'Par Page';
$txt['filter_alphanum'] = 'Activer la barre de filtre alphanumérique';
$txt['filter_alphanum_desc'] = 'Sujets commençant par ';
$txt['filter_alphanum_all'] = 'Tout';


do you thinkin adaptation for modification on smf version 2.0 beta 3.1 ?


Eventually yes when i get the time.
But at the moment i'm too busy.


Okay, I'll wait for that thanks from now.


this is kinda funny but I need help with it just the same hehehe

I installed a new theme - and made the necessary edits to the MessageIndex.template.php and the Modifications.english.php files for that theme. The filter works great, however, I dont know HOW I did it, but the filter is at the "top" of the topic view instead of the (see attached image).

Now, the filter being at the top is NOT a problem. Actually I like it at the top much better because when you have alot of topics on a board, folks have to scroll all the way to the bottom just to get to it. It being at the top is alot more convenient and makes sure that everyone viewing that board sees it.

Something that might be the cause but I cant determine because I dont have a copy of it to check is: I have 2.4 installed, but the only one listed on the mod page is 2.5. (I dont have a copy of 2.4 because I had that hardrive crash and lost it a while back). 2.5 is the one I used to make the theme edits.

What did I do to cause it to appear at the top, and how do I change it so that its like that on the default theme? (I have another theme I use that pulls from the default themes files so I would like it to be on the top there as well) :)

Ive attached those 2 files incase you want to look at them.


Well you put it in the wrong place.
(and it isn't w3c valid where you put it)
As you've put the rows of the table OUTSIDE of the table.

If you want it near the top, it should be inside the table

either just before
$stickybar = false;
$normalbar = false;

to be just below the columns of the table

if you truly want it above the table columns, it would need to go between

echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">

// Are there actually any topics to show?
if (!empty($context['topics']))

The code would need splitting and * AT THIS POINT * would be where the code would go. (although you since your breaking an echo statement remember to close the first part, and start the echo again, otherwise you'll get a template parse error)


I put the code exactly where the parser on the mod page said to (or atleast I thought I did). I will double check it again tho.

I checked the messageindex file - the parser says to put it right above this line which is where I put it.

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))

I even checked the messageindex on the default theme to make sure thats where it was at on that one too and it is, so I am totaly confused

im not sure what the w3c even is - is it important?  hehe. 

Edit: I just copied my message.index file from my default theme over to my new theme and it corrected it and put the filter back down at the bottom. I noticed on a few places, it was messing up my link tree at the top. I sure would like to have it up at the top though. (hint hint..hehe). I know your busy. I know absolutely nothing about coding but if you wouldnt mind helpin a girl out when you had a few minutes to spare I would greatly appreciate it :).