RSS Icon Twitter Icon Linked In Icon

Web Threads » Author Archive

Find Deleted SMF User Posts

When an SMF member deletes their account and then contacts you to delete their posts, it’s not an easy request because the posts are no longer attached to a user account. What can you do? You can query the database for the list of the messages they posted.

SELECT * FROM smf_messages WHERE posterName='{deletedusername}'

Replace all of {deletedusername} with the username of the deleted member and update your table name for smf_messages.

You could run a DELETE query, but this could result in some odd behaviour, forum message counts would be wrong and if it’s the first post of a topic, it could make the whole topic out of kilter. It’s best to manually delete these. (And you might consider wanting to charge people for your trouble!)

After running the above query in phpmyadmin, click the export link at the bottom and save to excel csv.

Once you have the excel file, you can copy the full link to the the forum index.php?topic= in a new inserted column. Copy from the first row and highlight the rest to paste to all cells. Delete or move the second column (message numbers) so that the link column is next to the topic number. You could then highlight both columns and paste to a text file for list of links to the topics, or concatenate (merge) both columns in another new column.

Filed under: Development

Drupal Query to Disable Comments on Node by Content Type

A handy drupal snippet, when someone’s added hundreds of nodes with comments allowed and you need to bulk disable them without editing them each by hand.
Read entire Article »

Filed under: Development

Wordpress Plugin Exec-PHP Hack – Disable For Post

If you’re running the Exec-PHP plugin in Wordpress and struggling with posting your php code blocks without it being executed, I’ve made a quick hack to disable this plugin per post by adding a custom field. You just have to remember not to upgrade automatically or you’ll lose the changes. With a few lines of code and a Custom field in on your post entry page, you can disable Exec-PHP and it will skip this content. Note it will still run on other elements, just not the content.

Read entire Article »

1 person likes this post.

Filed under: Development

Assign Guest Posts to New Member in SMF

Or as I like to call it, “Query to assign guest posts to user who threw a tantrum and deleted their account and then wanted it back again.” We get these at least twice a year, usually around the holidays.
Read entire Article »

1 person likes this post.

Filed under: Development

Remove Spam Private Message Content in SMF

A useful MySQL query to delete a spam PM content on Simple Machines Forum.

Read entire Article »

Filed under: Development