예제 #1
0
        }
    }
    $smarty->assign('comments', $comments);
}
$smarty->assign('cat_id', $HTTP_GET_VARS['cat_id']);
//there is no usefull title_name...
//$smarty->assign('title_name','');
if ($HTTP_GET_VARS['mode'] == "add") {
    $smarty->assign('parent_id', $HTTP_GET_VARS['parent_id']);
    $smarty->assign('title_page', $lang['add_comment']);
}
if ($HTTP_GET_VARS['mode'] == 'edit_comment') {
    if ($userdata['user_level'] == ADMIN) {
        $smarty->assign('users_data', get_users_data('user_id,username'));
    }
    if ($HTTP_GET_VARS['type'] == 'content') {
        $comment = new content_comment();
    } else {
        $comment = new cat_comment();
    }
    $comment->generate_from_id($id);
    $smarty->assign('text', $comment->get_feedback());
    $smarty->assign('user_id', $comment->get_user_id());
    $smarty->assign('poster_name', $comment->get_poster_name());
    $smarty->assign('topic', $comment->get_topic());
    $smarty->assign('title_page', $lang['edit_comment']);
    $smarty->assign('title_name', $comment->get_topic());
    // parent id is just as id here
    $smarty->assign('parent_id', $id);
}
$smarty->display($userdata['photo_user_template'] . '/comment.tpl');