Detect($spam_publish)==1) { $tr = new Translate; echo "

".$tr->trans('spam_message')."

"; echo ""; exit; } // mostly we are just assigning template variables here, publishing is done in publish class include_once(SF_SHARED_PATH . '/classes/pages/publish.inc'); $tr = new Translate(); $publish = new publish(); $publish->generate_filebox_html(); $max_num_uploads = array(0,1); $this->tkeys['select_filecount'] = $this->make_select_form("file_count", $max_num_uploads, $_POST['file_count']); if ($_GET['top_id'] > 0) $top_id = $_GET['top_id']; if ($_POST['top_id'] > 0) $top_id = $_POST['top_id']; // generate random extension for captcha image if (isset($_SESSION['captcha_filename']) && strlen($_SESSION['captcha_filename']) > 0) { $captcha_filename = $_SESSION['captcha_filename']; $captcha_url = $_SESSION['captcha_url']; $generate_image = false; } else { $random_number = 0; $random_number = time(); $rand_array = array("d","e","x","WWws","234sdfadf","dsdkdkttyyiyyiyi","qqqf_","l","j","e"); for ($x=0; $x <= 10; $x++) { $j = rand(1,10); $random_number .= $rand_array[$j]; } $random_number .= "X"; $captcha_filename = SF_WEB_PATH.'/images/captcha/captcha' . $random_number . '.png'; $captcha_url = '/images/captcha/captcha' . $random_number . '.png'; $_SESSION['captcha_filename'] = $captcha_filename; $_SESSION['captcha_url'] = $captcha_url; $generate_image = true; } if ($generate_image == true) { // Set up the CAPTCHA $captcha = Text_CAPTCHA::factory('Image'); $text_image_options = array('font_size'=>'34', 'font_path' => '/usr/local/lib/X11/fonts/webfonts', 'font_file'=>'arial.ttf'); $captcha->init(250,100,null,$text_image_options); //$image_data = $captcha->getCAPTCHAAsJPEG(); $image_data = $captcha->getCAPTCHAAsPNG(); $_SESSION['captcha_word'] = $captcha->getPhrase(); $handle = fopen($captcha_filename, 'w'); fwrite($handle, $image_data); fclose($handle); $this->tkeys['captcha_url'] = $captcha_url; } else { $this->tkeys['captcha_url'] = $_SESSION['captcha_url']; } $text_options = array( "t" => "text/plain", "h" => "text/html" ); $this->tkeys['select_artmime'] = $this->make_select_form("artmime", $text_options, $_POST['artmime']); $this->tkeys['local_top_id'] = $top_id; $this->tkeys['file_boxes'] = $publish->filebox; $this->tkeys['pub_stepone'] = $tr->trans('comment_pub_one'); $this->tkeys['pub_steptwo'] = $tr->trans('comment_pub_two'); $this->tkeys['pub_stepthree'] = $tr->trans('comment_pub_three'); $this->tkeys['pub_optional'] = $tr->trans('pub_optional'); $this->tkeys['local_site_nick'] = $GLOBALS['site_nick']; $this->tkeys['pub_author'] = $tr->trans('author'); $this->tkeys['pub_url'] = $tr->trans('link'); include_once(SF_CACHE_PATH.'/language_options.inc'); if (! array_key_exists('language_id', $_POST)) { include_once(SF_CACHE_PATH.'/language_codes.inc'); global $language_codes; $language = array_search($GLOBALS['lang'], $language_codes); } else { $language = $_POST['language_id']; } $language_options[''] = ' '.$tr->trans('select_a_language'); asort($language_options); $this->tkeys['dropdown_language'] = $this->make_select_form('language_id', $language_options, $language); $this->tkeys['local_heading'] = ''; $this->tkeys['local_author'] = ''; $this->tkeys['local_contact'] = ''; $this->tkeys['local_phone'] = ''; $this->tkeys['local_address'] = ''; $this->tkeys['local_link'] = ''; $this->tkeys['local_article'] = ''; } } // end class ?>