PDA

View Full Version : Sessions - 1 works, 1 doesnt.


blacklabelled
03-12-2011, 05:29 PM
I am trying to set sessions for the 8way media library in order to be able to sort the videos by both categories and tagcache. I have provided the code below, which works great when sorting divisions. However, when sorting by Leagues the session is not setting properly
// determine if user filtered by solely the league
else if (isset($_REQUEST['league'])) {

//update the session
$media_league = $_REQUEST['league'];
$vbulletin->session->set('media_league', $media_league);

//set the filter
$query_filter = "WHERE media_category.catOrder = '" . $vbulletin->session->var['media_league'] . "'";
}

// determine if user filtered by solely the division
else if (isset($_REQUEST['division'])) {

//update the session
$media_division = $_REQUEST['division'];
$vbulletin->session->set('media_division' , $media_division);


// set the filter
$query_filter = "WHERE media_category.catOrder != '0' AND media.tagcache LIKE '%" . $vbulletin->session->var['media_division'] . "%'";
}

//otherwise no filter
else {
$query_filter = "WHERE media_category.catOrder != '0'";
}

To further explain my situation I have provided the problematic code below.

//THIS WORKS
$media_league = $_REQUEST['league'];

//THIS DOESNT
$vbulletin->session->set('media_league', $media_league);

Now. The only difference between the two is that media_division is passed as either "toronto, calgary, montreal, or vancouver" while media_league is passed as either "1, 2, 3, 4, 5, 6, or 7"

I tried both (int)$media_league and (string)$media_league with no success. Any ideas? Thank you!