function form( $instance ) { $source = isset( $instance['source'] ) ? $instance['source'] : 'post'; $excerpt = isset( $instance['excerpt'] ) ? $instance['excerpt'] : 'true'; $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $mtitle = isset( $instance['mtitle'] ) ? $instance['mtitle'] : 'true'; $mimgpos = isset( $instance['mimgpos'] ) ? $instance['mimgpos'] : 'btitle'; $mvideo = isset( $instance['mvideo'] ) ? $instance['mvideo'] : 'false'; $perpage = isset( $instance['perpage'] ) ? $instance['perpage'] : '10'; $multiple = isset( $instance['multiple'] ) ? $instance['multiple'] : '1coli'; $multiplew = isset( $instance['multiplew'] ) ? $instance['multiplew'] : '220'; $multipleh = isset( $instance['multipleh'] ) ? $instance['multipleh'] : '220'; $excerptlength = isset( $instance['excerptlength'] ) ? $instance['excerptlength'] : '100'; $mmeta = isset( $instance['mmeta'] ) ? $instance['mmeta'] : 'aimage'; $mmargin = isset( $instance['mmargin'] ) ? $instance['mmargin'] : '30'; $mdate = isset( $instance['mdate'] ) ? $instance['mdate'] : 'true'; $mauthor = isset( $instance['mauthor'] ) ? $instance['mauthor'] : 'false'; $mcomments = isset( $instance['mcomments'] ) ? $instance['mcomments'] : 'true'; $mcats = isset( $instance['mcats'] ) ? $instance['mcats'] : 'false'; $mreadmore = isset( $instance['mreadmore'] ) ? $instance['mreadmore'] : 'right'; $mmseperator = isset( $instance['mmseperator'] ) ? $instance['mmseperator'] : '|'; $rmtext = isset( $instance['rmtext'] ) ? $instance['rmtext'] : 'Read More'; $noimage = isset( $instance['noimage'] ) ? $instance['noimage'] : 'true'; $mnoimage = isset( $instance['mnoimage'] ) ? $instance['mnoimage'] : 'true'; $mshowtime = isset( $instance['mshowtime'] ) ? $instance['mshowtime'] : ''; $looporder1 = isset( $instance['looporder1'] ) ? $instance['looporder1'] : ''; $looporder2 = isset( $instance['looporder2'] ) ? $instance['looporder2'] : ''; $orderdir = isset( $instance['orderdir'] ) ? $instance['orderdir'] : 'DESC'; $skip = isset( $instance['skip'] ) ? $instance['skip'] : ''; global $wpdb; $termstable = $wpdb->prefix . ULTIMATUM_PREFIX . '_tax'; ?> <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'ultimatum' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>"/> </p> <p> <label for="<?php echo $this->get_field_id( 'source' ); ?>"><?php _e( 'Select Content Source', 'ultimatum' ); ?></label> <select class="widefat" name="<?php echo $this->get_field_name( 'source' ); ?>" id="<?php echo $this->get_field_id( 'source' ); ?>"> <optgroup label="Post Type"> <?php $args = array( 'public' => true, 'publicly_queryable' => true ); $post_types = get_post_types( $args, 'names' ); foreach ( $post_types as $post_type ) { if ( $post_type != 'attachment' ) { echo '<option value="ptype-' . $post_type . '" ' . selected( $source, 'ptype-' . $post_type, false ) . '>' . $post_type . '</option>'; } } ?> </optgroup> <?php $entries = get_categories( 'title_li=&orderby=name&hide_empty=0' ); if ( count( $entries ) >= 1 ) { echo '<optgroup label="Categories(Post)">'; foreach ( $entries as $key => $entry ) { echo '<option value="cat-' . $entry->term_id . '" ' . selected( $source, 'cat-' . $entry->term_id, false ) . '>' . $entry->name . '</option>'; } echo '</optgroup>'; } ?> <?php $termsql = "SELECT * FROM $termstable"; $termresult = $wpdb->get_results( $termsql, ARRAY_A ); foreach ( $termresult as $term ) { $properties = unserialize( $term['properties'] ); echo '<optgroup label="' . $properties['label'] . '(' . $term['pname'] . ')">'; $entries = get_terms( $properties['name'], 'orderby=name&hide_empty=0' ); foreach ( $entries as $key => $entry ) { $optiont = 'taxonomy-' . $term['pname'] . '|' . $properties['name'] . '|' . $entry->slug; echo '<option value="' . $optiont . '" ' . selected( $source, $optiont, false ) . '>' . $entry->name . '</option>'; } echo '</optgroup>'; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'mtitle' ); ?>"><?php _e( 'Show Article Titles', 'ultimatum' ) ?></label> <select class="widefat" name="<?php echo $this->get_field_name( 'mtitle' ); ?>" id="<?php echo $this->get_field_id( 'mtitle' ); ?>"> <option value="true" <?php selected( $mtitle, 'true' ); ?>>ON</option> <option value="false" <?php selected( $mtitle, 'false' ); ?>>OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'perpage' ); ?>"><?php _e( 'Items Count', 'ultimatum' ) ?></label> <input class="widefat" type="text" value="<?php echo $perpage; ?>" name="<?php echo $this->get_field_name( 'perpage' ); ?>" id="<?php echo $this->get_field_id( 'perpage' ); ?>"/> </p> <p> <label for="<?php echo $this->get_field_id( 'looporder1' ); ?>"><?php _e( 'Loop Order first', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'looporder1' ); ?>" id="<?php echo $this->get_field_id( 'looporder1' ); ?>"> <option value='' <?php selected( $looporder1, '' ); ?>><?php _e( 'None', 'ultimatum' ) ?></option> <option value='ID' <?php selected( $looporder1, 'ID' ); ?>><?php _e( 'ID', 'ultimatum' ) ?></option> <option value='author' <?php selected( $looporder1, 'author' ); ?>><?php _e( 'author', 'ultimatum' ) ?></option> <option value='title' <?php selected( $looporder1, 'title' ); ?>><?php _e( 'title', 'ultimatum' ) ?></option> <option value='name' <?php selected( $looporder1, 'name' ); ?>><?php _e( 'name', 'ultimatum' ) ?></option> <option value='date' <?php selected( $looporder1, 'date' ); ?>><?php _e( 'date {default}', 'ultimatum' ) ?></option> <option value='modified' <?php selected( $looporder1, 'modified' ); ?>><?php _e( 'modified', 'ultimatum' ) ?></option> <option value='parent' <?php selected( $looporder1, 'parent' ); ?>><?php _e( 'parent', 'ultimatum' ) ?></option> <option value='rand' <?php selected( $looporder1, 'rand' ); ?>><?php _e( 'rand', 'ultimatum' ) ?></option> <option value='comment_count' <?php selected( $looporder1, 'comment_count' ); ?>><?php _e( 'comment_count', 'ultimatum' ) ?></option> <option value='menu_order' <?php selected( $looporder1, 'menu_order' ); ?>><?php _e( 'menu_order', 'ultimatum' ) ?></option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'looporder2' ); ?>"><?php _e( 'Loop Order second', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'looporder2' ); ?>" id="<?php echo $this->get_field_id( 'looporder2' ); ?>"> <option value='' <?php selected( $looporder2, '' ); ?>><?php _e( 'None', 'ultimatum' ) ?></option> <option value='ID' <?php selected( $looporder2, 'ID' ); ?>><?php _e( 'ID', 'ultimatum' ) ?></option> <option value='author' <?php selected( $looporder2, 'author' ); ?>><?php _e( 'author', 'ultimatum' ) ?></option> <option value='title' <?php selected( $looporder2, 'title' ); ?>><?php _e( 'title', 'ultimatum' ) ?></option> <option value='name' <?php selected( $looporder2, 'name' ); ?>><?php _e( 'name', 'ultimatum' ) ?></option> <option value='date' <?php selected( $looporder2, 'date' ); ?>><?php _e( 'date {default}', 'ultimatum' ) ?></option> <option value='modified' <?php selected( $looporder2, 'modified' ); ?>><?php _e( 'modified', 'ultimatum' ) ?></option> <option value='parent' <?php selected( $looporder2, 'parent' ); ?>><?php _e( 'parent', 'ultimatum' ) ?></option> <option value='rand' <?php selected( $looporder2, 'rand' ); ?>><?php _e( 'rand', 'ultimatum' ) ?></option> <option value='comment_count' <?php selected( $looporder2, 'comment_count' ); ?>><?php _e( 'comment_count', 'ultimatum' ) ?></option> <option value='menu_order' <?php selected( $looporder2, 'menu_order' ); ?>><?php _e( 'menu_order', 'ultimatum' ) ?></option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'orderdir' ); ?>"><?php _e( 'Order Direction', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'orderdir' ); ?>" id="<?php echo $this->get_field_id( 'orderdir' ); ?>"> <option value='DESC' <?php selected( $orderdir, 'DESC' ); ?>><?php _e( 'Descending', 'ultimatum' ) ?></option> <option value='ASC' <?php selected( $orderdir, 'ASC' ); ?>><?php _e( 'Ascending', 'ultimatum' ) ?></option> </select> </p> <?php ultimatum_custcontent_inptext( 'skip', $skip, __('Skip first','ultimatum'), $this, '3' ); ?> Posts... <p> <label for="<?php echo $this->get_field_id( 'multiple' ); ?>"><?php _e( 'Loop Layout', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'multiple' ); ?>" id="<?php echo $this->get_field_id( 'multiple' ); ?>"> <?php if (file_exists(THEME_LOOPS_DIR . '/extraloops.php')) { include(THEME_LOOPS_DIR . '/extraloops.php'); foreach ($extraloops as $loops) { ?> <option value="<?php echo $loops["file"]; ?>" <?php selected($multiple, $loops["file"]); ?>><?php _e($loops["name"], 'ultimatum') ?></option> <?php } } if(is_plugin_active( 'wonderloops/wonderloops.php' )) { $theme_loops_dir = @opendir(ULTLOOPBUILDER_DIR); $loop_files = array(); if ($theme_loops_dir) { while (($file = readdir($theme_loops_dir)) !== false) { if (substr($file, 0, 1) == '.') { continue; } if (substr($file, -4) == '.php') { $loop_files[] = $file; } } } @closedir($theme_loops_dir); if ($theme_loops_dir && !empty($loop_files)) { foreach ($loop_files as $loop_file) { if (is_readable(ULTLOOPBUILDER_DIR . "/$loop_file")) { unset($data); $data = ultimatum_get_loop_files(ULTLOOPBUILDER_DIR . "/$loop_file"); if (isset($data['generator']) && !empty($data['generator'])) { ?> <option value="<?php echo $data["file"]; ?>" <?php selected($multiple, $data["file"]); ?>><?php _e($data["name"], 'ultimatum') ?></option> <?php } } } } } ?> <option value="1-col-i" <?php selected( $multiple, '1-col-i' ); ?>><?php _e( 'One Column With Full Image', 'ultimatum' ) ?></option> <option value="1-col-li" <?php selected( $multiple, '1-col-li' ); ?>><?php _e( 'One Column With Image On Left', 'ultimatum' ) ?></option> <option value="1-col-ri" <?php selected( $multiple, '1-col-ri' ); ?>><?php _e( 'One Column With Image On Right', 'ultimatum' ) ?></option> <option value="1-col-gl" <?php selected( $multiple, '1-col-gl' ); ?>><?php _e( 'One Column Gallery With Image On Left', 'ultimatum' ) ?></option> <option value="1-col-gr" <?php selected( $multiple, '1-col-gr' ); ?>><?php _e( 'One Column Gallery With Image On Right', 'ultimatum' ) ?></option> <option value="1-col-n" <?php selected( $multiple, '1-col-n' ); ?>><?php _e( 'One Column With No Image', 'ultimatum' ) ?></option> <option value="2-col-i" <?php selected( $multiple, '2-col-i' ); ?>><?php _e( 'Two Columns With Image', 'ultimatum' ) ?></option> <option value="2-col-g" <?php selected( $multiple, '2-col-g' ); ?>><?php _e( 'Two Columns Gallery', 'ultimatum' ) ?></option> <option value="2-col-n" <?php selected( $multiple, '2-col-n' ); ?>><?php _e( 'Two Columns With No Image', 'ultimatum' ) ?></option> <option value="3-col-i" <?php selected( $multiple, '3-col-i' ); ?>><?php _e( 'Three Columns With Image', 'ultimatum' ) ?></option> <option value="3-col-g" <?php selected( $multiple, '3-col-g' ); ?>><?php _e( 'Three Columns Gallery', 'ultimatum' ) ?></option> <option value="3-col-n" <?php selected( $multiple, '3-col-n' ); ?>><?php _e( 'Three Columns With No Image', 'ultimatum' ) ?></option> <option value="4-col-i" <?php selected( $multiple, '4-col-i' ); ?>><?php _e( 'Four Columns With Image', 'ultimatum' ) ?></option> <option value="4-col-g" <?php selected( $multiple, '4-col-g' ); ?>><?php _e( 'Four Columns Gallery', 'ultimatum' ) ?></option> <option value="4-col-n" <?php selected( $multiple, '4-col-n' ); ?>><?php _e( 'Four Columns With No Image', 'ultimatum' ) ?></option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'mnoimage' ); ?>"><?php _e( 'No Image', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'mnoimage' ); ?>" id="<?php echo $this->get_field_id( 'mnoimage' ); ?>"> <option value="true" <?php selected( $mnoimage, 'true' ); ?>>Show Placeholder</option> <option value="false" <?php selected( $mnoimage, 'false' ); ?>>OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'mimgpos' ); ?>"><?php _e( 'Image Position', 'ultimatum' ) ?> </label> <i>For Full image and columns 2 or 2+</i> <select class="widefat" name="<?php echo $this->get_field_name( 'mimgpos' ); ?>" id="<?php echo $this->get_field_id( 'mimgpos' ); ?>"> <option value="atitle" <?php selected( $mimgpos, 'atitle' ); ?>><?php _e( 'After Title', 'ultimatum' ) ?></option> <option value="btitle" <?php selected( $mimgpos, 'btitle' ); ?>><?php _e( 'Before Title', 'ultimatum' ) ?></option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'mvideo' ); ?>"><?php _e( 'Replace Featured Image with gallery or Video', 'ultimatum' ) ?> </label> <i>Works for non Gallery views only</i> <select class="widefat" name="<?php echo $this->get_field_name( 'mvideo' ); ?>" id="<?php echo $this->get_field_id( 'mvideo' ); ?>"> <option value="true" <?php selected( $mvideo, 'true' ); ?>>ON</option> <option value="false" <?php selected( $mvideo, 'false' ); ?>>OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'excerpt' ); ?>"><?php _e( 'Show Content As', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'excerpt' ); ?>" id="<?php echo $this->get_field_id( 'excerpt' ); ?>"> <option value="true" <?php selected( $excerpt, 'true' ); ?>>Excerpt</option> <option value="content" <?php selected( $excerpt, 'content' ); ?>>Content</option> <option value="false" <?php selected( $excerpt, 'false' ); ?>>OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'excerptlength' ); ?>"><?php _e( 'Excerpt Length(chars)', 'ultimatum' ) ?> </label> <input class="widefat" type="text" value="<?php echo $excerptlength; ?>" name="<?php echo $this->get_field_name( 'excerptlength' ); ?>" id="<?php echo $this->get_field_id( 'excerptlength' ); ?>"/> </p> <p> <label for="<?php echo $this->get_field_id( 'multiplew' ); ?>"><?php _e( 'Image Width', 'ultimatum' ) ?> </label> <input class="widefat" type="text" value="<?php echo $multiplew; ?>" name="<?php echo $this->get_field_name( 'multiplew' ); ?>" id="<?php echo $this->get_field_id( 'multiplew' ); ?>"/><i>Applied on Image on Left/Right Aligned pages</i> </p> <p> <label for="<?php echo $this->get_field_id( 'multipleh' ); ?>"><?php _e( 'Image Height', 'ultimatum' ) ?> </label> <input class="widefat" type="text" value="<?php echo $multipleh; ?>" name="<?php echo $this->get_field_name( 'multipleh' ); ?>" id="<?php echo $this->get_field_id( 'multipleh' ); ?>"/> </p> <p> <label for="<?php echo $this->get_field_id( 'mcats' ); ?>"><?php _e( 'Taxonomy', 'ultimatum' ) ?></label> <select class="widefat" name="<?php echo $this->get_field_name( 'mcats' ); ?>" id="<?php echo $this->get_field_id( 'mcats' ); ?>"> <option value="ameta" <?php selected( $mcats, 'ameta' ); ?>><?php _e( 'After Meta', 'ultimatum' ) ?></option> <option value="acontent" <?php selected( $mcats, 'acontent' ); ?>><?php _e( 'After Content', 'ultimatum' ) ?></option> <option value="false" <?php selected( $mcats, 'false' ); ?>>OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'mmeta' ); ?>"><?php _e( 'Meta', 'ultimatum' ) ?></label> <select class="widefat" name="<?php echo $this->get_field_name( 'mmeta' ); ?>" id="<?php echo $this->get_field_id( 'mmeta' ); ?>"> <option value="atitle" <?php selected( $mmeta, 'atitle' ); ?>><?php _e( 'After Title', 'ultimatum' ) ?></option> <option value="aimage" <?php selected( $mmeta, 'aimage' ); ?>><?php _e( 'After Image', 'ultimatum' ) ?></option> <option value="atext" <?php selected( $mmeta, 'atext' ); ?>><?php _e( 'After Content', 'ultimatum' ) ?></option> <option value="false" <?php selected( $mmeta, 'false' ); ?>>OFF</option> </select> </p> <fieldset> <legend>Post Meta Properties</legend> <p> <label for="<?php echo $this->get_field_id( 'mmseperator' ); ?>"><?php _e( 'Meta Seperator', 'ultimatum' ) ?> </label> <input name="<?php echo $this->get_field_name( 'mmseperator' ); ?>" id="<?php echo $this->get_field_id( 'mmseperator' ); ?>" value="<?php echo $mmseperator; ?>"/> </p> <p> <label for="<?php echo $this->get_field_id( 'mdate' ); ?>"><?php _e( 'Date', 'ultimatum' ) ?></label> <select name="<?php echo $this->get_field_name( 'mdate' ); ?>" id="<?php echo $this->get_field_id( 'mdate' ); ?>"> <option value="true" <?php selected( $mdate, 'true' ); ?>>ON</option> <option value="false" <?php selected( $mdate, 'false' ); ?>>OFF</option> </select> <?php ultimatum_custcontent_inpcheckbox( 'mshowtime', $mshowtime, 'Show time', $this ); ?> <label for="<?php echo $this->get_field_id( 'mauthor' ); ?>"><?php _e( 'Author', 'ultimatum' ) ?> </label> <select name="<?php echo $this->get_field_name( 'mauthor' ); ?>" id="<?php echo $this->get_field_id( 'mauthor' ); ?>"> <option value="true" <?php selected( $mauthor, 'true' ); ?>>ON</option> <option value="false" <?php selected( $mauthor, 'false' ); ?>>OFF</option> </select> <label for="<?php echo $this->get_field_id( 'mcomments' ); ?>"><?php _e( 'Comments', 'ultimatum' ) ?> </label> <select name="<?php echo $this->get_field_name( 'mcomments' ); ?>" id="<?php echo $this->get_field_id( 'mcomments' ); ?>"> <option value="true" <?php selected( $mcomments, 'true' ); ?>>ON</option> <option value="false" <?php selected( $mcomments, 'false' ); ?>>OFF</option> </select> </p> </fieldset> <p> <label for="<?php echo $this->get_field_id( 'mreadmore' ); ?>"><?php _e( 'Read More Link', 'ultimatum' ) ?> </label> <select class="widefat" name="<?php echo $this->get_field_name( 'mreadmore' ); ?>" id="<?php echo $this->get_field_id( 'mreadmore' ); ?>"> <option value="right" <?php selected( $mreadmore, 'right' ); ?>><?php _e( 'Right Aligned', 'ultimatum' ) ?></option> <option value="left" <?php selected( $mreadmore, 'left' ); ?>><?php _e( 'Left Aligned', 'ultimatum' ) ?></option> <option value="false" <?php selected( $mreadmore, 'false' ); ?>>OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id( 'rmtext' ); ?>"><?php _e( 'Read More Text', 'ultimatum' ) ?></label> <select class="widefat" name="<?php echo $this->get_field_name( 'rmtext' ); ?>" id="<?php echo $this->get_field_id( 'rmtext' ); ?>"> <option value="Read More" <?php selected( $rmtext, 'Read More' ); ?>><?php _e( 'Read More', 'ultimatum' ) ?></option> <option value="More" <?php selected( $rmtext, 'More' ); ?>><?php _e( 'More', 'ultimatum' ) ?></option> <option value="Continue Reading" <?php selected( $rmtext, 'Continue Reading' ); ?>><?php _e( 'Continue Reading', 'ultimatum' ) ?></option> <option value="Continue" <?php selected( $rmtext, 'Continue' ); ?>><?php _e( 'Continue', 'ultimatum' ) ?></option> <option value="Details" <?php selected( $rmtext, 'Details' ); ?>><?php _e( 'Details', 'ultimatum' ) ?></option> </select> </p> <?php }
function form($instance) { $source = isset($instance['source']) ? $instance['source'] : 'post'; $single = isset($instance['single']) ? $instance['single'] : 'fimage'; $title = isset($instance['title']) ? $instance['title'] : 'true'; $excerpt = isset($instance['excerpt']) ? $instance['excerpt'] : 'true'; $singlew = isset($instance['singlew']) ? $instance['singlew'] : '220'; $singleh = isset($instance['singleh']) ? $instance['singleh'] : '220'; $meta = isset($instance['meta']) ? $instance['meta'] : 'aimage'; $mseperator = isset($instance['mseperator']) ? $instance['mseperator'] : '|'; $date = isset($instance['date']) ? $instance['date'] : 'true'; $author = isset($instance['author']) ? $instance['author'] : 'false'; $comments = isset($instance['comments']) ? $instance['comments'] : 'true'; $cats = isset($instance['cats']) ? $instance['cats'] : 'false'; $gallery = isset($instance['gallery']) ? $instance['gallery'] : 'false'; $thumbs = isset($instance['thumbs']) ? $instance['thumbs'] : '3'; $nivo_effect = isset($instance['nivo_effect']) ? $instance['nivo_effect'] : 'random'; $nivo_segments = isset($instance['nivo_segments']) ? $instance['nivo_segments'] : '10'; $nivo_animspeed = isset($instance['nivo_animspeed']) ? $instance['nivo_animspeed'] : '700'; $nivo_pausetime = isset($instance['nivo_pausetime']) ? $instance['nivo_pausetime'] : '4000'; $nivo_nav = isset($instance['nivo_nav']) ? $instance['nivo_nav'] : ''; $nivo_navhover = isset($instance['nivo_navhover']) ? $instance['nivo_navhover'] : ''; $nivo_controls = isset($instance['nivo_controls']) ? $instance['nivo_controls'] : ''; $nivo_pausehover = isset($instance['nivo_pausehover']) ? $instance['nivo_pausehover'] : ''; $nivo_captions = isset($instance['nivo_captions']) ? $instance['nivo_captions'] : ''; $nivo_captionsopacity = isset($instance['nivo_captionsopacity']) ? $instance['nivo_captionsopacity'] : '0.5'; $nivo_color = isset($instance['nivo_color']) ? $instance['nivo_color'] : 'grey'; $mtitle = isset($instance['mtitle']) ? $instance['mtitle'] : 'true'; $mimgpos = isset($instance['mimgpos']) ? $instance['mimgpos'] : 'btitle'; $mvideo = isset($instance['mvideo']) ? $instance['mvideo'] : 'false'; $perpage = isset($instance['perpage']) ? $instance['perpage'] : '10'; $multiple = isset($instance['multiple']) ? $instance['multiple'] : '1coli'; $multiplew = isset($instance['multiplew']) ? $instance['multiplew'] : '220'; $multipleh = isset($instance['multipleh']) ? $instance['multipleh'] : '220'; $excerptlength = isset($instance['excerptlength']) ? $instance['excerptlength'] : '100'; $mmeta = isset($instance['mmeta']) ? $instance['mmeta'] : 'aimage'; $mmargin = isset($instance['mmargin']) ? $instance['mmargin'] : '30'; $mdate = isset($instance['mdate']) ? $instance['mdate'] : 'true'; $mauthor = isset($instance['mauthor']) ? $instance['mauthor'] : 'false'; $mcomments = isset($instance['mcomments']) ? $instance['mcomments'] : 'true'; $mcats = isset($instance['mcats']) ? $instance['mcats'] : 'false'; $mreadmore = isset($instance['mreadmore']) ? $instance['mreadmore'] : 'right'; $mmseperator = isset($instance['mmseperator']) ? $instance['mmseperator'] : '|'; $rmtext = isset($instance['rmtext']) ? $instance['rmtext'] : 'Read More'; $noimage = isset($instance['noimage']) ? $instance['noimage'] : 'true'; $mnoimage = isset($instance['mnoimage']) ? $instance['mnoimage'] : 'true'; $mshowtime = isset($instance['mshowtime']) ? $instance['mshowtime'] : ''; $looporder1 = isset($instance['looporder1']) ? $instance['looporder1'] : ''; $looporder2 = isset($instance['looporder2']) ? $instance['looporder2'] : ''; $orderdir = isset($instance['orderdir']) ? $instance['orderdir'] : 'DESC'; $skip = isset($instance['skip']) ? $instance['skip'] : ''; global $wpdb; $termstable = $wpdb->prefix . 'ultimatum_tax'; ?> <p> <label for="<?php echo $this->get_field_id('source'); ?> "><?php _e('Select Content Source', THEME_ADMIN_LANG); ?> </label> <select name="<?php echo $this->get_field_name('source'); ?> " id="<?php echo $this->get_field_id('source'); ?> " > <optgroup label="Post Type"> <?php $args = array('public' => true, 'publicly_queryable' => true); $post_types = get_post_types($args, 'names'); foreach ($post_types as $post_type) { if ($post_type != 'attachment') { echo '<option value="ptype-' . $post_type . '" ' . selected($source, 'ptype-' . $post_type, false) . '>' . $post_type . '</option>'; } } ?> </optgroup> <?php $entries = get_categories('title_li=&orderby=name&hide_empty=0'); if (count($entries) >= 1) { echo '<optgroup label="Categories(Post)">'; foreach ($entries as $key => $entry) { echo '<option value="cat-' . $entry->term_id . '" ' . selected($source, 'cat-' . $entry->term_id, false) . '>' . $entry->name . '</option>'; } echo '</optgroup>'; } ?> <?php $termsql = "SELECT * FROM {$termstable}"; $termresult = $wpdb->get_results($termsql, ARRAY_A); foreach ($termresult as $term) { $properties = unserialize($term[properties]); echo '<optgroup label="' . $properties[label] . '(' . $term[pname] . ')">'; $entries = get_terms($properties[name], 'orderby=name&hide_empty=0'); foreach ($entries as $key => $entry) { $optiont = 'taxonomy-' . $term[pname] . '|' . $properties[name] . '|' . $entry->slug; echo '<option value="' . $optiont . '" ' . selected($source, $optiont, false) . '>' . $entry->name . '</option>'; } echo '</optgroup>'; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('mtitle'); ?> "><?php _e('Title', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mtitle'); ?> " id="<?php echo $this->get_field_id('mtitle'); ?> "> <option value="true" <?php selected($mtitle, 'true'); ?> >ON</option> <option value="false" <?php selected($mtitle, 'false'); ?> >OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('perpage'); ?> "><?php _e('Items Per Page', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <input type="text" value="<?php echo $perpage; ?> " name="<?php echo $this->get_field_name('perpage'); ?> " id="<?php echo $this->get_field_id('perpage'); ?> " /> </p> <p> <label for="<?php echo $this->get_field_id('looporder1'); ?> "><?php _e('Loop Order first', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('looporder1'); ?> " id="<?php echo $this->get_field_id('looporder1'); ?> "> <option value='' <?php selected($looporder1, ''); ?> ><?php _e('None', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='ID' <?php selected($looporder1, 'ID'); ?> ><?php _e('ID', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='author' <?php selected($looporder1, 'author'); ?> ><?php _e('author', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='title' <?php selected($looporder1, 'title'); ?> ><?php _e('title', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='name' <?php selected($looporder1, 'name'); ?> ><?php _e('name', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='date' <?php selected($looporder1, 'date'); ?> ><?php _e('date {default}', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='modified' <?php selected($looporder1, 'modified'); ?> ><?php _e('modified', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='parent' <?php selected($looporder1, 'parent'); ?> ><?php _e('parent', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='rand' <?php selected($looporder1, 'rand'); ?> ><?php _e('rand', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='comment_count' <?php selected($looporder1, 'comment_count'); ?> ><?php _e('comment_count', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='menu_order' <?php selected($looporder1, 'menu_order'); ?> ><?php _e('menu_order', THEME_ADMIN_LANG_DOMAIN); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('looporder2'); ?> "><?php _e('Loop Order second', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('looporder2'); ?> " id="<?php echo $this->get_field_id('looporder2'); ?> "> <option value='' <?php selected($looporder2, ''); ?> ><?php _e('None', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='ID' <?php selected($looporder2, 'ID'); ?> ><?php _e('ID', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='author' <?php selected($looporder2, 'author'); ?> ><?php _e('author', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='title' <?php selected($looporder2, 'title'); ?> ><?php _e('title', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='name' <?php selected($looporder2, 'name'); ?> ><?php _e('name', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='date' <?php selected($looporder2, 'date'); ?> ><?php _e('date {default}', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='modified' <?php selected($looporder2, 'modified'); ?> ><?php _e('modified', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='parent' <?php selected($looporder2, 'parent'); ?> ><?php _e('parent', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='rand' <?php selected($looporder2, 'rand'); ?> ><?php _e('rand', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='comment_count' <?php selected($looporder2, 'comment_count'); ?> ><?php _e('comment_count', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='menu_order' <?php selected($looporder2, 'menu_order'); ?> ><?php _e('menu_order', THEME_ADMIN_LANG_DOMAIN); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('orderdir'); ?> "><?php _e('Order Direction', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('orderdir'); ?> " id="<?php echo $this->get_field_id('orderdir'); ?> "> <option value='DESC' <?php selected($orderdir, 'DESC'); ?> ><?php _e('Descending', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value='ASC' <?php selected($orderdir, 'ASC'); ?> ><?php _e('Ascending', THEME_ADMIN_LANG_DOMAIN); ?> </option> </select> </p> <?php ultimatum_custcontent_inptext('skip', $skip, 'Skip first', $this, '3'); ?> Posts... <p> <label for="<?php echo $this->get_field_id('multiple'); ?> "><?php _e('Layout When Page has Multiple Posts', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('multiple'); ?> " id="<?php echo $this->get_field_id('multiple'); ?> "> <option value="1-col-i" <?php selected($multiple, '1-col-i'); ?> ><?php _e('One Column With Full Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="1-col-li" <?php selected($multiple, '1-col-li'); ?> ><?php _e('One Column With Image On Left', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="1-col-ri" <?php selected($multiple, '1-col-ri'); ?> ><?php _e('One Column With Image On Right', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="1-col-gl" <?php selected($multiple, '1-col-gl'); ?> ><?php _e('One Column Gallery With Image On Left', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="1-col-gr" <?php selected($multiple, '1-col-gr'); ?> ><?php _e('One Column Gallery With Image On Right', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="1-col-n" <?php selected($multiple, '1-col-n'); ?> ><?php _e('One Column With No Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="2-col-i" <?php selected($multiple, '2-col-i'); ?> ><?php _e('Two Columns With Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="2-col-g" <?php selected($multiple, '2-col-g'); ?> ><?php _e('Two Columns Gallery', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="2-col-n" <?php selected($multiple, '2-col-n'); ?> ><?php _e('Two Columns With No Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="3-col-i" <?php selected($multiple, '3-col-i'); ?> ><?php _e('Three Columns With Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="3-col-g" <?php selected($multiple, '3-col-g'); ?> ><?php _e('Three Columns Gallery', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="3-col-n" <?php selected($multiple, '3-col-n'); ?> ><?php _e('Three Columns With No Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="4-col-i" <?php selected($multiple, '4-col-i'); ?> ><?php _e('Four Columns With Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="4-col-g" <?php selected($multiple, '4-col-g'); ?> ><?php _e('Four Columns Gallery', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="4-col-n" <?php selected($multiple, '4-col-n'); ?> ><?php _e('Four Columns With No Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('mnoimage'); ?> "><?php _e('No Image', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mnoimage'); ?> " id="<?php echo $this->get_field_id('mnoimage'); ?> "> <option value="true" <?php selected($mnoimage, 'true'); ?> >Show Placeholder</option> <option value="false" <?php selected($mnoimage, 'false'); ?> >OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('mmargin'); ?> "><?php _e('Margin', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <i>For columns 2 or 2+</i> <input type="text" name="<?php echo $this->get_field_name('mmargin'); ?> " id="<?php echo $this->get_field_id('mmargin'); ?> " value="<?php echo $mmargin; ?> " /> </p> <p> <label for="<?php echo $this->get_field_id('mimgpos'); ?> "><?php _e('Image Position', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <i>For Full image and columns 2 or 2+</i> <select name="<?php echo $this->get_field_name('mimgpos'); ?> " id="<?php echo $this->get_field_id('mimgpos'); ?> "> <option value="atitle" <?php selected($mimgpos, 'atitle'); ?> ><?php _e('After Title', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="btitle" <?php selected($mimgpos, 'btitle'); ?> ><?php _e('Before Title', THEME_ADMIN_LANG_DOMAIN); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('mvideo'); ?> "><?php _e('Video', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <i>Works for non Gallery views only</i> <select name="<?php echo $this->get_field_name('mvideo'); ?> " id="<?php echo $this->get_field_id('mvideo'); ?> "> <option value="atitle" <?php selected($mvideo, 'atitle'); ?> ><?php _e('After Title', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="aimage" <?php selected($mvideo, 'aimage'); ?> ><?php _e('After Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="replace" <?php selected($mvideo, 'replace'); ?> ><?php _e('Replace Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="false" <?php selected($mvideo, 'false'); ?> >OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('excerpt'); ?> "><?php _e('Show Content As', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('excerpt'); ?> " id="<?php echo $this->get_field_id('excerpt'); ?> "> <option value="true" <?php selected($excerpt, 'true'); ?> >Excerpt</option> <option value="content" <?php selected($excerpt, 'content'); ?> >Content</option> <option value="false" <?php selected($excerpt, 'false'); ?> >OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('excerptlength'); ?> "><?php _e('Excerpt Length(chars)', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <input type="text" value="<?php echo $excerptlength; ?> " name="<?php echo $this->get_field_name('excerptlength'); ?> " id="<?php echo $this->get_field_id('excerptlength'); ?> " /> </p> <p> <label for="<?php echo $this->get_field_id('multiplew'); ?> "><?php _e('Image Width', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <input type="text" value="<?php echo $multiplew; ?> " name="<?php echo $this->get_field_name('multiplew'); ?> " id="<?php echo $this->get_field_id('multiplew'); ?> " /><i>Applied on Image on Left/Right Aligned pages</i> </p> <p> <label for="<?php echo $this->get_field_id('multipleh'); ?> "><?php _e('Image Height', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <input type="text" value="<?php echo $multipleh; ?> " name="<?php echo $this->get_field_name('multipleh'); ?> " id="<?php echo $this->get_field_id('multipleh'); ?> " /> </p> <p> <label for="<?php echo $this->get_field_id('mcats'); ?> "><?php _e('Taxonomy', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mcats'); ?> " id="<?php echo $this->get_field_id('mcats'); ?> "> <option value="ameta" <?php selected($mcats, 'ameta'); ?> ><?php _e('After Meta', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="acontent" <?php selected($mcats, 'acontent'); ?> ><?php _e('After Content', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="false" <?php selected($mcats, 'false'); ?> >OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('mmeta'); ?> "><?php _e('Meta', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mmeta'); ?> " id="<?php echo $this->get_field_id('mmeta'); ?> "> <option value="atitle" <?php selected($mmeta, 'atitle'); ?> ><?php _e('After Title', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="aimage" <?php selected($mmeta, 'aimage'); ?> ><?php _e('After Image', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="atext" <?php selected($mmeta, 'atext'); ?> ><?php _e('After Content', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="false" <?php selected($mmeta, 'false'); ?> >OFF</option> </select> </p> <fieldset><legend>Multi Post Meta Properties</legend> <p> <label for="<?php echo $this->get_field_id('mmseperator'); ?> "><?php _e('Meta Seperator', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <input name="<?php echo $this->get_field_name('mmseperator'); ?> " id="<?php echo $this->get_field_id('mmseperator'); ?> " value="<?php echo $mmseperator; ?> " /> </p> <p> <label for="<?php echo $this->get_field_id('mdate'); ?> "><?php _e('Date', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mdate'); ?> " id="<?php echo $this->get_field_id('mdate'); ?> "> <option value="true" <?php selected($mdate, 'true'); ?> >ON</option> <option value="false" <?php selected($mdate, 'false'); ?> >OFF</option> </select> <?php ultimatum_custcontent_inpcheckbox('mshowtime', $mshowtime, 'Show time', $this); ?> <label for="<?php echo $this->get_field_id('mauthor'); ?> "><?php _e('Author', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mauthor'); ?> " id="<?php echo $this->get_field_id('mauthor'); ?> "> <option value="true" <?php selected($mauthor, 'true'); ?> >ON</option> <option value="false" <?php selected($mauthor, 'false'); ?> >OFF</option> </select> <label for="<?php echo $this->get_field_id('mcomments'); ?> "><?php _e('Comments', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mcomments'); ?> " id="<?php echo $this->get_field_id('mcomments'); ?> "> <option value="true" <?php selected($mcomments, 'true'); ?> >ON</option> <option value="false" <?php selected($mcomments, 'false'); ?> >OFF</option> </select> </p></fieldset> <p> <label for="<?php echo $this->get_field_id('mreadmore'); ?> "><?php _e('Read More Link', THEME_ADMIN_LANG_DOMAIN); ?> :</label> <select name="<?php echo $this->get_field_name('mreadmore'); ?> " id="<?php echo $this->get_field_id('mreadmore'); ?> "> <option value="right" <?php selected($mreadmore, 'right'); ?> ><?php _e('Right Aligned', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="left" <?php selected($mreadmore, 'left'); ?> ><?php _e('Left Aligned', THEME_ADMIN_LANG_DOMAIN); ?> </option> <option value="false" <?php selected($mreadmore, 'false'); ?> >OFF</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('rmtext'); ?> "><?php _e('Read More Text:', THEME_ADMIN_LANG_DOMAIN); ?> </label> <select name="<?php echo $this->get_field_name('rmtext'); ?> " id="<?php echo $this->get_field_id('rmtext'); ?> "> <option value="Read More" <?php selected($rmtext, 'Read More'); ?> ><?php _e('Read More', THEME_LANG_DOMAIN); ?> </option> <option value="More" <?php selected($rmtext, 'More'); ?> ><?php _e('More', THEME_LANG_DOMAIN); ?> </option> <option value="Continue Reading" <?php selected($rmtext, 'Continue Reading'); ?> ><?php _e('Continue Reading', THEME_LANG_DOMAIN); ?> </option> <option value="Continue" <?php selected($rmtext, 'Continue'); ?> ><?php _e('Continue', THEME_LANG_DOMAIN); ?> </option> <option value="Details" <?php selected($rmtext, 'Details'); ?> ><?php _e('Details', THEME_LANG_DOMAIN); ?> </option> </select> </p> <?php }