page_title='hardlyFamous.com :: Submit a New Entry';
//$gbl->meta_key='';
//$gbl->meta_desc='';
$gbl->getHeader();
//some intitializing
$error='';
$done='';
$_POST['actor'] = isset($_POST['actor']) ? $_POST['actor'] : '';
$_POST['cool'] = isset($_POST['cool']) ? $_POST['cool'] : '';
$_POST['category'] = isset($_POST['category']) ? $_POST['category'] : '';
$_POST['source'] = isset($_POST['source']) ? $_POST['source'] : '';
$_POST['description'] = isset($_POST['description']) ? $_POST['description'] : '';
$_POST['submitted_by'] = isset($_POST['submitted_by']) ? $_POST['submitted_by'] : '';
?>
';
}
if (!$_POST['description']) {
$error .= '- Please enter a short description.
';
}
if (!$_POST['category']) {
$error .= '- Please choose which category this person belongs.
';
}
if (!$_POST['source']) {
$error .= '- Please tell where you found this info.
';
}
if (strlen($_POST['description']) > 800 ) {
$error .= '- Sorry, your description is tooooooo long.
';
}
if ($_POST['description'] && strlen($_POST['description']) < 25 ) {
$error .= '- Sorry, your description is tooooooo short.
';
}
if ( preg_match("/http/i",$_POST['description']) ||
preg_match("/http/i",$_POST['actor'])) {
$error .= '- Please include the URL in the source.
';
}
if (preg_match("/^unknown$/i",$_POST['submitted_by'])) {
$error .= '- Please tell us your name or nickname.
';
}
//clean up POST data
foreach ($_POST as $k => $v) {
$_POST[$k] = trim(preg_replace("/\s+/", " ", $v));
}
// if no errors, generate remaining fields, and insert row
if ( !$error ) {
//add period to end of description if not already there
// reminder: if strcmp matches it returns 0
if ( strcmp(substr($_POST['description'],-1,1),'.') and
strcmp(substr($_POST['description'],-1,1),'"') ) {
$_POST['description'] .= '.';
}
$_POST['description'] = ucfirst($_POST[description]);
//sentence case these fields too
$_POST['actor'] = ucwords($_POST['actor']);
// split actor name into first/last
list( $_POST['actor_first'], $_POST['actor_last'] )
= $gbl->makeFirstLast($_POST['actor']);
// determine actor_sort_by & actor_file_under
list( $_POST['actor_sort_by'], $_POST['actor_file_under'] )
= $gbl->makeActorValues($_POST['actor_first'],$_POST['actor_last']);
$status = 'new';
if (strtolower($_POST['submitted_by']) == 's-k-c' ||
(strtolower($_POST['submitted_by']) == 'mc' and $_SERVER['REMOTE_ADDR'] == $gbl->my_ip)) {
$status = 'live';
}
//set defaults, unless overridden by posting a duplicate from edit.html
//bind to my IP so that override only works from my machine
//in fact, let's even only show the hidden fields if my IP
/*
if ($_SERVER['REMOTE_ADDR'] == $gbl->my_ip) {
if (!$_POST['date_entered']) {
$_POST['date_entered'] = $gbl->INtime();
}
if (!$_POST['uagent']) {
$_POST['uagent'] = $_SERVER['HTTP_USER_AGENT'];
}
if (!$_POST['ip']) {
$_POST['ip'] = $_SERVER['REMOTE_ADDR'];
}
}
*/
$_POST['date_entered'] = $gbl->INtime();
$_POST['uagent'] = $_SERVER['HTTP_USER_AGENT'];
$_POST['ip'] = $_SERVER['REMOTE_ADDR'];
//magic_quotes is off via .htaccess, so escape data before inserting
$_POST = array_map($db->real_escape_string, $_POST);
$query = "INSERT INTO entries (
date_entered,
actor_first,
actor_last,
description,
category,
source,
actor_file_under,
actor_sort_by,
status,
submitted_by,
uagent,
ip,
cool
) VALUES (
'$_POST[date_entered]',
'$_POST[actor_first]',
'$_POST[actor_last]',
'$_POST[description]',
'$_POST[category]',
'$_POST[source]',
'$_POST[actor_file_under]',
'$_POST[actor_sort_by]',
'$status',
'$_POST[submitted_by]',
'$_POST[uagent]',
'$_POST[ip]',
'$_POST[cool]'
)";
$db->query($query);
//set mode for thankyou page if not me
//if me, leave fields there for me to re-submit next entry
if (strtolower($_POST['submitted_by']) == 'mc' and
$_SERVER['REMOTE_ADDR'] == $gbl->my_ip) {
$done = 0;
} else {
$done = 1;
}
}
}
?>
Click here to submit another entry
Note: All entries are reviewed before appearing on the site. This process
can sometimes take up to a few days. We reserve the right to edit or remove
any entry for any reason.