Gallery

From GreyWiki

Jump to: navigation, search

There isn't much to be said about Menalto Gallery, but we can do something about accumulated spam... maybe. Here's a script; save the following as 'g2spamkiller.sql' or something to that effect.

CREATE TEMPORARY TABLE tmptable
SELECT g_id
FROM `g2_Comment` gc
WHERE
gc.g_subject like '%url%' or
gc.g_subject like '%http%' or
gc.g_subject like '%personals%' or
gc.g_subject like '%poker%' or
gc.g_subject like '%blackjack%' or
gc.g_subject like '%gambling%' or
gc.g_subject like '%viagra%' or
gc.g_subject like '%phentermine%' or
gc.g_subject like '%casino%' or
gc.g_subject like '100%' or
gc.g_subject like '%slots%' or
gc.g_subject like '%Cialis%' or
gc.g_subject like '%ringtone%' or
gc.g_subject like '%url%' or
gc.g_comment like '%http%' or
gc.g_comment like '%personals%' or
gc.g_comment like '%poker%' or
gc.g_comment like '%blackjack%' or
gc.g_comment like '%gambling%' or
gc.g_comment like '%viagra%' or
gc.g_comment like '%phentermine%' or
gc.g_comment like '%casino%' or
gc.g_comment like '100%' or
gc.g_comment like '%slots%' or
gc.g_comment like '%ringtone%' or
gc.g_comment like '%Cialis%';

DELETE g2_Entity
FROM g2_Entity
INNER JOIN tmptable ON g2_Entity.g_id = tmptable.g_id;

DELETE g2_ChildEntity
FROM g2_ChildEntity
INNER JOIN tmptable ON g2_ChildEntity.g_id = tmptable.g_id;

DELETE g2_Comment
FROM g2_Comment
INNER JOIN tmptable ON g2_Comment.g_id = tmptable.g_id;

DROP TEMPORARY TABLE tmptable;

Then just run:

mysql -proot-password < ./g2spamkiller.sql
Personal tools