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!