Pligg Welcome Page Redirect

Today a guest in the IRC chatroom for Pligg (irc.freenode.net #pligg) ask if there was a way to create a landing page on his website to welcome first time visitors. Being the gracious coder that I am, I gave him a simple example that can be used to redirect newcomers to a welcome page. Add the code below to the top of your pligg.tpl template file to redirect users to a URL of your choosing (see code comments). I suggest creating a static HTML page with a welcome message or registration form.

{if $pagename eq 'index'}
	{php}
		if(!isset($_COOKIE['PliggWelcome'])){
			setcookie("PliggWelcome", "visited");
			// Change this line to point to your welcome page...
			echo '<meta http-equiv="REFRESH" content="0;url=http://pligg.com/demo/">';
			exit;
		}else{
			// echo "No cookie was found.. Continue loading page"; 
		}	
	{/php}
{/if}

Having trouble reading or copying the text above? Try this pastebin.com url.

This snippet of code works by checking if the person browsing the page has a specific cookie installed on their browser. If the cookie does not exist, it will add it and then redirect the user to another page. If the user does have the cookie, then the page will continue loading like normal. I haven’t personally tested this out on a Pligg myself, so let me know if you have any problems or comments.

2 thoughts on “Pligg Welcome Page Redirect

  1. Do you know any of module or something,where we can ask for newsletter subscription… I checked alot but couldnot found

Comments are closed.