Nope instead change those lines you posted to this
$query = "SELECT SUM(views) as tviews, COUNT(*) AS tphotos FROM {$Globals['pp_db_prefix']}products";
$totalv = mysql_query($query, $rplink);
list( $totalpviews, $products ) = mysql_fetch_row($totalv);
mysql_free_result($totalv);
$totalpviews = number_format( $totalpviews );
$prototal = number_format( $products );