Changeset 1086 for trunk/common
- Timestamp:
- 12/22/09 14:21:51 (2 years ago)
- File:
-
- 1 edited
-
trunk/common/db/textblock.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/db/textblock.php
r1074 r1086 243 243 244 244 // Grep through textblocks. This is mostly a hack needed for macro_grep.php 245 function textblock_grep($substr, $page, $regexp = false) { 245 // Also used for round deletion 246 function textblock_grep($substr, $page, $regexp = false, $offset = 0, $count = 0) { 246 247 if (!$regexp) { 247 248 $compare = "LIKE"; … … 255 256 WHERE `name` LIKE '%s' AND 256 257 (`text` $compare '%s' OR `title` $compare '%s') 257 ORDER BY `name`", 258 ORDER BY `name` 259 LIMIT %s, %s", 260 db_escape($page), db_escape($substr), db_escape($substr), 261 db_escape($offset), db_escape($count)); 262 return db_fetch_all($query); 263 } 264 265 function textblock_grep_count($substr, $page, $regexp = false) { 266 if (!$regexp) { 267 $compare = "LIKE"; 268 } else { 269 $compare = "REGEXP"; 270 } 271 $query = sprintf("SELECT COUNT(*) as `cnt` 272 FROM ia_textblock 273 WHERE `name` LIKE '%s' AND 274 (`text` $compare '%s' OR `title` $compare '%s')", 258 275 db_escape($page), db_escape($substr), db_escape($substr)); 259 return db_fetch _all($query);276 return db_fetch($query); 260 277 } 261 278 … … 278 295 db_query("DELETE FROM `ia_textblock_revision` WHERE `name` = '$pageesc'"); 279 296 db_query("DELETE FROM `ia_textblock` WHERE `name` = '$pageesc'"); 280 if (db_affected_rows() != 1) { 281 return true; 282 } 297 298 return (db_affected_rows() != 0); 283 299 } 284 300
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)