Create($db,$user,$host,$pass); $cdc = new MySQL_class; $cdc->Create($cdc_db,$cdc_user,$cdc_host,$cdc_pass); $crm = new MySQL_class; $crm->Create($crm_db,$crm_user,$crm_host,$crm_pass); $gc_sql = $crm; // session handling $article_id = ass($article_id); $custom_page_id = ass($custom_page_id); if($affiliate_id) { get_aff_referer($code,$crm); header("location: /news/"); exit(); } // foil hackers unset($u_type,$u_id,$session_email); // start session start_session($php_sessid); if(page_auth(3,$u_type,$cdc) == "yes") { $staging = "yes"; } unset($u_id); start_session($sessid); lock_down("publisher",$u_id,$code,$array); $conf = get_conf2("11"); $conf_cali = get_conf2(1); // send a message if($message_submit) { exit(); $to_email = trim($to_email); $from_email = trim($from_email); $message = trim($message); $email = explode(",",$to_email); for($a=0;$a125) { $message .= "
Unfortunately your message is to long to send, please make it less than 125 characters."; } if(eregi('http',$short_message)) { $message .= "
Please, no http in the message."; } } if($message_submit && !$message) { $query = "select article_title from $TITLE where brand = '$code' and article_id = '$article_id' "; $data = $brnd->mydata($query); $new_array[article_title] = ss($data[article_title][0]); $new_array[article_id] = $article_id; $new_array[from] = $from_email; $new_array[message] = htmlentities($short_message); for($a=0;$aMessage sent to $to_email.
"); exit(); } if($contact_us) { $subject = trim($subject); $body = trim($body); $email = trim($email); $name = trim($name); if(!simple_valid_email($email)) { $message .="
Please enter your email address."; } if(!$name) { $message .="
Please enter your name."; } if(!$subject) { $message .="
Please enter a subject for your message."; } if(!$body) { $message .="
Please enter text for your message."; } // add random foo to the body if($other_vars) { $keys = array_keys($other_vars); for($a=0;$ano_strict(); $tpl->quiet(); /* if(@is_file("../cache_news/view_customGZ$custom_page_id$code") && !$submit && !$message_submit && !$no_cache) { $old = time() - filemtime("../cache_news/view_customGZ$custom_page_id$code"); if($old<$cache_expiration) { header('Content-Encoding: gzip'); if($css) { header("Content-Type: text/css"); } if($js) { header("Content-Type: text/javascript"); } echo file_get_contents("../cache_news/view_customGZ$custom_page_id$code"); exit(); } } */ // log it app_log('publisher',$PHP_SELF,$search_word,$custom_page_id,'view',$code,$array); // getting the page if($conf[custom]=='Y') { $main = get_template('7',$TEMPLATE,$brnd,$code,$staging); } else { $main = get_template('10',$TEMPLATE,$brnd,$code,$staging); if($js=='Y') { $body = get_template('7',$TEMPLATE,$brnd,$code,$staging,true); } else { $body = get_template('7',$TEMPLATE,$brnd,$code,$staging); } } if($css) { header("Content-Type: text/css"); } if($js) { header("Content-Type: text/javascript"); } $tpl->define_raw( array( main => $main, body => $body )); if($u_id) { $user = get_cdc($u_id,$code,$cdc); $tpl->assign(array( COMPANY_ID => $company_id, HLO1 => "", HLO2 => "", HLI1 => "", USER => "You are logged in as: $user[first_name] $user[last_name]
Logout - Manage Email " )); } else { $tpl->assign(array( HLI1 => "", HLI2 => "", HLO1 => "" )); } $tpl->assign(array( BODY => $body, NAME => $name, SUBJECT => $subject, EMAIL => $email )); $tpl = show_login($u_id,$tpl); $tpl->assign( array( SELF => $PHP_SELF )); // lets get the issue info .... $query = "select name, image, issue_id from $ISSUE where brand = '$code' and date <= '".date("Y-m-d")."' order by date desc limit 0,1"; $data = $brnd->mydata($query); $tpl->assign(array( ISSUE_NAME => stripslashes($data[name][0]), ISSUE_IMAGE => stripslashes($data[image][0]), ISSUE_ID => $data[issue_id][0] )); // lets get the custom page if(!$send_message) { if(!$no_cache) { $cache='yes'; } if($language_c) { $language_sql = "and language = '".ass($language_c)."' "; } else { $language_sql = "and language = 'english' "; } if($staging=="yes") { $query = "select staging_html, title, meta from $CUSTOM_PAGE where custom_page_id = '$custom_page_id' $language_sql and brand = '$code' "; $data = $brnd->mydata($query); if(!$data[staging_html][0]) { exit(); } //$custom = stripslashes($data[staging_html][0])."
You are in staging mode. [edit custom page]h
";; $custom = stripslashes($data[staging_html][0]); } else { $query = "select live_html, title, meta from $CUSTOM_PAGE where custom_page_id = '$custom_page_id' $language_sql and brand = '$code' "; $data = $brnd->mydata($query); $custom = stripslashes($data[live_html][0]); if(!$data[live_html][0]) { exit(); } } $tpl->assign(array( PAGE_TITLE => ss($data[title][0]), PAGE_META => ss($data[meta][0]) )); } else { $tpl->assign(array( PAGE_TITLE => 'Send Article' )); if($staging=="yes") { $query = "select staging_html from $TEMPLATE where template_id = '9' $language_sql and brand = '$code' "; $data = $brnd->mydata($query); if($js!='Y') { $custom = stripslashes($data[staging_html][0])."

You are in staging mode. [edit]";; } } else { $query = "select live_html from $TEMPLATE where template_id = '9' $language_sql and brand = '$code' "; $data = $brnd->mydata($query); if(!$data[live_html][0]) { exit(); } $custom = stripslashes($data[live_html][0]); } } $tpl->assign( array( CUSTOM => $custom )); // sending messages if($article_id) { $query = "select article_title from $TITLE where brand = '$code' and article_id = '$article_id' "; $data = $brnd->mydata($query); $article_title = stripslashes($data[article_title][0]); } $tpl->assign(array( TO_EMAIL => $to_email, FROM_EMAIL => $from_email, SHORT_MESSAGE => $short_message, ARTICLE_TITLE => $article_title, ARTICLE_ID => $article_id, MESSAGE => $message )); $tpl->assign( array( SEARCH_WORD => $search_word )); // **************************** display categories $tpl = publisher_auto_category($tpl,$code,$brnd); // *************** display all of todays or the top 20 articles $today = date("Ymd"); $query = "select count(*) as num from $TITLE where brand = '$code' and timestamp like '$today%'"; $data=$brnd->mydata($query); if($data[num][0]>=5) { $query = "select * from $TITLE where brand = '$code' and disable = 'T' and timestamp like '$today%' order by timestamp desc"; } else { $query = "select * from $TITLE where brand = '$code' and disable = 'T' order by timestamp desc limit 0, 5"; } $data=$brnd->mydata($query); // loop through and print // will get the block to loop through // will put the dates in long format $long_date=yes; // the actual loop for($a=0;$aassign( array( LS_TITLE => stripslashes($data[article_title][$a]), LS_ARTICLE_ID => $data[article_id][$a], LS_DATE => $ts_date )); if($data[article_publisher][$a]!="") { $tpl->assign( array( LS_PUBLISHER => stripslashes($data[article_publisher][$a]).",")); } else { $tpl->assign( array( LS_PUBLISHER => "" )); } if($data[article_author][$a]!="") { $tpl->assign( array( BY => $conf[by] )); $tpl->assign( array( LS_AUTHOR => stripslashes($data[article_author][$a])."," )); } else { $tpl->assign( array( BY => "" )); $tpl->assign( array( LS_AUTHOR => "" )); } $tpl->parse("LEAD_STORY",".lead_story"); } // **************************** focus group $query = "select image, category_name from $C_FOCUS_CATEGORY where brand = '$code' and category_id = '$conf[focus_group_to_display]' "; $data_i=$brnd->mydata($query); $tpl->assign( array( F_IMAGE => stripslashes($data_i[image][0]), F_CATEGORY_NAME => stripslashes($data_i[category_name][0]), F_CATEGORY_ID => $conf[focus_group_to_display] )); $query = "select article_id from $FOCUS_ORGANIZE where brand = '$code' and category_id = '$conf[focus_group_to_display]' order by time_stamp desc limit 0, 4"; $data_c=$brnd->mydata($query); for($a=0;$amydata($query); date_time($data[timestamp][0]); $tpl->assign( array( F_ARTICLE_ID => $data[article_id][0], F_TITLE => stripslashes($data[article_title][0]), F_DATE => $ts_date )); if($data[article_publisher][$a]!="") { $tpl->assign( array( F_PUBLISHER => stripslashes($data[article_publisher][$a]).",")); } else { $tpl->assign( array( F_PUBLISHER => "" )); } $tpl->parse("FOCUS_GROUP",".focus_group"); } $tpl = html_chunks($staging,$tpl,$code,$brnd); // social media $tpl = get_social_media($HTTP_HOST,"http://$HTTP_HOST".$_SERVER['REQUEST_URI']."",$tpl ); if($no_header) { $tpl->parse( MAIN, body ); $tpl->FastPrint(); // cache this page if ... if(!$message_submit) { if($cache=='yes') { $file_data = $tpl->Fetch(); $fp = fopen("../cache_news/view_customGZ$custom_page_id$code", 'w'); fwrite($fp, gzencode($file_data)); fclose($fp); } } exit(); } if($conf[custom]=='Y') { $tpl->parse( MAIN, main ); } else { $tpl->parse( MAIN, array( "body", "main" )); } $tpl = html_chunks($staging,$tpl,$code,$brnd); header( "Content-type: text/html; charset=iso-8859-1", false); $tpl->FastPrint(); // cache this page if ... if(!$message_submit) { if($cache=='yes') { $file_data = $tpl->Fetch(); $fp = fopen("../cache_news/view_customGZ$custom_page_id$code", 'w'); fwrite($fp, gzencode($file_data)); fclose($fp); } } exit(); ?>