 |
|
 |
 |
| View previous topic :: View next topic |
| Author |
Message |
DJCassio Administrator

Gender:  Joined: Jun 11, 2004 Posts: 974 Location: Denver
  votes: 1

Status: Offline
|
Posted: Fri Feb 05, 2010 3:40 pm Post subject: Re: Logged in to listen project |
|
|
I don't allow non-registered (guests) on my playlist page.
You could check for userid>1 and then eclose that section in brackets { } |
Rob Oyler
Program Director, FM5280
|
|
| Back to top |
|
 |
GoreApostle Smooth Jazz Forum King

Gender:  Joined: Feb 24, 2007 Age: 41 Posts: 257 Location: Mobile, Al.
  

Status: Offline
|
Posted: Fri Feb 05, 2010 3:46 pm Post subject: Re: Logged in to listen project |
|
|
Like this?
| Code:
|
// Check to see if user is listening for at least 20 minutes to make a request
if ($userdata['user_id'] <1>open("SELECT last_seen_listening FROM userinfo WHERE userid = ".$userdata['user_id']);
$user_row = $SAMdb->row();
$seconds = (strToTime(date("Y-m-d H:i:s",time())) - strToTime($user_row['last_seen_listening']));
if ($seconds < 0)
$seconds = -1 * $s;
$minutes = intval($seconds / 60);
if($minutes <= 20)
$requestok = true;
else
$requestok = false;
|
|
|
|
| Back to top |
|
 |
DJCassio Administrator

Gender:  Joined: Jun 11, 2004 Posts: 974 Location: Denver
  votes: 1

Status: Offline
|
Posted: Sat Feb 06, 2010 8:21 am Post subject: Re: Logged in to listen project |
|
|
No, that code would produce an error. It would be more like this.
| PHP:
|
if ($userdata['user_id'] > 1) { // Check to see if user is listening for at least 20 minutes to make a request $SAMdb->open("SELECT last_seen_listening FROM userinfo WHERE userid = ".$userdata['user_id']); $user_row = $SAMdb->row(); $seconds = (strToTime(date("Y-m-d H:i:s",time())) - strToTime($user_row['last_seen_listening'])); if ($seconds < 0) $seconds = -1 * $s; $minutes = intval($seconds / 60); if($minutes <= 20) $requestok = true; } else $requestok = false;
|
|
Rob Oyler
Program Director, FM5280
|
|
| Back to top |
|
 |
|
GoreApostle Smooth Jazz Forum King

Gender:  Joined: Feb 24, 2007 Age: 41 Posts: 257 Location: Mobile, Al.
  

Status: Offline
|
Posted: Mon Feb 08, 2010 11:00 am Post subject: Re: Logged in to listen project |
|
|
| I tried that change and it only rendered a blank white borked page. I changed it back and it worked for logged in members. Hoever, even the way I have it set a non-member viewing the Playlist page gets that error I posted. How would I set things, like you do, so that non-registered visitors can't view my Playlist page or maybe send them to the registration page with a message telling them they have to be a member in order to view the Playlist page? I have gotten the ShoutCAST script, posted on Scott's site, to work but it doesn't calculate the listening time from what I can tell because I have been listening to two days and it still gives me the 'Tune In' button on the request pages. The script works though. Haha. Thanks for any help on this matter. |
|
|
| Back to top |
|
 |
DJCassio Administrator

Gender:  Joined: Jun 11, 2004 Posts: 974 Location: Denver
  votes: 1

Status: Offline
|
Posted: Mon Feb 08, 2010 11:42 am Post subject: Re: Logged in to listen project |
|
|
| Those pages are modules correct? Go to the Modules admin and make them Registered Users only. |
Rob Oyler
Program Director, FM5280
|
|
| Back to top |
|
 |
GoreApostle Smooth Jazz Forum King

Gender:  Joined: Feb 24, 2007 Age: 41 Posts: 257 Location: Mobile, Al.
  

Status: Offline
|
Posted: Mon Feb 08, 2010 11:49 am Post subject: Re: Logged in to listen project |
|
|
| DUH!!! Gosh. I can't believe I even posted how to do that. Thanks DJ. |
|
|
| Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
|
|
 |