Location: PHPKode > projects > Uniform Price Markets > UPmarkets-0.1.0/inc.d/f_user_is_partner.inc
<?php

// (C) 2000 LinuxFutures.com, Inc.
// 
// Part of UPmarkets - the software behind the LinuxFutures game site
//                     visit www.LinuxFutures.com to play
//
//  We are making the software available to you under the GNU General Public License,
//  a copy of which should accompany this software in the file LICENSE.
//
// A web-based copy of the LICENSE is located at http://www.gnu.org/copyleft/gpl.txt
//
// While there is no charge for using this software, there are important restrictions.
//
// This LICENSE does not allow, in general, proprietary modifications or proprietary derivative works.
//
// This software carries ABSOLUTELY NO WARRANTY. It is offered AS-IS, and may not work at all
//  or may have harmful or hazardous side effects.
//
// 
// -------------------- what this file does ---------------------
// provides function user_is_partner($sym, $user, $status)
//    determines if a given userid is a partner of market $sym of given status


function user_is_partner($symid="0", $user="0", $status="accepted") {
  global $db_link;
 
  $symbolid = (int) $symid;  
  $userid   = (int) $user;
  if (($symbolid <= 0 ) || ($userid <= 0)) { echo "f_user_is_partner bad parms"; exit(); }
 
  $sql = "SELECT COUNT(*) from partners WHERE ";
  $sql   .= " symbolid = ".$symbolid." AND userid = ".$userid." AND status = '".addslashes($status)."';";

  $q = mysql_query($sql, $db_link);  
  mysql_error_sanity("f_user_is_partner.inc"); // dies if sql error
  $answer = mysql_result($q,0,0);

  return($answer);

}
  

  
Return current item: Uniform Price Markets