root/dev/common/comments.php @ 296

Revision 213, 0.9 KB (checked in by ralle030583, 15 years ago)

All files (i hope i havent forgott something) was modified to use the the config in this way:
- config::get($key)
- config::del($key)
- config::set($key,value)

Exception Templates/Smarty?:
The templates still uses $config->get($key) and $config->set($key,$value) cause
it seems that smarty dont like the :: notification

Line 
1<?php
2require_once('common/includes/class.comments.php');
3
4$comments = new Comments($kll_id);
5if (isset($_POST['comment']))
6{
7    $pw = false;
8    if (!config::get('comments_pw') || $page->isAdmin())
9    {
10        $pw = true;
11    }
12    if ($_POST['password'] == config::get("post_password") || $pw)
13    {
14        if ($_POST['comment'] == '')
15        {
16            $html .= 'Error: Silent type hey? good for you, bad for a comment.';
17        }
18        else
19        {
20            $comment = $_POST['comment'];
21            $name = $_POST['name'];
22            if ($name == null)
23            {
24                $name = 'Anonymous';
25            }
26            $comments->addComment($name, $comment);
27        }
28    }
29    else
30    {
31        // Password is wrong
32        $html .= 'Error: Wrong Password';
33    }
34}
35
36$smarty->assign_by_ref('page', $page);
37
38$comment = $comments->getComments();
39?>
Note: See TracBrowser for help on using the browser.