If $IN->QSTR returns nothing, can I give it a value from the result of a query? Or am I not supposed to mess with those global variables? Sorry if this is a silly question but this is my first attempt at a plugin.
What I want to do is give it the value of the latest entry’s entry_id ONLY IF there is no entry id in the URL.
I want to use something like this with some existing gallery module code which uses the result of $IN->QSTR
if ($IN->QSTR == ‘’)
{
$sql =“SELECT entry_id FROM exp_gallery_entries
WHERE gallery_id=’’ LIMIT 1”;
$IN = $DB->query($sql);
}
Still working on getting the gallery id in there so please ignore that. I want to know if this is basically sound before I go diving in there and possibly screw something up.
