View Single Post
Old 04-30-2016, 01:44 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,057
Quote:
Originally Posted by k33n View Post
@adulttemps your Cb script is great.Any ideas how to solve soft 404 pages generated if username is not online?For example if a visitor comes from a SE link like domain.com/cam/username but the username is offline,page has no content because there is no info to extract from xml.Soft 404 in google eyes and bad website experience for visitor.Thanks
The script started as the NMIP standalone that we have discussed before. The function for the individual cam is in the functions.php file and is called solo_cams().

I took a look and right now because some of the display stuff is in the functions there are actually 2 different solo_cams() functions, one for adulttemps Version 1 (v1) and one for version 2 (v2). The differences between the 2 are because of the display stuff inside the functions.

The problem of nobody on line can be solved by modifying the solo_cams function.

1. Near the beginning define a variable to use as a switch as to whether the cam was found or not ($found_cam=0;)

2. Then if the cam is found change the value of the switch ($found_cam=1;)

3. Then check to see if the cam was found and if it wasn't then put something else up. (if(!$found_cam){do something here;})

It would end up looking something like this:

Code:
// Print Solo Cams
		
function solo_cams( $affid, $track, $user ) {
      
        // add found cam switch and initialize it to 0
        $found_cam=0;
        .
	.
	foreach( $cams as $cam ){ 
        .
        .
   	   if ( $cam->username == $user ) {
            
              // cam was found set found cam switch to 1
              $found_cam=1;
             .
             .
	   }
        }

        // check to see if cam was found
       if(!$found_cam)
       {
          // if cam was not found then   
          echo "Put the alternate display stuff for if the cam user is not on line here.";
       } 			
				
       if ( RELATED_SHOW ) {
            .
            .
      }					
}
I think ;p
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote