Can I do this with $IN ???
Posted: 18 February 2005 07:05 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  836
Joined  04-17-2002

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.

 Signature 

antipodean.org | uptheduff.org

Profile
 
 
Posted: 18 February 2005 10:58 AM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

The downside is that EE tags use that variable (empty or not) to determine what entry, page, date, etc. to display on a page.  My manipulating that variable it is possible you might confuse those tags by having invalid values (entries that do not exist) or having it interpret it incorrectly (something looks like a date).

If you are careful though, it probably can work.

 Signature 
Profile
 
 
Posted: 18 February 2005 01:33 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  836
Joined  04-17-2002

Thanks Paul, I’ll keep to my plan and post the results here.

 Signature 

antipodean.org | uptheduff.org

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 23
Total Topics: 82016 Total Anonymous Users: 17
Total Replies: 440816 Total Guests: 176
Total Posts: 522832    
Members ( View Memberlist )