Importing from other guestbooks

More
11 years 8 months ago #12428 by Hawk
I have been using a guestbook that has no ip blocking, now I am getting flooded with spam and cannot block the ip's. I would love to use your guestbook, but of course everyone's flat file is different and yours looks like it uses multiple files. Is there an easy way to import from another flat file?? Thanks!!!

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #12429 by Pete
Hello Hawk,

Do you have a sample data file from your old guestbook? If so email it to us at support@digioz.com and we'll take a look at it for you.

Pete

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #12431 by Hawk
Sorry for the late reply, been out of town. Thanks for looking at this. Sending it in now. Thanks!!!!

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #12432 by Pete
Hey Mike,

I looked at your data file. Here is what a typical record looks like:
Code:
|~|20110922061446|~|1/24/2005|~|Some Guy|~|email@mail.com|~|Entry Message Goes Here|~||~|1.2.3.4|~|

Based on the above layout, I wrote the following converter code to convert your .dat file data to DigiOz Guestbook 1.7.2 format. Here is the code for "converter_mike.php":
Code:
<?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>"; ?>

The converter assumes the following:
  • Each guestbook entry resides on a separate line in the data file.
  • Email address seems to be optional, so you will have to set email to optional in the new guestbook file.
  • The following mapping was assumed based on sequence of entry blocks (basically these are only the fields that we need for the new guestbook):
    • 2 - Date
    • 3 - Name
    • 4 - Email
    • 5 - Message

You can edit the data in the .dat file with Notepad and re-run the script to make corrections to the data before finalizing the converted file. All you have to do is to create a file called "converter_mike.php" and place it in the "/converter/" folder of your guestbook, along with a file called "list.txt" then run the php file. It will convert and create a new file called "list_converted.txt" when it is done, which you can then copy into "/data/" folder and rename to "list.txt" to use for your guestbook.

Let me know if you have any questions.

Pete

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #12433 by Hawk
Wow!!! Thanks so much!!!!! The guestbook I was using was Ardguest in case anyone else is coming over from it. Again, Pete, I cannot thank you enough!!! Now to get it all converted and set up!!!

Edit:
Here is the website to the old guestbook:

www.promosi-web.com/script/guestbook/

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #12464 by Hawk
I am just now getting around to getting this implemented. Is there a way to sort the guestbook by date? I uploaded the file you sent me and the 2004 posts start on the first page. I can manually go in and adjust it I guess.

Please Log in or Create an account to join the conversation.

Time to create page: 0.124 seconds
Powered by Kunena Forum