Monthly Archive for May, 2007

Add reinvigorate to a phpBB forum

Following up my previous post, here’s how to get reinvigorate working in phpBB:

Open the index.php file for editing and find the following text near the end of the file:

$template->pparse('body');

Now, just after this, enter the following, and be sure to replace REINVIGORATE-ID with your own code from reinvigorate.


?>
<script type="text/javascript" src="http://include.reinvigorate.net/re_.js"></script>
<script type="text/javascript">
<?php if ( $userdata['session_logged_in'] ) { ?>
var re_name_tag = “<?php echo( $userdata['username'] );?>”;
<?php } ?>
re_(”REINVIGORATE-ID”);
</script>
<?php

Add reinvigorate to a MediaWiki site

Aloha!

Long time no see. Since last I’ve gotten married in Las Vegas, spent my honeymoon in Hawaii, bought a house, a car, fixed a garden and planted a few trees. But enough about me, on to some tech-talk again.

I recently set up a MediaWiki for a big(-ish) swedish site and wanted to add stats from reinvigorate to it. No biggie, since they make it real easy, but for future trail blazers, here’s how to do it (using the login name + email as name tags for logged in, registered users).

Open the skins/MonoBook.php file (assuming you do use this skin) for editing and find the following text:
<div id="globalWrapper">

Now, just before this, enter the following, and be sure to replace REINVIGORATE-ID with your own code from reinvigorate.

<script type="text/javascript" src="http://include.reinvigorate.net/re_.js"></script>
<script type="text/javascript">
<?php global $wgUser;
if ($wgUser->getId() != 0){ ?>
var re_name_tag = "<?php echo( $wgUser->getName() );?>";
var re_context_tag = "mailto:<?php echo( $wgUser->getEmail() );?>";
<?php }?>
re_("REINVIGORATE-ID“);
</script>

Now just reload a page without being logged in, then log in and try again. In a short while your stats should show you both anonymous users and named users will have accessed your site.

Bonus tip:
In order to show the actual pages your users browse, you need more descriptive page titles. Here’s a good way to enable that in MediaWiki.