<?php
// Meta Options (WPShout.com)

require(ghostpool_inc . 'options.php');

add_action('admin_menu', 'ghostpool_create_meta_box');
add_action('save_post', 'ghostpool_save_meta_data');

function ghostpool_create_meta_box() {
    //add_meta_box('post-meta-boxes', __('Post Settings', 'gp_lang'), 'post_meta_boxes', 'post', 'normal', 'high');
    add_meta_box('page-meta-boxes', __('Page Settings', 'gp_lang'), 'page_meta_boxes', 'page', 'normal', 'high');
    add_meta_box('slide-meta-boxes', __('Slide Settings', 'gp_lang'), 'slide_meta_boxes', 'slide', 'normal', 'high');
    add_meta_box('dedication-meta-boxes', __('Dedication Settings', 'gp_lang'), 'dedication_meta_boxes', 'post', 'normal', 'high');
}

/* * ************************* Dedication Settings ************************** */

function ghostpool_dedication_meta_boxes() {

    $meta_boxes = array(
        'users_settings' => array(
            'name' => 'users_settings', 
            'type' => 'open', 
            'desc' => __('', 'gp_lang'), 
            'title' => __('Users Settings', 'gp_lang')),
        
        'ghostpool_destination_user_email' => array(
            'name' => 'ghostpool_destination_user_email', 
            'title' => __('Destination user email', 'gp_lang'), 
            'desc' => __('', 'gp_lang'), 
            'std' => '', 
            'type' => 'text', 
            'size' => 'large'),

        'ghostpool_destination_user_name' => array(
            'name' => 'ghostpool_destination_user_name', 
            'title' => __('Destination user nick/name', 'gp_lang'), 
            'desc' => __('', 'gp_lang'), 
            'std' => '', 
            'type' => 'text', 
            'size' => 'large'),
                
        'ghostpool_destination_user_id' => array(
            'name' => 'ghostpool_destination_user_id', 
            'title' => __('Destination user', 'gp_lang'), 
            'desc' => __('', 'gp_lang'), 
            'std' => '', 
            'type' => 'text', 
            'size' => 'large'),
        
        array('type' => 'separator'),
        array('type' => 'close'),

        'video_settings' => array(
            'name' => 'video_settings',
            'type' => 'open',
            'desc' => __('', 'gp_lang'),
            'title' => __('Video Settings', 'gp_lang')),
        'ghostpool_dedication_url' => array(
            'name' => 'ghostpool_dedication_url',
            'title' => __('Video URL', 'gp_lang'),
            'desc' => __('Enter the video URL (YouTube / Vimeo).', 'gp_lang'),
            'type' => 'upload_video', 'std' => '', 
            'size' => 'large', 'details' => 'px'),
        'ghostpool_dedication_artist' => array(
            'name' => 'ghostpool_dedication_artist', 
            'title' => __('Artist name', 'gp_lang'), 
            'desc' => __('Enter the artist name.', 'gp_lang'), 
            'std' => '', 'type' => 'text'),
        'ghostpool_dedication_song' => array(
            'name' => 'ghostpool_dedication_song', 
            'title' => __('Song name', 'gp_lang'), 
            'desc' => __('Enter the song name.', 'gp_lang'), 
            'std' => '', 'type' => 'text'),

        array('type' => 'close'),
        array('type' => 'clear'),
    );

    return apply_filters('ghostpool_dedication_meta_boxes', $meta_boxes);
}

/* * ************************* Post Settings ************************** */

function ghostpool_post_meta_boxes2() {

    $meta_boxes = array(
        'post_type_settings' => array('name' => 'post_type_settings', 'title' => __('Post Type Settings', 'gp_lang'), 'desc' => '', 'type' => 'open'),
        'ghostpool_post_type' => array('name' => 'ghostpool_post_type', 'title' => __('Post Type', 'gp_lang'), 'desc' => __('Choose the post type.', 'gp_lang'), 'type' => 'select', 'std' => '', 'options' => array('Article' => __('Article', 'gp_lang'), 'Review' => __('Review', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'Video' => __('Video', 'gp_lang'))),
        array('type' => 'separator'),
        array('type' => 'close'),
        'thumbnail_settings' => array('name' => 'thumbnail_settings', 'type' => 'open', 'desc' => __('', 'gp_lang'), 'title' => __('Thumbnail Settings', 'gp_lang')),
        'ghostpool_thumbnail_width' => array('name' => 'ghostpool_thumbnail_width', 'title' => __('Thumbnail Width', 'gp_lang'), 'desc' => __('The width to crop the thumbnail to (set to 0 to have a proportionate width).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_thumbnail_height' => array('name' => 'ghostpool_thumbnail_height', 'title' => __('Thumbnail Height', 'gp_lang'), 'desc' => __('The height to crop the thumbnail to (set to 0 to have a proportionate height).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        array('type' => 'separator'),
        array('type' => 'close'),
        'image_settings' => array('name' => 'image_settings', 'type' => 'open', 'desc' => '', 'title' => __('Image Settings', 'gp_lang')),
        'ghostpool_show_image' => array('name' => 'ghostpool_show_image', 'title' => __('Featured Image', 'gp_lang'), 'desc' => __('Choose whether to display the featured image.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Show' => __('Show', 'gp_lang'), 'Hide' => __('Hide', 'gp_lang')), 'type' => 'select'),
        'ghostpool_image_width' => array('name' => 'ghostpool_image_width', 'title' => __('Image Width', 'gp_lang'), 'desc' => __('The width to crop the image to (set to 0 to have a proportionate width).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_image_height' => array('name' => 'ghostpool_image_height', 'title' => __('Image Height', 'gp_lang'), 'desc' => __('The height to crop the image to (set to 0 to have a proportionate height).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_image_wrap' => array('name' => 'ghostpool_image_wrap', 'title' => __('Image Wrap', 'gp_lang'), 'desc' => __('Choose whether the page content wraps around the featured image.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Enable' => __('Enable', 'gp_lang'), 'Disable' => __('Disable', 'gp_lang')), 'type' => 'select'),
        array('type' => 'divider'),
        'ghostpool_lightbox_content' => array('name' => 'ghostpool_lightbox_content', 'title' => __('Lightbox Content', 'gp_lang'), 'desc' => __('Upload images/audio/videos that will be opened in the lightbox, giving them an order value of "1".', 'gp_lang'), 'type' => 'gallery'),
        array('type' => 'separator'),
        array('type' => 'close'),
        'review_settings' => array('name' => 'review_settings', 'title' => __('Review Settings', 'gp_lang'), 'desc' => '', 'type' => 'open', 'style' => 'hidden'),
        'ghostpool_user_voting' => array('name' => 'ghostpool_user_voting', 'title' => __('User Voting', 'gp_lang'), 'desc' => __('Choose how users can vote.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Vote with or without posting a comment' => __('Vote with or without posting a comment', 'gp_lang'), 'Vote without posting a comment' => __('Vote without posting a comment', 'gp_lang'), 'Vote only when posting a comment' => __('Vote only when posting a comment', 'gp_lang'), 'Users cannot vote' => __('Users cannot vote', 'gp_lang')), 'type' => 'select'),
        'ghostpool_user_comments' => array('name' => 'ghostpool_user_comments', 'title' => __('User Comments', 'gp_lang'), 'desc' => __('Choose whether users can post unlimited comments (only works with registered users).', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Unlimited Comments' => __('Unlimited Comments', 'gp_lang'), 'One Comment' => __('One Comment', 'gp_lang')), 'type' => 'select'),
        'ghostpool_comment_thumbs' => array('name' => 'ghostpool_comment_thumbs', 'title' => __('Comment Thumbs', 'gp_lang'), 'desc' => __('Choose whether users can rate other comments.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Users can rate other comments' => __('Users can rate other comments', 'gp_lang'), 'Users cannot rate other comments' => __('Users cannot rate other comments', 'gp_lang')), 'type' => 'select'),
        'ghostpool_review_details' => array('name' => 'ghostpool_review_details', 'title' => __('Review Details', 'gp_lang'), 'desc' => __('Add review details for this review e.g. release date, genre etc., adding each detail on a new line.', 'gp_lang'), 'type' => 'textarea'),
        array('type' => 'divider'),
        'ghostpool_good_point' => array('name' => 'ghostpool_good_point', 'title' => __('Good Point', 'gp_lang'), 'desc' => __('A good point of the item being reviewed.', 'gp_lang'), 'std' => '', 'type' => 'text'),
        'ghostpool_bad_point' => array('name' => 'ghostpool_bad_point', 'title' => __('Bad Point', 'gp_lang'), 'desc' => __('A bad point of the item being reviewed.', 'gp_lang'), 'std' => '', 'type' => 'text'),
        array('type' => 'divider'),
        'ghostpool_link_title' => array('name' => 'ghostpool_link_title', 'title' => __('Tab/Link Title', 'gp_lang'), 'desc' => '', 'type' => 'link_title'),
        'ghostpool_link_url' => array('name' => 'ghostpool_link_url', 'title' => __('Tag/Page Slug or Page URL', 'gp_lang'), 'desc' => '', 'type' => 'link_title', 'link_url' => true), 'ghostpool_link_type' => array('name' => 'ghostpool_link_type', 'title' => __('Tab Type', 'gp_lang'), 'desc' => '', 'type' => 'link_title', 'link_type_title' => "hide"),
        array('type' => 'clear'),
        'ghostpool_link_title_0' => array('name' => 'ghostpool_link_title_0', 'desc' => '', 'std' => __('Review', 'gp_lang'), 'type' => 'link_text', 'link_number' => '1'),
        array('type' => 'clear'),
        'ghostpool_link_title_1' => array('name' => 'ghostpool_link_title_1', 'desc' => '', 'type' => 'link_text', 'link_number' => '2'),
        'ghostpool_link_url_1' => array('name' => 'ghostpool_link_url_1', 'type' => 'link_text'), 'ghostpool_link_type_1' => array('name' => 'ghostpool_link_type_1', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_2' => array('name' => 'ghostpool_link_title_2', 'type' => 'link_text', 'link_number' => '3'),
        'ghostpool_link_url_2' => array('name' => 'ghostpool_link_url_2', 'type' => 'link_text'), 'ghostpool_link_type_2' => array('name' => 'ghostpool_link_type_2', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_3' => array('name' => 'ghostpool_link_title_3', 'type' => 'link_text', 'link_number' => '4'),
        'ghostpool_link_url_3' => array('name' => 'ghostpool_link_url_3', 'type' => 'link_text'), 'ghostpool_link_type_3' => array('name' => 'ghostpool_link_type_3', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_4' => array('name' => 'ghostpool_link_title_4', 'type' => 'link_text', 'link_number' => '5'),
        'ghostpool_link_url_4' => array('name' => 'ghostpool_link_url_4', 'type' => 'link_text'), 'ghostpool_link_type_4' => array('name' => 'ghostpool_link_type_4', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_5' => array('name' => 'ghostpool_link_title_5', 'type' => 'link_text', 'link_number' => '6'),
        'ghostpool_link_url_5' => array('name' => 'ghostpool_link_url_5', 'type' => 'link_text'), 'ghostpool_link_type_5' => array('name' => 'ghostpool_link_type_5', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_6' => array('name' => 'ghostpool_link_title_6', 'type' => 'link_text', 'link_number' => '7'),
        'ghostpool_link_url_6' => array('name' => 'ghostpool_link_url_6', 'type' => 'link_text'), 'ghostpool_link_type_6' => array('name' => 'ghostpool_link_type_6', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_7' => array('name' => 'ghostpool_link_title_7', 'type' => 'link_text', 'link_number' => '8'),
        'ghostpool_link_url_7' => array('name' => 'ghostpool_link_url_7', 'type' => 'link_text'), 'ghostpool_link_type_7' => array('name' => 'ghostpool_link_type_7', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_8' => array('name' => 'ghostpool_link_title_8', 'type' => 'link_text', 'link_number' => '9'),
        'ghostpool_link_url_8' => array('name' => 'ghostpool_link_url_8', 'type' => 'link_text'), 'ghostpool_link_type_8' => array('name' => 'ghostpool_link_type_8', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_9' => array('name' => 'ghostpool_link_title_9', 'type' => 'link_text', 'link_number' => '10'),
        'ghostpool_link_url_9' => array('name' => 'ghostpool_link_url_9', 'type' => 'link_text'), 'ghostpool_link_type_9' => array('name' => 'ghostpool_link_type_9', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'clear'),
        'ghostpool_link_title_10' => array('name' => 'ghostpool_link_title_10', 'type' => 'link_text', 'link_number' => '11'),
        'ghostpool_link_url_10' => array('name' => 'ghostpool_link_url_10', 'type' => 'link_text'), 'ghostpool_link_type_10' => array('name' => 'ghostpool_link_type_10', 'type' => 'link_select', 'options' => array('List Of Articles' => __('List Of Articles', 'gp_lang'), 'Image Gallery' => __('Image Gallery', 'gp_lang'), 'List Of Videos' => __('List Of Videos', 'gp_lang'), 'Single Post/Page' => __('Single Post/Page', 'gp_lang'))),
        array('type' => 'separator'),
        array('type' => 'close'),
        'image_gallery_settings' => array('name' => 'image_gallery_settings', 'type' => 'open', 'desc' => __('', 'gp_lang'), 'title' => __('Image Gallery Settings', 'gp_lang'), 'style' => 'hidden'),
        'ghostpool_gallery' => array('name' => 'ghostpool_gallery', 'title' => __('', 'gp_lang'), 'desc' => __('Upload your images by clicking the "Add Media" button above.', 'gp_lang'), 'std' => '', 'type' => 'gallery', 'size' => 'large'),
        array('type' => 'separator'),
        array('type' => 'close'),
        'video_settings' => array('name' => 'video_settings', 'type' => 'open', 'desc' => __('', 'gp_lang'), 'title' => __('Video Settings', 'gp_lang'), 'style' => 'hidden'),
        'ghostpool_video' => array('name' => 'ghostpool_video', 'title' => __('Video URL', 'gp_lang'), 'desc' => __('The URL of the video or audio file (YouTube/Vimeo/FLV/MP4/M4V/MP3).', 'gp_lang'), 'std' => '', 'type' => 'upload_video'),
        'ghostpool_webm_mp4_video' => array('name' => 'ghostpool_webm_mp4_video', 'title' => __('HTML5 Video URL (Safari/Chrome)', 'gp_lang'), 'desc' => __('Enter the HTML5 video URL for Safari/Chrome (YouTube/Vimeo/WEBM/MP4).', 'gp_lang'), 'std' => '', 'type' => 'upload_video'),
        'ghostpool_ogg_video' => array('name' => 'ghostpool_ogg_video', 'title' => __('HTML5 Video URL (FireFox/Opera)', 'gp_lang'), 'desc' => __('Enter the HTML5 video URL for FireFox/Opera (YouTube/Vimeo/OGG/OGV).', 'gp_lang'), 'std' => '', 'type' => 'upload_video'),
        'ghostpool_video_priority' => array('name' => 'ghostpool_video_priority', 'title' => __('Video Priority', 'gp_lang'), 'desc' => __('If you have provided both flash and HTML5 videos, select which one will take priority if the browser can play both.', 'gp_lang'), 'options' => array('Flash' => __('Flash', 'gp_lang'), 'HTML5' => __('HTML5', 'gp_lang')), 'type' => 'select', 'std' => ''),
        array('type' => 'divider'),
        'ghostpool_video_width' => array('name' => 'ghostpool_video_width', 'title' => __('Video Width', 'gp_lang'), 'desc' => __('The width of the video.', 'gp_lang'), 'std' => '590', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_video_height' => array('name' => 'ghostpool_video_height', 'title' => __('Video Height', 'gp_lang'), 'desc' => __('The height of the video.', 'gp_lang'), 'std' => '315', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_autostart_video' => array('name' => 'ghostpool_autostart_video', 'title' => __('Autostart Video', 'gp_lang'), 'desc' => __('Plays the video/audio automatically when the page is loaded.', 'gp_lang'), 'type' => 'checkbox', 'std' => ''),
        'ghostpool_video_controls' => array('name' => 'ghostpool_video_controls', 'title' => __('Video Controls', 'gp_lang'), 'desc' => __('Choose how to display the video controls (does not apply to Vimeo videos).', 'gp_lang'), 'options' => array('Bottom' => __('Bottom', 'gp_lang'), 'Over' => __('Over', 'gp_lang'), 'None' => __('None', 'gp_lang')), 'type' => 'select', 'std' => 'Bottom'),
        array('type' => 'separator'),
        array('type' => 'close'),
        'format_settings' => array('name' => 'format_settings', 'type' => 'open', 'desc' => __('', 'gp_lang'), 'title' => __('Format Settings', 'gp_lang')),
        'ghostpool_sidebar' => array('name' => 'ghostpool_sidebar', 'title' => __('Sidebar', 'gp_lang'), 'desc' => __('Choose which sidebar to display.', 'gp_lang'), 'std' => 'default', 'type' => 'select_sidebar'),
        'ghostpool_layout' => array('name' => 'ghostpool_layout', 'title' => __('Layout', 'gp_lang'), 'desc' => __('Choose the page layout.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'sb-right' => __('Sidebar Right', 'gp_lang'), 'sb-left' => __('Sidebar Left', 'gp_lang'), 'fullwidth' => __('Fullwidth', 'gp_lang')), 'type' => 'select'),
        'ghostpool_title' => array('name' => 'ghostpool_title', 'title' => __('Title', 'gp_lang'), 'desc' => __('Choose whether to display the page title.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Show' => __('Show', 'gp_lang'), 'Hide' => __('Hide', 'gp_lang')), 'type' => 'select'),
        'ghostpool_skin' => array('name' => 'ghostpool_skin', 'title' => __('Skin', 'gp_lang'), 'desc' => __('Choose the page skin.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'blue' => __('Blue', 'gp_lang'), 'black' => __('Black', 'gp_lang')), 'type' => 'select', 'std' => ''),
        array('type' => 'divider'),
        'ghostpool_custom_stylesheet' => array('name' => 'ghostpool_custom_stylesheet', 'title' => __('Custom Stylesheet URL', 'gp_lang'), 'desc' => __('Enter the relative URL to your custom stylesheet e.g. <code>lib/css/custom-style.css</code>.', 'gp_lang'), 'std' => '', 'type' => 'text'),
        array('type' => 'close'),
        array('type' => 'clear'),
    );

    return apply_filters('ghostpool_post_meta_boxes2', $meta_boxes);
}

/* * ************************* Page Settings ************************** */

function ghostpool_page_meta_boxes() {

    $meta_boxes = array(
        'thumbnail_settings' => array('name' => 'thumbnail_settings', 'type' => 'open', 'desc' => __('', 'gp_lang'), 'title' => __('Thumbnail Settings', 'gp_lang')),
        'ghostpool_thumbnail_width' => array('name' => 'ghostpool_thumbnail_width', 'title' => __('Thumbnail Width', 'gp_lang'), 'desc' => __('The width to crop the thumbnail to (set to 0 to have a proportionate width).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_thumbnail_height' => array('name' => 'ghostpool_thumbnail_height', 'title' => __('Thumbnail Height', 'gp_lang'), 'desc' => __('The height to crop the thumbnail to (set to 0 to have a proportionate height).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        array('type' => 'separator'),
        array('type' => 'close'),
        'image_settings' => array('name' => 'image_settings', 'type' => 'open', 'desc' => '', 'title' => __('Image Settings', 'gp_lang')),
        'ghostpool_show_image' => array('name' => 'ghostpool_show_image', 'title' => __('Featured Image', 'gp_lang'), 'desc' => __('Choose whether to display the featured image.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Show' => __('Show', 'gp_lang'), 'Hide' => __('Hide', 'gp_lang')), 'type' => 'select'),
        'ghostpool_image_width' => array('name' => 'ghostpool_image_width', 'title' => __('Image Width', 'gp_lang'), 'desc' => __('The width to crop the image to (set to 0 to have a proportionate width).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_image_height' => array('name' => 'ghostpool_image_height', 'title' => __('Image Height', 'gp_lang'), 'desc' => __('The height to crop the image to (set to 0 to have a proportionate height).', 'gp_lang'), 'std' => '', 'type' => 'text', 'size' => 'small', 'details' => 'px'),
        'ghostpool_image_wrap' => array('name' => 'ghostpool_image_wrap', 'title' => __('Image Wrap', 'gp_lang'), 'desc' => __('Choose whether the page content wraps around the featured image.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Enable' => __('Enable', 'gp_lang'), 'Disable' => __('Disable', 'gp_lang')), 'type' => 'select'),
        array('type' => 'separator'),
        array('type' => 'close'),
        'format_settings' => array('name' => 'format_settings', 'type' => 'open', 'desc' => __('', 'gp_lang'), 'title' => __('Format Settings', 'gp_lang')),
        'ghostpool_sidebar' => array('name' => 'ghostpool_sidebar', 'title' => __('Sidebar', 'gp_lang'), 'desc' => __('Choose which sidebar to display.', 'gp_lang'), 'std' => 'default', 'type' => 'select_sidebar'),
        'ghostpool_layout' => array('name' => 'ghostpool_layout', 'title' => __('Layout', 'gp_lang'), 'desc' => __('Choose the page layout.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'sb-right' => __('Sidebar Right', 'gp_lang'), 'sb-left' => __('Sidebar Left', 'gp_lang'), 'fullwidth' => __('Fullwidth', 'gp_lang')), 'type' => 'select'),
        'ghostpool_title' => array('name' => 'ghostpool_title', 'title' => __('Title', 'gp_lang'), 'desc' => __('Choose whether to display the page title.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'Show' => __('Show', 'gp_lang'), 'Hide' => __('Hide', 'gp_lang')), 'type' => 'select'),
        'ghostpool_skin' => array('name' => 'ghostpool_skin', 'title' => __('Skin', 'gp_lang'), 'desc' => __('Choose the page skin.', 'gp_lang'), 'options' => array('Default' => __('Default', 'gp_lang'), 'blue' => __('Blue', 'gp_lang'), 'black' => __('Black', 'gp_lang')), 'type' => 'select', 'std' => ''),
        array('type' => 'divider'),
        'ghostpool_custom_stylesheet' => array('name' => 'ghostpool_custom_stylesheet', 'title' => __('Custom Stylesheet URL', 'gp_lang'), 'desc' => 'Enter the relative URL to your custom stylesheet e.g. <code>lib/css/custom-style.css</code>.', 'std' => '', 'type' => 'text'),
        array('type' => 'close'),
        array('type' => 'clear'),
    );

    return apply_filters('ghostpool_page_meta_boxes', $meta_boxes);
}

/* * ************************* Meta Fields ************************** */

function post_meta_boxes2() {
    global $post;
    $meta_boxes = ghostpool_post_meta_boxes2();
    ?>

    <script>

        jQuery(document).ready(function(){

            var $image_settings = jQuery("#image_settings");
            var $review_settings = jQuery("#review_settings");
            var $image_gallery_settings = jQuery("#image_gallery_settings");
            var $video_settings = jQuery("#video_settings");
            var $ligthbox_images = jQuery("#meta-box-ghostpool_lightbox_images");
    		
            if (jQuery("select[name='ghostpool_post_type']").val() == "Review") {
                $image_settings.removeClass('hidden');
                $review_settings.removeClass('hidden');	
                $image_gallery_settings.addClass('hidden');
                $video_settings.addClass('hidden');
            } else if (jQuery("select[name='ghostpool_post_type']").val() == "Image Gallery") {
                $image_settings.addClass('hidden');
                $review_settings.addClass('hidden');	
                $image_gallery_settings.removeClass('hidden');
                $video_settings.addClass('hidden');		
            } else if (jQuery("select[name='ghostpool_post_type']").val() == "Video") {
                $image_settings.addClass('hidden');
                $review_settings.addClass('hidden');	
                $image_gallery_settings.addClass('hidden');
                $video_settings.removeClass('hidden');	
            } else if (jQuery("select[name='ghostpool_post_type']").val() == "Article") {
                $image_settings.removeClass('hidden');
                $review_settings.addClass('hidden');	
                $image_gallery_settings.addClass('hidden');
                $video_settings.addClass('hidden');
            }
    		
            jQuery("select[name='ghostpool_post_type']").change(function() {
    			
                if (jQuery(this).val() == "Review") {
                    $image_settings.slideDown();
                    $review_settings.slideDown();
                    $image_gallery_settings.slideUp();
                    $video_settings.slideUp();
                    $ligthbox_images.show();
                } else if (jQuery(this).val() == "Image Gallery") {	
                    $image_settings.slideUp();
                    $review_settings.slideUp();
                    $image_gallery_settings.slideDown();
                    $video_settings.slideUp();
                    $ligthbox_images.hide();
                } else if (jQuery(this).val() == "Video") {	
                    $image_settings.slideUp();
                    $review_settings.slideUp();
                    $image_gallery_settings.slideUp();
                    $video_settings.slideDown();		
                    $ligthbox_images.hide();		
                } else if (jQuery(this).val() == "Article") {	
                    $image_settings.slideDown();
                    $review_settings.slideUp();
                    $image_gallery_settings.slideUp();
                    $video_settings.slideUp();
                    $ligthbox_images.hide();
                }			
            });
    		
        });
    </script>

    <?php
    foreach ($meta_boxes as $meta) :
        if (isset($meta['name'])) {
            $value = get_post_meta($post->ID, $meta['name'], true);
        }
        if ($meta['type'] == 'text')
            get_meta_text($meta, $value);
        elseif ($meta['type'] == 'upload_image')
            get_meta_upload_image($meta, $value);
        elseif ($meta['type'] == 'upload_video')
            get_meta_upload_video($meta, $value);
        elseif ($meta['type'] == 'textarea')
            get_meta_textarea($meta, $value);
        elseif ($meta['type'] == 'select')
            get_meta_select($meta, $value);
        elseif ($meta['type'] == 'select_sidebar')
            get_meta_select_sidebar($meta, $value);
        elseif ($meta['type'] == 'checkbox')
            get_meta_checkbox($meta, $value);
        elseif ($meta['type'] == 'open')
            get_meta_open($meta, $value);
        elseif ($meta['type'] == 'close')
            get_meta_close($meta, $value);
        elseif ($meta['type'] == 'divider')
            get_meta_divider($meta, $value);
        elseif ($meta['type'] == 'separator')
            get_meta_separator($meta, $value);
        elseif ($meta['type'] == 'clear')
            get_meta_clear($meta, $value);
        elseif ($meta['type'] == 'link_title')
            get_meta_link_title($meta, $value);
        elseif ($meta['type'] == 'link_text')
            get_meta_link_text($meta, $value);
        elseif ($meta['type'] == 'link_select')
            get_meta_link_select($meta, $value);
        elseif ($meta['type'] == 'gallery')
            get_meta_gallery($meta, $value);
    endforeach;
}

function page_meta_boxes() {
    global $post;
    $meta_boxes = ghostpool_page_meta_boxes();

    foreach ($meta_boxes as $meta) :
        if (isset($meta['name'])) {
            $value = get_post_meta($post->ID, $meta['name'], true);
        }
        if ($meta['type'] == 'text')
            get_meta_text($meta, $value);
        elseif ($meta['type'] == 'upload_image')
            get_meta_upload_image($meta, $value);
        elseif ($meta['type'] == 'upload_video')
            get_meta_upload_video($meta, $value);
        elseif ($meta['type'] == 'textarea')
            get_meta_textarea($meta, $value);
        elseif ($meta['type'] == 'select')
            get_meta_select($meta, $value);
        elseif ($meta['type'] == 'select_sidebar')
            get_meta_select_sidebar($meta, $value);
        elseif ($meta['type'] == 'checkbox')
            get_meta_checkbox($meta, $value);
        elseif ($meta['type'] == 'open')
            get_meta_open($meta, $value);
        elseif ($meta['type'] == 'close')
            get_meta_close($meta, $value);
        elseif ($meta['type'] == 'divider')
            get_meta_divider($meta, $value);
        elseif ($meta['type'] == 'separator')
            get_meta_separator($meta, $value);
        elseif ($meta['type'] == 'clear')
            get_meta_clear($meta, $value);
    endforeach;
}

function dedication_meta_boxes() {
    global $post;
    $meta_boxes = ghostpool_dedication_meta_boxes();?>

    <script>
        jQuery(document).ready(function(){

            var $dedication_settings = jQuery('#dedication-meta-boxes');
            
            if (jQuery("ul#categorychecklist input:checkbox:checked").val() == 84) {
                $dedication_settings.removeClass('hidden');
                $dedication_settings.removeClass('hide-if-js');
            } else {
                $dedication_settings.addClass('hidden');
            }
    		
            jQuery("ul#categorychecklist input:checkbox").change(function() {
                if ((jQuery(this).val() == 84) && (jQuery(this).is(":checked"))) {
                    $dedication_settings.removeClass('hidden');
                    $dedication_settings.removeClass('hide-if-js');
                    $dedication_settings.sliceDown();
                } else {
                    $dedication_settings.addClass('hidden');
                    $dedication_settings.sliceUp();                    
                }
            });                
        });
    </script>    
    <?php
    foreach ($meta_boxes as $meta) :
        if (isset($meta['name'])) {
            $value = get_post_meta($post->ID, $meta['name'], true);
        }
        if ($meta['type'] == 'text')
            get_meta_text($meta, $value);
        elseif ($meta['type'] == 'upload_image')
            get_meta_upload_image($meta, $value);
        elseif ($meta['type'] == 'upload_video')
            get_meta_upload_video($meta, $value);
        elseif ($meta['type'] == 'textarea')
            get_meta_textarea($meta, $value);
        elseif ($meta['type'] == 'select')
            get_meta_select($meta, $value);
        elseif ($meta['type'] == 'checkbox')
            get_meta_checkbox($meta, $value);
        elseif ($meta['type'] == 'open')
            get_meta_open($meta, $value);
        elseif ($meta['type'] == 'close')
            get_meta_close($meta, $value);
        elseif ($meta['type'] == 'divider')
            get_meta_divider($meta, $value);
        elseif ($meta['type'] == 'separator')
            get_meta_separator($meta, $value);
        elseif ($meta['type'] == 'clear')
            get_meta_clear($meta, $value);
    endforeach;
}

function get_meta_open($args = array(), $value = false) {
    extract($args);
    ?>

    <div class="meta-settings" id="<?php echo $name; ?>">

        <h4><?php echo $title; ?></h4>
        <div class="clear"></div>

        <div class="meta-settings-desc"><?php echo $desc; ?></div><div class="clear"></div>

        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />		


<?php }

function get_meta_close($args = array(), $value = false) {
    extract($args);
    ?>

    </div><div class="clear"></div>

    <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />		


<?php }

function get_meta_divider($args = array(), $value = false) {
    extract($args);
    ?>

    <div class="clear"></div>
    <div class="divider"></div>
    <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />		


<?php }

function get_meta_separator($args = array(), $value = false) {
    extract($args);
    ?>

    <div class="clear"></div>
    <div class="separator"></div>
    <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />		


<?php }

function get_meta_clear($args = array(), $value = false) {
    extract($args);
    ?>

    <div class="clear"></div>
    <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />		


<?php }

function get_meta_text($args = array(), $value = false) {
    extract($args);
    global $post;
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box<?php if ($size == "small") { ?> text-small<?php } ?>">
        <strong><?php echo $title; ?></strong>
        <br/><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_html($value, 1); ?>" size="<?php if ($size == "small") { ?>3<?php } else { ?>30<?php } ?>" /><?php if ($details) { ?> <span><?php echo $details; ?></span><?php } ?>
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_upload_image($args = array(), $value = false) {
    extract($args);
    global $post;
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box upload-field">
        <strong><?php echo $title; ?></strong>
        <br/><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" class="upload" value="<?php echo esc_html($value, 1); ?>" size="30" />
        <input type="button" class="upload-image-button button" value="<?php _e('Upload', 'gp_lang'); ?>" />
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_upload_video($args = array(), $value = false) {
    extract($args);
    global $post;
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box upload-field">
        <strong><?php echo $title; ?></strong>
        <br/><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" class="upload" value="<?php echo esc_html($value, 1); ?>" size="30" />
        <input type="button" class="upload-video-button button" value="<?php _e('Upload', 'gp_lang'); ?>" />
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_select($args = array(), $value = false) {
    extract($args);
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box">
        <strong><?php echo $title; ?></strong>
        <br/><select name="<?php echo $name; ?>" id="<?php echo $name; ?>">
    <?php foreach ($options as $key => $option) : ?>
                <option value="<?php echo $key; ?>" <?php if (htmlentities($value, ENT_QUOTES) == $key) echo ' selected="selected"'; ?>>
        <?php echo $option; ?>
                </option>
    <?php endforeach; ?>
        </select>
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_select_sidebar($args = array(), $value = false) {
    extract($args);
    global $post, $wp_registered_sidebars;
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box">
        <strong><?php echo $title; ?></strong><br/>		
        <select name="<?php echo $name; ?>" id="<?php echo $name; ?>">
    <?php $sidebars = $wp_registered_sidebars;
    if (is_array($sidebars) && !empty($sidebars)) {
        foreach ($sidebars as $sidebar) {
            if ($selected_sidebar[$i] == $sidebar['id']) {
                ?>
                        <option value="<?php echo $sidebar['id']; ?>"<?php if ($value == $sidebar['id']) {
                    echo ' selected="selected"';
                } ?>><?php echo $sidebar['name']; ?></option>
            <?php } else { ?>
                        <option value="<?php echo $sidebar['id']; ?>"<?php if ($value == $sidebar['id']) {
                    echo ' selected="selected"';
                } ?>><?php echo $sidebar['name']; ?></option>
            <?php }
        }
    } ?>
        </select>
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_textarea($args = array(), $value = false) {
    extract($args);
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box<?php if ($size == "large") { ?> text-large<?php } ?>">	
        <strong><?php echo $title; ?></strong>
        <br/><textarea name="<?php echo $name; ?>" id="<?php echo $name; ?>" cols="60" rows="4" tabindex="30"><?php echo esc_html($value, 1); ?></textarea>
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_checkbox($args = array(), $value = false) {
    extract($args);
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box">
        <strong><?php echo $title; ?></strong>
            <?php if (esc_html($value, 1)) {
                $checked = "checked=\"checked\"";
            } else {
                if ($std === "true") {
                    $checked = "checked=\"checked\"";
                } else {
                    $checked = "";
                }
            } ?>
        <input type="checkbox" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="false" <?php echo $checked; ?> />
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" /></p>			
    </div>


<?php }

function get_meta_link_title($args = array(), $value = false) {
    extract($args);
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box" style="width: 30%;">
        <strong><?php echo $title; ?></strong> <em><?php echo $desc; ?></em>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_link_text($args = array(), $value = false) {
    extract($args);
    ?>


    <div id="meta-box-<?php echo $name; ?>" class="meta-box" style="width: 30%;">
        <br/><?php if ($link_number) { ?><span style="font-weight: bold; float: left; margin-top: 10px; width: 10%;"><?php echo $link_number; ?></span><?php } ?><input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php if (esc_html($value, 1)) {
        echo esc_html($value, 1);
    } else {
        echo esc_html($std, 1);
    } ?>" size="30" tabindex="30"<?php if ($link_number) { ?> style="width:80%;"<?php } ?> />
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_link_select($args = array(), $value = false) {
    extract($args);
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box">
        <br/><select name="<?php echo $name; ?>" id="<?php echo $name; ?>">
    <?php foreach ($options as $key => $option) : ?>
                <option value="<?php echo $key; ?>" <?php if (htmlentities($value, ENT_QUOTES) == $key) echo ' selected="selected"'; ?>>
        <?php echo $option; ?>
                </option>
    <?php endforeach; ?>
        </select>
        <div class="meta-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
    </div>


<?php }

function get_meta_gallery($args = array(), $value = false) {
    extract($args);
    global $post;
    ?>

    <div id="meta-box-<?php echo $name; ?>" class="meta-box<?php if ($size == "large") { ?> text-large<?php } ?>">

        <div style="margin-bottom: 15px;">
            <strong><?php echo $title; ?></strong>
            <div class="clear"></div>
    <?php if ($size == "large") {
        
    } else { ?><br/><?php } ?><a href="media-upload.php?post_id=<?php echo $post->ID; ?>&amp;type=image&amp;TB_iframe=true&amp;width=640&amp;height=790" id="add_image" class="thickbox button" title="<?php _e('Add Media', 'gp_lang'); ?>" onclick="return false;"><?php _e('Add Media', 'gp_lang'); ?></a> <a href="media-upload.php?post_id=<?php echo $post->ID; ?>&amp;type=image&amp;tab=gallery&amp;TB_iframe=true&amp;width=640&amp;height=790" id="add_image" class="thickbox button" title="<?php _e('View Media', 'gp_lang'); ?>" onclick="return false;"><?php _e('View Media', 'gp_lang'); ?></a>
        </div>

        <div class="clear"></div>

    <?php $image_url = site_url() . '/wp-includes/images/crystal/video.png';
    $args = array('post_type' => 'attachment', 'post_parent' => $post->ID, 'numberposts' => -1, 'orderby' => 'menu_order', 'order' => 'asc');
    $attachments = get_children($args);
    ?>		
    <?php if ($attachments) {
        foreach ($attachments as $attachment) { ?>
            <?php if ($attachment->post_mime_type == 'image/jpeg' OR $attachment->post_mime_type == 'image/jpg' OR $attachment->post_mime_type == 'image/png' OR $attachment->post_mime_type == 'image/gif') {
                $image = vt_resize($attachment->ID, '', 50, 50, true);
            } else {
                $image = vt_resize('', $image_url, 50, 50, true);
            } ?>
                <img src="<?php echo $image[url]; ?>" width="50" height="50" alt="" />	
        <?php }
    } ?>
        <div class="meta-box-desc"><?php echo $desc; ?></div>
        <input type="hidden" name="<?php echo $name; ?>_noncename" id="<?php echo $name; ?>_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />

    </div>


    <?php
    }

    if (function_exists('wp_enqueue_style')) {
        if (is_admin() && ($pagenow == "post.php" OR $pagenow == "post-new.php")) {
            wp_enqueue_style('admin', get_template_directory_uri() . '/lib/admin/css/admin.css');
            wp_enqueue_script('custom', get_template_directory_uri() . '/lib/admin/scripts/custom.js', array('media-upload'));
        }
    }

    function ghostpool_save_meta_data($post_id) {
        global $post;

        if ('page' == $_POST['post_type'])
            $meta_boxes = array_merge(ghostpool_page_meta_boxes());
        elseif ('post' == $_POST['post_type'])
            $meta_boxes = array_merge(ghostpool_dedication_meta_boxes());

        foreach ($meta_boxes as $meta_box) :

            if (!wp_verify_nonce($_POST[$meta_box['name'] . '_noncename'], plugin_basename(__FILE__)))
                return $post_id;

            if ('page' == $_POST['post_type'] && !current_user_can('edit_page', $post_id))
                return $post_id;

            elseif ('post' == $_POST['post_type'] && !current_user_can('edit_post', $post_id))
                return $post_id;

            $data = stripslashes($_POST[$meta_box['name']]);

            if (get_post_meta($post_id, $meta_box['name']) == '')
                add_post_meta($post_id, $meta_box['name'], $data, true);

            elseif ($data != get_post_meta($post_id, $meta_box['name'], true))
                update_post_meta($post_id, $meta_box['name'], $data);

            elseif ($data == '')
                delete_post_meta($post_id, $meta_box['name'], get_post_meta($post_id, $meta_box['name'], true));

        endforeach;
    }
    ?>