Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#973 2024-10-01 09:27:38

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

Re: smd_gallery: super-flexible gallery generator

If it helps, in MySQL 8 you can use ROW_NUMBER() function, plugging it into smd/etc_query:

SELECT * FROM (SELECT *, CEILING(ROW_NUMBER() OVER (ORDER BY date DESC)/10) AS page_num FROM `txp_image`) img WHERE category="sidebar-highlights" LIMIT 12

Offline

#974 2024-10-01 16:09:35

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: smd_gallery: super-flexible gallery generator

etc wrote #337908:

If it helps, in MySQL 8 you can use ROW_NUMBER() function, plugging it into smd/etc_query:

SELECT * FROM (SELECT *, CEILING(ROW_NUMBER() OVER (ORDER BY date DESC)/10) AS page_num FROM `txp_image`) img WHERE category="sidebar-highlights" LIMIT 12...

Oh nice! Thank you, I will give this a try.

Last edited by maruchan (2024-10-03 01:24:12)

Offline

Board footer

Powered by FluxBB