From bb15c30da7fd7d54da3d1317f83f31c4c0a85c0f Mon Sep 17 00:00:00 2001 From: nanosimbiot Date: Wed, 29 Jun 2011 08:48:08 +0000 Subject: [PATCH] r42 git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@42 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/config.php | 15 +++++++-------- upload/includes/captcha/captcha.php | 6 ++++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/upload/config.php b/upload/config.php index 68d6be08a..62ba2b5b1 100644 --- a/upload/config.php +++ b/upload/config.php @@ -67,7 +67,7 @@ $bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент $dbcharset = 'utf8'; $pconnect = defined('IN_CRON') ? false : false; -$bb_cfg['db']['db1'] = array( 'localhost', 'forum', 'user', 'user', $dbcharset, $pconnect ); +$bb_cfg['db']['db1'] = array( 'localhost', 'forum', 'user', 'pass', $dbcharset, $pconnect ); $bb_cfg['db_alias'] = array( @@ -258,17 +258,17 @@ $bb_cfg['topic_tpl']['rules_video'] = TEMPLATES_DIR .'topic_tpl_rules_video.h // Cookie $bb_cfg['cookie_domain'] = ''; # '.yourdomain.com' -$bb_cfg['cookie_path'] = '/forum/'; # '/forum/' +$bb_cfg['cookie_path'] = '/'; # '/forum/' $bb_cfg['cookie_secure'] = (!empty($_SERVER['HTTPS']) ? 1 : 0); # 0 $bb_cfg['cookie_prefix'] = 'bb_'; # 'bb_' define('COOKIE_DBG', 'bb_dbg'); // debug cookie name // Server -$bb_cfg['server_name'] = $_SERVER['SERVER_NAME']; // The domain name from which this board runs -$bb_cfg['server_port'] = $_SERVER['SERVER_PORT']; // The port your server is running on -$bb_cfg['script_path'] = '/forum/'; // The path where FORUM is located relative to the domain name -$bb_cfg['sitename'] = 'TorrentPier II - Torrent Tracker'; // Name of your site +$bb_cfg['server_name'] = 'torrentpier.me'; // The domain name from which this board runs +$bb_cfg['server_port'] = 80; // The port your server is running on +$bb_cfg['script_path'] = '/'; // The path where FORUM is located relative to the domain name +$bb_cfg['sitename'] = 'TorrentPier II - Torrent Tracker (see $bb_cfg[\'sitename\'] in config.php)'; // Name of your site // Server load $bb_cfg['max_srv_load'] = 0; // 0 - disable @@ -279,7 +279,7 @@ $bb_cfg['db_backup_shell_cmd'] = ''; // '/path/to/db_backup.sh 2>& $bb_cfg['site_backup_shell_cmd'] = ''; // GZip -$bb_cfg['gzip_compress'] = false; // compress output +$bb_cfg['gzip_compress'] = false; // compress output $bb_cfg['gzip_force'] = false; // always compress (don't check client compatibility) // Sessions @@ -541,7 +541,6 @@ $bb_cfg['advert_html_path'] = $bb_cfg['html_path'] .'advert.html'; # // Captcha -$bb_cfg['captcha']['name'] = 'torrentpier.me'; $bb_cfg['captcha']['disabled'] = false; $bb_cfg['captcha']['secret_key'] = 'secret_key'; $bb_cfg['captcha']['img_path'] = "./images/captcha/"; # without '/' diff --git a/upload/includes/captcha/captcha.php b/upload/includes/captcha/captcha.php index 41f6b68c2..363ed118e 100644 --- a/upload/includes/captcha/captcha.php +++ b/upload/includes/captcha/captcha.php @@ -157,6 +157,8 @@ class captcha_kcaptcha extends captcha_common // generates keystring and image function gen_img ($cap_id) { + global $bb_cfg; + // do not change without changing font files! $alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"; @@ -206,7 +208,7 @@ class captcha_kcaptcha extends captcha_common # show credits $show_credits = true; # set to false to remove credits line. Credits adds 12 pixels to image height - $credits = $this->cfg['name']; # if empty, HTTP_HOST will be shown + $credits = $bb_cfg['server_name']; # if empty, HTTP_HOST will be shown # CAPTCHA image colors (RGB, 0-255) //$foreground_color = array(0, 0, 0); @@ -316,7 +318,7 @@ class captcha_kcaptcha extends captcha_common $background=imagecolorallocate($img2, $background_color[0], $background_color[1], $background_color[2]); imagefilledrectangle($img2, 0, 0, $width-1, $height-1, $background); imagefilledrectangle($img2, 0, $height, $width-1, $height+12, $foreground); - $credits=empty($credits)?$this->cfg['name']:$credits; + $credits=empty($credits)?$bb_cfg['server_name']:$credits; imagestring($img2, 2, $width/2-imagefontwidth(2)*strlen($credits)/2, $height-2, $credits, $background); // periods