winpeace
11-14-2006, 10:29 AM
function saveComment($database, $tmpl) {
global $my, $mosConfig_offset, $maxLanguage, $mosConfig_live_site, $mainframe;
$maxConfig = new maxConfig();
$row = new mosComment($database);
$_contentid = mosGetParam($_POST,'contentid','');
$row->bind($_POST);
$comment =$row->comment;
$comment = addslashes($comment);
$row->comment = $comment;
$row->myid = $my->id;
$row->state = $maxConfig->auto_publish;
$row->approved = $maxConfig->auto_approve;
$row->ip = mosGetParam($_SERVER,'REMOTE_ADDR','');
$row->browser = mosGetParam($_SERVER,'HTTP_USER_AGENT','');
$zone=3600*3;
$d = gmdate( "D M Y H:i", time() + $zone);
$row->date = gmdate( "D M Y H:i", time() + $zone);
$row->store();
$tmpl->addVar("emailcomment", 'date', $d);
$subject = $maxLanguage->EMAIL_SUBJECT_ADMIN_ALERT;
$tmpl = new patTemplate();
$tmpl->setBasedir("components/com_combomax/templates/");
$tmpl->setNameSpace('pxt');
$tmpl->readTemplatesFromFile("showcomment.tpl");
$tmpl->addVar("emailcomment", "NAME", stripslashes(stripslashes($row->name)));
$tmpl->addVar("emailcomment", 'email', stripslashes($row->email));
$tmpl->addVar("emailcomment", 'url', stripslashes($row->url));
$tmpl->addVar("emailcomment", 'comment', smile::smileReplace(stripslashes(stripslashes($row->comment))));
$tmpl->addVar("emailcomment", 'ip', stripslashes($row->ip));
$tmpl->addVar("emailcomment", 'browser', stripslashes($row->browser));
$tmpl->addVar("emailcomment", 'date', stripslashes($row->date));
$tmpl->addVar("emailcomment", 'reporturl', 'index.php?option=com_combomax&page=reportComment&commentid='.$row->id.'');
$tmpl->addVar("emailcomment", 'livesite', $mosConfig_live_site);
$tmpl->addVar("emailcomment", 'template', $mainframe->getTemplate());
$tmpl->addVar("emailcomment", 'contenttitle', getContentTitle($row->contentid));
$tmpl->addVar("emailcomment", 'linktocontent', $mosConfig_live_site.'/index.php?option=com_content&task=view&Itemid=1&id='.$row->contentid);
$tmpl->parseTemplate("emailcomment");
$message = $tmpl->getParsedTemplate("emailcomment");
the date seems 0000-00-00 00:00:00
global $my, $mosConfig_offset, $maxLanguage, $mosConfig_live_site, $mainframe;
$maxConfig = new maxConfig();
$row = new mosComment($database);
$_contentid = mosGetParam($_POST,'contentid','');
$row->bind($_POST);
$comment =$row->comment;
$comment = addslashes($comment);
$row->comment = $comment;
$row->myid = $my->id;
$row->state = $maxConfig->auto_publish;
$row->approved = $maxConfig->auto_approve;
$row->ip = mosGetParam($_SERVER,'REMOTE_ADDR','');
$row->browser = mosGetParam($_SERVER,'HTTP_USER_AGENT','');
$zone=3600*3;
$d = gmdate( "D M Y H:i", time() + $zone);
$row->date = gmdate( "D M Y H:i", time() + $zone);
$row->store();
$tmpl->addVar("emailcomment", 'date', $d);
$subject = $maxLanguage->EMAIL_SUBJECT_ADMIN_ALERT;
$tmpl = new patTemplate();
$tmpl->setBasedir("components/com_combomax/templates/");
$tmpl->setNameSpace('pxt');
$tmpl->readTemplatesFromFile("showcomment.tpl");
$tmpl->addVar("emailcomment", "NAME", stripslashes(stripslashes($row->name)));
$tmpl->addVar("emailcomment", 'email', stripslashes($row->email));
$tmpl->addVar("emailcomment", 'url', stripslashes($row->url));
$tmpl->addVar("emailcomment", 'comment', smile::smileReplace(stripslashes(stripslashes($row->comment))));
$tmpl->addVar("emailcomment", 'ip', stripslashes($row->ip));
$tmpl->addVar("emailcomment", 'browser', stripslashes($row->browser));
$tmpl->addVar("emailcomment", 'date', stripslashes($row->date));
$tmpl->addVar("emailcomment", 'reporturl', 'index.php?option=com_combomax&page=reportComment&commentid='.$row->id.'');
$tmpl->addVar("emailcomment", 'livesite', $mosConfig_live_site);
$tmpl->addVar("emailcomment", 'template', $mainframe->getTemplate());
$tmpl->addVar("emailcomment", 'contenttitle', getContentTitle($row->contentid));
$tmpl->addVar("emailcomment", 'linktocontent', $mosConfig_live_site.'/index.php?option=com_content&task=view&Itemid=1&id='.$row->contentid);
$tmpl->parseTemplate("emailcomment");
$message = $tmpl->getParsedTemplate("emailcomment");
the date seems 0000-00-00 00:00:00