Etomite Community Forums: Guestbook3 - Etomite Community Forums

Jump to content

Read Me

This forum is posted in automatically when a snippet is added to the library, or updated. Please use the snippet topic to discuss that snippet.
  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Guestbook3

#31 User is offline   pegro 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 5
  • Joined: 21-April 06

Posted 03 January 2007 - 11:21 PM

View PostDeniseDD, on Jun 15 2006, 09:58 PM, said:

And a hint for all who want to get notified of new entries. Just post the URL to your GB at www.change-detection.com. Usually within 24 hours of a change an email arrives.


This site must have shut down in the mean time. I am looking for that function exactly - to get an email when new posts are been made to the guestbook. Is it possible to set the manager section up to send an email to admin (in this case me!) when a new message arrives in the manager inbox? Or is there another way?

Pls help! :unsure:

/Pegro

#32 User is offline   Duivelken 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 3
  • Joined: 01-March 07

Posted 31 March 2007 - 12:45 PM

Hi,

I've used this guestbook on several sites and cannot figure out how to make the input fields dissapear and just make a link appear.

I would like visitors to have the guestbook straight away, and then when they click the link "Write a new message" or "Schrijf een nieuw bericht" the come to the page where they can leave a new message.

Thx for the help.

Duivelken

http://www.djkina.be
http://www.scoutskluisbergen.be
http://www.charlies-gent.be/nieuw
http://www.galerierooyart.nl

Edit: Solved it by messing around in the code a bit, my apologies.

This post has been edited by Duivelken: 31 March 2007 - 04:29 PM


#33 User is offline   katherholt 

  • Likes Etomite Forums!
  • PipPip
  • Group: Member
  • Posts: 376
  • Joined: 15-July 04
  • Gender:Female
  • Location:Fort Gaines, GA

Posted 31 March 2007 - 04:32 PM

Try this for charlies-gent.be/nieuw:

<a href="[~56~]">Write a new message.</a>


This should then link to this page:
http://www.charlies-gent.be/nieuw/index.php?id=56

Karen



View PostDuivelken, on Mar 31 2007, 08:45 AM, said:

Hi,

I've used this guestbook on several sites and cannot figure out how to make the input fields dissapear and just make a link appear.

I would like visitors to have the guestbook straight away, and then when they click the link "Write a new message" or "Schrijf een nieuw bericht" the come to the page where they can leave a new message.

Thx for the help.

Duivelken

http://www.djkina.be
http://www.scoutskluisbergen.be
http://www.charlies-gent.be/nieuw
http://www.galerierooyart.nl

Edit: Solved it by messing around in the code a bit, my apologies.


#34 User is offline   Duivelken 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 3
  • Joined: 01-March 07

Posted 02 April 2007 - 01:02 AM

Hi Karen,

thx for the reply but the problem was already solved by changing the code.

Many thx.

Duivelken

#35 User is offline   hellenb 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 59
  • Joined: 25-October 05
  • Location:Netherlands

Posted 27 October 2007 - 08:33 AM

hi,

I installed guestbook, it looks nice. How can I manage this guestbook messages (other then going into the etomite database and edit the specific table)?

#36 User is offline   dodgeuk 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 1
  • Joined: 24-June 08

Posted 17 September 2008 - 11:47 AM

Hi

Using guestbook3 but getting loads of spam is there any way of adding a spam protection to this guestbook.

Thanks

Roger

#37 User is offline   MoZz 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 3
  • Joined: 26-November 09

Posted 27 November 2009 - 05:52 AM

Testing GuestBook3 with captcha...

This post has been edited by MoZz: 30 November 2009 - 05:53 PM


#38 User is offline   MoZz 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 3
  • Joined: 26-November 09

Posted 30 November 2009 - 05:52 PM

View Postdodgeuk, on 17 September 2008 - 11:47 AM, said:

Hi

Using guestbook3 but getting loads of spam is there any way of adding a spam protection to this guestbook.

Thanks

Roger


Yeaaah!!!
It's work!

There is a working code of GuestBook3 with captcha!!!
Some words in russian - translate it yourself!!!
Snippet without any smiles and forms for it.

Quote

/*
Snippet: GuestBook3 (based on GuestBook2) - Etomite v0.6.3 - Modified 2005-09-05

Created By: Ralph A. Dahlgren - rad14701@yahoo.com
Modified By: Mikko K. Lammi - lammikko@gmail.com - www.parea.fi
Modified By: Rain R. Visser
Modified By: MoZz (based on original scripts GuestBook(with Captcha)&GuestBook3)

Usage: Create an Etomite user or admin as GuestBook owner in Etomite Manager
Change $defaultadmin variable to match GuestBook owner
OR
Messages will be deposited into that mailbox, but only GuestBook
messages will be displayed within the GuestBook listing.
Place the .gifs in assets\images
Place the .JS in assets\site

Variables: $gbtype - Referenced in GuestBook admin User Messages Subject
$gbadmin - Etomite User/Admin who will receive this message

Examples: Use the [!SnippetName!] syntax instead of regular [[SnippetName]]:
[!GuestBook!] - Will use snippet defaults for $gbtype and $gbadmin
[!GuestBook?gbtype=GuestBook&gbadmin=guestbook!] - Self Explanatory
[!GuestBook?gbadmin=someuser!] - Uses $etomite->documentObject['pagetitle'] for $gbtype
[!GuestBook?bgtype=SomeTopic!] - Uses $defaultadmin for $gbadmin

Note: $etomite->documentObject['createdby'] was not used for $gbadmin intentionally
To implement this capability would entail and additonal DB Query before Inserts
*/

// BEGIN SETTINGS -------------------------------------------------------------

// Variables you may want to change

$defaultadmin = "GuestBook"; // Default GuestBook admin to use if $gbadmin not passed
$gap = " :: "; // Separator between $type and $subject in User Messages Subject field
$messages = 10; // Number of messages on one page
$header_style = "style='font-size: medium;'"; // Css style for header
$message_box_style = "style='border: 1px solid #000000; padding: 5px; background-color: #DDDDDD;'"; // Css style for message box
$dateformat = "%d.%m.%Y om %H:%M:%S"; // Preferred Date & Time display format, European dateformat is "%d.%m.%Y %H:%M:%S"
$order = "DESC"; // Order of messages by postdate: DESC = descending, ASC = ascending
$server_offset_time = 21600; // number of seconds for timezone difference


// Russian language for guestbook (optimized 4 Opera AC)

$_lang_guestbook["write_new_message"] = "Написать новое сообщение ";
$_lang_guestbook["messages"] = "Сообщения ";
$_lang_guestbook["name_or_alias"] = "Введите имя или E-mail адрес ";
$_lang_guestbook["send"] = "Отправить ";
$_lang_guestbook["reset"] = "Очистить ";
$_lang_guestbook["next_page"] = "Следущая страница ";
$_lang_guestbook["previous_page"] = "Предыдущая страница ";
$_lang_guestbook["message"] = "Сообщение: ";
$_lang_guestbook["date_and_time"] = "Дата и время ";
$_lang_guestbook["sender"] = "Отправитель ";
$_lang_guestbook["cancel"] = "Отменить ";
$_lang_guestbook["error"] = "GuestBook User/Manager not found... Check your settings...";

// END SETTINGS ---------------------------------------------------------------

// Variables you should not need to change
$type = isset($gbtype) ? $gbtype : $etomite->documentObject['pagetitle']; // Set $type field for new entry
$trimtype=substr($type,0,15); // Truncate $type to 15 character limit for field
$guestbookadmin = isset($gbadmin) ? $gbadmin : $defaultadmin; // Set GuestBook admin
$pageid=$etomite->documentIdentifier; // ID of the calling document
$pageurl=$etomite->makeURL($pageid); // URL if you don't have friendly uri
$tbl = $etomite->dbConfig['dbase'].".".$etomite->dbConfig['table_prefix'];
$msgdb = $tbl."user_messages"; // DB.Prefix_user_messages variable

// Function to make hyperlinks
function hyperlink($text) {
$search = array ("/([\w\.\/\&\=\?\-]+)@([\w\.\/\&\=\?\-]+)/","/((ftp(7?):\/\/)|(ftp\.))([\w\.\/\&\=\?\-]+)/","/((http(s?):\/\/)|(www\.))([\w\.\/\&\=\?\-]+)/");
$replace = array ("<a href='mailto:$1@$2'>$1@$2</a>","<a href='ftp$3://$4$5' target='_blank'>$4$5</a>","<a href='http$3://$4$5' target='_blank'>$4$5</a>");
return preg_replace ($search, $replace, $text);
}

// Don't allow unwanted re-posts of messages
if($_POST['submitted'] == "TRUE") header( "Location: index.php?id=$etomite->documentIdentifier" );

// Query for the user ID (id) for the GuestBook owner
$sql = "SELECT id FROM ".$tbl."manager_users WHERE ".$tbl."manager_users.username='$guestbookadmin';";
$rs = $etomite->dbQuery($sql);
$limit = $etomite->recordCount($rs);

// Check to make sure $guestbookadmin has been created and assigned
if($limit == 1) {

$userrec = $etomite->fetchRow($rs);
$userid = $userrec['id'];

// Check to see if a valid message has been submitted
if(isset($_POST['submit']) && ($_POST['subject'] > "") && ($_POST['message'] > "") && ($etomite->validCaptchaCode($_POST['captcha']))){
$postdate = time();

$recipient = $userid;
$subject = $type . $gap . strip_tags($_POST['subject']);
$message = strip_tags($_POST['message']);

// Query to INSERT a new GuestBook message into user_messages
$sql = "INSERT INTO $msgdb ( id , type , subject , message , sender , recipient , private , postdate , messageread ) VALUES ( '', '$type', '$subject', '$message', '0', '$recipient', '0', '$postdate', '0' );";

$rs = $etomite->dbQuery($sql); // Execute the Query
$submitted="TRUE";
}
else $submitted = "TRUE";

// Display write new message form
if ($_GET['new_message'] == "TRUE") {
// Display a Form for submitting a new message
$output .= "<table width='100%'><tr><td align=center>";
$output .= "<h2 $header_style>".$_lang_guestbook["write_new_message"]."</h2>";
$output .= "<form name=\"form\" method='post' action='index.php'>";
$output .= "<input type='hidden' name='id' value='$pageid' />";
$output .= "<input type='hidden' name='submitted' value='$submitted' />";
$output .= $_lang_guestbook["name_or_alias"]."<br /><input name='subject' size='40' />";
$output .= "<br /><br />".$_lang_guestbook["message"]."<br /><text"."area rows='8' cols='50' name='message'></"."text"."area>";
$output .= "<div>Enter SecCode:</div><div><input name='captcha' size='40' /></div><br />";
$output .= "<div>".$etomite->getCaptchaCode()."</div><br />";$output .= "<input type='submit' name='submit' value='".$_lang_guestbook["send"]."' />";
$output .= " <input type='reset' name='reset' value='".$_lang_guestbook["reset"]."' />";
$output .= " <input type='button' value='".$_lang_guestbook["cancel"]."' onClick=\"window.location.href='$pageurl&new_message=FALSE'\">";
$output .= "</form>";
$output .= "</td></tr></table>";
}

// Display write new message link
else {
$output .= "<h2 $header_style>".$_lang_guestbook["write_new_message"]."</h2>";
$output .= " <form><input type='button' value='".$_lang_guestbook["write_new_message"]."' onClick=\"window.location.href='$pageurl&new_message=TRUE'\"></form>";
}

$output .= "<h2 $header_style>".$_lang_guestbook["messages"]."</h2>";

// Query to COUNT existing messages
$sql = "SELECT * FROM ".$tbl."user_messages
WHERE ".$tbl."user_messages.recipient=$userid
AND ".$tbl."user_messages.type='".$trimtype."'
ORDER BY ".$tbl."user_messages.postdate $order;";

$rs = $etomite->dbQuery($sql); // Execute the Query
$total = $etomite->recordCount($rs); // Number of messages found

// Message page number from GET
if (isset($_GET["page"])) { $page = $_GET["page"]; }
else { $page = 1; }

// Index where to start in result set
$from = 0 + ($page-1)*$messages;

// Query to SELECT existing messages
$sql = "SELECT * FROM ".$tbl."user_messages
WHERE ".$tbl."user_messages.recipient=$userid
AND ".$tbl."user_messages.type='".$trimtype."'
ORDER BY ".$tbl."user_messages.postdate $order LIMIT $from, $messages;";

$rs = $etomite->dbQuery($sql); // Execute the Query
$limit = $etomite->recordCount($rs); // Number of messages found

// Number of pages
$pages = ceil($total/$messages);

// Previous page link
$previouspage = $page-1;
$previouspage_text .= " <form><input type='button' value='? ".$_lang_guestbook["previous_page"]." [$previouspage/$pages]' onClick=\"window.location.href='$pageurl&page=$previouspage'\"></form>";
// $previouspage_text = "<a href='?page=$previouspage'>? ".$_lang_guestbook["previous_page"]." [$previouspage/$pages]</a> ";

// Next page link
$nextpage = $page+1;
$nextpage_text = " <form><input type='button' value='".$_lang_guestbook["next_page"]." [$nextpage/$pages] ?' onClick=\"window.location.href='$pageurl&page=$nextpage'\"></form>";
// $nextpage_text = "<a href='?page=$nextpage'>".$_lang_guestbook["next_page"]." [$nextpage/$pages] ?</a>";

// Previous and next page links at top of the page
if ($previouspage > 0) { $output .= $previouspage_text; }
if ($nextpage <= $pages) { $output .= $nextpage_text; }

// Empty lines
if ($total > $messages) {
$output .= "<br /><br />";
}

// Loop through each of the messages and format for display
for ($y = 0; $y < $limit; $y++) {
if ($order == "DESC") { $number = $total - $from - $y; }
if ($order == "ASC") { $number = $from + $y + 1; }
$guestbookrec = $etomite->fetchRow($rs);
$poster = str_replace($type.$gap,"",$guestbookrec['subject']);
$message = nl2br($guestbookrec['message']);
$postdate = strftime($dateformat, $guestbookrec['postdate']+$server_offset_time);
$output .= "<table $message_box_style width='700'>";
$output .= "<tr bgcolor=#CCCCCC><td nowrap width='80%'>$poster</td>";
$output .= "<td nowrap width='20%' align=right>$postdate</td>";
$output .= "<tr><td colspan=\"2\"> </td>";
$output .= "<tr><td colspan=\"2\">$message</td>";
$output .= "<tr><td width='80%'> </td>";
$output .= "<td width='20%' nowrap align=right>".$_lang_guestbook["message"].": $number/$total</td>";
$output .= "</table><br />";
}

// Previous and next page links at bottom of the page
if ($previouspage > 0) { $output .= $previouspage_text; }
if ($nextpage <= $pages) { $output .= $nextpage_text; }
}

// If no valid GuestBook owner is found display error message...
else $output = $_lang_guestbook["error"];

// Output
return $output;


#39 User is offline   0zz 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 82
  • Joined: 30-April 05

Posted 02 December 2009 - 01:19 PM

OMG! Can't believe that anyone still cares about the guestbook. Thank you, man! ))

But, I get this:

Quote

GuestBook User/Manager not found... Check your settings...

regular error, that doesn't explain much. Etomite 1.1., i call snippet with [GuestBook!] command..

#40 User is offline   Ralph 

  • Etomite Administrator
  • Group: Admin
  • Posts: 6,429
  • Joined: 01-July 04
  • Gender:Male
  • Location:Jamestown, NY USA
  • Interests:Computers, Camping, Hiking, Aviation

Posted 02 December 2009 - 01:53 PM

Checking the code for $_lang_guestbook["error"] = "GuestBook User/Manager not found... Check your settings..."; and then looking for where $_lang_guestbook["error"] is located lower in the code you will find:

// If no valid GuestBook owner is found display error message...
else $output = $_lang_guestbook["error"];


This means that the default GuesBook admin doesn't exist... You can assign the proper admin in the snippet call as described in the self contained snippet documentation...

Or modify:

$defaultadmin = "GuestBook"; // Default GuestBook admin to use if $gbadmin not passed


Or create the manager user "GuestBook" and give them permission to access messages...

#41 User is offline   0zz 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 82
  • Joined: 30-April 05

Posted 03 December 2009 - 12:03 PM

All right, all right... Now I almost got it. I've set the GB admin as the "Admin" - default admin for Etomite Engine..
Now the GB creates messages somewhere, but it says, that the messages are not approved and i cannot find them inside Etomite control panel... It seems like i've missed some stepp during installation..

#42 User is offline   MoZz 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 3
  • Joined: 26-November 09

Posted 30 December 2009 - 07:54 AM

View Post0zz, on 03 December 2009 - 12:03 PM, said:

All right, all right... Now I almost got it. I've set the GB admin as the "Admin" - default admin for Etomite Engine..
Now the GB creates messages somewhere, but it says, that the messages are not approved and i cannot find them inside Etomite control panel... It seems like i've missed some stepp during installation..

You'll find your massages in your "Control panel" with authenticated under "defaultadmin" account in "My Etomite/Massages", but i can't see any premoderating function in script above.
In my case it works here (http_://lift.perm.ru/guestbook.html) without any modifications.
Have you swithOn "Use Visitor Permissions" and "Use CAPTCHA codes" at "User settings" on your "Contol panel"?
I have no ideas why you get this error. I'm just a lamer in PHP and did this script exclusively for myself. Long and tiresomely selecting arguments. For me it has working. Though to combine GB1 and GB3 for me it was difficult. The patience and all will work. Just read the usage comments in the head of script (GB1(with captcha) & GB3).
Greatest thanks to author of this scripts and developers of Etomite!
Sorry for my english - online translators is a piece of shit)

This post has been edited by MoZz: 30 December 2009 - 08:06 AM


#43 User is offline   0zz 

  • Etomite Forum Fan
  • Pip
  • Group: Member
  • Posts: 82
  • Joined: 30-April 05

Posted 07 April 2010 - 05:44 AM

MoZz, thanks for your answer, i need to try it.
И, кстати, можешь писать по-русски, если админы не забанят )

Share this topic:


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users