exit; } } } $rg_banname = explode(',', $rg_banname); foreach ($rg_banname as $value) { if (strpos($username, $value) !== false) { $tipsvar = '��<font color=#008000>���磺' . cdstrletters(4) . '����' . cdstrletters(4) . cdstr(4) . '</font>'; echo "<script language=\"JavaScript1.2\">parent.retmsg('1','" . $tipsvar . "');</script>"; exit; } } require_once wrzc_net . 'sub/conn.php'; $rt = $db->query("SELECT id FROM " . __TBL_MAIN__ . " WHERE username='******'"); if ($db->num_rows($rt)) { $tipsvar = '<br>����<font color=#008000>���磺' . $username . cdstr(4) . '</font>'; echo "<script language=\"JavaScript1.2\">parent.retmsg('3','" . $tipsvar . "');</script>"; exit; } else { echo "<script language=\"JavaScript1.2\">parent.retmsg('4','');</script>"; exit; } } elseif ($submitok == "addupdate") { $ifnext = true; $varmsg = ""; if (!preg_match('/(^[a-z]{1})([a-z0-9]{2,11}$)/', $form_username)) { $varmsg .= "�� �û���������3~12λСдӢ����ĸ��СдӢ����ĸ��������϶��ɣ�������ĸ��ͷ��\\n"; $ifnext = false; } $rg_banname = explode(',', $rg_banname); foreach ($rg_banname as $value) {
$hex = $value; while (strlen($hex) < 6) { $hex = "0" . $hex; } $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); $test = imagecolorallocate($img, $r, $g, $b); imagesetpixel($img, $cols, $rows, $test); } } } $filepath = wrzc_net . "up/photo/" . date("y") . "/" . date("md") . "/"; mkpath($filepath); $dbpath = date("y") . "/" . date("md") . "/"; $filename = $cook_userid . "_" . cdstr(20) . ".jpg"; $destination = $filepath . "b_" . $filename; imagejpeg($img, $destination, 85); imagedestroy($img); $path_s = $dbpath . "s_" . $filename; $path_b = $dbpath . "b_" . $filename; $RESIZEWIDTH = 100; $RESIZEHEIGHT = 100; $im = imagecreatefromjpeg($destination); makexiao($im, $RESIZEWIDTH, $RESIZEHEIGHT, $filepath . 's_' . $filename); imagedestroy($im); $addtime = date("Y-m-d H:i:s"); $db->query("INSERT INTO " . __TBL_PHOTO__ . " (userid,path_s,path_b,title,addtime) VALUES ('{$cook_userid}','{$path_s}','{$path_b}','{$title}','{$addtime}')"); // $tmpid = $db->insert_id(); $rt = $db->query("SELECT a.userid,b.grade,b.if2 FROM " . __TBL_FRIEND__ . " a," . __TBL_MAIN__ . " b WHERE a.senduserid=" . $cook_userid . " AND a.userid=b.id AND a.ifagree=1");
$simage = imagecreatefromjpeg($file[tmp_name]); break; case 3: $simage = imagecreatefrompng($file[tmp_name]); break; case 6: $simage = imagecreatefromwbmp($file[tmp_name]); break; } } if ($_SERVER['REQUEST_METHOD'] == 'POST' && is_uploaded_file($_FILES["pic"][tmp_name])) { $file = $_FILES["pic"]; $filepath = wrzc_net . "up/wzphoto/" . date("Ym") . "/"; $dbpath = date("Ym") . "/"; mkpath($filepath); $savename = $cook_userid . "_" . cdstr(20) . "."; $filename = $file["tmp_name"]; $image_size = getimagesize($filename); $pinfo = pathinfo($file["name"]); $ftype = $pinfo['extension']; $destination = $filepath . "b_" . $savename . $ftype; if (!move_uploaded_file($filename, $destination)) { callmsg("移动照片出错", "-1"); } $path_b = $dbpath . "b_" . $savename . $ftype; // 略 $RESIZEWIDTH2 = 700; $RESIZEHEIGHT2 = 700; if ($ftype == "jpg" || $ftype == "JPG") { $im = imagecreatefromjpeg($destination); } else {
$hex = $value; while (strlen($hex) < 6) { $hex = "0" . $hex; } $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); $test = imagecolorallocate($img, $r, $g, $b); imagesetpixel($img, $cols, $rows, $test); } } } $filepath = wrzc_net . "up/" . $Global['m_flvpath'] . "/" . date("y") . "/" . date("md") . "/"; $dbpath = date("y") . "/" . date("md") . "/"; mkpath($filepath); $tmpname = $cook_userid . "_" . cdstr(20); $newpic = $tmpname . ".jpg"; $newflv = $tmpname . ".flv"; $destinationJPG = $filepath . $newpic; imagejpeg($img, $destinationJPG, 85); imagedestroy($img); $destinationFLV = $filepath . $newflv; $addtime = date("Y-m-d H:i:s"); $path_s = $dbpath . $newpic; $path_b = $dbpath . $newflv; $flag = $cook_grade > 1 ? 1 : 0; $db->query("INSERT INTO " . __TBL_VIDEO__ . " (userid,path_s,path_b,title,content,flag,addtime,effectid,frameid) VALUES ('{$cook_userid}','{$path_s}','{$path_b}','{$title}','{$content}','{$flag}','{$addtime}','{$effectID}','{$frameID}')"); copy(wrzc_net . "FMS/record/streams/_definst_/" . $oldflv, $filepath . $newflv); if (file_exists(wrzc_net . "FMS/record/streams/_definst_/" . $oldflv)) { unlink(wrzc_net . "FMS/record/streams/_definst_/" . $oldflv); }