The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2006, 10:05 AM
Marris Marris is offline
Junior Member
 
Join Date: Feb 2006
Posts: 23
Geek Article and Review System License Holder 
Question MySQL queries sort/search on GARS custom variables?

I would like to be able to output a list of the next 10 upcoming titles in my GARS database, based on and ordered by my custom date field.

Looking at the database, it appears that custom variables are not actually stored in their own MySQL fields, but together in one field with all the other fields from modules used on the page.

If my custom date field was in it's own field like other vB date fields, it would be straightforward to select and order the items based on date.

Right now, the only method that I can imagine to do this is to parse all the custom1 fields by looking through each entry for a unique string sequence preceeding the date, extract the date and then build a temporary new array to be able to sort and select relevant items.

Is this the best/only way to run queries and sort on a custom field? Or is there a way to make a custom GARS field that only has my custom date information and no other module data, so I can run a direct MySQL query? (To avoid substring extraction and building a temporary sorting array.)

Example custom field database entry:

Code:
a:8:{s:17:"custom_header_url";s:47:"http://www.site.com/forums/forumdisplay.php?f=9";s:8:"datesimp";s:10:"11/23/2004";i:26;s:19:"link1
link2
link3";i:25;a:1:{s:7:"custom1";a:1:{s:17:"custom_header_url";s:47:"http://www.site.com/forums/forumdisplay.php?f=9";}}i:41;a:1:{s:8:"datesimp";i:1101186000;}i:28;N;i:16;N;i:17;N;}
This is the relevant data I want to use to select and sort (this will be different for each item):

1101186000

Any advice is appreciated.
Reply With Quote
  #2  
Old 03-03-2006, 05:45 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Hey Marris,

You can use custom2 field if you are wanting to store a lastupdate value. Saving that, I have already started working on the next version of GARS that actually gives you the ability to create seperate custom fields which you can sort by.

HTHs
Reply With Quote
  #3  
Old 03-04-2006, 12:07 AM
Marris Marris is offline
Junior Member
 
Join Date: Feb 2006
Posts: 23
Geek Article and Review System License Holder 
Default

Quote:
Originally Posted by The Geek
You can use custom2 field if you are wanting to store a lastupdate value. Saving that, I have already started working on the next version of GARS that actually gives you the ability to create seperate custom fields which you can sort by.
Ok, thanks. I'm still early on in testing , so I will probably be better off waiting for your update rather than cobbling something together myself.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing custom fields in vbulletin search results stckhlm Geek Article and Review System 1 09-30-2008 07:06 PM
Gars causing high queries ? miyukichii Geek Article and Review System 8 03-04-2008 05:40 PM
Search Articles by first letter and custom fields Praetorian Geek Article and Review System 1 05-13-2007 01:48 PM
Sort by custom fields Ramses Geek Article and Review System 4 04-18-2007 05:01 PM
Custom Variables outside of Article display ? Zate Geek Article and Review System 4 02-06-2006 08:08 PM


All times are GMT. The time now is 12:03 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.