avatars
female avatars buddy icons
Avatars Avatar Galleries Forums About AllAvatars
aim buddy icons
Linda Bergkvist

Avatars
 > Newest Avatars
 > Popular Avatars
Make an Avatar
Avatar Pack
Virtual World Avatars

Forums
Avatar Games

[ Upload Avatar ]

Avatar Linkage
Privacy Policy











Newest Avatars

Latest Avatars: Last Day  Last 7 Days  Last 14 Days  All Avatars

     

Query: $query

Result: $mysql_eval_error

Database handle: $database" ); exit; } return FALSE; } else { return $mysql_eval_result; } } function get_ext( $filename ) { $photolen = strlen($filename); $RetVal = substr( $filename, $photolen-3, $photolen); return $RetVal; } function get_filename($filename) { // strip off the last 4 $len = strlen( $filename )-4; $RetVal = substr( $filename, 0, $len); return $RetVal; } // ---------------------- THESE FUNCS FROM pp-inc ----------------- // Connecting, selecting database $link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.'); mysql_select_db ("$database")or die("Could not select database"); // Here is the hacked up display_gallery($q_switch) $catquery=""; if ( IsSet($cat) ) { $querya="SELECT catname FROM pp_categories WHERE id=$cat"; $catq = ppmysql_query_eval($querya,$link); $catr = mysql_fetch_array($catq); $catname = $catr['catname']; mysql_free_result($catq); $queryb = "SELECT id FROM pp_categories WHERE parent='$cat' ORDER BY catorder ASC"; $boards = ppmysql_query_eval($queryb,$link); $cnt=0; while ( $row = mysql_fetch_array($boards, MYSQL_ASSOC)) { $catqid = $row['id']; if ( $cnt == 0 ) { $cnt=1; $catquery .= "$catqid"; } else { $catquery .= ",$catqid"; } } mysql_free_result($boards); } // Connecting, selecting database // Selecting method and Perform SQL query switch ($q_switch) { case "most_views": if ( !IsSet($cat) ) { $group_title = "Most Popular Images - All Categories"; $query = "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY views DESC LIMIT $limit"; } else { $query = "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY views DESC LIMIT $limit"; $group_title = "Most Popular Images - $catname"; } break; case "latest": if ( !IsSet($cat) ) { $group_title = "Most Recent Images - All Categories"; $query = "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY date DESC LIMIT $limit"; break; } else { $group_title = "Most Recent Images - $catname"; $query = "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY date DESC LIMIT $limit"; break; } break; default: if ( !IsSet($cat) ) { $group_title = "Random Images - All Categories"; $query = "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY RAND() DESC LIMIT $limit"; break; } else { $group_title = "Random Images - $catname"; $query = "SELECT id,user,userid,cat,title,bigimage,views FROM pp_photos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY RAND() DESC LIMIT $limit"; break; } break; } $i = 1; $e = 2; $col_val = $column; $result = mysql_query_eval($query,$link) or die("Query failed"); print ""; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $photo_name = get_filename( $line['bigimage'] ); print ""; $column = $col_val*$e; $e++; } else {print "";} $i++; } print "
"; $theext = get_ext( $line['bigimage'] ); $thecat = $line['cat']; $temp_user = ($line["userid"]); $filepath = "$data_dir"."$thecat/$temp_user$photo_name-thumb.$theext"; $rel_path = "$rel_dir"."$thecat/$temp_user$photo_name-thumb.$theext"; print ""; if ( file_exists( $rel_path ) ) print ""; else print "$filepath"; print "\n"; if ($q_switch == "most_views") { print "
".$line["title"]."
".$line["views"]." views"; print "


"; } else { print "
"".$line["title"]."""; print "
by ".$line["user"].""; } if ($i == "$column") { print "
"; // Closing connection mysql_close($link); // mysql_close($db_link); ?>

Google
Web AllAvatars