function module_footer() { global $smarty; $obj = new menu(); $obj->set_where("men_type = 'footer'"); $smarty->assign('footer_nav', $obj->get_list()); $obj = new varia(); $site['domain'] = $obj->get_value('site_domain'); $site['record'] = $obj->get_value('site_record'); $site['record_url'] = $obj->get_value('site_record_url'); $site['tech'] = $obj->get_value('site_tech'); $site['tech_url'] = $obj->get_value('site_tech_url'); $site['statistical_code'] = im_filter($obj->get_value('statistical_code', true)); $smarty->assign('site', $site); }
function module_article_main() { global $global, $smarty; if (!$global['id']) { $art_best = get_global('best'); $prefix = get_data('channel', $global['channel_id'], 'cha_code'); $list_len = get_varia('art_list_len'); $obj = new article(); $obj->set_where('art_channel_id = ' . $global['channel_id']); if ($global['cat']) { $family = implode(',', get_cat_family('cat_art', $global['cat'])); $obj->set_where("art_cat_id in ({$family})"); $prefix .= '/cat-' . $global['cat']; } if ($art_best) { $obj->set_where('art_best = 1'); $prefix .= '/best-1'; } $obj->set_page_size($list_len ? $list_len : 20); $obj->set_page_num($global['page']); $sheet = $obj->get_sheet(); for ($i = 0; $i < count($sheet); $i++) { $sheet[$i]['short_title'] = cut_str($sheet[$i]['art_title'], 42); } set_link($obj->get_page_sum()); $smarty->assign('show_sheet', 1); $smarty->assign('article', $sheet); $smarty->assign('prefix', $prefix); } else { $obj = new article(); $obj->set_field('art_id,art_title,art_author,art_add_time,art_text'); $obj->set_where('art_channel_id = ' . $global['channel_id']); $obj->set_where('art_id = ' . $global['id']); $one = $obj->get_one(); $smarty->assign('article', $one); $obj = new article(); $obj->set_field('art_id,art_title'); $obj->set_where('art_channel_id = ' . $global['channel_id']); $obj->set_where('art_id < ' . $global['id']); $one = $obj->get_one(); if (count($one)) { $smarty->assign('next_id', $one['art_id']); $smarty->assign('next_title', cut_str($one['art_title'], 15)); } else { $smarty->assign('next_id', ''); $smarty->assign('next_title', ''); } $obj = new article(); $obj->set_field('art_id,art_title'); $obj->set_where('art_channel_id = ' . $global['channel_id']); $obj->set_where('art_id > ' . $global['id']); $obj->set_order(''); $obj->set_order('art_top', 'asc'); $obj->set_order('art_index', 'asc'); $obj->set_order('art_id', 'asc'); $one = $obj->get_one(); if (count($one)) { $smarty->assign('prev_id', $one['art_id']); $smarty->assign('prev_title', cut_str($one['art_title'], 15)); } else { $smarty->assign('prev_id', ''); $smarty->assign('prev_title', ''); } $obj = new varia(); $smarty->assign('share_code', im_filter($obj->get_value('share_code', true))); $smarty->assign('show_sheet', 0); } }
function get_site_info() { $site = array(); $obj = new varia(); $obj->set_where("(left(var_name,5) = 'site_' or var_name = 'statistical_code' or var_name = 'share_code')"); $list = $obj->get_list(); for ($i = 0; $i < count($list); $i++) { $val = $list[$i]['var_value']; switch ($list[$i]['var_name']) { case 'site_title': $site['title'] = $val; break; case 'site_admin_title': $site['admin_title'] = $val; break; case 'site_name': $site['name'] = $val; break; case 'site_domain': $site['domain'] = $val; break; case 'site_record': $site['record'] = $val; break; case 'site_record_url': $site['record_url'] = $val; break; case 'site_tech': $site['tech'] = $val; break; case 'site_tech_url': $site['tech_url'] = $val; break; case 'site_keywords': $site['keywords'] = $val; break; case 'site_description': $site['description'] = $val; break; case 'statistical_code': $site['statistical_code'] = im_filter($list[$i]['var_text']); break; case 'share_code': $site['share_code'] = im_filter($list[$i]['var_text']); break; } } return $site; }
function call_send_email($title, $text, $username, $user_email) { $site_name = get_varia('site_name'); if ($username == '匿名用户') { $username = '******' . get_ip() . '的匿名用户'; } $info = "网站名称: {$site_name} <br />"; $info .= "用户名称: {$username} <br />"; $info .= "用户邮箱: {$user_email} <br />"; $text = $info . '<br />' . $text; $smtp = get_varia('sentmail_smtp'); $send = get_varia('sentmail_send'); $password = im_filter(get_varia('sentmail_password')); $receive = get_varia('sentmail_receive'); send_email($smtp, $send, $password, $receive, $title, $text); }