How Can I Place Comment Form at the bottom of the page?

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
DrubusCulubus
Posts: 47
Joined: Sat 10. Apr 2004, 12:53
Location: NL

How Can I Place Comment Form at the bottom of the page?

Post by DrubusCulubus »

Hi Guys and Galls,

I'm busy with some try outs of a website to be and my question is how can I get the 'entry form' of the guestbook/comments below the already entered comments....?

I've tried several things in all kinds of files but nothing sems to work properly... The reason is that I do not want visitors to start entering their opinion without even reading the already entered comments.

I know, pushing my luck with the following.... ;) :
Isn't it possible that only registrered folks can enter a comment?

Cheers!
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

sorry: you can only do this by hacking your scripts.

But... who really wants to dig through 900 million post just to say the same thing in a new order?

I have guest book on my personal site but quickly realised that they are for the benefit of the owner and not of much interest to the other users, who will probably only read the top five posts anyway.

having never considered the order the form and remarks go before now I can say that I am much happier this way around :)

(sorry in advance for any offence to anyone: it seams I do agitate some higher intelects than my own on these occasions.)
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Re: How Can I Place Comment Form at the bottom of the page?

Post by frold »

DrubusCulubus wrote:Hi Guys and Galls,

I'm busy with some try outs of a website to be and my question is how can I get the 'entry form' of the guestbook/comments below the already entered comments....?
First add your article and then add the content part "guestbook/comments"
Isn't it possible that only registrered folks can enter a comment?

Cheers!
No, you can´t
http://www.studmed.dk Portal for doctors and medical students in Denmark
DrubusCulubus
Posts: 47
Joined: Sat 10. Apr 2004, 12:53
Location: NL

Post by DrubusCulubus »

Hi Guys and Galls,

I found the solution to get the listing infront of the entry form!

Open /inc_front/content/cnt18.article.inc.php

Move the following, start around line 30 code to the bottom around line 130:
$guestbook['readform'] = 0;

if(isset($_POST['guestbook_email'])) {

$guestbook['post']['email'] = clean_slweg($_POST['guestbook_email']);
$guestbook['post']['name'] = clean_slweg($_POST['guestbook_name']);
$guestbook['post']['url'] = clean_slweg($_POST['guestbook_url']);
$guestbook['post']['msg'] = clean_slweg($_POST['guestbook_msg']);

// check URL and try to connect - if fails set to ''
if($guestbook['post']['url']) {
if(!strstr($guestbook['post']['url'], "http://")) {
$guestbook['post']['url'] = 'http://'.$guestbook['post']['url'];
}
if ($guestbook['fp'] = @fopen($guestbook['post']['url'],"r")) {
fclose($guestbook['fp']);
} else {
$guestbook['post']['url'] = '';
}
}

if(is_valid_email($guestbook['post']['email']) && $guestbook['post']['name']) {

$guestbook['sql'] = "INSERT INTO ".DB_PREPEND."phpwcms_guestbook SET ";
$guestbook['sql'] .= "guestbook_cid='".intval($crow["acontent_id"])."', ";
$guestbook['sql'] .= "guestbook_msg='".aporeplace($guestbook['post']['msg'])."', ";
$guestbook['sql'] .= "guestbook_name='".aporeplace($guestbook['post']['name'])."', ";
$guestbook['sql'] .= "guestbook_email='".aporeplace($guestbook['post']['email'])."', ";
$guestbook['sql'] .= "guestbook_created='".time()."', ";
$guestbook['sql'] .= "guestbook_url='".aporeplace($guestbook['post']['url'])."';";
mysql_query($guestbook['sql'], $db);
if(mysql_insert_id()) {
$guestbook['readform'] = 1;
} else {
$guestbook['readform'] = 0;
$content["main"] .= '<div style="color:#FF3300;">A technical problem occured while you ';
$content["main"] .= 'have tried to sign the guestbook</div>';
}
}
}

if(!$guestbook['readform']) {

if(!isset($_POST['guestbook_email'])) {
// remove post form error part
$guestbook['form'] = preg_replace("/<!--FORM_ERROR_START-->(.*?)<!--FORM_ERROR_END-->/si", '', $guestbook['form']);
}
$guestbook['form'] = str_replace('###EMAIL###', html_specialchars($guestbook['post']['email']), $guestbook['form']);
$guestbook['form'] = str_replace('###NAME###', html_specialchars($guestbook['post']['name']), $guestbook['form']);
$guestbook['form'] = str_replace('###URL###', html_specialchars($guestbook['post']['url']), $guestbook['form']);
$guestbook['form'] = str_replace('###MSG###', html_specialchars($guestbook['post']['msg']), $guestbook['form']);
// build sign guestbook form
$content["main"] .= '<form name="sign_guestbook" method="post" style="margin:0;padding:0;">'.$guestbook['form'].'</form>';

} else {
// if successfully signed show signed info
$guestbook['signed'] = str_replace('###EMAIL###', html_specialchars($guestbook['post']['email']), $guestbook['signed']);
$guestbook['signed'] = str_replace('###NAME###', html_specialchars($guestbook['post']['name']), $guestbook['signed']);
$guestbook['signed'] = str_replace('###URL###', html_specialchars($guestbook['post']['url']), $guestbook['signed']);
$guestbook['signed'] = str_replace('###MSG###', html_specialchars($guestbook['post']['msg']), $guestbook['signed']);
$content["main"] .= $guestbook['signed'];

}
Cheers!
Post Reply