Page 1 of 1

Can't make any guestbook entries

Posted: Thu Sep 14, 2006 10:51 am
by Grega
Hi. I have a little problem with the Guestbook. I'm using CMSMS 1.0 Hawaii and Guestbook 1.1.2. The guestbook ist included as content-type "page", but the problem appeared with content-type "guestbook" too. Everything works fine, exept I can't make any guestbook entries. :-( I changed the file class.Guestbook.php (/lib/classes/module/) a little bit by adding some more smileys. I also changed the Guestbook Entry HTML Template and the insertform.tpl. The first one works fine, but changing the insertform.tpl causes the problem, that I don't get any entries into my database. Using the default-insertform.tpl - no problems. Here is my insertform.tpl:

Code: Select all

<div class="cms-gastbuch-div-insert">
 <form name="insert" action="{$geturl}" method="post">
 <input type="hidden" name="flag" value="1" />
 <input type="hidden" name="anzeigen" value="1" />
 <input type="hidden" name="uid" value="{$uid}" />
 <input type="hidden" name="lan" value="{$lan}" />
  <fieldset>
  <legend>Schreib 'mal wieder</legend>
   <p><label for="sender">Name (Pfichtfeld)</label><br />
   <input type="text" id="sender" name="sender" value="{$sender}" /></p>
   <p><label for="e_mail">eMail-Adresse</label><br />
   <input type="text" id="e_mail" name="e_mail" value="{$e_mail}" /></p>
   <p><label for="homepage">Homepage</label><br />
   <input type="text" id="homepage" name="homepage" value="{$homepage}" /> (ohne http://)</p>
   <p><label for="message">Message</label><br />
   {$message}</p>
						
   {if $captcha}
   <p><label for="captcha">Bitte gib die Zeichen aus dem Bild unten ein</label> <input type="text" name="captcha_phrase" /><br />
   {$captcha}
   </p>
   {/if}
						
   <p>{$submit}</p>
 </fieldset>     
 {$formend}
</div>
As you can see, I got rid of the table-layout and I kicked out the input-fields for country and location. That's all. Typing my statements, pushing the send-button and I get the successnote. Going back to the entries - yaeh, that's the problem, there are no entries at all. Looking at the database - the same game.  :( Any ideas, why this doesn't work?

Thanks in advance

Re: Can't make any guestbook entries

Posted: Thu Sep 14, 2006 12:01 pm
by cyberman
Hmm, have you tried to use the out kicked fields as hidden fields with a dummy value?

Re: Can't make any guestbook entries

Posted: Thu Sep 14, 2006 3:32 pm
by Grega
Okay, now I used

Code: Select all

<input type="hidden" name="country" value="foo" />
<input type="hidden" name="location" value="bar" />
It works. But what I don't understand: Using the "good ol' gastbuch", it was possible to use an insertform like I posted before. That means an insertform without one or two fields. Back then, the script wrote into the database - but now? Using extra-fields, even if they're hidden, that is extra-markup, that I would rather not use. Don't get me wrong: It works! Jeah!  ;D But it would be nicer, if the extra-markup would't have to be used.

Thanks for the tip though.  ;)

Re: Can't make any guestbook entries

Posted: Fri Sep 15, 2006 5:45 am
by cyberman
If I'm right Guestbook was completely rewritten (it's not gastbuch).

And as I'm not a coder for real it's very diffcult for me to read the source cause it's splitted. But found a part in class.Guestbook.php

Code: Select all

$query = "
	    INSERT INTO " . cms_db_prefix() . 'module_guestbook' . " 
	    (entry_id, sender, e_mail, homepage, message, date, approved, country, location)
	    VALUES
	    (?, ?, ?, ?, ?, $timestamp, ?, ?, ?)
	";
	$values = array($new_id, $sender, $e_mail, $homepage, $message, $approved, $country, $location);
	$db->Execute($query, $values);
Perhaps module has a problem to insert something if one or two values are missed  ::). Don't know if this could be a bug ...