I've got a column in my lsql_Links table called isFeatured.
When this is set to 1, I show the link in a highlighted table and placed above the rest of the links.
I'd like to develop a global, which will update the category and detailed pages and show featured links belonging the appropriate category.
Say for example, someone browses a link with the ID=100.
The following sql statement tells me which category that link belongs to if its a link.
select * from lsql_CatLinks where LinkID=100;
Say that returns the CategoryID as 31. Not sure where the Category ID is stored when I'm building a category listing page.
The following SQL statement allows me to then find the featured links in that category.
Can someone help me turn this into a global which I can use during the build process in the various templates?
Thanks!
When this is set to 1, I show the link in a highlighted table and placed above the rest of the links.
I'd like to develop a global, which will update the category and detailed pages and show featured links belonging the appropriate category.
Say for example, someone browses a link with the ID=100.
The following sql statement tells me which category that link belongs to if its a link.
Code:
select * from lsql_CatLinks where LinkID=100;
Say that returns the CategoryID as 31. Not sure where the Category ID is stored when I'm building a category listing page.
The following SQL statement allows me to then find the featured links in that category.
Code:
select ID,Title from lsql_Links,lsql_CatLinks where lsql_CatLinks.CategoryID=31 and lsql_Links.ID=lsql_CatLinks.LinkID and lsql_Links.isFeatured=1;Can someone help me turn this into a global which I can use during the build process in the various templates?
Thanks!