hack

PHP Memory Issues? There's a Hack for That!

I've had to raise my php memory limits much further than I'd like just to get some normal things done in D7. The admin page for Drupal's menu system with a large menu tree can easily crush what I'd consider a healthy amount of available ram. Here is a fast and ugly fix settings.php:


$path = explode('/', $_GET['q']);
if ($path[0] == 'admin') {
  ini_set('memory_limit', '192M');
}

Hopefully this is sufficient for most cases.

Auto Link TinyMCE Images

Unless I am just completely missing it, the support for auto linking images back to their source for TinyMCE is just not intuitive. Since I generally upload a larger image than what I can use on a page, I want to have the image on the page link back to the larger one. Having to create a link after you have placed an image does not really make sense to me. So an obvious hack enters the room. Since we know that at least in Drupal, imaes that are in content areas of a post are likely to have been uploaded by a user, we can make a general assumption that these are likely to want to lnk to the original. jQuery of course gives us just enough power to be dangerous: