View Single Post
Old 11-30-2014, 07:34 AM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,060
Quote:
Originally Posted by funnytimecpl View Post
can you guys point me in a direction on how can i make this code to work this way ?

show my cam when i'm online , else show Best Converting Tour ?
Depend on exactly ehat you mean by show your cam when online but using the code from above. You could make yourself the only user in the array and then in the "if(!online..." you could put up the best converting tour link:

Code:
$users_to_show=array("myusername");

$cams = new SimpleXMLElement('http://chaturbate.com/affiliates/api/onlinerooms/?format=xml&wm=AFFILIATELINK', null, true);

$online = false;
foreach ($cams as $user) 
{
  if(in_array(strtolower($user->username),$users_to_show))
  {
    echo '<div id="roomname_b"> ';
    echo '<img src="' . $user->image_url . '">';
    echo $user->username .' is online';
    echo '<div class="site">';
    echo '</div></span>'; 
    $online = true;
  }
}
if (!$online) 
{
    echo '<div id="null"> Info for best converting tour here.....;
That is probably not what you really want though. I am thinking you want to iframe your room or the best converting room. But I have answered what you have asked and will wait to see if that was what you really want ;p

.
__________________
All cookies cleared!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook