. */ //tell wordpress to register the children-excerpt shortcode add_shortcode("iom_show_childpages_actie", "iom_show_childpage_actie"); //children excerpt shortcode worker function function iom_show_childpage_actie($atts, $content = null){ if($atts['length'] > 0 ){ //maybe set a minimum length here } else { $atts['length'] = 50; } //get the id of the current article that is calling the shortcode $parent_id = get_the_ID(); $frontpage_id = get_option('page_on_front'); $output = ""; $i = 0; $j = 0; $width_of_box = '459px;'; $width_of_text = '250px;'; if ( $children = get_children(array( 'post_parent' => $parent_id, 'post_type' => 'page', 'post_status'=> 'publish', 'order' => 'ASC', 'orderby' => 'menu_order'))) { foreach( $children as $child ) { $showparent = get_post_meta( $child->ID, 'show_parent', true); if ($showparent !== "1") { $j++; } } foreach( $children as $child ) { $i++; $title = $child->post_title; $menu_order = $child->menu_order; $link = get_permalink($child->ID); $extraimage = get_post_meta( $child->ID, 'bannerafbeelding', true); $child_image = wp_get_attachment_image_src( $extraimage , 'thumbnail' ); $showparent = get_post_meta( $child->ID, 'show_parent', true); $actievan = get_post_meta( $child->ID, 'van_prijs', true); $actievoor = get_post_meta( $child->ID, 'voor_prijs', true); $actieslogan = get_post_meta( $child->ID, 'slogan', true); $number = count($children); $defaultimage = get_post_meta( $frontpage_id, 'bannerafbeelding', true); $default_image = wp_get_attachment_image_src( $defaultimage , 'thumbnail' ); if ($child_image == "") { $child_image = $default_image; } if (!empty($actievan)) { $pos = strpos($actievan,','); if($pos === false) { $actievan = $actievan.',-'; } else { } } if (!empty($actievoor)) { $pos = strpos($actievoor,','); if($pos === false) { $actievoor = $actievoor.',-'; } else { } } if (!empty($actievan) && !empty($actievoor)){ $actie = "
Van € $actievan nu voor € $actievoor
"; } else { $actie = ""; } if (!empty($actieslogan)){ $actie_slogan = "
$actieslogan
"; } else { $actie_slogan = ""; } if (!empty($child_image)){ $image = "
$actie_slogan
"; } else { $image =""; } if ($showparent == "1") { $i = $i - 1; } if ($showparent != "1") { $child_excerpt = strip_tags(apply_filters('the_content', $child->post_content)); //split excerpt into array for processing $words = explode(' ', $child_excerpt); //chop off the excerpt based on the atts->lenth if ( $i&1 && $i == $j) { $atts['length'] = 100; } $words = array_slice($words, 0, $atts['length']); //merge the array of words for the excerpt back into sentances $child_excerpt = implode(' ', $words); if ($i&1) { $add_margin = '18px;'; } else { $add_margin = '0px;'; } if ( $i&1 && $i == $j) { $width_of_box = '948px;'; $add_margin = 'margin-left: 0px;'; $width_of_text='750px;'; } $output .= "
$image
$title
$child_excerpt $actie
"; } } } return $output; } ?> . */ //tell wordpress to register the children-excerpt shortcode add_shortcode("iom_show_childpages", "iom_show_childpage"); //children excerpt shortcode worker function function iom_show_childpage($atts, $content = null){ if($atts['length'] > 0 ){ //maybe set a minimum length here } else { $atts['length'] = 50; } //get the id of the current article that is calling the shortcode $parent_id = get_the_ID(); $frontpage_id = get_option('page_on_front'); $output = ""; $i = 0; $j = 0; $width_of_box = '370px;'; if ( $children = get_children(array( 'post_parent' => $parent_id, 'post_type' => 'page', 'post_status'=> 'publish', 'order' => 'ASC', 'orderby' => 'menu_order'))) { foreach( $children as $child ) { $showparent = get_post_meta( $child->ID, 'show_parent', true); if ($showparent !== "1") { $j++; } } foreach( $children as $child ) { $i++; $title = $child->post_title; $menu_order = $child->menu_order; $link = get_permalink($child->ID); $extraimage = get_post_meta( $child->ID, 'bannerafbeelding', true); $showparent = get_post_meta( $child->ID, 'show_parent', true); $child_image = wp_get_attachment_image_src( $extraimage , 'thumbnail' ); $defaultimage = get_post_meta( $frontpage_id, 'bannerafbeelding', true); $banner_breed = get_post_meta( $frontpage_id, 'banner_breed', true); $default_image = wp_get_attachment_image_src( $defaultimage , 'thumbnail' ); /* $child_image = wp_get_attachment_image_src( get_post_thumbnail_id( $child->ID ), 'thumbnail' ); */ $plaats = get_post_meta( $child->ID, 'laat_zien_op_parent', true); $number = count($children); if ($showparent == "1") { $output .= ""; $i = $i - 1; } else { if (!empty($child_image)){ $image = "
"; } else { $image ="
"; } $child_excerpt = strip_tags(apply_filters('the_excerpt', $child->post_content)); //split excerpt into array for processing $words = explode(' ', $child_excerpt); //chop off the excerpt based on the atts->lenth if ( $i&1 && $i == $j && $banner_breed == 1 ) { $atts['length'] = 25; } $words = array_slice($words, 0, $atts['length']); //merge the array of words for the excerpt back into sentances $child_excerpt = implode(' ', $words); if ($i&1) { $add_margin = '20px;'; } else { $add_margin = '0px;'; } if ( $i&1 && $i == $j && $banner_breed == 1) { $width_of_box = '772px;'; $add_margin = 'margin-left: 0px;'; } $output .= "
$image
$title
$child_excerpt
"; } } } return $output; } ?> 'merken', 'post_status'=> 'publish', 'order' => 'ASC', 'orderby' => 'title'))) $marq_count = count($children); if ($marq_count < 8) { $tick_id = "webticker_not_ticking"; $tick_id_2 = "
"; $tick_id_3 = "
"; } else { $tick_id = "webticker"; } { if ($marq_count == 0) {} else { echo "$tick_id_2$tick_id_3"; } //iom_marquee_grayscale_jquery(); } echo ""; } // Script voor het laten zien van een marquee op een individuele pagina. Alleen gekoppelde merkenlogo's worden getoond function iom_marquee_page($thispost){ iom_marquee_scripts(); iom_marquee_layout("1000"); iom_marquee_webticker_jquery(); iom_marquee_topdiv(); $marquees = explode(",",get_post_meta( $thispost, 'in_collectie', true)); $marq_count = count($marquees); if ($marq_count < 8) { $tick_id = "webticker_not_ticking"; $tick_id_2 = "
"; $tick_id_3 = "
"; } else { $tick_id = "webticker"; } echo "$tick_id_2$tick_id_3"; //iom_marquee_grayscale_jquery(); echo ""; } // Script voor het laten zien van een marquee op een individuele pagina. Laat alleen de merkenlogo's van de childpages zien function iom_marquee_children($thispost){ iom_marquee_scripts(); iom_marquee_layout("1000"); iom_marquee_webticker_jquery(); iom_marquee_topdiv(); $pages = get_pages("child_of=$thispost"); foreach($pages as $child) { $marquees = get_post_meta( $child->ID, 'in_collectie', true); if ($marquees != "") { $marq .= $marquees; $marq .= ","; } } echo "
Merken in deze collectie:
"; $marq_array = array_unique(explode(",",$marq)); $marq_count = count($marq_array); if ($marq_count < 9) { $tick_id = "webticker_not_ticking"; $tick_id_2 = "
"; $tick_id_3 = "
"; } else { $tick_id = "webticker"; } echo "$tick_id_2$tick_id_3"; //iom_marquee_grayscale_jquery(); echo ""; } // Script voor het laten zien van een marquee op een individuele pagina. Laat zowel de gekoppelde als de merkenlogos van de childpages zien. function iom_marquee_combi($thispost){ iom_marquee_scripts(); iom_marquee_layout("1000"); iom_marquee_webticker_jquery(); iom_marquee_topdiv(); $marq_this = get_post_meta( $thispost, 'in_collectie', true); $marq .= $marq_this.","; $pages = get_pages("child_of=$thispost"); foreach($pages as $child) { $marquees = get_post_meta( $child->ID, 'in_collectie', true); if ($marquees != "") { $marq .= $marquees; $marq .= ","; } } echo "
Merken in deze collectie:
"; $marq_array = array_unique(explode(",",$marq)); $marq_count = count($marq_array); if ($marq_count < 9) { $tick_id = "webticker_not_ticking"; $tick_id_2 = "
"; $tick_id_3 = "
"; } else { $tick_id = "webticker"; } echo "$tick_id_2$tick_id_3"; //iom_marquee_grayscale_jquery(); echo ""; } // Script voor het laten zien van overzicht van merken in een collectie, in tegelvorm function iom_marquee_tegel($thispost){ iom_marquee_scripts(); $marq_this = get_post_meta( $thispost, 'in_collectie', true); $marq .= $marq_this.","; $pages = get_pages("child_of=$thispost"); foreach($pages as $child) { $marquees = get_post_meta( $child->ID, 'in_collectie', true); if ($marquees != "") { $marq .= $marquees; $marq .= ","; } } $marq_array = array_unique(explode(",",$marq)); $marq_count = count($marq_array); foreach( $marq_array as $merk ) { $link = get_permalink($merk); $logoimage = get_post_meta( $merk, 'merk_logo', true); $logo_image = wp_get_attachment_image_src( $logoimage , 'full' ); if (!empty($logo_image) && get_post_status( $merk ) == "publish") { echo "
"; } } //iom_marquee_grayscale_jquery(); } //=================================== Helper functies ================================== function iom_marquee_scripts() { wp_enqueue_script('iommarquee', WP_PLUGIN_URL . '/iom_marquee/js/jquery.webticker.js'); wp_enqueue_style('iommarquee.style', WP_PLUGIN_URL . '/iom_marquee/css/webticker.css'); } function iom_marquee_layout( $tickcontainer ){ $overlay_left = WP_PLUGIN_URL . '/iom_marquee/image/left.png'; $overlay_right = WP_PLUGIN_URL . '/iom_marquee/image/right.png'; echo " "; } function iom_marquee_webticker_jquery() { echo ' '; } function iom_marquee_topdiv() { echo "
"; } function iom_marquee_grayscale_jquery() { wp_enqueue_script('iomgreyscale', WP_PLUGIN_URL . '/iom_marquee/js/greyScale.js'); echo " "; } //=================================== Einde helper functies ================================== //=================================== Admin scherm ================================== function iom_marquee_admin() { if (function_exists('add_options_page')) { add_options_page('IOM Marquee Options', 'IOM Marquee Options', 8, 'iom_marquee_op', 'iom_marquee_op'); } } function iom_marquee_op() { if (isset($_POST['info_updatew'])) { $msg_desc = ""; // Field 1 if (empty($_POST['iom_field_1'])) { $iom_field_1 = ''; delete_option('iom_field_1'); } else { $iom_field_1 = $_POST['iom_field_1']; update_option('iom_field_1', $iom_field_1); } if (empty($_POST['iom_marquee_2'])) { $iom_field_1 = ''; delete_option('iom_marquee_2'); } else { $iom_marquee_2 = $_POST['iom_marquee_2']; $iom_marquee_checked = "Checked"; update_option('iom_marquee_2', $iom_marquee_2); } if (empty($_POST['iom_field_2'])) { $iom_field_2 = ''; delete_option('iom_field_2'); } else { $iom_field_2 = $_POST['iom_field_2']; $iom_field_2_content = get_the_title($iom_field_2); update_option('iom_field_2', $iom_field_2); } if ($msg_desc != '') { echo '

' . $msg_desc . '

'; } else { echo '

Your settings have been saved.

'; } } else { $iom_field_1 = get_option('iom_field_1'); $iom_field_2 = get_option('iom_field_2'); $iom_marquee_2 = get_option('iom_marquee_2'); if ($iom_marquee_2 == "Marquee") { $iom_marquee_checked = "Checked"; } $iom_field_2_content = get_the_title($iom_field_2); } echo '
'; echo '

IOM Marquee

'; echo '

Op deze pagina kan de merken-module worden aan/uit gezet. Alleen zichtbaar voor super-admin

'; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo ' Activeren '; echo '
'; echo '
'; echo '

'; echo '

Info: This plugin stores the options in the WordPress database. By leaving the above fields empty and hitting the "Update Options"'; echo ' button, the options are removed from the WordPress database. Although it is not necessary, you should consider doing this before uninstalling the plugin, so no trace is left behind.

'; echo '
'; echo '
'; echo '