Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[solved] txp 4.7.1: safe_count no longer works
The code used to return the number of links under the contributors link category but since the upgrade, no number is returned. Does anyone have any advice on what the new php should be?
<txp:php>echo safe_count('txp_link', "category = 'contributors'");</txp:php>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [solved] txp 4.7.1: safe_count no longer works
Hi Yiannis, any complains in debug mode? Where and how do you use this code?
Offline
Re: [solved] txp 4.7.1: safe_count no longer works
Using colak’s code in an article, with a link category contributors
, I get this in debug mode:
Parse error: syntax error, unexpected '=', expecting ',' or ')' in /var/www/vhosts/textpattern.co/release-demo/live/textpattern/publish/taghandlers.php(4248) : eval()'d code on line 1
…and nothing else.
Edit: I had Textile enabled. Mea culpa.
Last edited by gaekwad (2018-06-28 15:01:35)
Offline
Re: [solved] txp 4.7.1: safe_count no longer works
I get a plain zero as expected. Unless the code is textiled, perhaps?
Offline
Re: [solved] txp 4.7.1: safe_count no longer works
Actually, I have Textile enabled. Please ignore p312749 – the office is hot today and my brain isn’t working!
Offline
Re: [solved] txp 4.7.1: safe_count no longer works
It is in a page not in an article. github.com/colak/neme/blob/master/pages/default.tpl#L683
> Edit solved… It’s a good thing I have backups on github:)
Last edited by colak (2018-06-28 16:02:27)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline