Ejemplo n.º 1
0
            $contents = iconv("gb2312", "utf-8//IGNORE", $contents);
        }
        $contents = extract_content($contents, $sqlconfigRs["li_start_index"], $sqlconfigRs["li_start_offset"], $sqlconfigRs["li_end_index"], $sqlconfigRs["li_end_offset"]);
        $a = array();
        $b = array();
        $c = array();
        while (!(strpos($contents, $sqlconfigRs["item_start_index"]) === false)) {
            $contents = substr($contents, strpos($contents, $sqlconfigRs["item_start_index"]) + $sqlconfigRs["item_start_offset"]);
            $date = extract_content($contents, $sqlconfigRs["date_start_index"], $sqlconfigRs["date_start_offset"], $sqlconfigRs["date_end_index"], $sqlconfigRs["date_end_offset"]);
            $link = extract_content($contents, $sqlconfigRs["url_start_index"], $sqlconfigRs["url_start_offset"], $sqlconfigRs["url_end_index"], $sqlconfigRs["url_end_offset"]);
            $title = extract_content($contents, $sqlconfigRs["title_start_index"], $sqlconfigRs["title_start_offset"], $sqlconfigRs["title_end_index"], $sqlconfigRs["title_end_offset"]);
            array_push($a, $title);
            array_push($b, $link);
            array_push($c, $date);
        }
        $max = 0;
        for ($i = 0; $i < count($a); $i++) {
            if ((int) $sqlconfigRs["topid"] < (int) $b[$i]) {
                mysql_query("insert into job_news (title,src,id,date) VALUES('" . $a[$i] . "','" . $school . "','" . $b[$i] . "','" . $c[$i] . "')", $dbh);
            }
            if ($max < (int) $b[$i]) {
                $max = (int) $b[$i];
            }
        }
        mysql_query("update job_config set topid={$max} where src='" . $school . "'", $dbh);
    }
}
update_zhaopin();
?>
</body>
</html>
Ejemplo n.º 2
0
 private function replyZhaopin($data)
 {
     $from = $data->FromUserName;
     $Position = $this->SELECT("mapping", "Pos", $data->FromUserName);
     /*if($Position=="opt_stu"||$Position=="opt_admin"||$Position=="other_stu"||$Position=="cas_stu"||$Position=="opt_staff")
       {
           */
     require "db.php";
     include "./addons/zhaopin/control/update_list.php";
     update_zhaopin();
     $sql_command = "SELECT * FROM job_news order by jid DESC LIMIT 8";
     $sql = mysql_query($sql_command);
     $news = array(array("title" => "招聘信息", "description" => "微就业", "picurl" => "http://4.weixiguang.sinaapp.com/addons/news/newsbanner.gif"));
     while ($sqlusrdbRs = mysql_fetch_row($sql)) {
         array_push($news, array("title" => $sqlusrdbRs[1], "description" => "微就业", "url" => "http://4.weixiguang.sinaapp.com/addons/zhaopin/view/index.php?j=" . $sqlusrdbRs[0], "picurl" => "http://4.weixiguang.sinaapp.com/addons/zhaopin/files/" . $sqlusrdbRs[2] . "_logo.png"));
     }
     $sql = mysql_query("update mapping set MenuStatus='none' where OpenId='" . $from . "'", $dbh);
     if ($news != null) {
         $this->news($news);
     } else {
         $this->text("不好意思,暂时木有招聘信息,怪我咯:(");
     }
     /*}
       else
       {
           $news= array(array("title"=>"这个暂时点不了呃可能是您权限不够,请点击此链接完成身份验证","picurl"=>"http://4.weixiguang.sinaapp.com/addons/news/newsbanner.gif","url"=>"http://4.weixiguang.sinaapp.com/addons/register/index.php?oid=".$data->FromUserName));
          
          $this->news($news);
       } */
 }