www.gusucode.com > citySHOP B2C商城系统 进销存 2.0.6码程序 > upload/links.php

    <?php
include ('./include/common.inc.php');
$pagetitle = '友情链接';
$act = isset($act)?trim($act):'';
$headlinks = showlinks('css','style');
$jslinks = showlinks('js','common');
if($act=='reg'){
	if (submitcheck('addsubmit')) {
	    $datalogo = '';
	    $sname = scriptfilter($sname);
	    $target = scriptfilter($target);
	    $description = scriptfilter($description);
	    if (!empty($_FILES['logo']['name'])) {
	        $updir = $attachdir . '/links';
	        $dots = rand(1,99999);
	        $datalogo = upload_files($timestamp.$dots, $updir, $_FILES['logo'], 88, 31, false,false);
	    }
	    $db->query("INSERT INTO {$tablepre}links (`name`,`target`,`description`,`logo`,`pubtime`,`stats`) VALUES ('$sname','$target','$description','$datalogo','$timestamp','2')");
	    showmessage('提交成功!我们的工作人员会尽快审核,非常感谢您的申请。');
	}	
}else{
	$query = $db->query("SELECT * FROM {$tablepre}links WHERE stats=1 ORDER BY linkid ASC");
	$links = array(
        'pic' => array(),
        'nopic' => array()
    );
	while($arr = $db->fetch_array($query)){
		if(empty($arr['logo'])){
			$links['nopic'][] = $arr;
		}else{
			$links['pic'][] = $arr;
		}
	}	
}

include (template('links'));
?>