企业站制作流程


<?php require "top.php"; ?>
<?php require "foot.php"; ?>


<?php require "conn.php"; ?>

<title><?=$DocumentTitle?></title>
<meta name="keywords" http-equiv="keywords" content="<?=$keywords?>"  />
<meta name="description" http-equiv="description" content="<?=$description?>"/>
<link href="css/page.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/index.js"></script>


<a href="javascript:" onclick="SetHome(this,window.location.href);return false;">设置首页</a>
<a href="javascript:" onclick="AddFavorite('',document.title);return false;">加入收藏</a>

 �瞟铷����� news表循环

<?php  
  $query = $conn->query("select id,title,outLinkUrl,pic from news where classId=6 order by newsOrder,id desc");         
  while($row = $conn->fetch_array($query)){
?>

<li><a href="<?=$row['outLinkUrl']?>" target="_blank"><img src=\'#\'" width="120" height="48" /><?=$row['title']?></a></li>

  <?php
  }
  $conn->free_result($query);
  ?>

 �瞟铷����� newsclass表循环

  <?php  
  $query = $conn->query("select classId,className from newsclass where parentId=10 order by classOrder desc");         
  while($row = $conn->fetch_array($query)){
  ?>

<?php echo $row['id']; ?>

<?php echo cutstr($row["title"], 28, '...','gb2312'); ?>
 
<?php echo wlw_nopic($row['pic'],'images/no_pic.jpg'); ?>

<?php echo date('Y-m-d',strtotime($row["addDate"])); ?>

<?php $ly_addDate=date("Y-m-d H:i:s",strtotime(now)); ?>

前台显示和后台文本框一样
<?php echo str_replace(array(CHR(13),"\r\n",CHR(32)),array("<br>","<br>","&nbsp;"),$a15); ?>

wlw_FsonZID(小类ID); 获得某小类的第一条新闻id.
wlw_FsonID(大类ID); 获得某大类的第一个小类id

 �瞟铷�����
LOGO:<?=banner($id,$width,$height)?>

单图:<img src=\'#\'" height="81" width="165" class="LOGO"/>

相关信息:<?=$site["a1"]?>

底部版权:<?=getdata(2)?>  <a href="http://www..cn/"><span style="color:#999">技术支持:</span></a>

     <script type="text/javascript" src="http://www.cudo.cn/cudo.js"></script>

BANNER: 图不为空
$query = $conn->query("select id,title,outLinkUrl,pic from news where classId=17 and length(pic)!=0 and recommend=1 order by newsOrder,id desc");  

 


�瞟铷�����

最后更新时间
<?php if($row['updateDate']==""){echo date('Y-m-d',strtotime($row['addDate']));}else{echo date('Y-m-d',strtotime($row['updateDate']));}?>
 
浏览次数加一
<?php
$sql="update news set hits=hits+1 where id=$id";
 mysql_query($sql);
?>

类别ID 类别名 类别简介

$BID=getdata($SID,$parameter='parentId',$table = 'newsclass',$para1="classId");

$Bclass=getdata($BID,$parameter='className',$table = 'newsclass',$para1="classId");

getdata(16,'instro1','newsclass','classId');

 �瞟铷�����三级类别推荐
<?php

          $wlw_sonID=wlw_sonID(5);
          // echo $wlw_sonID;
          $sonID=getChildClassIds($wlw_sonID);
          $sql_hot="select * from news where recommend=1 and classId in ($sonID) limit 0,10";
          $query_hot=$conn->query($sql_hot);
          while($row=$conn->fetch_array($query_hot)){ }

?>

 �瞟铷�����搜索PHP
$search=str_replace(array('\\','%','&','"',"'"),'',$search);
 // $sql_add=" and title like '%".$search."%'";
$query=mysql_query("select * from article where article_title like '%$search%' ") ;   




�瞟铷�����搜索HTML
 <form action="#" id="business-select" class="selector"  onsubmit="if(document.getElementById('search').value=='' || document.getElementById('search').value=='请输入产品名称'){alert('请输入产品名称');return false;}else{ return true}">
                    
                    
             <input type="text" id="search" name="search" class="search" value="请输入产品名称" onfocus="if(this.value=='请输入产品名称'){this.value='';}" onblur="if(this.value==''){this.value='请输入产品名称';}"/>       
                    
                    <button type="submit" class="seatchbtn"><b>搜 索</b></button>
 </form>






�瞟铷�����多图读取

<?PHP     if($kfphoto!=""){
       $photo_ar=explode(",",$kfphoto);
      
       $i=0;
       foreach($photo_ar as $photo){
        //   echo $i."<br>";
             echo $photo[$i];
?>


<?php
        $i++;
    } }
?>

�瞟铷�����判断高亮
<?php if($_SERVER['PHP_SELF']=="about.php"){ } ?>


�瞟铷�����某$id是否是某类别下有二级类别时的判断BEGIN
$id_in=$rs[0];
  $sonID=wlw_sonID($id_in);
  $temp_i=0;
   
  if($sonID!=""){
       $arr=explode(",",$sonID);
       for($i=0;$i<count($arr);$i++){
 // echo $arr[$i]."<hr>".$id;
                  if($id==$arr[$i]){
                  $temp_i=1;
                  }
           
           }
      
      }

//echo $temp_i;
 
if($id_in==$id || $temp_i==1){
    $query_in = $conn->query("select classId,className from newsclass where parentId={$id_in} order by classOrder desc");
    ------
 }

类别下有二级类别时的判断END

�瞟铷�����【英文版COPY所有文件进EN ,另挂一个数据库,改后台这两个地方
upload/class/config.php   6行 for($i=3;$i<count($fl1);$i++){$tstr.="../";}
adminhead.php 12行 for($i=3;$i<count($fl1);$i++){$tstr.='../';}//$i有虚拟目录为3,没虚拟目录为2

修改inc/data.php  里用户名 root 密码:YyL9GNE82ZUDVTD8

hkhoutai/upload/reData.php 去掉注解 将在备份中显示所有可写入数据库



你可能感兴趣的:(制作,企业站)