Step 1: Create a new campaign with Purlem
Start as if you are creating a new campaign with Purlem. Give your campaign a name and enter the URL for where your blog is located. You DO NOT need to enter the entire URL. For example, I'm not typing in "http://purlem.com/blog", just "http://purlem.com" will do just fine. Click the "Submit" button.
Step 2: Click to "manually install" the files
Step 3: Keep this page open and continue to Step 4.
You will need information on this page to continue with the integrate into Wordpress. Just keep this page open and move on to Step 4.
Step 4: Login to your Wordpress Admin
Open a new browser window and navigate to your wordpress admin.
Step 5: Create a New Blog Page
Select "Pages" > "Add New" from the left column.
Step 6: Give your new page a name and click "Publish"
Step 7: View Live Page
Click on "View Live Page." A window will open with your new blog page. Leave this window open and continue to the next step.
Step 8: Edit Theme
Return to your Wordpress Admin. In the left column, go to "Appearance" then "Editor".
Step 9: Find the file the displays the page content.
I'm using the 'Wordpress Default 1.6' theme. In my theme, the file that displays the page content is the 'Page Template (page.php)'. It will likely be similar in other themes. Select this file under "Theme Files".
Step 10: Paste in PURL CODE
At the top of the text editor for 'Page Template (page.php)' paste in the following code:
- Code: Select all
<?php
//******* PURL CODE - DO NOT EDIT ************
$curl = curl_init();curl_setopt ($curl, CURLOPT_URL, 'http://www.purlapi.com/lp/index.php?ID='.$_GET["ID"].'&name='.$_GET["purl"].'&page='.$_GET["page"].'&conversionID='.$_REQUEST["conversionID"].'&test='.$_GET["test"].'&wordpress='.$_GET["wordpress"].''); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $user = curl_exec ($curl); curl_close ($curl); $user = json_decode($user); session_start(); if($_GET['username']) $_SESSION['visitor']=$_GET['username']; if($user->{'login'} && ($_SESSION['visitor'] != $user->{'firstName'}.''.$user->{'lastName'})) { echo $user->{'login'}; exit; }
//******* END PURL CODE ************
?>
It will look something like this....
For those that care... This code basically calls on Purlem's database to pull all the information on the person visiting the PURL. This information is stored in a recordset named "$user".
Step 11: Add Content and Form
In the same text editor, you're going to want to find where the blog post is being called. In most cases, the blog post will be called just after this tag:
- Code: Select all
<div class="entry">
It is just before after this tag where add the code:
- Code: Select all
<?php echo $user->{'content'}; ?>
<?php echo $user->{'form'}; ?>
Will look something like this...
Step 12: Update File
Click the "Update File" button just below the text editor to save your changes.
Step 13: Return to Purlem and copy code
Your doing great! Now return the Purlem window you kept open from Step 3. Copy the "Purl Redirect Code" from the text area as seen below:
Step 14: .htaccess file
Open your favorite ftp client application (I use 'fetch' on a mac). Connect to the server that hosts your blog, and create a new file with the name '.htaccess' in the root directory of your website (This is usually 'public_html'). Paste in the 'Purl Redirect Code' that you just copied from Purlem. (If you already have a '.htaccess' file, then just paste in the code in the existing file.
Step 15: Modify the code
To work with wordpress, your going to have to slightly modify the code you just pasted.
- Return to the Blog Page you left open from Step 11. Copy the URL.
Delete the default URL in the code (in my case it will be: http://purlem.com/purlpage_Blog/index.php?).
And paste in the URL you just copied in its place followed by the "&" sign. Will look something like this...
- Find "name=" and replace with "purl=".
- Add "&wordpress=Y" to the end of the URL string.
- Code: Select all
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !([A-Za-z0-9_]+)\.(html?|php|asp|css|jpg|gif|shtml|htm|xhtml|txt|ico|xml)/?$ [NC]
RewriteRule ^([A-Za-z]+)\.([A-Za-z]+)/?$ http://purlem.com/blog/?page_id=217&purl=$1$2&ID=45&page=1&wordpress=Y [R]
Step 16: Upload .htaccess file
Upload the .htaccess file you just created to the root directory of the site.
Step 17: Create a test Contact and view Personalized URL
Your almost done! Now just return to Purlem, and create a new contact (Click on Contacts > Add New Contact).
Now visit: http://yoursite.com/firstName.lastName (where firstName and lastName were that of the contact you just created, and yoursite is obviously your site name).
In my case I'm going to http://purlem.com/Joey.Thomas
If everything was done correctly, you should be redirected to the Personalized URL on your Wordpress Blog. Let me know if you run into any problems!
