mike3k
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Moving from Drupal to WordPressThe conversion was pretty clean for me. The only problem I had was that most user info was lost. The password seemed to be correct, but users were given no role. A few users are still having difficulty logging in. All of the content & categories copied over cleanly.
Forum: Themes and Templates
In reply to: Header Automatic ChangeI just did it. See it at https://www.mcdevzone.com/
I have a series of images kubrickheader0.jpg – kubrickheader7.jpg in my images directory and I added the following script to header.php:
<?php
function header_graphic() {
echo “/images/”;
$num=rand(0,7);
echo “kubrickheader”.$num.”.jpg”;
};
?>Finally, I changed the stylesheet header element as follows:
#header { background: url(“<?php bloginfo(‘stylesheet_directory’); header_graphic(); ?>”) no-repeat bottom center; }
Forum: Plugins
In reply to: WP Page as static home pageHome.php would be perfect. It would be awsome if it ccan be displayed without a database query, so it will work even if my database server is down.
Forum: Fixing WordPress
In reply to: how to block comment spammerI grepped my access log and the only hits containing that exact user agent ending with PCUser were wp-comments-post.php. I don’t think normal IE 6.0/NT 4.0 will have that exact string.
Forum: Plugins
In reply to: Avoiding Comment ModerationI’ve converted it to a plugin, which can be downloaded here.
Forum: Fixing WordPress
In reply to: how to block comment spammerI’ve been getting a ton of those. I wrote a plugin to kill those comments before it even gets passed to moderation. Download it here.
In addition, I put the following in my .htaccess:
SetEnvIfNoCase User-Agent "^Mozilla\/4.0 \(compatible; MSIE 6.0; Windows NT 4.0; PCUser\)" denyThis
<Limit GET POST>
Order Allow,Deny
Allow from all
Deny from env=denyThis
</Limit>Forum: Fixing WordPress
In reply to: Comment SpamI’ve been getting hit by a spammer constantly since Thursday. I find that I can block him by changing your condition to:
SetEnvIfNoCase User-Agent "^Mozilla\/4.0 \(compatible; MSIE 6.0; Windows NT 4.0; PCUser\)" denyThis
I’ve also written a plugin called from post_comment_text which looks for some unique spam words in the comment and calls die() with a nasty message before it even gets to be moderated.Forum: Plugins
In reply to: Avoiding Comment ModerationP.S. you can change that array as necessary to list any words that only appear in spam, such as domain names.
Forum: Plugins
In reply to: Avoiding Comment ModerationYesterday I got hit with a lot of comment spam and got tired of having to delete each one of them, so I came up with this patch.
In wp-comments-post.php, add the following code
$words = array (
"golimar.com",
"levitra",
"tramadol",
"cialis",
"fioricet",
"phentermine",
"viagra",
);
foreach ($words as $word) {
$word = trim($word);
$pattern = "#$word#i";
if (preg_match($pattern,$comment) || preg_match($pattern,$url)) {
die ("You are not allowed to post comments, spammer.");
}
Before the line:
$wpdb->query("INSERT INTO $tablecomments
(comment_post_ID, comment_author, comment_author_email, comment_author_url,
How can I convert this to a plugin?Forum: Installing WordPress
In reply to: I can’t log in, why?!?I was able to fix the login problem, which only occurred in Safari, by editing wp-login.php and changing every instance of COOKIEPATH to $COOKIEPATH in the setcookie calls.
Forum: Installing WordPress
In reply to: I can’t log in, why?!?I’m having the same problem, but only in Safari. I can log in with FireFox, Opera, or IE, but when I try to log in with Safari, it always bounces me back to the login screen with “wrong login/password”, which it also displays the first time in that screen before I enter anything. When I try to reset the password, it always shows the username as blank. I’m logging in as the administrator, which is the only user in ny blog.