FoolFuuka/Housekeeping: Difference between revisions
From Bibliotheca Anonoma
Antonizoon (talk | contribs) |
Antonizoon (talk | contribs) No edit summary |
||
Line 42: | Line 42: | ||
== Deleting all ghostposts in a thread == | == Deleting all ghostposts in a thread == | ||
In delete-by-search-query.php: | |||
$use_specificboard = true; | |||
$specificboard = 'a';}} | |||
$querymatch = "tnum = 1234141"; // Delete by thread num | |||
Then run: | |||
php /home/atc/delete-by-search-query.php | php /home/atc/delete-by-search-query.php |
Revision as of 05:01, 2 January 2019
Undelete post
Deleted posts by moderators are thrown in the deleted table. It is a hassle to grab stuff, but its not gone forever.
- Get mysql workbench and login
- type in the command
SELECT * FROM asagi.a_deleted;
- Click that lightning button
- The results are the posts. Observe if they are the posts you want.
These commands can be run in mysql console or the mysql workbench
- Single posts:
INSERT INTO `asagi`.`<board>` (SELECT * FROM `asagi`.`<board>_deleted` WHERE doc_id = <doc_id>);
- Entire thread:
INSERT INTO `asagi`.`<board>` (SELECT * FROM `asagi`.`<board>_deleted` WHERE thread_num = <thread_num>);
Delete Ghost Posts by search query
- modify /home/atc/delete-by-search-query.php
- Under the profiler:
- 27 Start: SphinxQL: SELECT id, board, tnum FROM a_ancient, a_main, a_delta WHERE MATCH('(@comment mado mami)') AND is_internal = 1 ORDER BY timestamp DESC LIMIT 0, 25 OPTION max_matches = 5000, reverse_scan = 1
- you have no idea how angry it has made us to see the words "mado mami" and their accomplices be spammed on our ghostposts
- Replace $querymatch with the highlighted portion
- You can also include AND if there is more to filter by
Deleting by ghost posts by IP range
Example: 148.74.* (first IP: 148.74.0.0, last IP 148.74.255.255)
- Search for 1st IP in range in FF - Look at query in Profiler
- Take the `pip` out
- Example for 148.74.0.0 - WHERE pip = 2487877632
- Take the `pip` out
- Search for last IP in range
- Take the `pip` out
- Example for 148.74.255.255 - WHERE pip = 2487943167
- Take the `pip` out
- Edit /home/atc/delete-by-search-query.php
- Set $dry = true; to test
- Comment the line after NORMAL QUERY
- Uncomment line after IP RANGE
- Edit PIP numbers. First IP is first, Last IP goes second
- Test with php /home/atc/delete-by-search-query.php
- If it looks good, set $dry = false; and run again
Deleting all ghostposts in a thread
In delete-by-search-query.php:
$use_specificboard = true; $specificboard = 'a';}} $querymatch = "tnum = 1234141"; // Delete by thread num
Then run:
php /home/atc/delete-by-search-query.php