Sunday, June 19, 2011

Links in New Window for PHPBB 3 Mod : HOW TO

How to Open Links in New Window for PHPBB3 Mod
Okay, here it is. The super simple way to get links to open in a new window in PHPBB 3.0 (or higher). This mod is designed to be super simple to install, and if your server is configured appropriately all you need to do is copy and paste. upload & go!

This "new window mod" has several features based on the latest SEO tactic and recommended guidelines from major search engines.
-It will open all external links in a new window, but local links will open in the same.
-Nofollow is added to all links past the first post like a blog though an option is given to disable it and make all non-local links nofollow.
-An optional white list for links you want to be followed all the time can be filled
-Restricts all links to nofollow until the user gains at least 3 posts
- Optional Black list for NOFOLLOW on first posts if first post DOFOLLOW is enabled.

1) To Install, download and open viewtopic.php

2) Search for the lines:

$message = bbcode_nl2br($message);
$message = smiley_text($message);

3) Directly Below that, copy and paste the following code:



// BEGIN - OPEN LINKS IN NEW WINDOW MOD
// August 8th, 2010 By TheSocialRift.co.uk
//


// *Custom Variables:


// If your server variable isn't set you may need to replace
// this line with an example such as:
// $home_url=socialrift.co.uk;


$home_url=$_SERVER['HTTP_HOST'];


// *Option Custom Variables:


// This is a White List of URLs
// other than yours you'd like to link to


$short_list=array(
'socialrift.co.uk',
'bbc.com',
);


// This is a Black List of URLs
// Links such as affiliate links, etc. to NOFOLLOW
// For First Posts.


$short_list2=array(
'r.popshops.com',
'www.entertainment.com',
);


// Disable First First Post DoFollow (default: enabled)
// To disable remove the commenting slashes in front of:


// $follow_fp='disable';










// ************ CHANGE NOTHING BELOW HERE ****************


// Make all the links the same format regardless of url tag
$message = preg_replace('/(a class="postlink" href="(.*?)")/','a href="$2" class="postlink"',$message);


// replace all links with nofollow
$message = preg_replace('/(class="postlink")/','class="postlink" rel="nofollow" onclick="window.open(this.href);return false;"',$message);


// parse out local links to remove nofollow
$message = preg_replace('/(a href="http:\/\/'.$home_url.'(.*?)" class="postlink" rel="nofollow" onclick="window.open\(this.href\)\;return false\;")/','a href="http://'.$home_url.'$2" class="postlink-local"',$message);


// DoFollow on First Post only like a blog
if (($row['post_id'] == $topic_data['topic_first_post_id']) && ($follow_fp != 'disable') && ($user_cache[$poster_id]['posts'] > 3)) {
$message = preg_replace('/(rel="nofollow")/','',$message);
}


// Optional WhiteList for dofollowing
// (But still open in new window)


foreach($short_list as $sl) {
$message = preg_replace('/(href="http:\/\/'.$sl.'(.*?)" class="postlink" rel="nofollow")/','href="http://'.$sl.'$2" class="postlink"',$message);
}


//Black List for first posts.


foreach($short_list2 as $sl) {
$message = preg_replace('/(href="http:\/\/'.$sl.'(.*?)" class="postlink")/','href="http://'.$sl.'$2" class="postlink" rel="nofollow"',$message);
}


// Parsing Image Sizes (Optional)
// if ($row['post_id'] == $topic_data['topic_first_post_id']) {
// $message = preg_replace('/(alt="Image")/','alt="Image" style="max-width:400px;"',$message); } else {
// $message = preg_replace('/(alt="Image")/','alt="Image" style="max-width:650px;"',$message); }


// END - OPEN LINKS IN NEW WINDOW MOD


4) Save and upload to your server... Test it and if all is well, you're good! In some situations the server may not pass the host and you may need to change the one line at the top of the mod (indicated in file) to your domain so it can parse out local links. Other information is given if you wish to add links to your white-list or enable nofollow on first posts.

5) Now go to the pub and drink, good luck... or link back to us because that would prove you to be a person of awesome character!

Friday, June 10, 2011

Google's Panda 2.2 - Black, white and redemption.

I've been quiet for sometime now. Today that ends. Today I respond to this chaos called Panda.

More than money, more than anything I enjoy the sharing of knowledge that the Internet has given us. I've been a fan-girl of Google for longer than I can remember. A company who I've imagined being one that launches each update in a NASA type launch center with the pomp and circumstance of children in their imaginations. After all, they, like me, I believe they are people who see the world a little bit differently, or at least that's what I thought. Google always seemed like a group of very smart people whose goal in life was to do good, a geek missionary group to change the world for the better. I started noticing a change for the worse about a year or so prior to Panda. Little things in their programs that would go on for months broken or obvious quarks in their Chrome OS. Things started to make little sense. Nasa is going bankrupt and Google's shares are several hundred dollars but yet their CR-48 can't post on Facebook? (Mine still struggles to play Youtube videos.) I had faith as it didn't really affect my life all that much. Minor nuisances from a once precise product. After all I was busy, back in college pursuing a degree while raising two children. That's when Panda hit. Immediately I tried to find out what went wrong. My income, my goals of graduating started to look in peril as my life's work online seemed to become less important than a cat behind the piano or information on how to dye your hair pink. While I often don't doubt America itself is at times as "simple" as LOLCATS, the bottom line is it's hard to believe that what Panda did is what engineers and doctors would choose to represent as quality content on the Internet. So I expected change. I expected a company to right its wrong when it made a mistake, but then in the weeks that followed all we heard was "It was working as expected." Surely not?  Surely someone spiked the Panda cake with too much pride?

So time goes on. Thirty days becomes sixty,  then ninety. Major news outlets question the decision, forums are filled with examples of poor SERPs but the Google remains silent. In a time in which we're suffering the biggest economic depression in 70 years, Google a company that prides itself on good destroyed the livelihood of thousands of people and businesses. Even Doctor Who gives the aliens a chance to redeem themselves before destroying them. Isn't that what goodness is about. The chance to be redeemed?

Of course there are those who see this whole thing as infinite genius, they play their parts as members of the cult of stupid suggesting Google is superlative, without fault. No one is perfect, especially capitalistic American companies whom are heavily under the pressure of investors while being knifed in the lung by Microsoft's Bing. Except that's the point. Is the Panda merely a metaphor for good and evil, of black and white? (Somebody at the Plex watches way too much LOST.) Surely it's this moment in time which will ultimately decide if Google as a company becomes like its rivals or stands by its principles and does whats right and fix whats wrong?

So we await.... Google's Panda 2.2 update. Redemption? A new hope for internetkind?