Fix to ISE blog system
Posted by mholmes on 12 Feb 2008 in Activity log
Worked with Greg (including some time yesterday) to debug and provide a hack for a problem with the blog they're using for reviews of theatre performances. This is my ise-dev posting detailing what we did:
Hi folks, This is by way of "documentation" of a hack Greg and I had to perform to get the blog system working. The basic problem was this: The blog is actually running in lettuce.tapor.uvic.ca/~isedev/sip_blog/ However, it's proxied so that it appears to be running in internetshakespeare.uvic.ca/Theater/reviews/ [Incidentally, I'm enraged by the spelling of "Theater" there. Grrr.] Now, when you log in or log out, the PHP code which processes the login and composes the redirect to send you to the default blog does its work based on the server variables and paths it knows about. It thinks of itself as running at lettuce.tapor.uvic.ca/~isedev/sip_blog/, so the login script ends up bouncing you to lettuce URLs instead of staying on the internetshakespeare site. The only way we could find to get around this is a veritable hack. We were able to add three lines to one file in order to override the lettuce paths: We edited /inc/_vars_inc.php and added these lines: /* MDH and Gregster: Hack to request URI to handle proxy problem. */ $ReqURI = str_replace('/%7Eisedev/sip_blog/', '/Theater/reviews', ReqURI); $ReqPath = str_replace('/%7Eisedev/sip_blog/', '/Theater/reviews', $ReqPath); $ReqHost = str_replace('lettuce.tapor', 'internetshakespeare', $ReqHost); These lines were added at line 183, before these original lines: // So far, we did not include the javascript for popupups $b2commentsjavascript = false; Nothing was removed or changed. This hack will need to be re-added if the blog software is updated and the _vars_inc.php file changes; or if the hosting/proxy setup is changed. This hack is also documented in a file called: _vars_inc.php_HACKDOCUMENTATION.txt in the same folder, so even if the original file is overwritten by an upgrade, the details are still available. Sorry it's such an unclean solution, but a couple of hours swimming in the spaghetti that is B2Evolution didn't suggest any better options. Please test the blog system and make sure everything's working as expected; there might be more gotchas once people start creating logins for themselves, posting stuff, etc.