Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#337 2020-01-03 13:23:23

etc
Developer
Registered: 2010-11-11
Posts: 5,132
Website GitHub

Re: smd_query: Talk to the database directly via SQL

I would expect many front-side plugins to stop working in 4.8. But it’s the third txp version since introducing tags registry, the authors had almost four years to update their plugins.

Offline

#338 2020-01-04 00:31:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,413
Website GitHub

Re: smd_query: Talk to the database directly via SQL

etc wrote #320798:

the authors had almost four years to update their plugins.

Okay okay, guilty! I’ll get it fixed :)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#339 2020-05-16 06:43:47

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

Re: smd_query: Talk to the database directly via SQL

Sorry to come up with this again, but I run into the same problem again and I did not really manage to solve it the last time. I took a look at the post tag registering but I have no clue where to register it or where to put what exactly in case of smd_query. Can you help please?

Offline

#340 2020-05-16 10:20:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,413
Website GitHub

Re: smd_query: Talk to the database directly via SQL

Sorry for the huge delay. I’ve finally released smd_query v0.6.0 which brings with it tag registration as well as <txp:smd_query_info /> tag which you can use instead of the {replacement} syntax for added power and flexibility.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#341 2020-05-16 15:19:49

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

Re: smd_query: Talk to the database directly via SQL

Thanks a lot Stef!

But I have to admit that my very problem was at the end not related to smd_query. I found out that it was in combination with smd_macro that caused the problem. I am using smd_query inside a smd_macro which until the update to 4.8.0 was working like a charm.

After I updated smd_query to 0.6.0 my problem was still there. First I tried to register the tags for smd_macro by putting the code for tag registration just inside the code on the top but no success. Maybe I miss something here? Would be good to know on how tag registration should be done in general to be able to help myself in the future. But I don´t want to go too much off-topic here.

For smd_macro: I know that I should not be using smd_marco anymore because txp forms can do the same and better. So I arranged all my macros in forms now and voila. Everything seems fine now.

Offline

#342 2020-05-16 15:24:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,413
Website GitHub

Re: smd_query: Talk to the database directly via SQL

demoncleaner wrote #323014:

I tried to register the tags for smd_macro by putting the code for tag registration just inside the code on the top but no success.

If you’re using the latest version then it should auto-register your tags. Strange if not.

I arranged all my macros in forms now and voila. Everything seems fine now.

Yay, good. While it works well, smd_macro is a massive hack so the more people that can move to core shortcodes, the better.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#343 2020-05-16 15:30:34

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 220
Website

Re: smd_query: Talk to the database directly via SQL

Here we go… my bad! Didn´t realise that there was a later version. I was on 0.30.
But anyway – as you said – I am happy to have switched it to the more elegant version.
Thanks again!

Offline

#344 2020-11-10 14:18:11

Pemischl
Member
From: Vienna, Austria
Registered: 2012-01-14
Posts: 22
Website

Re: smd_query: Talk to the database directly via SQL

Would it be possible to delete comments older than a certain amount from an article. i tried this code in an article-form, but it didn’t work out:

<txp:if_comments>
<txp:smd_query query="DELETE FROM 'txp_discuss' WHERE parentid = '<txp:article_id/>' AND DATEDIFF( NOW( ) ,  posted ) >=30">
</txp:smd_query>
</txp:if_comments>

Offline

#345 2020-11-12 11:58:36

etc
Developer
Registered: 2010-11-11
Posts: 5,132
Website GitHub

Re: smd_query: Talk to the database directly via SQL

Pemischl wrote #326710:

Would it be possible to delete comments older than a certain amount from an article. i tried this code in an article-form, but it didn’t work out:

The query itself should work, provided the site is granted sufficient db permissions (stale cache?). But I wouldn’t recommend it, since if_comments pulls its data from articles comments_count field that will not be updated via this code.

Offline

#346 2021-07-19 15:00:09

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: smd_query: Talk to the database directly via SQL

Hi Stef

Got a warning about count for empty results, sent you a commit on GitHub.

Cheers.

PS: Another warning on php 7 about $pageout = “” it should be $pageout = array(); (in the textpattern modify plugin it s on line 143)

Last edited by Dragondz (2021-07-19 16:08:05)

Offline

#347 2022-10-03 17:12:27

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: smd_query: Talk to the database directly via SQL

Hi Stef

I got a problem with 0.6 version, i think it s not handling smd_query imbrication well, i will stau with 0.5.

Cheers.

Offline

Board footer

Powered by FluxBB