News:

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

Main Menu

Topics Filter v3.0

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

Previous topic - Next topic

diegolyanky

SMF ... SimpleMachines ... Simple, but complete if you want it ;)

karlbenson

For some reason one of the brackets got changed to a question mark.

Replace
$datefilter = "AND '". ( time() - ($context['filter_date'] * 24 * 60 * 60? )) ."' <= ml.posterTime";
With
$datefilter = "AND '". ( time() - ($context['filter_date'] * 24 * 60 * 60) ) ."' <= ml.posterTime";

diegolyanky

#62
Same error but in other line ...

Parse error: syntax error, unexpected ')' in /home2/diego/public_html/Sources/MessageIndex.php on line 319

But, I corrected by replacing:


$datefilter = "AND '". ( time() - ($context['filter_date'] * 24 * 60 * 60? ) ."' <= ml.posterTime";



With:


$datefilter = "AND '". ( time() - ($context['filter_date'] * 24 * 60 * 60) ) ."' <= ml.posterTime";


And I give this error:

Unknown column '113Array' in 'where clause'
Archivo: /home2/diego/public_html/Sources/MessageIndex.php
Línea: 825

Line 825 says:

LIMIT " . ($pre_query ? '' : "$start, ") . "$maxindex", __FILE__, __LINE__);

DAtabase error ?
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

karlbenson

Try
$datefilter = "AND ". ( time() - ($context['filter_date'] * 24 * 60 * 60) ) ." <= ml.posterTime";

diegolyanky

I'm sorry, but I was the same error ...

Parse error: syntax error, unexpected ')' in /home2/diego/public_html/Sources/MessageIndex.php on line 319

IF you like, I can give you an access to my FTP to try ;)

Thanks for your time ;)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

diegolyanky

So ? ... ANy other solution ? ... I wanna use your cool MOD  ;D
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

karlbenson

Replace those few lines with
// Don't filter by date unless filter date is set
if($context['filter_date'] == "366")
$datefilter = "AND ". ( time() - (365 * 24 * 60 * 60) ) ." > ml.posterTime";
elseif($context['filter_date'] != 0)
$datefilter = "AND ". ( time() - ($context['filter_date'] * 24 * 60 * 60) ) ." <= ml.posterTime";

diegolyanky

I did it and I have this error:

Unknown column '112Array' in 'where clause'
Archivo: /home2/diego/public_html/Sources/MessageIndex.php
Línea: 829

SMF ... SimpleMachines ... Simple, but complete if you want it ;)

ディン1031

So i help diegolyanky:

The Strange thing is, you mod have error here, somehow you have a special esc char in you mod xD, with it it will not work. But that did you all ready show how to fix. (You should fix it in you mod, too).

The other thing that now occure is,

You use $filter as variable, but you also fill this variable with a array. But you forget to remove the array if nothing is selected... One way could be search for:

// Sequential pages are often not optimized, so we add an additional query.

and add before

//Normal this should not happen!
if(!empty($filter) && is_array($filter))
$filter = '';

, than it will never happen that there is array in it, but i'm not sure if this correct, because it is possible that there is a other mistake ;)

I hope it will help you to find the error.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

ne.miguelito

It lacks the letter L,

in MessageIndex.template.php


find   

$letters = array('0-9','A','B','C','D','E','F','G','H','I','J','K','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','all');


replace

$letters = array('0-9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','all');


diegolyanky

Quote from: ディン1031 on January 23, 2008, 10:38:38 AM
So i help diegolyanky:

The Strange thing is, you mod have error here, somehow you have a special esc char in you mod xD, with it it will not work. But that did you all ready show how to fix. (You should fix it in you mod, too).

The other thing that now occure is,

You use $filter as variable, but you also fill this variable with a array. But you forget to remove the array if nothing is selected... One way could be search for:

// Sequential pages are often not optimized, so we add an additional query.

and add before

//Normal this should not happen!
if(!empty($filter) && is_array($filter))
$filter = '';

, than it will never happen that there is array in it, but i'm not sure if this correct, because it is possible that there is a other mistake ;)

I hope it will help you to find the error.

Bye
DIN1031

DIN1031 is a GENIUS !!! ... Man, you found the error only on the code, without testing and in only 3 minutes !!!! ... You are great ! ...
Tell me the truth: Is your real name " NEO " ? :D
Many thanks a lot for your help ! ...

Worked very fine ;)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

karlbenson

2.3 - 13th February 2008
o Fixed missing L from Alphanum filter
o Fixed disappearing filters where guest is viewing board with children, but no posts.

ne.miguelito

Filter topics based on
o Post Date
- Last 90 Days | Last 180 Days | Last 270 Days | Last 365 Days | Over 365 days

at this options appears this errors only if I change page( like go page 2 inside the board):

Unknown table 'ml' in where clause
Ficheiro: /home/nemigue/public_html/Sources/MessageIndex.php
Linha: 619

karlbenson

version of smf?
Can you please attach your MessageIndex.php

ne.miguelito


karlbenson

Sorry for taking so long to get back to you.

I have managed to fix it with an additional edit. It is included in v2.4. It is probably preferential if you can to uninstall 2.3, then installing 2.4 rather than manually applying this fix, as it will mean in future, the mod will be able to uninstall.

FIND
LEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)" : '') . "

REPLACE
LEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)" : "LEFT JOIN {$db_prefix}messages AS ml ON (ml.ID_MSG = t.ID_LAST_MSG)") . "

karlbenson

V2.4 now available, fixing the above bug.

2.4 - 14th February 2008
o Fixed ml. no table

ne.miguelito

I prefer to do manually...  Already it works well



you could indicate (manually) as fix this point from the previous version:

o Fixed disappearing filters where guest is viewing board with children, but no posts.

Sorry my bad English...

karlbenson

Unfortunately its too time consuming to provide detailed changes.
Thats one of the reason I tend not to do upgrade packages. And with the no. of mods I have and am currently updating, its impractical.

If you were specificially asking me about that change it was

Sources/MessageIndex.php
FIND
// If there are children, but no topics and no ability to post topics...
$context['no_topic_listing'] = !empty($context['boards']) && empty($context['topics']) && !$context['can_post_new'];

REPLACE
// If there are children, but no topics and no ability to post topics...
// Only if no filtering is being done here, otherwise they won't be able to remove the filter
$usingfilter = (!isset($letter) && empty($context['filter_topics']) && empty($context['filter_date'])) ? 0 : 1 ;
$context['no_topic_listing'] = !empty($context['boards']) && empty($context['topics']) && !$context['can_post_new'] && !$usingfilter;

ne.miguelito


Advertisement: