杰奇CMS articleinfo.php开源代码
杰奇articleinfo.php开源代码,有利于二次开发。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | <?php /** * 文章信息页 * * 显示一篇文章信息,包括最近书评等 * * 调用模板:/modules/article/templates/articleinfo.html * * @category jieqicms * @package article * @copyright Copyright (c) Hangzhou Jieqi Network Technology Co.,Ltd. (http://www.wonmeng.com) * @author $Author: juny $ * @version $Id: articleinfo.php 332 2009-02-23 09:15:08Z juny $ */ define( 'JIEQI_MODULE_NAME' , 'article' ); if (!defined( 'JIEQI_GLOBAL_INCLUDE' )) include_once ( '../../global.php' ); if ( empty ( $_REQUEST [ 'id' ])) jieqi_printfail(LANG_ERROR_PARAMETER); jieqi_loadlang( 'article' , JIEQI_MODULE_NAME); include_once ( $jieqiModules [ 'article' ][ 'path' ]. '/class/article.php' ); $article_handler =& JieqiArticleHandler::getInstance( 'JieqiArticleHandler' ); $article = $article_handler ->get( $_REQUEST [ 'id' ]); if (! $article ) jieqi_printfail( $jieqiLang [ 'article' ][ 'article_not_exists' ]); elseif ( $article ->getVar( 'display' ) != 0 && $jieqiUsersStatus != JIEQI_GROUP_ADMIN) jieqi_printfail( $jieqiLang [ 'article' ][ 'article_not_audit' ]); else { //包含区块参数(定制) jieqi_getconfigs(JIEQI_MODULE_NAME, 'sort' ); jieqi_getconfigs(JIEQI_MODULE_NAME, 'configs' ); $jieqi_pagetitle = $article ->getVar( 'articlename' ). '-' . $article ->getVar( 'author' ). '-' .JIEQI_SITE_NAME; include_once (JIEQI_ROOT_PATH. '/header.php' ); $article_static_url = ( empty ( $jieqiConfigs [ 'article' ][ 'staticurl' ])) ? $jieqiModules [ 'article' ][ 'url' ] : $jieqiConfigs [ 'article' ][ 'staticurl' ]; $article_dynamic_url = ( empty ( $jieqiConfigs [ 'article' ][ 'dynamicurl' ])) ? $jieqiModules [ 'article' ][ 'url' ] : $jieqiConfigs [ 'article' ][ 'dynamicurl' ]; $jieqiTpl ->assign( 'article_static_url' , $article_static_url ); $jieqiTpl ->assign( 'article_dynamic_url' , $article_dynamic_url ); $jieqiTpl ->assign( 'makezip' , $jieqiConfigs [ 'article' ][ 'makezip' ]); $jieqiTpl ->assign( 'makejar' , $jieqiConfigs [ 'article' ][ 'makejar' ]); $jieqiTpl ->assign( 'makeumd' , $jieqiConfigs [ 'article' ][ 'makeumd' ]); $jieqiTpl ->assign( 'maketxtfull' , $jieqiConfigs [ 'article' ][ 'maketxtfull' ]); $jieqiTpl ->assign( 'maketxt' , $jieqiConfigs [ 'article' ][ 'maketxt' ]); $jieqiTpl ->assign( 'articlename' , $article ->getVar( 'articlename' )); $jieqiTpl ->assign( 'keywords' , $article ->getVar( 'keywords' )); $jieqiTpl ->assign( 'postdate' , date (JIEQI_DATE_FORMAT, $article ->getVar( 'postdate' ))); $jieqiTpl ->assign( 'lastupdate' , date (JIEQI_DATE_FORMAT, $article ->getVar( 'lastupdate' ))); $jieqiTpl ->assign( 'authorid' , $article ->getVar( 'authorid' )); $jieqiTpl ->assign( 'author' , $article ->getVar( 'author' )); $jieqiTpl ->assign( 'agentid' , $article ->getVar( 'agentid' )); $jieqiTpl ->assign( 'agent' , $article ->getVar( 'agent' )); $jieqiTpl ->assign( 'sortid' , $article ->getVar( 'sortid' )); $_REQUEST [ 'class' ] = $article ->getVar( 'sortid' ); $_REQUEST [ 'sortid' ] = $article ->getVar( 'sortid' ); $jieqiTpl ->assign( 'sort' , $jieqiSort [ 'article' ][ $article ->getVar( 'sortid' )][ 'caption' ]); $preg_from = array ( '/((https?|ftp):\/\/|www\.)[a-z0-9\/\-_+=.~!%@?#%&;:$\\│]+(\.gif|\.jpg|\.jpeg|\.png|\.bmp)/isU' ); $preg_to = array ( '<img src="\\0" border="0">' ); $jieqiTpl ->assign( 'intro' ,preg_replace( $preg_from , $preg_to , $article ->getVar( 'intro' ))); $jieqiTpl ->assign( 'notice' , preg_replace( $preg_from , $preg_to , $article ->getVar( 'notice' ))); //文章封面图片标志 $jieqiTpl ->assign( 'imgflag' , $article ->getVar( 'imgflag' , 'n' )); $url_simage = jieqi_geturl( 'article' , 'cover' , $article ->getVar( 'articleid' ), 's' , $article ->getVar( 'imgflag' , 'n' )); if (! empty ( $url_simage )) $jieqiTpl ->assign( 'hasimage' , 1); else $jieqiTpl ->assign( 'hasimage' , 0); $jieqiTpl ->assign( 'url_simage' , $url_simage ); $jieqiTpl ->assign( 'url_limage' ,jieqi_geturl( 'article' , 'cover' , $article ->getVar( 'articleid' ), 'l' , $article ->getVar( 'imgflag' , 'n' ))); $lastchapter = $article ->getVar( 'lastchapter' ); if ( $lastchapter != '' ){ if ( $article ->getVar( 'lastvolume' ) != '' ) $lastchapter = $article ->getVar( 'lastvolume' ). ' ' . $lastchapter ; $jieqiTpl ->assign( 'url_lastchapter' , jieqi_geturl( 'article' , 'chapter' , $article ->getVar( 'lastchapterid' ), $article ->getVar( 'articleid' ))); } else { $jieqiTpl ->assign( 'url_lastchapter' , '' ); } $jieqiTpl ->assign( 'lastchapter' , $lastchapter ); $jieqiTpl ->assign( 'size' , $article ->getVar( 'size' )); $jieqiTpl ->assign( 'size_k' , ceil ( $article ->getVar( 'size' )/1024)); $jieqiTpl ->assign( 'size_c' , ceil ( $article ->getVar( 'size' )/2)); $jieqiTpl ->assign( 'dayvisit' , $article ->getVar( 'dayvisit' )); $jieqiTpl ->assign( 'weekvisit' , $article ->getVar( 'weekvisit' )); $jieqiTpl ->assign( 'monthvisit' , $article ->getVar( 'monthvisit' )); $jieqiTpl ->assign( 'mouthvisit' , $article ->getVar( 'monthvisit' )); $jieqiTpl ->assign( 'allvisit' , $article ->getVar( 'allvisit' )); $jieqiTpl ->assign( 'dayvote' , $article ->getVar( 'dayvote' )); $jieqiTpl ->assign( 'weekvote' , $article ->getVar( 'weekvote' )); $jieqiTpl ->assign( 'monthvote' , $article ->getVar( 'monthvote' )); $jieqiTpl ->assign( 'mouthvote' , $article ->getVar( 'monthvote' )); $jieqiTpl ->assign( 'allvote' , $article ->getVar( 'allvote' )); $jieqiTpl ->assign( 'goodnum' , $article ->getVar( 'goodnum' )); $jieqiTpl ->assign( 'badnum' , $article ->getVar( 'badnum' )); if ( $article ->getVar( 'fullflag' )==0) $jieqiTpl ->assign( 'fullflag' , $jieqiLang [ 'article' ][ 'article_not_full' ]); else $jieqiTpl ->assign( 'fullflag' , $jieqiLang [ 'article' ][ 'article_is_full' ]); $tmpvar = '' ; switch ( $article ->getVar( 'permission' )){ case '3' : $tmpvar = $jieqiLang [ 'article' ][ 'article_permission_special' ]; break ; case '2' : $tmpvar = $jieqiLang [ 'article' ][ 'article_permission_insite' ]; break ; case '1' : $tmpvar = $jieqiLang [ 'article' ][ 'article_permission_yes' ]; break ; case '0' : default : $tmpvar = $jieqiLang [ 'article' ][ 'article_permission_no' ]; break ; } $jieqiTpl ->assign( 'permission' , $tmpvar ); $tmpvar = '' ; switch ( $article ->getVar( 'firstflag' )){ case '1' : $tmpvar = $jieqiLang [ 'article' ][ 'article_site_publish' ]; break ; case '0' : default : $tmpvar = $jieqiLang [ 'article' ][ 'article_other_publish' ]; break ; } $jieqiTpl ->assign( 'firstflag' , $tmpvar ); //管理 $jieqiTpl ->assign( 'url_manage' , $article_static_url . '/articlemanage.php?id=' . $article ->getVar( 'articleid' )); //举报 $tmpstr =sprintf( $jieqiLang [ 'article' ][ 'article_report_reason' ], jieqi_geturl( 'article' , 'article' , $article ->getVar( 'articleid' ), 'info' )); $jieqiTpl ->assign( 'url_report' , JIEQI_URL. '/newmessage.php?tosys=1&title=' .urlencode(sprintf( $jieqiLang [ 'article' ][ 'article_report_title' ], $article ->getVar( 'articlename' , 'n' ))). '&content=' .urlencode( $tmpstr )); //采集 $setting =unserialize( $article ->getVar( 'setting' , 'n' )); $url_collect = $article_static_url . '/admin/collect.php?toid=' . $article ->getVar( 'articleid' , 'n' ); if ( is_numeric ( $setting [ 'fromarticle' ])) $url_collect .= '&fromid=' . $setting [ 'fromarticle' ]; if ( is_numeric ( $setting [ 'fromsite' ])) $url_collect .= '&siteid=' . $setting [ 'fromsite' ]; $jieqiTpl ->assign( 'url_collect' , $url_collect ); //互换链接 if ( $jieqiConfigs [ 'article' ][ 'eachlinknum' ]>0){ $eachlinkrows = array (); $eachlinkcount =0; $setting =unserialize( $article ->getVar( 'setting' , 'n' )); if (! empty ( $setting [ 'eachlink' ][ 'ids' ])){ foreach ( $setting [ 'eachlink' ][ 'ids' ] as $k => $v ){ $eachlinkrows [ $eachlinkcount ][ 'articleid' ]= $v ; $eachlinkrows [ $eachlinkcount ][ 'articlename' ]=jieqi_htmlstr( $setting [ 'eachlink' ][ 'names' ][ $k ]); $eachlinkrows [ $eachlinkcount ][ 'articlesubdir' ]=jieqi_getsubdir( $v ); $eachlinkrows [ $eachlinkcount ][ 'url_articleinfo' ]=jieqi_geturl( 'article' , 'article' , $v , 'info' ); //$imageinfo = JieqiArticleHandler::getCoverInfo($v->getVar('imgflag','n')); //$eachlinkrows[$eachlinkcount]['url_image']=jieqi_uploadurl($jieqiConfigs['article']['imagedir'], $jieqiConfigs['article']['imageurl'], 'article', $article_static_url).jieqi_getsubdir($v).'/'.$v.'/'.$v.'s'.$simgtype; $eachlinkcount ++; } } $jieqiTpl ->assign( 'eachlinknum' , $jieqiConfigs [ 'article' ][ 'eachlinknum' ]); $jieqiTpl ->assign( 'eachlinkcount' , $eachlinkcount ); $jieqiTpl ->assign_by_ref( 'eachlinkrows' , $eachlinkrows ); } else { $jieqiTpl ->assign( 'eachlinknum' , 0); $jieqiTpl ->assign( 'eachlinkcount' , 0); } //文章序号 $jieqiTpl ->assign( 'articleid' , $article ->getVar( 'articleid' )); $jieqiTpl ->assign( 'lastchapterid' , $article ->getVar( 'lastchapterid' )); //点击阅读,全文阅读 if ( $article ->getVar( 'chapters' , 'n' )>0){ $jieqiTpl ->assign( 'url_read' , jieqi_geturl( 'article' , 'article' , $article ->getVar( 'articleid' ), 'index' )); if ( $jieqiConfigs [ 'article' ][ 'makefull' ]==0 || JIEQI_CHAR_SET != JIEQI_SYSTEM_CHARSET){ $jieqiTpl ->assign( 'url_fullpage' , $article_static_url . '/reader.php?aid=' . $article ->getVar( 'articleid' )); } else { $jieqiTpl ->assign( 'url_fullpage' , jieqi_uploadurl( $jieqiConfigs [ 'article' ][ 'fulldir' ], $jieqiConfigs [ 'article' ][ 'fullurl' ], 'article' , $article_static_url ).jieqi_getsubdir( $article ->getVar( 'articleid' )). '/' . $article ->getVar( 'articleid' ). $jieqiConfigs [ 'article' ][ 'htmlfile' ]); } } else { $jieqiTpl ->assign( 'url_read' , '#' ); $jieqiTpl ->assign( 'url_fullpage' , '#' ); } //放入书架 $jieqiTpl ->assign( 'url_bookcase' , $article_dynamic_url . '/addbookcase.php?bid=' . $article ->getVar( 'articleid' )); //推荐本书 $jieqiTpl ->assign( 'url_uservote' , $article_dynamic_url . '/uservote.php?id=' . $article ->getVar( 'articleid' )); //作家专栏 if ( $article ->getVar( 'authorid' )>0){ $jieqiTpl ->assign( 'url_authorpage' , $article_dynamic_url . '/authorpage.php?id=' . $article ->getVar( 'authorid' )); } else { $jieqiTpl ->assign( 'url_authorpage' , '#' ); } $jieqiTpl ->assign( 'url_authorarticle' , $article_dynamic_url . '/authorarticle.php?author=' .urlencode( $article ->getVar( 'author' , 'n' ))); //打包下载 if ( $article ->getVar( 'chapters' , 'n' )>0){ if ( $jieqiConfigs [ 'article' ][ 'makehtml' ]==0){ $jieqiTpl ->assign( 'url_download' , '#' ); } else { $jieqiTpl ->assign( 'url_download' , jieqi_uploadurl( $jieqiConfigs [ 'article' ][ 'zipdir' ], $jieqiConfigs [ 'article' ][ 'zipurl' ], 'article' , $article_static_url ).jieqi_getsubdir( $article ->getVar( 'articleid' )). '/' . $article ->getVar( 'articleid' ). $jieqi_file_postfix [ 'zip' ]); } $jieqiTpl ->assign( 'url_txtarticle' , $article_static_url . '/txtarticle.php?id=' . $article ->getVar( 'articleid' )); } else { $jieqiTpl ->assign( 'url_download' , '#' ); $jieqiTpl ->assign( 'url_txtarticle' , '#' ); } //投票部分 $showvote =0; $jieqiConfigs [ 'article' ][ 'articlevote' ]= intval ( $jieqiConfigs [ 'article' ][ 'articlevote' ]); if ( $jieqiConfigs [ 'article' ][ 'articlevote' ] > 0 && isset( $setting [ 'avoteid' ]) && $setting [ 'avoteid' ]>0){ include_once ( $jieqiModules [ 'article' ][ 'path' ]. '/class/avote.php' ); $avote_handler =& JieqiAvoteHandler::getInstance( 'JieqiAvoteHandler' ); $avote = $avote_handler ->get( $setting [ 'avoteid' ]); if ( is_object ( $avote )){ $jieqiTpl ->assign( 'voteid' , $avote ->getVar( 'voteid' )); $jieqiTpl ->assign( 'votetitle' , $avote ->getVar( 'title' )); $jieqiTpl ->assign( 'mulselect' , $avote ->getVar( 'mulselect' )); $useitem = $avote ->getVar( 'useitem' , 'n' ); $voteitemrows = array (); for ( $i =1; $i <= $useitem ; $i ++){ $voteitemrows [ $i -1][ 'id' ]= $i ; $voteitemrows [ $i -1][ 'item' ]= $avote ->getVar( 'item' . $i ); } $jieqiTpl ->assign_by_ref( 'voteitemrows' , $voteitemrows ); $showvote =1; } } $jieqiTpl ->assign( 'showvote' , $showvote ); //电子书部分 $articletype = intval ( $article ->getVar( 'articletype' )); if (( $articletype & 1)>0) $hasebook =1; else $hasebook =0; if (( $articletype & 2)>0) $hasobook =1; else $hasobook =0; if (( $articletype & 4)>0) $hastbook =1; else $hastbook =0; if ( $hasobook ==1){ include_once ( $jieqiModules [ 'obook' ][ 'path' ]. '/class/obook.php' ); $obook_handler =& JieqiObookHandler::getInstance( 'JieqiObookHandler' ); $criteria = new CriteriaCompo(); $criteria ->add( new Criteria( 'articleid' , $article ->getVar( 'articleid' ), '=' )); $obook_handler ->queryObjects( $criteria ); $obook = $obook_handler ->getObject(); if ( is_object ( $obook ) && $obook ->getVar( 'display' )==0 && $obook ->getVar( 'size' )>0){ $jieqiTpl ->assign( 'obook_obookid' , $obook ->getVar( 'obookid' )); $jieqiTpl ->assign( 'obook_lastvolume' , $obook ->getVar( 'lastvolume' )); $jieqiTpl ->assign( 'obook_lastvolumeid' , $obook ->getVar( 'lastvolumeid' )); $jieqiTpl ->assign( 'obook_lastchapter' , $obook ->getVar( 'lastchapter' )); $jieqiTpl ->assign( 'obook_lastchapterid' , $obook ->getVar( 'lastchapterid' )); $jieqiTpl ->assign( 'obook_lastupdate' , date (JIEQI_DATE_FORMAT, $obook ->getVar( 'lastupdate' ))); $jieqiTpl ->assign( 'obook_size' , $obook ->getVar( 'size' )); $jieqiTpl ->assign( 'obook_publishid' , $obook ->getVar( 'publishid' )); } else { $hasobook =0; } } $jieqiTpl ->assign( 'articletype' , $articletype ); $jieqiTpl ->assign( 'hasebook' , $hasebook ); $jieqiTpl ->assign( 'hasobook' , $hasobook ); $jieqiTpl ->assign( 'hastbook' , $hastbook ); //网友章节 /* if($jieqiConfigs['article']['allowuserchap']){ $jieqiTpl->assign('allowuserchap', 1); $jieqiTpl->assign('url_newuserchap', $jieqiModules['article']['url'].'/newuserchap.php?aid='.$article->getVar('articleid')); $jieqiTpl->assign('url_userchaplist', $jieqiModules['article']['url'].'/userchaplist.php?aid='.$article->getVar('articleid')); $query=JieqiQueryHandler::getInstance('JieqiQueryHandler'); $sql="SELECT userchapid, posterid, poster, postdate, volumename, chaptername, size, goodnum, badnum FROM ".jieqi_dbprefix('article_userchap')." WHERE articleid=".jieqi_dbslashes($article->getVar('articleid', 'n'))." ORDER BY userchapid DESC LIMIT 0, ".intval($jieqiConfigs['article']['userchapnew']); $ret=$query->execute($sql); $userchaprows=array(); $k=0; while($v =$query->getObject()){ $userchaprows[$k]['userchapid']=$v->getVar('userchapid'); $userchaprows[$k]['posterid']=$v->getVar('posterid'); $userchaprows[$k]['poster']=$v->getVar('poster'); $userchaprows[$k]['postdate']=date(JIEQI_DATE_FORMAT.' '.JIEQI_TIME_FORMAT, $v->getVar('postdate')); $userchaprows[$k]['volumename']=$v->getVar('volumename'); $userchaprows[$k]['chaptername']=$v->getVar('chaptername'); $userchaprows[$k]['size']=$v->getVar('size'); $userchaprows[$k]['goodnum']=$v->getVar('goodnum'); $userchaprows[$k]['badnum']=$v->getVar('badnum'); $k++; } $jieqiTpl->assign_by_ref('userchaprows', $userchaprows); }else{ $jieqiTpl->assign('allowuserchap', 0); } */ //书评部分 include_once (JIEQI_ROOT_PATH. '/include/funpost.php' ); $jieqiConfigs [ 'article' ][ 'reviewtype' ]=2; if (!isset( $jieqiConfigs [ 'article' ][ 'reviewtype' ]) || $jieqiConfigs [ 'article' ][ 'reviewtype' ] == 1){ include_once ( $jieqiModules [ 'article' ][ 'path' ]. '/class/review.php' ); include_once (JIEQI_ROOT_PATH. '/lib/text/textfunction.php' ); $review_handler =& JieqiReviewHandler::getInstance( 'JieqiReviewHandler' ); $criteria = new CriteriaCompo( new Criteria( 'articleid' , $article ->getVar( 'articleid' ))); $criteria ->setSort( 'topflag DESC, topicid' ); $criteria ->setOrder( 'DESC' ); $criteria ->setLimit( $jieqiConfigs [ 'article' ][ 'reviewnew' ]); $criteria ->setStart(0); $review_handler ->queryObjects( $criteria ); $reviewrows = array (); $k =0; while ( $v = $review_handler ->getObject()){ $start =3; if ( $v ->getVar( 'topflag' )==1) { $reviewrows [ $k ][ 'topflag' ]=1; $start +=4; } else { $reviewrows [ $k ][ 'topflag' ]=0; } if ( $v ->getVar( 'goodflag' )==1) { $reviewrows [ $k ][ 'goodflag' ]=1; $start +=4; } else { $reviewrows [ $k ][ 'goodflag' ]=0; } if ( $jieqiConfigs [ 'article' ][ 'reviewenter' ]== '0' ){ $reviewrows [ $k ][ 'content' ]=jieqi_htmlstr(jieqi_limitwidth( str_replace ( array ( "\r" , "\n" ), array ( '' , ' ' ), $v ->getVar( 'reviewtext' , 'n' )), $jieqiConfigs [ 'article' ][ 'reviewwidth' ], $start )); } else { $reviewrows [ $k ][ 'content' ]=jieqi_htmlstr(jieqi_limitwidth( $v ->getVar( 'reviewtext' , 'n' ), $jieqiConfigs [ 'article' ][ 'reviewwidth' ], $start )); } $reviewrows [ $k ][ 'postdate' ]= date (JIEQI_DATE_FORMAT. ' ' .JIEQI_TIME_FORMAT, $v ->getVar( 'postdate' )); $reviewrows [ $k ][ 'userid' ]= $v ->getVar( 'userid' ); $reviewrows [ $k ][ 'username' ]= $v ->getVar( 'username' ); $k ++; } $jieqiTpl ->assign_by_ref( 'reviewrows' , $reviewrows ); $jieqiTpl ->assign( 'url_goodreview' , $article_dynamic_url . '/reviews.php?aid=' . $article ->getVar( 'articleid' ). '&type=good' ); $jieqiTpl ->assign( 'url_allreview' , $article_dynamic_url . '/reviews.php?aid=' . $article ->getVar( 'articleid' ). '&type=all' ); $jieqiTpl ->assign( 'url_review' , $article_dynamic_url . '/reviews.php?aid=' . $article ->getVar( 'articleid' )); } elseif ( $jieqiConfigs [ 'article' ][ 'reviewtype' ] == 2){ include_once ( $jieqiModules [ 'article' ][ 'path' ]. '/class/reviews.php' ); include_once (JIEQI_ROOT_PATH. '/lib/text/textfunction.php' ); $reviews_handler =& JieqiReviewsHandler::getInstance( 'JieqiReviewsHandler' ); $criteria = new CriteriaCompo( new Criteria( 'ownerid' , $article ->getVar( 'articleid' ))); $criteria ->setSort( 'istop DESC, topicid' ); $criteria ->setOrder( 'DESC' ); $criteria ->setLimit( $jieqiConfigs [ 'article' ][ 'reviewnew' ]); $criteria ->setStart(0); $reviews_handler ->queryObjects( $criteria ); $reviewrows = array (); $k =0; while ( $v = $reviews_handler ->getObject()){ $reviewrows [ $k ] = jieqi_topic_vars( $v ); $k ++; } $jieqiTpl ->assign_by_ref( 'reviewrows' , $reviewrows ); $jieqiTpl ->assign( 'url_goodreview' , $article_dynamic_url . '/reviews.php?aid=' . $article ->getVar( 'articleid' ). '&type=good' ); $jieqiTpl ->assign( 'url_allreview' , $article_dynamic_url . '/reviews.php?aid=' . $article ->getVar( 'articleid' ). '&type=all' ); $jieqiTpl ->assign( 'url_review' , $article_dynamic_url . '/reviews.php?aid=' . $article ->getVar( 'articleid' )); } if (! empty ( $_SESSION [ 'jieqiUserId' ])) $jieqiTpl ->assign( 'enablepost' , 1); else $jieqiTpl ->assign( 'enablepost' , 0); //是否显示验证码 if (!isset( $jieqiConfigs [ 'system' ])) jieqi_getconfigs( 'system' , 'configs' ); $jieqiTpl ->assign( 'postcheckcode' , $jieqiConfigs [ 'system' ][ 'postcheckcode' ]); $jieqiTpl ->setCaching(0); $jieqiTset [ 'jieqi_contents_template' ] = $jieqiModules [ 'article' ][ 'path' ]. '/templates/articleinfo.html' ; //点击统计要设置cookie和访问数据库,所以放footer.php前面 if (!isset( $jieqiConfigs [ 'article' ][ 'visitstatnum' ]) || ! empty ( $jieqiConfigs [ 'article' ][ 'visitstatnum' ])) include_once ( $jieqiModules [ 'article' ][ 'path' ]. '/articlevisit.php' ); include_once (JIEQI_ROOT_PATH. '/footer.php' ); } ?> |
共有 0 条评论