/** * * 登陆接口 ... * @param unknown_type $userlogin * @param unknown_type $isRe */ public function login($userlogin = array(), $isRe = false) { $userlogin = $userlogin ? $userlogin : array('username' => $this->input['username'], 'password' => $this->input['password'], 'isextend' => 1); $UserLogin = $this->auth->login($userlogin); unset($userlogin['password']); log2file(array(), 'debug', '用户登陆', $userlogin, $UserLogin); unset($UserLogin['password']); if ($isRe) { return $UserLogin; } $this->addItem($UserLogin); $this->output(); }
/** * * 登陆接口 ... * @param unknown_type $userlogin * @param unknown_type $isRe */ public function login($userlogin = array(), $isRe = false) { $userlogin = $userlogin ? $userlogin : array('username' => $this->input['username'], 'password' => $this->input['password'], 'isextend' => 1); $UserLogin = $this->auth->login($userlogin); unset($userlogin['password']); log2file(array(), 'debug', '用户登陆', $userlogin, $UserLogin); $this->addLogs('用户登陆', array(), $UserLogin, $userlogin['username']); unset($UserLogin['password']); //读取用户余额 $sql = 'SELECT balance FROM ' . DB_PREFIX . 'user_queue WHERE user_id=' . $UserLogin['id']; $balance = $this->db->query_first($sql); $UserLogin['balance'] = $balance['balance']; if ($isRe) { return $UserLogin; } //$this->insert_user_queue($UserLogin); $this->addItem($UserLogin); $this->output(); }
protected function callback_app_by_client_id($client_id = '', $vid = 0) { log2file($this->user, 'debug', '应用回调', array('video_id' => $vid, 'client_id' => $client_id)); if (!$vid) { return; } $sql = 'SELECT * FROM ' . DB_PREFIX . 'user_bind_app WHERE user_id = ' . $this->user['user_id']; $query = $this->db->query($sql); $queue_id = array(); while ($row = $this->db->fetch_array($query)) { $data = array('vid' => $vid, 'user_id' => $this->user['user_id'], 'app_id' => $row['app_id'], 'update_time' => TIMENOW, 'level' => $row['status']); $sql = 'INSERT INTO ' . DB_PREFIX . 'distr_app_queue SET '; foreach ($data as $key => $val) { $sql .= "{$key}=\"{$val}\","; } $sql = trim($sql, ','); //file_put_contents(CACHE_DIR . 'debug.txt', $sql); $this->db->query($sql); $queue_id[$row['app_id']] = $this->db->insert_id(); } if (!$queue_id) { return; } if ($client_id) { $data = array('flag' => 'application', 'search_field' => 'client_id', 'client_id' => $client_id, 'a' => 'get_specify_settings', 'access_token' => $this->user['token']); include_once ROOT_PATH . 'lib/class/curl.class.php'; $curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir'] . 'admin/'); $curl->initPostData(); foreach ($data as $k => $v) { $curl->addRequestData($k, $v); } $responce = $curl->request('preferences.php'); //file_put_contents(CACHE_DIR . 'app.txt', var_export($responce,1)); log2file($this->user, 'debug', '获取回调设置', $data, $responce); if (is_array($responce[0])) { $responce = $responce[0]; } if (!$responce) { log2file($this->user, 'error', '获取回调设置失败', $data, $responce); return; //应用不存在 } //修改自身应用的优先级最高 $sql = 'UPDAE ' . DB_PREFIX . 'distr_app_queue SET level=3 WHERE id=' . $queue_id[$responce['id']]; $this->query($sql); } /* //如果是m2o视频应用需要包含appid和appkey 因为需要访问mediaserver的外部接口 $callback_url = $responce['admin_settings']['callback_url']; if(!$callback_url) { log2file($this->user, 'error', '未设置回调地址', $data, $responce); return; } $data = array( 'access_token'=>$this->user['token'], 'id'=>$vid, 'a'=>'detail', ); $curl = new curl($this->settings['App_livmedia']['host'], $this->settings['App_livmedia']['dir'] . 'admin/'); $curl->initPostData(); foreach($data as $k=>$v) { $curl->addRequestData($k, $v); } $responce = $curl->request('vod.php'); if(is_array($responce[0])) { $responce = $responce[0]; } //file_put_contents(CACHE_DIR . 'v.txt', var_export($responce,1) . var_export($data,1) . var_export($this->settings['App_livmedia'],1), FILE_APPEND); if(!$responce) { log2file($this->user, 'error', '获取视频数据失败', $data, $responce); return; } $data = array( 'title' => $responce['title'], 'subtitle'=> $responce['subtitle'], 'chain_m3u8'=>$responce['video_m3u8'], 'keywords'=>$responce['keywords'], 'index_pic'=>$responce['img_info']['host'].$responce['img_info']['dir'].$responce['img_info']['filepath'].$responce['img_info']['filename'], 'comment'=>$responce['comment'], 'author'=>$responce['addperson'], 'vod_sort_id'=>$responce['vod_sort_id'], 'duration'=>$responce['duration'], 'bitrate'=>$responce['bitrate'], 'a'=>'create', ); $responce = $this->curl_post($callback_url, $data); //file_put_contents(CACHE_DIR . 'return.txt', var_export($responce,1) . var_export($data,1) .$callback_url, FILE_APPEND); if(!$responce[0]['id']) { log2file($this->user, 'error', '应用回调失败', $data, $responce); //进入错误队列等待重试 提交数据 } */ }
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation Europe e.V., Villa Vogelsang, Antonienallee 1, * 45279 Essen, Germany. */ // *** phpflow symbol 'arrow' *** @(include 'verifyVal.php'); // verify input values if (!$valverified) { if (include_once 'common.php') { log2file('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } die('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } // verify additional input vars isset($_GET['s']) ? $start = $_GET['s'] : (isset($_GET['start']) ? $start = $_GET['start'] : die('start not given!')); isset($_GET['e']) ? $end = $_GET['e'] : (isset($_GET['end']) ? $end = $_GET['end'] : die('end not given!')); if ($end == $start) { die('start and end mustn\'t be the same!'); } // preparation calculations switch ($start) { case 'top': $startx = round($width / 2); $starty = 0;
} while (true); // end preparations header("Content-type: image/png"); $decision = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($decision, 255, 255, 255); $black = ImageColorAllocate($decision, 0, 0, 0); $points = array(0, floor($height / 2), floor($width / 2), 0, $width, floor($height / 2), floor($width / 2), $height); ImagePolygon($decision, $points, 4, $black); $yvalue = 0; if (strlen($textline[count($maxcharsperline)]) == '0' && count($maxcharsperline) % 2 == '0') { $yoffset = round($fontheight / 2); } else { $yoffset = 0; } log2file('[drawDcs] textline: ' . strlen($textline[count($maxcharsperline)])); for ($n = 0; $n <= $m; $n++) { log2file('[drawDcs] strlen of textline[$n]: ' . strlen($textline[$n])); if (strlen($textline[$n] == '0')) { $yvalue = round($fontheight / 2); log2file('[drawDcs] strlen=0'); } else { $xval = $leftx[$n] + strlen($textline[$n]) * $fontwidth / 3; log2file('[drawDcs] xval: $xval'); log2file('[drawDcs] yval[$n]+yvalue+yoffset: ' . $yval[$n] . '+' . $yvalue . '+' . $yoffset); log2file('[drawDcs] textline[$n]: $textline[$n]'); ImageString($decision, $font, $xval, $yval[$n] + $yvalue + $yoffset, $textline[$n], $black); $yvalue = 0; } } ImagePNG($decision); ImageDestroy($decision);
function debug($str) { if ($_SERVER['REMOTE_ADDR'] == "127.0.0.1") { log2file("debug.txt", $str); } }
log2file('[ini-wrapper] LpE-text: ' . $text); $flowchart .= "<img src=\"drawLpE.php?w={$width}&h={$height}&" . "f={$font}&t={$text}\"{$noborder} alt=\"Loop End: " . "'{$text}'\">"; break; case "Process": $text = rawurlencode($row_data["text" . $column]); log2file('[ini-wrapper] Prc-text: ' . $text); $flowchart .= "<img src=\"drawPrc.php?w={$width}&h={$height}&" . "f={$font}&t={$text}\"{$noborder} alt=\"Process: " . "'{$text}'\">"; break; case "Subprocess": $text = rawurlencode($row_data["text" . $column]); log2file('[ini-wrapper] Sub-text: ' . $text); $flowchart .= "<img src=\"drawSub.php?w={$width}&h={$height}&" . "f={$font}&t={$text}\"{$noborder} alt=\"Subprocess: " . "'{$text}'\">"; break; case "Terminator": $text = rawurlencode($row_data["text" . $column]); log2file('[ini-wrapper] Trm-text: ' . $text); $flowchart .= "<img src=\"drawTrm.php?w={$width}&h={$height}&" . "f={$font}&t={$text}\"{$noborder} alt=\"Terminator: " . "'{$text}'\">"; break; case "none": $flowchart .= " "; break; default: if (isset($type)) { die('unknown type.'); } break; } $flowchart .= "</a></td>\n"; $column++; $type = $row_data["type" . $column]; } while (isset($type));
// verify input values if (!$valverified) { if (include_once 'common.php') { log2file('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } die('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } // preparation calculations $textareax = floor($width * 0.9); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file('[drawLpB] text: ' . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", 'TEXT TOO LONG'); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $loop = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($loop, 255, 255, 255); $black = ImageColorAllocate($loop, 0, 0, 0);
// verify input values if (!$valverified) { if (include_once 'common.php') { log2file('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } die('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } // preparation calculations $textareax = floor($width * 0.87); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file('[drawSub] text: ' . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight))); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $subprocess = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($subprocess, 255, 255, 255); $black = ImageColorAllocate($subprocess, 0, 0, 0);
log2file("[ini-wrapper] LpE-text: " . $text); $flowchart .= "<img src=\"drawLpE.php?w={$width}&h={$height}&f={$font}&t={$text}\"{$noborder} alt=\"Loop End: '{$text}'\">"; break; case "Process": $text = rawurlencode($row_data["text" . $column]); log2file("[ini-wrapper] Prc-text: " . $text); $flowchart .= "<img src=\"drawPrc.php?w={$width}&h={$height}&f={$font}&t={$text}\"{$noborder} alt=\"Process: '{$text}'\">"; break; case "Subprocess": $text = rawurlencode($row_data["text" . $column]); log2file("[ini-wrapper] Sub-text: " . $text); $flowchart .= "<img src=\"drawSub.php?w={$width}&h={$height}&f={$font}&t={$text}\"{$noborder} alt=\"Subprocess: '{$text}'\">"; break; case "Terminator": $text = rawurlencode($row_data["text" . $column]); log2file("[ini-wrapper] Trm-text: " . $text); $flowchart .= "<img src=\"drawTrm.php?w={$width}&h={$height}&f={$font}&t={$text}\"{$noborder} alt=\"Terminator: '{$text}'\">"; break; case "none": $flowchart .= " "; break; default: if (isset($type)) { die("unknown type."); } break; } $flowchart .= "</a></td>\n"; $column++; $type = $row_data["type" . $column]; } while (isset($type));
} while (true); // end preparations header("Content-type: image/png"); $decision = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($decision, 255, 255, 255); $black = ImageColorAllocate($decision, 0, 0, 0); $points = array(0, floor($height / 2), floor($width / 2), 0, $width, floor($height / 2), floor($width / 2), $height); ImagePolygon($decision, $points, 4, $black); $yvalue = 0; if (strlen($textline[count($maxcharsperline)]) == "0" && count($maxcharsperline) % 2 == "0") { $yoffset = round($fontheight / 2); } else { $yoffset = 0; } log2file("[drawDcs] textline: " . strlen($textline[count($maxcharsperline)])); for ($n = 0; $n <= $m; $n++) { log2file("[drawDcs] strlen of textline[{$n}]: " . strlen($textline[$n])); if (strlen($textline[$n] == "0")) { $yvalue = round($fontheight / 2); log2file("[drawDcs] strlen=0"); } else { $xval = $leftx[$n] + strlen($textline[$n]) * $fontwidth / 3; log2file("[drawDcs] xval: {$xval}"); log2file("[drawDcs] yval[{$n}]+yvalue+yoffset: {$yval[$n]}+{$yvalue}+{$yoffset}"); log2file("[drawDcs] textline[{$n}]: {$textline[$n]}"); ImageString($decision, $font, $xval, $yval[$n] + $yvalue + $yoffset, $textline[$n], $black); $yvalue = 0; } } ImagePNG($decision); ImageDestroy($decision);
public function get_bucket_status() { $user_extend = $this->auth->getUserExtendInfo(); if (!$user_extend || !is_array($user_extend)) { $this->errorOutput("获取绑定信息失败"); } $bucket_name = $user_extend['extend']['bucket_name']['value']; $domain = $user_extend['extend']['domain']['value']; $start_day = urldecode($this->input['start_day']) ? urldecode($this->input['start_day']) : ''; $period = intval($this->input['period']); $param = array('bucket_name' => $bucket_name, 'domain' => $domain, 'start_day' => $start_day ? $start_day : '', 'period' => $period > 1 ? $period : 1); $status = $this->upyun->BucketStatus($param); log2file($this->user, 'debug', '空间状态查询统计', $param, $status); if ($status['discharge']) { foreach ($status['discharge'] as $key => $val) { $time = $period > 1 ? date('m月d日', strtotime($key)) : date('H:i', strtotime($key . ':00:00')); unset($status['discharge'][$key]); $status['discharge'][$time] = round($val / 1024 / 1024, 2); } } if ($status['bandwidth']) { foreach ($status['bandwidth'] as $key => $val) { $time = $period > 1 ? date('m月d日H时', strtotime($key . ':00:00')) : date('H:i', strtotime($key)); unset($status['bandwidth'][$key]); $status['bandwidth'][$time] = round($val / 1024, 2); } } if ($status['reqs']) { foreach ($status['reqs'] as $key => $val) { $time = $period > 1 ? date('m月d日H时', strtotime($key . ':00:00')) : date('H:i', strtotime($key)); unset($status['reqs'][$key]); $status['reqs'][$time] = $val; } } if ($status['maxs']) { foreach ($status['maxs'] as $key => $val) { $time = date('Y年m月d日', strtotime($key)); $val['bytes'] = round($val['bytes'] / 1024, 2); $val['sbytes'] = round($val['sbytes'] / 1024 / 1024, 2); unset($status['maxs'][$key]); $status['maxs'][$time] = $val; } } if ($status['day_count']) { foreach ($status['day_count'] as $key => $val) { $time = date('m月d日', strtotime($key)); unset($status['day_count'][$key]); $status['day_count'][$time] = $val; } } $used = $this->upyun->BucketInfo(array('bucket_name' => $param['bucket_name'])); if ($used['storage']) { $used['storage']['total'] = round($used['storage']['total'] / 1024 / 1024, 2); $used['storage']['used'] = round($used['storage']['used'] / 1024 / 1024, 2); } $total = 'SELECT * FROM ' . DB_PREFIX . 'analytic_statistics WHERE user_id=' . $user_extend['user_id']; $total = $this->db->query_first($total); $return = array('bucket_name' => $used['bucket_name'], 'status' => $used['status'], 'storage' => $used['storage'], 'stats' => $status, 'total' => $total); $this->addItem($return); $this->output(); }
* Foundation Europe e.V., Villa Vogelsang, Antonienallee 1, * 45279 Essen, Germany. */ // *** phpflow symbol 'terminator' *** include "verifyVal.php"; // verify input values if (!$valVerified) { die("fatal error: input values NOT verified! check if valVerified.php is missing!"); } // preparation calculations $textareax = floor($width * 0.85); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file("[drawTrm] text: " . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $terminator = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($terminator, 255, 255, 255); $black = ImageColorAllocate($terminator, 0, 0, 0);
* Foundation Europe e.V., Villa Vogelsang, Antonienallee 1, * 45279 Essen, Germany. */ // *** phpflow symbol 'input/output' *** include "verifyVal.php"; // verify input values if (!$valVerified) { die("fatal error: input values NOT verified! check if valVerified.php is missing!"); } // preparation calculations $textareax = floor($width * 0.64); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file("[drawIO] text: " . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $io = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($io, 255, 255, 255); $black = ImageColorAllocate($io, 0, 0, 0);
// verify input values if (!$valverified) { if (include_once 'common.php') { log2file('fatal error: input value NOT verified! check if verifyVal.php is missing!'); } die('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } // preparation calculations $textareax = floor($width * 0.85); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file('[drawTrm] text: ' . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $terminator = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($terminator, 255, 255, 255); $black = ImageColorAllocate($terminator, 0, 0, 0);
* Foundation Europe e.V., Villa Vogelsang, Antonienallee 1, * 45279 Essen, Germany. */ // *** phpflow symbol 'loop begin' *** include "verifyVal.php"; // verify input values if (!$valVerified) { die("fatal error: input values NOT verified! check if valVerified.php is missing!"); } // preparation calculations $textareax = floor($width * 0.9); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file("[drawLpB] text: " . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $loop = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($loop, 255, 255, 255); $black = ImageColorAllocate($loop, 0, 0, 0);
function sms_send_smpp($smpp_hosts, $smpp_port, $smpp_login, $smpp_password, $smpp_from) { // smpp send global $db; $select = "select id, phonenumber, msg from sms where direction = 1 and process = 0 and method = 'smpp';"; if ($result = $db->query($select)) { while ($row = $result->fetch_assoc()) { $id = $row['id']; $phonenumber = check_phone($row['phonenumber']); $msg = $row['msg']; $result_sms = smpp_send($smpp_hosts, $smpp_port, $smpp_login, $smpp_password, $smpp_from, $phonenumber, $msg); if (DEBUG == 1) { log2file("pcntl_send smpp", $result_sms); } $update = "update sms set full_msg = '{$result_sms}', dt=now(), process = 1 where id = {$id}"; if (!$db->query($update)) { log2file("mysql_error", $db->error); } } } }
// verify input values if (!$valverified) { if (include_once 'common.php') { log2file('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } die('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } // preparation calculations $textareax = floor($width * 0.64); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file('[drawIO] text: ' . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", 'TEXT TOO LONG'); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $io = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($io, 255, 255, 255); $black = ImageColorAllocate($io, 0, 0, 0);
* Foundation Europe e.V., Villa Vogelsang, Antonienallee 1, * 45279 Essen, Germany. */ // *** phpflow symbol 'subprocess' *** include "verifyVal.php"; // verify input values if (!$valVerified) { die("fatal error: input values NOT verified! check if valVerified.php is missing!"); } // preparation calculations $textareax = floor($width * 0.87); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file("[drawSub] text: " . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight))); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $subprocess = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($subprocess, 255, 255, 255); $black = ImageColorAllocate($subprocess, 0, 0, 0);
* Foundation Europe e.V., Villa Vogelsang, Antonienallee 1, * 45279 Essen, Germany. */ // *** phpflow symbol 'process' *** include "verifyVal.php"; // verify input values if (!$valVerified) { die("fatal error: input values NOT verified! check if valVerified.php is missing!"); } // preparation calculations $textareax = floor($width * 0.98); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file("[drawPrc] text: " . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $process = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($process, 255, 255, 255); $black = ImageColorAllocate($process, 0, 0, 0);
// verify input values if (!$valverified) { if (include_once 'common.php') { log2file('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } die('fatal error: input values NOT verified! check if verifyVal.php is missing!'); } // preparation calculations $textareax = floor($width * 0.98); $textareay = floor($height * 0.98); $maxcharsperline = floor($textareax / $fontwidth); $maxlines = floor($textareay / $fontheight); // calculate if the text fits into the space available log2file('[drawPrc] text: ' . $text); $text = wordwrap($text, $maxcharsperline, "\n", 1); $lines = explode("\n", $text); if (count($lines) > $maxlines) { $lines = explode("\n", "TEXT TOO LONG"); } // centralize the text vertically $offsety = floor(floor($textareay / 2 - ceil(count($lines) / 2 * $fontheight)) * 0.98); // offsets to mark the textarea $x = round(($width - $textareax) / 2); $y = round(($height - $textareay) / 2); // end preparations header("Content-type: image/png"); $process = ImageCreate($width + 1, $height + 1); $white = ImageColorAllocate($process, 255, 255, 255); $black = ImageColorAllocate($process, 0, 0, 0);