예제 #1
0
파일: albums.php 프로젝트: MenZil/pluck
function albums_admin_module_settings_afterpost()
{
    global $lang;
    //Check if posted settings are numeric.
    if (!is_numeric($_POST['image_width']) || !is_numeric($_POST['thumb_width'])) {
        return show_error($lang['albums']['settings_error'], 1, true);
    } else {
        //Compose settings array
        $settings = array('resize_image_width' => $_POST['image_width'], 'resize_thumb_width' => $_POST['thumb_width']);
        //Save settings
        module_save_settings('albums', $settings);
    }
}
예제 #2
0
파일: blog.php 프로젝트: MenZil/pluck
function blog_admin_module_settings_afterpost()
{
    global $lang;
    //truncate_posts should be numeric.
    if (!is_numeric($_POST['truncate_posts']) || !is_numeric($_POST['posts_per_page'])) {
        return show_error($lang['blog']['numeric_error'], 1, true);
    }
    if (empty($_POST['posts_per_page'])) {
        return show_error($lang['blog']['posts_per_page_error'], 1, true);
    } else {
        //Compose settings array
        $settings = array('allow_reactions' => isset($_POST['allow_reactions']) ? 'true' : 'false', 'truncate_posts' => $_POST['truncate_posts'], 'posts_per_page' => $_POST['posts_per_page'], 'post_date' => $_POST['post_date'], 'post_time' => $_POST['post_time']);
        //Save settings
        module_save_settings('blog', $settings);
    }
}