To start off, thank you for your time and assistance. I recently bought a wordpress theme with a built in gallery. Here's the link to the theme's live preview, just click on the 'Fashion Model' link and the gallery will pop up: http://themeforest.net/item/mediabook-multimedia-wordpress-theme/full_screen_preview/3025192
As you can see it's a nice gallery that you just click on the different slices to view the different pics in that gallery. My goal for my site is to turn the full-view pics into links to the blogs posts with in the site. But I am completely lost on how to accomplish this task. I haven't worked with PHP too much in the last 5 years since I graduated school, and I only had a basic class on it when I did study it. So, my PHP knowledge is severly lacking. I have no idea where the sourse behind the coding comes from. Here's the exact code for the back-end module that let's you insert the pics:
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "option-tab",
"title" => __("Item Type", $wpw_theme_lang),
"id" => $this->cfg['id']."_item_type",
"description" => __("Chose what type of item.", $wpw_theme_lang),
"option-group" => "item-type",
"br" => "1",
"css-class" => " main-item-setting",
"options" => array(
"image" => "Image",
"video" => "Video",
"audio" => "Audio",
"text" => "Text"
)
)
);
I'm completely lost as to where the array info is coming from. Like how does the coding know that selecting "Image" means to allow you to access Wordpress' media library. And how can I code this to allow for the images to link to the posts/pages of my choosing? I know this isn't much to go on, so I'll add the entire PHP file. If you need me to add more files then please request and I'll do so. I'm not seeing an option to upload screenshots or actual files or I would just send the whole template. I'm willing to email that though. Here's the entire PHP file:
<?php
//
// GALLERY OBJECT
//
//
class WPW_HorizontalGallery{
//main
public $cfg;
public $activator;
public $item_model = array();
public $base;
//
function __construct(){
global $wpw_theme_lang;
$this->cfg['id'] = 'wpw_gallery';
$this->cfg['title'] = 'Gallery';
$this->cfg['active_on_posts'] = array('post', 'page');
add_action( 'init', array( &$this, 'init' ) );
} // function
public function init(){
global $wpw_theme_lang;
//
// SET MODULE BASE
//
$this->base = new WPW_ModuleBase(
array(
"id" => $this->cfg['id'],
"title" => $this->cfg['title'],
"module" => &$this,
"module_item_model" => array( &$this, 'item_model' ),
"admin_scripts" => array( &$this, 'admin_scripts' ),
"frontend_scripts" => array( &$this, 'frontend_scripts'),
"active_on_posts" => $this->cfg['active_on_posts'],
"sortable_items" => true
)
);
//CUSTOM SETTINGS ON MODULE BASE
//add custom manual buttons
$module_custom_settings = new WPW_AddMetaOption(
array(
'id' => $this->cfg['id']."-custom-settings",
'type' => 'custom-input',
'custom-callback' => array( &$this, 'pre_custom_settings')
)
);
$this->base->module_box->add_module($module_custom_settings, 1);
//INITIAL OPTIONS
$metabox_input = new WPW_AddMetaOption(
array(
"title" => __("<br/><br/>Gallery Items", $wpw_theme_lang),
"id" => "wpw_gall_section",
"description" => __("", $wpw_theme_lang),
"type" => "section-title"
)
);
$this->base->module_box->add_module($metabox_input, 1);
//
$metabox_input = new WPW_AddMetaOption(
array(
"title" => __("Controls Color ", $wpw_theme_lang),
"type" => "select",
"id" => $this->cfg['id']."_controls_color",
"options" => array(
"none" => "No Change",
"white" => "White",
"gray" => "Gray",
"dark" => "Dark"
),
"description" => __("Select the color of the graphical buttons that are present in the template. Every color represents a set of icons.", $wpw_theme_lang),
"default" => "none"
)
);
$this->base->module_box->add_module($metabox_input, 1);
$metabox_input = new WPW_AddMetaOption(
array(
"title" => __("Background Color", $wpw_theme_lang),
"id" => $this->cfg['id']."_bg_color",
"type" => "colorpicker-input",
"description" => "",
"degault" => ""
)
);
$this->base->module_box->add_module($metabox_input, 1);
$metabox_input = new WPW_AddMetaOption(
array(
"title" => __("Full Screen Options", $wpw_theme_lang),
"id" => "wpw_fs_section",
"description" => __("This settings allows you to set different colors for this gallery when it displays the content in full-screen mode.", $wpw_theme_lang),
"type" => "section-title"
)
);
$this->base->module_box->add_module($metabox_input, 1);
$wpw_enable_module = new WPW_AddMetaOption(
array(
"type" => "text",
"title" => __("Gallery Height", $wpw_theme_lang),
"id" => $this->cfg['id']."_gallery_height",
"description" => __("The height size of the gallery in normal view. This needs to be equal with the height size of the images in the normal view. <br/>In full screen this size will be calculated using the screen size of the viewer.", $wpw_theme_lang),
"default" => "300"
)
);
$this->base->module_box->add_module($wpw_enable_module, 1);
$wpw_enable_module = new WPW_AddMetaOption(
array(
"type" => "checkbox",
"title" => __("Hide Text Content", $wpw_theme_lang),
"id" => $this->cfg['id']."_hide_post_text",
"description" => __("The content of main text editor from above is displayed by default under the gallery when open. You can chose to disable it for this gallery so it won't appear in front page.", $wpw_theme_lang),
"default" => "false"
)
);
$this->base->module_box->add_module($wpw_enable_module, 1);
}
public function item_model(){
global $wpw_theme_lang;
if(isset($this->cfg['item_model'])){
return $this->cfg['item_model'];
}
//
// MODULE ITEM MODEL
//
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "option-tab",
"title" => __("Item Type", $wpw_theme_lang),
"id" => $this->cfg['id']."_item_type",
"description" => __("Chose what type of item.", $wpw_theme_lang),
"option-group" => "item-type",
"br" => "1",
"css-class" => " main-item-setting",
"options" => array(
"image" => "Image",
"video" => "Video",
"audio" => "Audio",
"text" => "Text"
)
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "text",
"title" => __("Item Title", $wpw_theme_lang),
"id" => $this->cfg['id']."_title",
"description" => __("The Item title - will appear when you hover over the item and near the Gallery name.", $wpw_theme_lang),
"br" => "1",
"default" => ""
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "att-id",
"title" => __("Image", $wpw_theme_lang),
"id" => $this->cfg['id']."_att_id",
"description" => __("This is the default image for the gallery item. Required if this is an Image Item. For the rest of the item types will be used as poster. <br/><br/>Click to Upload or select an image that is already in the Media Library. If you upload new images - Upload them then switch to Media Library so you can select them.", $wpw_theme_lang),
"default" => ""
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "att-id",
"title" => __("Alternate Image", $wpw_theme_lang),
"id" => $this->cfg['id']."_att_alt_id",
"description" => __("Add here another image if you want to transform this item into a Before/After Viewer.", $wpw_theme_lang),
"option-group" => "item-type",
"option-group-tab" => "image",
"default" => ""
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "select",
"title" => __("Media Type", $wpw_theme_lang),
"id" => $this->cfg['id']."_media_type",
"description" => __("Chose the type of player you want to use.", $wpw_theme_lang),
"option-group" => "item-type",
"option-group-tab" => "video",
"br" => "1",
"options" => array(
"vimeo" => "Vimeo",
"youtube" => "Youtube",
"jplayer" => "jPlayer - Video"
)
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "text",
"title" => __("Media Code", $wpw_theme_lang),
"id" => $this->cfg['id']."_media_code",
"description" => __("This field requires a code or a movie path, depending what video player are you using: <br><strong>Vimeo or Youtube</strong>: add the code of your video you need. The Youtube code is after the 'v=' parameter in a url: http://www.youtube.com/watch?v=<strong style='color:red'>iUpkmg1hYLk</strong> <br/><br/><strong>jPlayer Video and Audio</strong>: enter the media file path to play. In this case you can also add multiple paths to different music/video formats - because the player will search whatever movie format is supported by the device is used. <br/> The most usual media paths are .mp3, .mov or .ogg <br/> In case you are using muliple paths, sepparate them with the character: <strong style='font-size:140%;'>;</strong> ", $wpw_theme_lang),
"option-group" => "item-type",
"option-group-tab" => "video,audio",
"br" => "1",
"default" => ""
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "text",
"title" => __("Player Width Size", $wpw_theme_lang),
"id" => $this->cfg['id']."_video_ratio",
"description" => __("This setting will set the Width size of the video player but also his ratio when used in zoomed mode.", $wpw_theme_lang),
"option-group" => "item-type",
"option-group-tab" => "video",
"br" => "1",
"default" => "520"
)
);
$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "att-id",
"title" => __("Poster", $wpw_theme_lang),
"id" => $this->cfg['id']."_video_poster",
"description" => __("In case you want to use the jPlayer, you can also set a poster image for the movie", $wpw_theme_lang),
"option-group" => "item-type",
"option-group-tab" => "video",
"br" => "1",
"default" => ""
)
);
//$this->item_model[] = $module_item_option;
$module_item_option = new WPW_ModuleItemOption(
array(
"type" => "textarea",
"title" => __("Text Content", $wpw_theme_lang),
"id" => $this->cfg['id']."_text_content",
"description" => __("Supports HTML formated text.", $wpw_theme_lang),
"option-group" => "item-type",
"option-group-tab" => "text,audio",
"br" => "1",
"dont-escape" => 1,
"default" => ""
)
);
$this->item_model[] = $module_item_option;
$this->cfg['item_model'] = $this->item_model;
return $this->item_model;
}
function pre_custom_settings(){
?><?php
}
function admin_scripts(){
$src = get_template_directory_uri().'/wpw.h.gallery/module.admin.js';
wp_register_script( $this->cfg['id'].'_js_admin', $src);
wp_enqueue_script( $this->cfg['id'].'_js_admin' );
?>
<link rel='stylesheet' href='<?php echo get_template_directory_uri(); ?>/wpw.h.gallery/module.css' type='text/css' media='all' />
<?php
}
function frontend_scripts(){
?>
<link rel='stylesheet' href='<?php echo get_template_directory_uri(); ?>/wpw.h.gallery/module.css' type='text/css' media='all' />
<?php
}
} // class
$wpw_h_gallery = new WPW_HorizontalGallery();
?>
Thanks again for your time and help.