Ir para conteúdo
Fórum Script Brasil

luizin

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Sobre luizin

luizin's Achievements

0

Reputação

  1. Cara estou quebrando a cabeça com isso. A linha 511 é a em negrito e vermelho: <?php /* import other */ import('configure'); import('current'); import('utility'); import('mailer'); import('sms'); import('upgrade'); import('uc'); import('cron'); function template($tFile) { global $INI; if ( 0===strpos($tFile, 'manage') ) { return __template($tFile); } if ($INI['skin']['template']) { $templatedir = DIR_TEMPLATE. '/' . $INI['skin']['template']; $checkfile = $templatedir . '/html_header.html'; if ( file_exists($checkfile) ) { return __template($INI['skin']['template'].'/'.$tFile); } } return __template($tFile); } function render($tFile, $vs=array()) { ob_start(); foreach($GLOBALS AS $_k=>$_v) { ${$_k} = $_v; } foreach($vs AS $_k=>$_v) { ${$_k} = $_v; } include template($tFile); return render_hook(ob_get_clean()); } function render_hook($c) { global $INI; $c = preg_replace('#href=/#i', 'href="'.WEB_ROOT.'/', $c); $c = preg_replace('#src="/#i', 'src="'.WEB_ROOT.'/', $c); $c = preg_replace('#action="/#i', 'action="'.WEB_ROOT.'/', $c); /* theme */ $page = strval($_SERVER['REQUEST_URI]); if($INI['skin']['theme'] && !preg_match('#/manage/#i',$page)) { $themedir = WWW_ROOT. '/static/theme/' . $INI['skin']['theme']; $checkfile = $themedir. '/css/index.css'; if ( file_exists($checkfile) ) { $c = preg_replace('#/static/css/#', "/static/theme/{$INI['skin']['theme']}/css/", $c); $c = preg_replace('#/static/img/#', "/static/theme/{$INI['skin']['theme']}/img/", $c); } } if (strtolower(cookieget('locale','zh_cn'))==zh_tw') { require_once(DIR_FUNCTION . '/tradition.php'); $c = str_replace(explode('|',$_charset_simple), explode('|',$_charset_tradition),$c); } /* encode id */ $c = obscure_rep($c); return $c; } function output_hook($c) { global $INI; if ( 0==abs(intval($INI['system]['gzip']))) die($c); $HTTP_ACCEPT_ENCODING = $_SERVER["HTTP_ACCEPT_ENCODING"]; if( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false ) $encoding = 'x-gzip'; else if( strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false ) $encoding = 'gzip'; else $encoding == false; if (function_exists('gzencode')&&$encoding) { $c = gzencode($c); header("Content-Encoding: {$encoding}"); } $length = strlen($c); header("Content-Length: {$length}"); die($c); } $lang_properties = array(); function I($key) { global $lang_properties, $LC; if (!$lang_properties) { $ini = DIR_ROOT . '/i18n/' . $LC. '/properties.ini'; $lang_properties = Config::Instance($ini); } return isset($lang_properties[$key]) ? $lang_properties[$key] : $key; } function json($data, $type=eval') { $type = strtolower($type); $allow = array('eval','alert','updater','dialog','mix', 'refresh'); if (false==in_array($type, $allow)) return false; Output::Json(array( 'data' => $data, 'type' => $type,)); } function redirect($url=null, $notice=null, $error=null) { $url = $url ? obscure_rep($url) : $_SERVER['HTTP_REFERER]; $url = $url ? $url : '/'; if ($notice) Session::Set('notice', $notice); if ($error) Session::Set('error', $error); header("Location: {$url}"); exit; } function write_php_file($array, $filename=null){ $v = "<?php\r\n\$INI = "; $v .= var_export($array, true); $v .=";\r\n?>"; return file_put_contents($filename, $v); } function write_ini_file($array, $filename=null){ $ok = null; if ($filename) { $s = ";;;;;;;;;;;;;;;;;;\r\n"; $s .= ";; SYS_INIFILE\r\n"; $s .= ";;;;;;;;;;;;;;;;;;\r\n"; } foreach($array as $k=>$v) { if(is_array($v)) { if($k != $ok) { $s .= "\r\n[{$k}]\r\n"; $ok = $k; } $s .= write_ini_file($v); }else { if(trim($v) != $v || strstr($v,"[")) $v = "\"{$v}\""; $s .= "$k = \"{$v}\"\r\n"; } } if(!$filename) return $s; return file_put_contents($filename, $s); } function save_config($type=ini') { return configure_save(); global $INI; $q = ZSystem::GetSaveINI($INI); if ( strtoupper($type) == 'INI' ) { if (!is_writeable(SYS_INIFILE)) return false; return write_ini_file($q, SYS_INIFILE); } if ( strtoupper($type) == 'PHP' ) { if (!is_writeable(SYS_PHPFILE)) return false; return write_php_file($q, SYS_PHPFILE); } return false; } function save_system($ini) { $system = Table::Fetch('system', 1); $ini = ZSystem::GetUnsetINI($ini); $value = Utility::ExtraEncode($ini); $table = new Table('system', array('value'=>$value)); if ( $system ) $table->SetPK('id', 1); return $table->update(array( 'value')); } /* user relative */ function need_login($wap=false) { if ( isset($_SESSION['user_id]) ) { if (is_post()) { unset($_SESSION['loginpage']); unset($_SESSION['loginpagepost']); } return $_SESSION['user_id']; } if ( is_get() ) { Session::Set('loginpage', $_SERVER['REQUEST_URI']); } else { Session::Set('loginpage', $_SERVER['HTTP_REFERER']); Session::Set('loginpagepost', json_encode($_POST)); } if (true===$wap) { return redirect(WEB_ROOT . '/wap/login.php'); } return redirect(WEB_ROOT . '/account/loginup.php'); } function need_post() { return is_post() ? true : redirect(WEB_ROOT . '/index.php'); } function need_manager($super=false) { if ( ! is_manager() ) { redirect( WEB_ROOT . '/manage/login.php' ); } if ( ! $super ) return true; if ( abs(intval($_SESSION['user_id'])) == 1 ) return true; return redirect( WEB_ROOT . '/manage/misc/index.php'); } function need_partner() { return is_partner() ? true : redirect( WEB_ROOT . '/biz/login.php'); } function need_open($b=true) { if (true===$b) { return true; } if ($AJAX) json('Este recurso não está aberto', 'alert'); Session::Set('error', 'Características página que você visita não está aberto'); redirect( WEB_ROOT . '/index.php'); } function need_auth($b=true) { global $AJAX, $INI, $login_user; if (is_string($b)) { $auths = $INI['authorization'][$login_user['id']]; $b = is_manager(true)||in_array($b, $auths); } if (true===$b) { return true; } if ($AJAX) json('????', 'alert'); die(include template('manage_misc_noright')); } function is_manager($super=false, $weak=false) { global $login_user; if ( $weak===false && ( !$_SESSION['admin_id'] || $_SESSION['admin_id'] != $login_user['id']) ) { return false; } if ( ! $super ) return ($login_user['manager'] == 'Y'); return $login_user['id'] == 1; } function is_partner() { return ($_SESSION['partner_id']>0); } function is_newbie(){ return (cookieget('newbie')!=N'); } function is_get() { return ! is_post(); } function is_post() { return strtoupper($_SERVER['REQUEST_METHOD]) == 'POST'; } function is_login() { return isset($_SESSION['user_id']); } function get_loginpage($default=null) { $loginpage = Session::Get('loginpage', true); if ($loginpage) return $loginpage; if ($default) return $default; return WEB_ROOT . '/index.php'; } function cookie_city($city) { global $hotcities; if($city) { cookieset('city', $city['id']); return $city; } $city_id = cookieget('city'); $city = Table::Fetch('category', $city_id); if (!$city) $city = get_city(); if (!$city) $city = array_shift($hotcities); if ($city) return cookie_city($city); return $city; } function ename_city($ename=null) { return DB::LimitQuery('category', array( 'condition' => array( 'zone' => 'city', 'ename' => $ename, ), 'one' => true, )); } function cookieset($k, $v, $expire=0) { $pre = substr(md5($_SERVER['HTTP_HOST']),0,4); $k = "{$pre}_{$k}"; if ($expire==0) { $expire = time() + 365 * 86400; } else { $expire += time(); } setCookie($k, $v, $expire, '/'); } function cookieget($k, $default=') { $pre = substr(md5($_SERVER['HTTP_HOST]),0,4); $k = "{$pre}_{$k}"; return isset($_COOKIE[$k]) ? strval($_COOKIE[$k]) : $default; } function moneyit($k) { return rtrim(rtrim(sprintf("%1.2f",$k), ' '), '.'); } function moneyit2($k) { $moeda2 = number_format($k, '0'); // Formata o número colocando duas casas decimais return rtrim($moeda2); } /* function moneyit($k) { return rtrim(rtrim(sprintf('%.2f',$k), '0'), '.'); */ function debug($v, $e=false) { global $login_user_id; if ($login_user_id==100000) { echo "<pre>"; var_dump( $v); if($e) exit; } } function getparam($index=0, $default=0) { if (is_numeric($default)) { $v = abs(intval($_GET['param'][$index])); } else $v = strval($_GET['param'][$index]); return $v ? $v : $default; } function getpage() { $c = abs(intval($_GET['page'])); return $c ? $c : 1; } function pagestring($count, $pagesize, $wap=false) { $p = new Pager($count, $pagesize, 'page'); if ($wap) { return array($pagesize, $p->offset, $p->genWap()); } return array($pagesize, $p->offset, $p->genBasic()); } function uencode($u) { return base64_encode(urlEncode($u)); } function udecode($u) { return urlDecode(base64_decode($u)); } function share_facebook($team) { global $login_user_id; global $INI; if ($team) { $query = array( 'u' => $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}", 't' => $team['title'], ); } else { $query = array( 'u' => $INI['system']['wwwprefix'] . "/r.php?r={$login_user_id}", 't' => $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', ); } $query = http_build_query($query); return 'http://www.facebook.com/sharer.php?'.$query; } /* twitter @Harry */ function share_twitter($team) { global $login_user_id; global $INI; if ($team) { $query = array( 'status' => $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}" . ' ' . $team['title'], ); } else { $query = array( 'status' => $INI['system']['wwwprefix'] . "/r.php?r={$login_user_id}" . ' ' . $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', ); } $query = http_build_query($query); return 'http://twitter.com/?'.$query; } /* share link */ function share_renren($team) { global $login_user_id; global $INI; if ($team) { $query = array( 'link' => $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}", 'title' => $team['title'], ); } else { $query = array( 'link' => $INI['system']['wwwprefix'] . "/r.php?r={$login_user_id}", 'title' => $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', ); } $query = http_build_query($query); return 'http://share.renren.com/share/buttonshare.do?'.$query; } function share_kaixin($team) { global $login_user_id; global $INI; if ($team) { $query = array( 'rurl' => $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}", 'rtitle' => $team['title'], 'rcontent' => strip_tags($team['summary']), ); } else { $query = array( 'rurl' => $INI['system']['wwwprefix'] . "/r.php?r={$login_user_id}", 'rtitle' => $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', 'rcontent' => $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', ); } $query = http_build_query($query); return 'http://www.kaixin001.com/repaste/share.php?'.$query; } function share_douban($team) { global $login_user_id; global $INI; if ($team) { $query = array( 'url' => $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}", 'title' => $team['title'], ); } else { $query = array( 'url' => $INI['system']['wwwprefix'] . "/r.php?r={$login_user_id}", 'title' => $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', ); } $query = http_build_query($query); return 'http://www.douban.com/recommend/?'.$query; } function share_sina($team) { global $login_user_id; global $INI; if ($team) { $query = array( 'url' => $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}", 'title' => $team['title'], ); } else { $query = array( 'url' => $INI['system']['wwwprefix'] . "/r.php?r={$login_user_id}", 'title' => $INI['system']['sitename'] . '(' .$INI['system']['wwwprefix']. ')', ); } $query = http_build_query($query); return 'http://v.t.sina.com.cn/share/share.php?'.$query; } function share_mail($team) { global $login_user_id; global $INI; if (!$team) { $team = array( 'title' => $INI['system']['sitename'] . '(' . $INI['system']['wwwprefix'] . ')', ); } $pre[] = "Found a good site--{$INI['system']['sitename']}?Every day is a New deal!"; if ( $team['id'] ) { $pre[] = "Customers today are:{$team['title']}"; $pre[] = "I think you will be interested in:"; $pre[] = $INI['system']['wwwprefix'] . "/team.php?id={$team['id']}&r={$login_user_id}"; $pre = mb_convert_encoding(join("\n\n", $pre), 'GBK', 'UTF-8'); $sub = "You are interested in?{$team['title']}"; } else { $sub = $pre[] = $team['title']; } $sub = mb_convert_encoding($sub, 'GBK', 'UTF-8'); $query = array( 'subject' => $sub, 'body' => $pre, ); $query = http_build_query($query); return 'mailto:?'.$query; } function domainit($url) { if(strpos($url,'//')) { preg_match('#[//]([^/]+)#', $url, $m); } else { preg_match('#[//]?([^/]+)#', $url, $m); } return $m[1]; } // that the recursive feature on mkdir() is broken with PHP 5.0.4 for function RecursiveMkdir($path) { if (!file_exists($path)) { RecursiveMkdir(dirname($path)); @mkdir($path, 0777); } } function upload_image($input, $image=null, $type=team', $scale=false) { $year = date('Y'); $day = date('md'); $n = time().rand(1000,9999).'.jpg'; $z = $_FILES[$input]; if ($z && strpos($z['type], 'image')===0 && $z['error']==0) { if (!$image) { RecursiveMkdir( IMG_ROOT . '/' . "{$type}/{$year}/{$day}" ); $image = "{$type}/{$year}/{$day}/{$n}"; $path = IMG_ROOT . '/' . $image; } else { RecursiveMkdir( dirname(IMG_ROOT .'/' .$image) ); $path = IMG_ROOT . '/' .$image; } if ($type==user') { Image::Convert($z['tmp_name], $path, 48, 48, Image::MODE_CUT); } else if($type=='team') { move_uploaded_file($z['tmp_name'], $path); } if($type==team' && $scale) { $npath = preg_replace('#(\d+)\.(\w+)$#', "\\1_index.\\2", $path); Image::Convert($path, $npath, 200, 120, Image::MODE_CUT); } return $image; } return $image; } function user_image($image=null) { global $INI; if (!$image) { return $INI['system]['imgprefix'] . '/static/img/user-no-avatar.gif'; } return $INI['system']['imgprefix'] . '/static/' .$image; } function team_image($image=null, $index=false) { global $INI; if (!$image) return null; if ($index) { $path = WWW_ROOT . '/static/' . $image; $image = preg_replace('#(\d+)\.(\w+)$#', "\\1_index.\\2", $image); $dest = WWW_ROOT . '/static/' . $image; if (!file_exists($dest) && file_exists($path) ) { Image::Convert($path, $dest, 200, 120, Image::MODE_SCALE); } } return $INI['system']['imgprefix'] . '/static/' .$image; } function userreview($content) { $line = preg_split("/[\n\r]+/", $content, -1, PREG_SPLIT_NO_EMPTY); $r = '<ul>'; foreach($line AS $one) { $c = explode('|', htmlspecialchars($one)); $c[2] = $c[2] ? $c[2] : '/'; $r .= "<li>{$c[0]}<span><a href=\"{$c[2]}\" target=\"_blank\">{$c[1]}</a>"; $r .= ($c[3] ? "?{$c[3]}?":'') . "</span></li>\n"; } return $r.'</ul>'; } function invite_state($invite) { if ('Y' == $invite['pay']) return 'Rebate paid'; if ('C' == $invite['pay']) return 'Unapproved'; if ('N' == $invite['pay'] && $invite['buy_time']) return 'Rebate to be paid'; if (time()-$invite['create_time']>7*86400) return 'Expired'; return 'Not bought'; } function team_state(&$team) { if ( $team['now_number'] >= $team['min_number'] ) { if ($team['max_number']>0) { if ( $team['now_number']>=$team['max_number'] ){ if ($team['close_time']==0) { $team['close_time'] = $team['end_time']; } return $team['state'] = 'soldout'; } } if ( $team['end_time'] <= time() ) { $team['close_time'] = $team['end_time']; } return $team['state'] = 'success'; } else { if ( $team['end_time'] <= time() ) { $team['close_time'] = $team['end_time']; return $team['state'] = 'failure'; } } return $team['state'] = 'none'; } function current_team($city_id=0) { $today = strtotime(date('d-m-Y H:i:s')); $cond = array( 'city_id' => array(0, abs(intval($city_id))), 'team_type' => 'normal', "begin_time <= {$today}", "end_time > {$today}", ); $order = 'ORDER BY sort_order DESC, begin_time DESC, id DESC'; /* normal team */ $team = DB::LimitQuery('team', array( 'condition' => $cond, 'one' => true, 'order' => $order, )); if ($team) return $team; /* seconds team */ $cond['team_type'] = 'seconds'; unset($cond['begin_time']); $order = 'ORDER BY sort_order DESC, begin_time ASC, id DESC'; $team = DB::LimitQuery('team', array( 'condition' => $cond, 'one' => true, 'order' => $order, )); return $team; } function state_explain($team, $error=false') { $state = team_state($team); $state = strtolower($state); switch($state) { case 'none': return 'Oferta em curso'; case 'soldout': return 'Oferta esgotada'; case 'failure': if($error) return 'Oferta não atingiu min. de compradores'; case 'success': return 'Sucesso na oferta'; default: return 'Oferta Finalizada'; } } function get_zones($zone=null) { $zones = array( 'city' => 'Cidade', 'group' => 'Categoria de oferta', 'public' => 'Categoria do Forum', 'grade' => 'User Grade', 'express' => 'Express', 'partner' => 'Categoria de parceria', ); if ( !$zone ) return $zones; if (!in_array($zone, array_keys($zones))) { $zone = 'city'; } return array($zone, $zones[$zone]); } function down_xls($data, $keynames, $name='dataxls') { $xls[] = "<html><meta http-equiv=content-type content=\"text/html; charset=UTF-8\"><body><table border='1'>"; $xls[] = "<tr><td>ID</td><td>" . implode("</td><td>", array_values($keynames)) . '</td></tr>'; foreach($data As $o) { $line = array(++$index); foreach($keynames AS $k=>$v) { $line[] = $o[$k]; } $xls[] = '<tr><td>'. implode("</td><td>", $line) . '</td></tr>'; } $xls[] = '</table></body></html>'; $xls = join("\r\n", $xls); header('Content-Disposition: attachment; filename="'.$name.'.xls"'); die(mb_convert_encoding($xls,'UTF-8','UTF-8')); } function option_hotcategory($zone='city', $force=false, $all=false) { $cates = option_category($zone, $force, true); $r = array(); foreach($cates AS $id=>$one) { if ('Y'==strtoupper($one['display])) $r[$id] = $one; } return $all ? $r: Utility::OptionArray($r, 'id', 'name'); } function option_category($zone=city', $force=false, $all=false) { $cache = $force ? 0 : 86400*30; $cates = DB::LimitQuery('category', array( 'condition' => array( 'zone' => $zone, ), 'order' => 'ORDER BY sort_order DESC, id DESC', 'cache' => $cache, )); $cates = Utility::AssColumn($cates, 'id'); return $all ? $cates : Utility::OptionArray($cates, 'id', 'name'); } function option_yes($n, $default=false) { global $INI; if (false==isset($INI['option][$n])) return $default; $flag = trim(strval($INI['option'][$n])); return abs(intval($flag)) || strtoupper($flag) == 'Y'; } function option_yesv($n, $default=N') { return option_yes($n, $default=='Y') ? 'Y' : 'N'; } function magic_gpc($string) { if(SYS_MAGICGPC) { if(is_array($string)) { foreach($string as $key => $val) { $string[$key] = magic_gpc($val); } } else { $string = stripslashes($string); } } return $string; } function team_discount($team, $save=false) { if ($team['market_price]<0 || $team['team_price']<0 ) { return '?'; } return moneyit((10*$team['team_price']/$team['market_price'])); } function team_origin($team, $quantity=0) { $origin = $quantity * $team['team_price']; if ($team['delivery'] == 'express' && ($team['farefree']==0 || $quantity < $team['farefree']) ) { $origin += $team['fare']; } return $origin; } function error_handler($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_PARSE: case E_ERROR: echo "<b>Fatal ERROR</b> [$errno] $errstr<br />\n"; echo "Fatal error on line $errline in file $errfile"; echo "PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n"; exit(1); break; default: break; } return true; } /* for obscureid */ function obscure_rep($u) { if(!option_yes('encodeid')) return $u; if(preg_match('#/manage/#', $_SERVER['REQUEST_URI'])) return $u; return preg_replace_callback('#(\?|&)id=(\d+)(\b)#i', obscure_cb, $u); } function obscure_did() { $gid = strval($_GET['id']); if ($gid && strpos($gid, 'WR')===0) { $_GET['id'] = base64_decode(substr($gid,2))>>2; } } function obscure_cb($m) { $eid = obscure_eid($m[2]); return "{$m[1]}id={$eid}{$m[3]}"; } function obscure_eid($id) { return 'WR'.base64_encode($id<<2); } obscure_did(); /* end */ /* for post trim */ function trimarray($o) { if (!is_array($o)) return trim($o); foreach($o AS $k=>$v) { $o[$k] = trimarray($v); } return $o; } $_POST = trimarray($_POST); /* end */ set_error_handler('error_handler');
  2. A linha 511 é esta: Image::Convert($z['tmp_name'], $path, 48, 48, Image::MODE_CUT); Será que tem alguma coisa a ver com a hospedagem,me disseram que pode ser que ela não tem suporte ao GD do PHP! Grato galera.
  3. Olá galera efetuei o upload do Wroupon (script de site de compra coletiva em PHP) ao servidor e ao acessar o install.php ou index.php recebo a seguinte mensagem de erro: Parse error: syntax error, unexpected ')', expecting '(' in C:\Inetpub\vhosts\brasiliacoletiva.com.br\httpdocs\include\function\common.php on line 511 Já criei o banco de dados Mysql,a hospedagem é em um servidor windows com Plesk, em localhost funciona normalmente. O que poderá ser este erro? Grato "Aos moderadores": Caso este tópico esteja no local errado, peço a compreensão e que seja movido ao local correto.
×
×
  • Criar Novo...