Categories
PHP Snippets Programmer's Mindset

Solved: vBulletin Quick Reply Not Working (ckeditor.js unable to get value of the property ‘label’)

I have a vBulletin board that I manage and while recently had users complain about the Quick Reply not working.  They had to go into the advanced editor to make it work.

Doing my due diligence as an IT professional quickly narrowed it down to…. IE of course.  I spent hours digging, using a debugger I kept getting the error in the title of this post.  I kept going through the Call Stack trying to figure out what was going on, but the javascript is minified very tightly, so following it became daunting.

Two days later another user complained about not being able to update their profile.  While debugging this, both problems became very clear.

I had recently put in some rewrite rules to make the forum more SEO friendly.  However there are a couple situations where the rewrite rules broke down.  I was missing the two lines colored in green below.

RewriteEngine On
RewriteRule ^/videos.html /forums/36-Bowling-Videos-amp-Pictures
RewriteRule ^/threads/ckeditor.php /ckeditor.php?t=$1 [L]
RewriteRule ^/threads/(.*) /showthread.php?t=$1 [L]
RewriteRule ^/forums/(.*) /forumdisplay.php?$1 [L]
RewriteRule ^/entries/(.*) /entry.php?$1 [L]
RewriteRule ^/blogs/(.*) /blog.php?$1 [L]
RewriteRule ^/members/ajax.php /ajax.php?$1 [L]
RewriteRule ^/members/(.*) /member.php?$1 [L]
RewriteRule ^/list/(.*) /list.php?$1 [L]
RewriteRule ^/list/author/(.*) /list.php?$1 [L]
RewriteRule ^/$ http://www.bowlingboards.com/forum.php  [R,L]

It was that simple.  I am sure I am missing some other rules, and will try to get them corrected in due time.

 

Categories
PHP Snippets

Calculating This Day Last Year in PHP

Have you ever wanted to know what the date was last year on this day?

Example: You want to compare sales from Wednesday of this year to the same Wednesday of last year. There is a very simple solution in PHP.

[code]
function ThisDateLastYear($date_in) {
// date_in = input date in form of YYYY-MM-DD
$days = 364;
return date(‘Y-m-d’, strtotime(“-364 days”, mktime(0,0,0,$m,$d,$y)));
}
[/code]