'
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); function LimitText($Text,$Min,$Max,$MinAddChar) { if (strlen($Text) < $Min) { $Limit = $Min-strlen($Text); $Text .= $MinAddChar; } elseif (strlen($Text) >= $Max) { $words = explode(" ", $Text); $check=1; while (strlen($Text) >= $Max) { $c=count($words)-$check; $Text=substr($Text,0,(strlen($words[$c])+1)*(-1)); $check++; } } return $Text; } function bdw_get_images($postID,$imgwidth,$imgheight) { // Get the post ID $iPostID = $postID; // Get images for this post $arrImages =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $iPostID ); // If images exist for this page if($arrImages) { // Get array keys representing attached image numbers $arrKeys = array_keys($arrImages); /******BEGIN BUBBLE SORT BY MENU ORDER************ // Put all image objects into new array with standard numeric keys (new array only needed while we sort the keys) foreach($arrImages as $oImage) { $arrNewImages[] = $oImage; } // Bubble sort image object array by menu_order TODO: Turn this into std "sort-by" function in functions.php for($i = 0; $i < sizeof($arrNewImages) - 1; $i++) { for($j = 0; $j < sizeof($arrNewImages) - 1; $j++) { if((int)$arrNewImages[$j]->menu_order > (int)$arrNewImages[$j + 1]->menu_order) { $oTemp = $arrNewImages[$j]; $arrNewImages[$j] = $arrNewImages[$j + 1]; $arrNewImages[$j + 1] = $oTemp; } } } // Reset arrKeys array $arrKeys = array(); // Replace arrKeys with newly sorted object ids foreach($arrNewImages as $oNewImage) { $arrKeys[] = $oNewImage->ID; } ******END BUBBLE SORT BY MENU ORDER**************/ // Get the first image attachment $iNum = $arrKeys[0]; // Get the thumbnail url for the attachment $sThumbUrl = wp_get_attachment_thumb_url($iNum); // UNCOMMENT THIS IF YOU WANT THE FULL SIZE IMAGE INSTEAD OF THE THUMBNAIL //$sImageUrl = wp_get_attachment_url($iNum); // Build the string $sImgString = '' . '' . get_the_title($iPostID) . '' . ''; // Print the image echo $sImgString; } } function get_image_for_crop($postID) { // Get the post ID $iPostID = $postID; // Get images for this post $arrImages =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $iPostID ); // If images exist for this page if($arrImages) { // Get array keys representing attached image numbers $arrKeys = array_keys($arrImages); /******BEGIN BUBBLE SORT BY MENU ORDER************ // Put all image objects into new array with standard numeric keys (new array only needed while we sort the keys) foreach($arrImages as $oImage) { $arrNewImages[] = $oImage; } // Bubble sort image object array by menu_order TODO: Turn this into std "sort-by" function in functions.php for($i = 0; $i < sizeof($arrNewImages) - 1; $i++) { for($j = 0; $j < sizeof($arrNewImages) - 1; $j++) { if((int)$arrNewImages[$j]->menu_order > (int)$arrNewImages[$j + 1]->menu_order) { $oTemp = $arrNewImages[$j]; $arrNewImages[$j] = $arrNewImages[$j + 1]; $arrNewImages[$j + 1] = $oTemp; } } } // Reset arrKeys array $arrKeys = array(); // Replace arrKeys with newly sorted object ids foreach($arrNewImages as $oNewImage) { $arrKeys[] = $oNewImage->ID; } ******END BUBBLE SORT BY MENU ORDER**************/ // Get the first image attachment $iNum = $arrKeys[0]; $sImageUrl = wp_get_attachment_url($iNum); return $sImageUrl; } } // Handle Theme Options // VARIABLES $this_theme = "Saturday 658"; $themeoptionsprefix = "6609"; $options = array(); $arrnumposts=array('4','5','6','7','8','9','10'); $numfeaturedarr=array('3','4','5','6','7','8','9','10'); $styleschemeoptions=get_style_scheme_options(); $thecatlist_A = get_categories('hide_empty=0'); $catdlist = array(); foreach ($thecatlist_A as $catforlist) { $catdlist[$catforlist->cat_ID] = $catforlist->cat_name; } $categories_tmp = array_unshift($catdlist, "Select a category:"); $pathtothemetemplate = get_bloginfo('template_directory'); $menuico6609=TEMPLATEPATH . '/images/6609ico.png'; $options = array ( array("optionname" => "General Settings", "optiontype" => "heading"), array("optionname" => "Site Logo", "optiondescription" => "

You can replace the text title with a logo by entering the logo URL here Note:include http://

", "optionid" => $themeoptionsprefix."_sitelogo", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Style scheme to use", "optiondescription" => "

You can change betweeen style schemes by selecting the scheme of choice.

", "optionid" => $themeoptionsprefix."_stylescheme", "selectoptiondef" => "Select a scheme:", "optiontype" => "select", "options" => $styleschemeoptions), array("optionname" => "Site Tracking Code Example: Google Analytics", "optiondescription" => "

Using Goolge Analytics? You can enter your code below.

", "optionid" => $themeoptionsprefix."_sitetrackingcode", "selectoptiondef" => "", "optiontype" => "textarea"), array("optionname" => "Header Banner", "optiondescription" => "

You can display a banner in the header of your page to the far right of your title/logo by entering the complete banner code

", "optionid" => $themeoptionsprefix."_bannerad", "selectoptiondef" => "", "optiontype" => "textarea"), array("optionname" => "Sidebar Ad Code", "optiondescription" => "

You can display adds in your sidebar. For best results use 250 pixels wide ad or 280 pixels wide ad

", "optionid" => $themeoptionsprefix."_sidebarad", "selectoptiondef" => "", "optiontype" => "textarea"), array("optionname" => "Feedburner RSS URL", "optiondescription" => "

Your Feedburner URL

", "optionid" => $themeoptionsprefix."_feedburnerurl", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Feedburner ID", "optiondescription" => "

Your Feedburner ID here.

", "optionid" => $themeoptionsprefix."_feedburnerid", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Header for Sidebar Subscribe Block", "optiondescription" => "

The text to display as the header above the subscribe links in the sidebar.

", "optionid" => $themeoptionsprefix."_rsssubscribeblockh2", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Subtext for rss subscribe block", "optiondescription" => "

The text to display as a short description for why to subscribe to your feed.

", "optionid" => $themeoptionsprefix."_rsssubscribeblocksubtext", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Subscribe Link Text", "optiondescription" => "

The text to use for your subscribe link.

", "optionid" => $themeoptionsprefix."_rsssubscribeblocklinktext", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Featured Category for slideshow", "optiondescription" => "

Select the category from which your featured content will be pulled for the featured slideshow.

", "optionid" => $themeoptionsprefix."_featuredcat", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Number of Featured Posts to show", "optiondescription" => "

You can set the number of featured posts to show in the featured slideshow.

", "optionid" => $themeoptionsprefix."_numpostsfeatured", "selectoptiondef" => "Select a Number:", "optiontype" => "select", "options" => $numfeaturedarr), array("optionname" => "Number of Posts on Home Page", "optiondescription" => "

You can set the number of posts to show on the homepage.

", "optionid" => $themeoptionsprefix."_numpostshome", "selectoptiondef" => "Select a Number:", "optiontype" => "select", "options" => $arrnumposts), ); function do_options_update_theme() { global $this_theme, $options; if ( $_GET['page'] == basename(__FILE__) ) { if ( 'updateoptions' == $_REQUEST['action'] ) { foreach ($options as $optionvalue) { update_option( $optionvalue['optionid'], $_REQUEST[ $optionvalue['optionid'] ] ); } foreach ($options as $optionvalue) { if( isset( $_REQUEST[ $optionvalue['optionid'] ] ) ) { update_option( $optionvalue['optionid'], $_REQUEST[ $optionvalue['optionid'] ] ); } else { delete_option( $optionvalue['optionid'] ); } } header("Location: admin.php?page=functions.php&optionsupdated=true"); die; } } add_menu_page($this_theme." Options", $this_theme." Options", 'edit_themes', basename(__FILE__), 'do_page_6609', $menuico6609); } function get_style_scheme_options() { $styleschemeoptionsarr=array(); $stylespath=TEMPLATEPATH . '/styles'; if (is_dir($stylespath)) { $stylesavailable=opendir($stylespath); if ($stylesavailable) { while( $thestyledir = readdir($stylesavailable) ) { if( is_valid_style_dir($thestyledir) ) { $styleschemeoptionsarr[]=$thestyledir; } } } closedir($stylesavailable); } return $styleschemeoptionsarr; } function is_valid_style_dir( $thestyledir ) { if( $thestyledir == '.' || $thestyledir == '..' ) { $isvalidstyledir=0; } else { $isvalidstyledir=1; } return $isvalidstyledir; } function do_page_6609 () { global $options, $this_theme; ?>

Options

"heading" ) { ?>
" />

"heading" ) { ?>