function addItem_postInsertion() { /* controllare reload */ $mail = new Template("dtml/user.mail"); $mail->setContent("name", $_REQUEST['name']); $mail->setContent("username", $_REQUEST['username']); $mail->setContent("password", $_REQUEST['password']); $mail->setContent("message", $_REQUEST['message']); mail("{$_REQUEST['email']}", "{$GLOBALS['config']['website']['name']} Login data", $mail->get(), "From: {{$GLOBALS['config']['website']['email']}}"); } } /* LOCAL END */ #if (isset($_SESSION['registered-user'])) { # $main = new Template("dtml_{$_SESSION['language']}/frame-public-2.html"); #} else { # $main = new Template("dtml/frame-private.html"); #} $main = new Skin(); $form = new Form("dataEntry", $usersEntity); $form->addSection("Modifica Password"); #$form1->addText("username", "username", 20, MANDATORY); #$form1->addSection("personal data"); $form->addPassword("password", aux::lingual("Nuova Password", "New Password", "Nuova Password")); if (!isset($_REQUEST['page'])) { $_REQUEST['page'] = 1; $_REQUEST['value'] = $_SESSION['user']['username']; } $main->setContent("body", $form->editItem(NO_DELETE)); $main->close(); ?>
function getComments($id) { $comments = new Template("dtml/comments.html"); $data = aux::getResult("\n\t\t\tSELECT * \n\t\t FROM comments\n\t\t LEFT JOIN users\n\t\t ON users.username = comments.username\n\t\t WHERE entityname = '{$this->entity->name}'\n\t\t AND itemid = '{$id}'\n\t\t AND comments.active = '*'\n\t\t AND users.active = '*'\n\t\t ORDER BY creation DESC"); if (count($data) > 0) { foreach ($data as $item) { foreach ($item as $k => $v) { switch ($k) { case "creation": $comments->setContent($k, aux::formatDate($v, EXTENDED)); break; default: $comments->setContent($k, $v); break; } } } } else { $comments->setContent("username", ""); $comments->setContent("creation", ""); $comments->setContent("body", aux::lingual("Non ci sono commenti", "No comments", "Nemo para commentares")); } return $comments->get(); }