Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#106 2016-09-30 10:43:14
Re: mdn_count
Makes me think that <txp:article_custom /> could accept pgonly attribute (without setting the pagination stuff) and return just the number of pages in this case. Yay, nay?
Offline
#107 2016-11-16 09:36:18
Re: mdn_count
Hi
After upgrading to txp 4.6.2 i got this error :
Erreur de balise : <txp:mdn_count section="site" category='<txp:category />'/> -> Textpattern Error: Unknown column 'NULLDATETIME' in 'where clause' lors du traitement du module “Aucun” dans le gabarit “2016”
What s NULLDATETIME, i havent found anything even on google!
it refere to this line 46 :
$q[] = $andor.' (Posted <= now() and (now() <= Expires or Expires = '.NULLDATETIME.'))';
NULLDATETIME is not a mysql constant, then maybe a txp constant ? but i found nothing about it ?
UPDATE : it seems that the constant was defined on constants.php on txp 4.5.7 and before, but the constant is nt in new version,
I added
define('NULLDATETIME', '\'0000-00-00 00:00:00\'');
to the plugin and the error vanished.
Last edited by Dragondz (2016-11-16 09:58:44)
Offline
#108 2016-11-16 09:56:09
Offline
#109 2016-11-16 09:59:28
Re: mdn_count
Merci Nicolas
To make mdn_count work i had to change line 46 like this:
$q[] = $andor.' (Posted <= now() and (now() <= Expires or Expires is null))';
Offline
#110 2016-11-16 11:02:45
Re: mdn_count
Dragondz wrote #302935:
Unknown column ‘NULLDATETIME’
Here’s the plugin fix from a post the other day.
I added
define('NULLDATETIME', '\'0000-00-00 00:00:00\'');...to the plugin and the error vanished.
Not advisable. The reason it was removed is because MySQL and its various forks are starting to remove support for zero dates. Results are undefined if you use them and vary from version to version. If you feel you must use it, this is better:
define('NULLDATETIME', '\'1970-01-01 12:00:00\'');
But changing the code as you’ve done to use IS NULL is far better.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#111 2016-11-16 12:02:20
Re: mdn_count
Thanks Stef.
Offline