Moderator: Pete
|~|20110922061446|~|1/24/2005|~|Some Guy|~|email@mail.com|~|Entry Message Goes Here|~||~|1.2.3.4|~|<?php
include("../gbclass.php");
$fd = fopen ("list.txt", "r");
while (!feof ($fd))
{
$buffer = fgets($fd, 4096);
$lines[] = $buffer;
}
fclose ($fd);
$countLines = count($lines);
//echo $countLines;
foreach ($lines as $value)
{
$entry_array = explode('|~|',$value);
/*
echo "Time:".$entry_array[1]."<br>";
echo "Date:".$entry_array[2]."<br>";
echo "Name:".$entry_array[3]."<br>";
echo "Email:".$entry_array[4]."<br>";
echo "Message:".$entry_array[5]."<br>";
echo "???:".$entry_array[6]."<br>";
echo "IP:".$entry_array[7]."<br>";
echo "<hr>";
*/
$tmpDate = $entry_array[2];
$tmpFrom = $entry_array[3];
$tmpEmail = $entry_array[4];
$tmpMessage = $entry_array[5];
$tmpEmail = str_replace('"','"', $tmpEmail);
$tmpEmail = str_replace("'","'", $tmpEmail);
$tmpFrom = strip_tags($tmpFrom);
$tmpFrom = str_replace('"','"', $tmpFrom);
$tmpFrom = str_replace("'","'", $tmpFrom);
$tmpMessage = strip_tags($tmpMessage);
$tmpMessage = str_replace('"','"', $tmpMessage);
$tmpMessage = str_replace("'","'", $tmpMessage);
if($tmpDate != "" && $tmpFrom != "" && $tmpEmail != "" && $tmpMessage != "")
{
$a = new gbClass();
$a->setGBVars($tmpDate,$tmpFrom,$tmpEmail,$tmpMessage);
@ $fp = fopen("list_converted.txt","a");
flock($fp, 2);
$data = serialize($a)."<!-- E -->";
fwrite($fp, $data);
flock($fp, 3);
fclose($fp);
}
}
echo "<b>Guestbook Entry Conversion Completed!</b>";
?>
O:7:"gbClass":4:{s:6:"gbDate";s:23:"May 31, 2012 - 12:44 PM";s:6:"gbFrom";s:6:"Morgan";s:7:"gbEmail";s:20:"mbatastini@aflac.com";s:9:"gbMessage";s:721:"Hey Sissy... To say that I miss you would be the understatement of the century. Words cannot express just how badly I wish you were still here with me, but I know that you are watching over me and are with me every step of the way, in everything that I do. Today you would have turned 22 and I can just imagine the wonderful and beautiful woman you would have become. God is so lucky to have you amongst his angels and I am even more lucky to have you as my sister and Guardian Angel. I hope you are throwing one heck of a party in Heaven and know that we are all thinking of you, missing you, and loving you from down here, not just today but everyday. Sending butterfly kisses and the biggest hug - Your Big Sister";}<!-- E -->O:7:"gbClass":4:{s:6:"gbDate";s:20:"Thu 09/20/12 12:29PM";s:6:"gbFrom";s:4:"Mike";s:7:"gbEmail";s:13:"blah@blah.com";s:9:"gbMessage";s:9:"Test
<br>";}<!-- E --> ...
O:7:"gbClass":4:{s:6:"gbDate";s:20:"Thu 09/20/12 12:29PM";s:6:"gbFrom";s:4:"Mike";s:7:"gbEmail";s:13:"blah@blah.com";s:9:"gbMessage";s:9:"Test
<br>";}<!-- E -->
Users browsing this forum: No registered users and 1 guest