Little Tweaks

These are some small but essential fixes for me.

?phpsessid=

With the default configuration, PHP session id is added to the end of URLs sometimes (not always, I don’t know why). It’s harmless, but makes looking through the referer log quite difficult.

Adding

php_flag session.use_trans_sid off

to .htaccess file fix this.

not verified

I hate having (not verified) trailing names of everybody commenting on my site, so I always hacked this bit out of common.inc after every upgrade.

BBClone

I use BBClone to track site statistics. After installing it in /bbclone relative to the site root, these are addes near the bottom of Drupal’s index.php.


define("_BBC_PAGE_NAME", (drupal_get_title()?drupal_get_title():"ichris.ws"));
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);

At first I tried putting the code inside theme template, and it never worked. I got the tip to put the code in index.php from Emptyset. I didn’t try integrating BBClone into Drupal, though. I don’t need to show statistics on my page, it’s just for me to see.

For my other sites on the server, signposts are added, e.g.


define("_BBC_PAGE_NAME", (drupal_get_title() ?
"Sandbox -" . drupal_get_title() : "Sandbox"));
define("_BBCLONE_DIR", "../bbclone/");

for a drupal sub-site, and


define("_BBC_PAGE_NAME", "TNTU" . wp_title('-', false));
define("_BBCLONE_DIR", "/home/public_html/bbclone/");
define("COUNTER", _BBCLONE_DIR . "mark_page.php");
if (file_exists(COUNTER)) { include(COUNTER); }

for a wordpress site. Note that, for WordPress, the code does go into theme template.

You should probably use print($site_name) and bloginfo('name') for site name in Drupal and WordPress, respectively, if they will be changing.

web dweller's picture

I'm sorry, I'm interested in removing the (not verified) thingy. But I don't understand where to find the common.inc. Sorry for my noobness.. but where can I find it?

Thanks for the attention.