Changeset 848:ad18a33a3cef for inc/core/class.dc.core.php
- Timestamp:
- 07/31/12 13:18:23 (13 years ago)
- Branch:
- sexy
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.core.php
r706 r848 1141 1141 } 1142 1142 1143 /**1144 Inits <var>wiki2xhtml</var> property for simple blog comment (basic syntax).1145 */1146 public function initWikiSimpleComment()1147 {1148 $this->initWiki();1149 1150 $this->wiki2xhtml->setOpts(array(1151 'active_title' => 0,1152 'active_setext_title' => 0,1153 'active_hr' => 0,1154 'active_lists' => 0,1155 'active_quote' => 0,1156 'active_pre' => 0,1157 'active_empty' => 0,1158 'active_auto_br' => 1,1159 'active_auto_urls' => 1,1160 'active_urls' => 0,1161 'active_auto_img' => 0,1162 'active_img' => 0,1163 'active_anchor' => 0,1164 'active_em' => 0,1165 'active_strong' => 0,1166 'active_br' => 0,1167 'active_q' => 0,1168 'active_code' => 0,1169 'active_acronym' => 0,1170 'active_ins' => 0,1171 'active_del' => 0,1172 'active_footnotes' => 0,1173 'active_wikiwords' => 0,1174 'active_macros' => 0,1175 'parse_pre' => 0,1176 'active_fr_syntax' => 01177 ));1178 1179 # --BEHAVIOR-- coreInitWikiSimpleComment1180 $this->callBehavior('coreInitWikiSimpleComment',$this->wiki2xhtml);1181 }1182 1183 /**1184 Inits <var>wiki2xhtml</var> property for blog comment.1185 */1186 public function initWikiComment()1187 {1188 $this->initWiki();1189 1190 $this->wiki2xhtml->setOpts(array(1191 'active_title' => 0,1192 'active_setext_title' => 0,1193 'active_hr' => 0,1194 'active_lists' => 1,1195 'active_quote' => 0,1196 'active_pre' => 1,1197 'active_empty' => 0,1198 'active_auto_br' => 1,1199 'active_auto_urls' => 1,1200 'active_urls' => 1,1201 'active_auto_img' => 0,1202 'active_img' => 0,1203 'active_anchor' => 0,1204 'active_em' => 1,1205 'active_strong' => 1,1206 'active_br' => 1,1207 'active_q' => 1,1208 'active_code' => 1,1209 'active_acronym' => 1,1210 'active_ins' => 1,1211 'active_del' => 1,1212 'active_footnotes' => 0,1213 'active_wikiwords' => 0,1214 'active_macros' => 0,1215 'parse_pre' => 0,1216 'active_fr_syntax' => 01217 ));1218 1219 # --BEHAVIOR-- coreInitWikiComment1220 $this->callBehavior('coreInitWikiComment',$this->wiki2xhtml);1221 }1222 1223 1143 public function wikiPostLink($url,$content) 1224 1144 { … … 1269 1189 { 1270 1190 $defaults = array( 1271 array('allow_comments','boolean',true,1272 'Allow comments on blog'),1273 array('allow_trackbacks','boolean',true,1274 'Allow trackbacks on blog'),1275 1191 array('blog_timezone','string','Europe/London', 1276 1192 'Blog timezone'), 1277 array('comments_nofollow','boolean',true,1278 'Add rel="nofollow" to comments URLs'),1279 array('comments_pub','boolean',true,1280 'Publish comments immediately'),1281 array('comments_ttl','integer',0,1282 'Number of days to keep comments open (0 means no ttl)'),1283 1193 array('copyright_notice','string','','Copyright notice (simple text)'), 1284 1194 array('date_format','string','%A, %B %e %Y', … … 1306 1216 array('nb_post_per_feed','integer',20, 1307 1217 'Number of entries on feeds'), 1308 array('nb_comment_per_feed','integer',20,1309 'Number of comments on feeds'),1310 1218 array('post_url_format','string','{y}/{m}/{d}/{t}', 1311 1219 'Post URL format. {y}: year, {m}: month, {d}: day, {id}: post id, {t}: entry title'), … … 1330 1238 array('tpl_use_cache','boolean',true, 1331 1239 'Use template caching'), 1332 array('trackbacks_pub','boolean',true,1333 'Publish trackbacks immediately'),1334 array('trackbacks_ttl','integer',0,1335 'Number of days to keep trackbacks open (0 means no ttl)'),1336 1240 array('url_scan','string','query_string', 1337 1241 'URL handle mode (path_info or query_string)'), 1338 1242 array('use_smilies','boolean',false, 1339 1243 'Show smilies on entries and comments'), 1340 array('wiki_comments','boolean',false,1341 'Allow commenters to use a subset of wiki syntax')1342 1244 ); 1343 1245 } … … 1394 1296 1395 1297 /** 1396 Recreates comments search engine index.1397 1398 @param start <b>integer</b> Start comment index1399 @param limit <b>integer</b> Number of comments to index1400 1401 @return <b>integer</b> <var>$start</var> and <var>$limit</var> sum1402 */1403 public function indexAllComments($start=null,$limit=null)1404 {1405 $strReq = 'SELECT COUNT(comment_id) '.1406 'FROM '.$this->prefix.'comment';1407 $rs = $this->con->select($strReq);1408 $count = $rs->f(0);1409 1410 $strReq = 'SELECT comment_id, comment_content '.1411 'FROM '.$this->prefix.'comment ';1412 1413 if ($start !== null && $limit !== null) {1414 $strReq .= $this->con->limit($start,$limit);1415 }1416 1417 $rs = $this->con->select($strReq);1418 1419 $cur = $this->con->openCursor($this->prefix.'comment');1420 1421 while ($rs->fetch())1422 {1423 $cur->comment_words = implode(' ',text::splitWords($rs->comment_content));1424 $cur->update('WHERE comment_id = '.(integer) $rs->comment_id);1425 $cur->clean();1426 }1427 1428 if ($start+$limit > $count) {1429 return null;1430 }1431 return $start+$limit;1432 }1433 1434 /**1435 Reinits nb_comment and nb_trackback in post table.1436 */1437 public function countAllComments()1438 {1439 1440 $updCommentReq = 'UPDATE '.$this->prefix.'post P '.1441 'SET nb_comment = ('.1442 'SELECT COUNT(C.comment_id) from '.$this->prefix.'comment C '.1443 'WHERE C.post_id = P.post_id AND C.comment_trackback <> 1 '.1444 'AND C.comment_status = 1 '.1445 ')';1446 $updTrackbackReq = 'UPDATE '.$this->prefix.'post P '.1447 'SET nb_trackback = ('.1448 'SELECT COUNT(C.comment_id) from '.$this->prefix.'comment C '.1449 'WHERE C.post_id = P.post_id AND C.comment_trackback = 1 '.1450 'AND C.comment_status = 1 '.1451 ')';1452 $this->con->execute($updCommentReq);1453 $this->con->execute($updTrackbackReq);1454 }1455 1456 /**1457 1298 Empty templates cache directory 1458 1299 */
Note: See TracChangeset
for help on using the changeset viewer.