火车采集器软件交流官方论坛

 找回密码
 加入会员
搜索
火车采集器V9版免费下载火车浏览器 - 可视采集,万能群发,全自动脚本工具
查看: 3598|回复: 4

PHPCMS2007SP6文章发布模块 (服务器脚本+模块发布)????

[复制链接]
发表于 2008-4-22 18:02:10 | 显示全部楼层 |阅读模式
使用这个模块的时候怎么使它不自动提取
内容摘要
而是使用自己定义的内容摘要


http://bbs.locoy.com/spider-23281-1-1.html  就是。。。

[ 本帖最后由 ly365 于 2008-4-22 18:11 编辑 ]
发表于 2008-4-22 19:01:07 | 显示全部楼层
在规则里设置成固定格式就成了.
 楼主| 发表于 2008-4-22 19:08:32 | 显示全部楼层
????具体点。。。。。。。。。。
 楼主| 发表于 2008-4-22 20:05:43 | 显示全部楼层
<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/
@set_magic_quotes_runtime( 0 );
define( "IN_ADMIN", true );
define( "IN_PHPCMS", true );
define( "PHPCMS_ROOT", dirname( __FILE__ ) );
define( "MOD_ROOT", PHPCMS_ROOT."/module/article" );
require( PHPCMS_ROOT."/config.inc.php" );
require( PHPCMS_ROOT."/include/global.func.php" );
define( "PHPCMS_PATH", $CONFIG['rootpath'] );
define( "PHPCMS_CACHEDIR", $CONFIG['cachedir'] );
$CONFIG['enablephplog'] ? set_error_handler( "phpcms_error" ) : error_reporting( E_ERROR | E_WARNING | E_PARSE );
session_save_path( $CONFIG['sessionsavepath'] );
session_start( );
if ( function_exists( "date_default_timezone_set" ) )
{
  date_default_timezone_set( $CONFIG['timezone'] );
}
header( "Content-type: text/html; charset=".$CONFIG['charset'] );
if ( getenv( "HTTP_CLIENT_IP" ) && strcasecmp( getenv( "HTTP_CLIENT_IP" ), "unknown" ) )
{
  $PHP_IP = getenv( "HTTP_CLIENT_IP" );
}
else if ( getenv( "HTTP_X_FORWARDED_FOR" ) && strcasecmp( getenv( "HTTP_X_FORWARDED_FOR" ), "unknown" ) )
{
  $PHP_IP = getenv( "HTTP_X_FORWARDED_FOR" );
}
else if ( getenv( "REMOTE_ADDR" ) && strcasecmp( getenv( "REMOTE_ADDR" ), "unknown" ) )
{
  $PHP_IP = getenv( "REMOTE_ADDR" );
}
else if ( isset( $_SERVER['REMOTE_ADDR'] ) && $_SERVER['REMOTE_ADDR'] && strcasecmp( $_SERVER['REMOTE_ADDR'], "unknown" ) )
{
  $PHP_IP = $_SERVER['REMOTE_ADDR'];
}
preg_match( "/[\\d\\.]{7,15}/", $PHP_IP, $ipmatches );
$PHP_IP = $ipmatches[0] ? $ipmatches[0] : "unknown";
$PHP_TIME = time( );
$PHP_SELF = isset( $_SERVER['PHP_SELF'] ) ? $_SERVER['PHP_SELF'] : isset( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['SCRIPT_NAME'] : $_SERVER['ORIG_PATH_INFO'];
$PHP_QUERYSTRING = $_SERVER['QUERY_STRING'];
$PHP_DOMAIN = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : "";
$PHP_REFERER = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : "";
$PHP_SCHEME = $_SERVER['SERVER_PORT'] == "443" ? "https://" : "http://";
$PHP_PORT = $_SERVER['SERVER_PORT'] == "80" ? "" : ":".$_SERVER['SERVER_PORT'];
$PHP_SITEURL = $PHP_SCHEME.$PHP_DOMAIN.$PHP_PORT.PHPCMS_PATH;
$PHP_URL = $PHP_SCHEME.$PHP_DOMAIN.$PHP_PORT.$_SERVER['REQUEST_URI'];
$db_file = $db_class = "db_".$CONFIG['database'];
$magic_quotes_gpc = get_magic_quotes_gpc( );
if ( !$magic_quotes_gpc )
{
  $GLOBALS['_POST'] = new_addslashes( $_POST );
  $GLOBALS['_GET'] = new_addslashes( $_GET );
}
@extract( $_POST, EXTR_SKIP );
@extract( $_GET, EXTR_SKIP );
if ( empty( $channelid ) )
{
  exit( "<div style=\"color=grey;font-size:12px;\" align=\"center\">I'm sorry,you are not allowed to access this file directly!<br>please use the LocoySpier<sup>&reg;</sup>, or visit these site:<a href=\"http://www.phpcms.cn\" target=\"_blank\" >PHPCMS网站</a>  <a href=\"http://www.locoy.com\" target=\"_blank\" >火车采集器</a></div>" );
}
unset( $_POST );
unset( $_GET );
require( PHPCMS_ROOT."/include/".$db_file.".class.php" );
require( PHPCMS_ROOT."/include/tag.func.php" );
require( PHPCMS_ROOT."/include/extension.inc.php" );
$db = new $db_class( );
$db->connect( $CONFIG['dbhost'], $CONFIG['dbuser'], $CONFIG['dbpw'], $CONFIG['dbname'], $CONFIG['pconnect'] );
$db->iscache = $CONFIG['dbiscache'];
$db->expires = $CONFIG['dbexpires'];
if ( !cache_read( "table.php" ) )
{
  require_once( PHPCMS_ROOT."/include/cache.func.php" );
  cache_all( );
}
$CACHE = cache_read( "common.php" );
$MODULE = $CACHE['module'];
$CHANNEL = $CACHE['channel'];
$PHPCMS = $CACHE['phpcms'];
unset( $CACHE );
unset( $ipmatches );
unset( $CONFIG['timezone'] );
unset( $CONFIG['cachedir'] );
unset( $CONFIG['dbhost'] );
unset( $CONFIG['dbuser'] );
unset( $CONFIG['dbpw'] );
unset( $CONFIG['pconnect'] );
unset( $CONFIG['dbiscache'] );
unset( $CONFIG['dbexpires'] );
if ( $PHPCMS['enablebanip'] && ip_banned( $PHP_IP ) )
{
  showmessage( "该IP已被禁止" );
}
$MOD = $CHA = $CATEGORY = $CAT = array( );
$ftp = $enableftp = $tags = $html = 0;
if ( !isset( $mod ) )
{
  $mod = "phpcms";
}
else if ( $mod != "phpcms" )
{
  if ( !array_key_exists( $mod, $MODULE ) )
  {
    exit( "模块名不是article,或该模块已被禁止" );
  }
  $MOD = cache_read( $mod."_setting.php" );
}
if ( !isset( $forward ) )
{
  $forward = $PHP_REFERER;
}
$dosubmit = isset( $dosubmit ) ? 1 : 0;
$channelid = isset( $channelid ) ? intval( $channelid ) : 0;
$skindir = PHPCMS_PATH."templates/".$CONFIG['defaulttemplate']."/skins/".$CONFIG['defaultskin'];
if ( $PHPCMS['enablegzip'] && function_exists( "ob_gzhandler" ) )
{
  ob_start( "ob_gzhandler" );
}
else
{
  $PHPCMS['enablegzip'] = 0;
  ob_start( );
}
$_userid = 0;
$_username = "";
$_groupid = 3;
$_arrgroupid = array( );
unset( $db_class );
unset( $db_file );
require_once( PHPCMS_ROOT."/admin/include/global.func.php" );
require_once( PHPCMS_ROOT."/include/version.inc.php" );
require_once( PHPCMS_ROOT."/include/formselect.func.php" );
require_once( PHPCMS_ROOT."/include/cache.func.php" );
require_once( PHPCMS_ROOT."/include/post.func.php" );
$db->iscache = 0;
$fileiscache = 0;
$filecaching = 0;
$file = isset( $file ) ? $file : "login";
$action = isset( $action ) ? $action : "";
$job = isset( $job ) ? $job : "";
$catid = isset( $catid ) ? intval( $catid ) : 0;
$specialid = isset( $specialid ) ? intval( $specialid ) : 0;
$module_dir = moduledir( $mod );
if ( $channelid )
{
  require( PHPCMS_ROOT."/include/channel.inc.php" );
}
require( PHPCMS_ROOT."/module/".$mod."/include/global.func.php" );
require( PHPCMS_ROOT."/module/".$mod."/include/tag.func.php" );
$job = isset( $job ) ? $job : "";
if ( $channelid )
{
  $TYPE = cache_read( "type_".$channelid.".php" );
}
$channelid = intval( $channelid );
if ( !$channelid )
{
  showmessage( "无频道ID值", $referer );
}
require_once( PHPCMS_ROOT."/include/tree.class.php" );
$tree = new tree( );
require_once( PHPCMS_ROOT."/module/".$mod."/include/article.class.php" );
$articleid = isset( $articleid ) ? intval( $articleid ) : 0;
$art = new article( $channelid );
if ( $articleid )
{
  $art->articleid = $articleid;
}
$catid = isset( $catid ) ? intval( $catid ) : 0;
if ( $catid )
{
  $CAT = cache_read( "category_".$catid.".php" );
}
$pagesize = isset( $pagesize ) && $pagesize < 500 ? intval( $pagesize ) : $PHPCMS['pagesize'];
if ( $dosubmit )
{
  if ( !$catid )
  {
    showmessage( "栏目ID值为空", $referer );
  }
  if ( $CAT['child'] && !$CAT['enableadd'] )
  {
    showmessage( "该栏目下不允许添加文章", "goback" );
  }
  require( PHPCMS_ROOT."/include/field.class.php" );
  $field = new field( channel_table( "article", $channelid ) );
  require( PHPCMS_ROOT."/admin/include/position.class.php" );
  $pos = new position( $channelid );
if(empty($article['title'])) showmessage($LANG['short_title_can_not_be_blank']);
if(!isset($article['islink']) && empty($article['content'])) showmessage($LANG['content_can_not_be_blank'],'goback');
if(isset($addkeywords) && $article['keywords']) update_keywords($article['keywords'], $channelid);
if(isset($addauthor) && $article['author']) update_author($article['author'], $channelid);
if(isset($addcopyfrom) && $article['copyfrom']) update_copyfrom($article['copyfrom'], $channelid);

if(isset($save_remotepic))
{
  require PHPCMS_ROOT.'/include/get_remotefiles.func.php';
  $article['content'] = get_remotepics($article['content'], $PHPCMS['uploaddir'].'/'.$CHA['channeldir'].'/'.$CHA['uploaddir']);
}
  $introcude_length = isset( $introcude_length ) ? intval( $introcude_length ) : 0;
  /*if ( !isset( $article['islink'] ) || empty( $article['introduce'] ) && isset( $add_introduce ) && $introcude_length )
  {
    $article['introduce'] = str_cut( strip_tags( $article['content'] ), $introcude_length );
  }*/

  if ( !isset( $article['islink'] ) || empty( $article['thumb'] ) && isset( $auto_thumb ) && $auto_thumb_no )
  {
    if ( intval( $auto_thumb_no ) < 1 )
    {
      $auto_thumb_no = 1;
    }
    $c = stripslashes( $article['content'] );
    preg_match_all( "/<img[^>]*src=\"([^\"]+)\"/i", $c, $m );
    if ( isset( $m[1][$auto_thumb_no - 1] ) )
    {
      $thumb = $m[1][$auto_thumb_no - 1];
      $thumb = str_replace( "http://".$PHP_DOMAIN, "", $thumb );
      if ( $PHPCMS['enablethumb'] && !strpos( $thumb, "://" ) )
      {
        require_once( PHPCMS_ROOT."/include/watermark.class.php" );
        $thumb = substr( $thumb, strlen( PHPCMS_PATH ) );
        $newthumb = str_replace( basename( $thumb ), "thumb_".basename( $thumb ), $thumb );
        $width = $MOD['thumb_width'] ? $MOD['thumb_width'] : $PHPCMS['thumb_width'];
        $height = $MOD['thumb_height'] ? $MOD['thumb_height'] : $PHPCMS['thumb_height'];
        $wm = new watermark( PHPCMS_ROOT."/".$thumb, 10, $PHPCMS['water_pos'] );
        $wm->thumb( $width, $height, PHPCMS_ROOT."/".$newthumb );
        $article['thumb'] = $newthumb;
      }
      else
      {
        $article['thumb'] = strpos( $thumb, "://" ) ? $thumb : substr( $thumb, strlen( PHPCMS_PATH ) );
      }
    }
  }
  $article['islink'] = isset( $article['islink'] ) ? 1 : 0;
  $article['arrgroupidview'] = empty( $article['arrgroupidview'] ) ? "" : implode( ",", $article['arrgroupidview'] );
  $article['catid'] = $catid;
  $article['username'] = $article['editor'] = $article['checker'] = $_username;
  $article['urlruleid'] = $article['ishtml'] ? $html_urlrule : $php_urlrule;
  $article['addtime'] = $article['edittime'] = $article['checktime'] = preg_match( "/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $article['addtime'] ) ? strtotime( $article['addtime']." ".date( "H:i:s", $PHP_TIME ) ) : $PHP_TIME;
  if ( isset( $article['arrposid'] ) )
  {
    $arrposid = $article['arrposid'];
    $article['arrposid'] = ",".implode( ",", $arrposid ).",";
  }
  $articleid = $art->add( $article );
  $chid = $channelid;
  $cid = $catid;
  if ( $articleid )
  {
    if ( isset( $arrposid ) && $arrposid )
    {
      $pos->add( $articleid, $arrposid );
    }
    $field->update( "articleid=".$articleid );
    if ( $article['ishtml'] && $article['status'] == 3 && !$article['islink'] )
    {
      createhtml( "show" );
      createhtml( "index" );
      createhtml( "index", PHPCMS_ROOT );
      if ( $CAT['arrparentid'] )
      {
        $catids = explode( ",", $CAT['arrparentid'] );
        foreach ( $catids as $catid )
        {
          if ( $catid )
          {
            createhtml( "list" );
          }
        }
      }
      $catid = $cid;
      $fid = 1;
      $pernum = 5;
      createhtml( "list" );
    }
    showmessage( "发布文章成功", "goback" );
  }
  else
  {
    showmessage( "发布文章失败", "goback" );
  }
}
else if ( $x )
{
  $category_select = category_select( "catid", "请选择列表", $catid, "id=\"catid\"" );
  echo $category_select;
}
else
{
  showmessage( "请确认提交" );
}
?>


只要把这段注销下就OK
搞了半天原来是这个 phpcms_art_add_locoy.php

在搞鬼。。。。。。。。。。

[ 本帖最后由 ly365 于 2008-4-22 22:37 编辑 ]
发表于 2008-7-18 12:51:25 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

QQ|手机版|Archiver|火车采集器官方站 ( 皖ICP备06000549 )

GMT+8, 2024-11-15 06:45

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表