Add-on Batch Update Threads - Body Text

Wesker

Well-known member
/admin.php?threads/batch-update

Batch update threads is an useful tool but it lacks the ability to search threads based on content inside the body. For example, we'd like to search all threads that have a specific link or text phrase.

Is there currently a way to do this with xF?
 
Without a doubt but the point is then to apply a change to the selected threads "basically sticky the threads".
 
Code:
mysql> describe xf_thread;
+--------------------+---------------------------------------+------+-----+---------+----------------+
| Field              | Type                                  | Null | Key | Default | Extra          |
+--------------------+---------------------------------------+------+-----+---------+----------------+
| thread_id          | int(10) unsigned                      | NO   | PRI | NULL    | auto_increment |
| node_id            | int(10) unsigned                      | NO   | MUL | NULL    |                |
| title              | varchar(150)                          | NO   |     | NULL    |                |
| reply_count        | int(10) unsigned                      | NO   |     | 0       |                |
| view_count         | int(10) unsigned                      | NO   |     | 0       |                |
| user_id            | int(10) unsigned                      | NO   | MUL | NULL    |                |
| username           | varchar(50)                           | NO   |     | NULL    |                |
| post_date          | int(10) unsigned                      | NO   | MUL | NULL    |                |
| sticky             | tinyint(3) unsigned                   | NO   | MUL | 0       |                |
| discussion_state   | enum('visible','moderated','deleted') | NO   |     | visible |                |
| discussion_open    | tinyint(3) unsigned                   | NO   |     | 1       |                |
| discussion_type    | varchar(25)                           | NO   |     |         |                |
[...]

Do a join on the xf_thread and xf_post tables, and if updating the xf_post.message then also set the corresponding xf_thread.sticky = 1
Presuming that you want to sticky every thread that contains the link or phrase you're searching for.
 
Top Bottom