Twitter status in your PHPBB profile
I thought it would be nifty to show my last Twitter update as a profile field next to all of my posts in the Lime49 forums. It took a bit longer than expected, but eventually I got it working. These instructions are specific to Dreamhost, but you could change the slightly to work on other hosts.
-
You need to change your PHPBB template to include the status next to post matching a certain criteria. I'm the only administrator on the forum, so I set a template flag which is set for administrators, but no-one else.
-
Open viewtopic.php and add the template switch will determine whether the field will be shown. I used my User ID so it wouldn’t be shown for anyone else, but you could use another variable from PHPBB.
Find the section:
'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, 'S_TOPIC_POSTER' => ($topic_data['topic_poster'] == $poster_id) ? true : false, 'S_IGNORE_POST' => ($row['hide_post']) ? true : false, 'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '',
And at the end add:
'POSTER_ADMIN' => ($poster_id == 2),
-
Now open stylename\template\viewtopic_body.html and add the following to the top:
<!-- PHP --> $twitterStatus = file_get_contents('/home/hjennerway/lime49.com/forums/twitter.php'); <!-- ENDPHP -->
-
Still in viewtopic_body.html, add this to the profile section (where the status message will be shown).:
<!-- IF postrow.POSTER_ADMIN --> <br /> <dd><strong>Currently:</strong> <span class="twitter"><!-- PHP -->echo $twitterStatus;<!-- ENDPHP --></span> </dd> <!-- ENDIF -->
-
Log in to the admin panel and purge the cache.
-
By default, PHP is not enabled in templates. You can enable it in the Security Settings section on the General tab.
-
Now you need a cronjob to connect to twitter, parse your last update and write it to a file. Create a new php file and modify this script to point to your PHPBB installation. Save it as twittercron.php
-
Add a line to crontab to run the script every six hours (or more, depending on how often you update your status). You'll need to change the path to the location where PHP is installed, which you can using which php.
* */6 * * * php5.cgi /path/to/twittercron.php 1>&2 &>/dev/null
This code saves your twitter status to a file every six hours. Them stores the contents of the file in a variable, which is shown in the template.

Hey Guys,
I am a student (limited budget) and have seen a few offers for free ipods and iphones. Does anyone Know if any if the free IPhone or Ipod offers are actually legit? I don’t want to waste my time filling out a hundred surveys and was hoping to hear from someone who may have had some success with this.
Thanks