gulivernashuatec
Forum Replies Created
-
Forum: Themes and Templates
In reply to: How to hide "wp audio player" from resumed post?Function.php (Code):
<?php
$themename = “intrepidity”;
$shortname = “tbf1”;$content_width = 517;
$options = array (
array( “type” => “open”),
array( “name” => “Skin Color”,
“desc” => “Choose the overall color style of your site”,
“id” => $shortname.”_skin_color”,
“default” => “blue”,
“type” => “skin_color”),array( “name” => “Header Logo”,
“desc” => “Would you like a logo in your header?”,
“id” => $shortname.”_logo_header”,
“default” => “no”,
“type” => “logo”),array( “name” => “Logo or Blog Name Location”,
“desc” => “Where do you want your Logo or Blog Name located?”,
“id” => $shortname.”_logo_location”,
“default” => “left”,
“type” => “logo-location”),array( “name” => “Font Size”,
“desc” => “Selct the font size used for your site”,
“id” => $shortname.”_font_size”,
“default” => “12px”,
“type” => “font_size”),array( “name” => “Search Bar”,
“desc” => “Would you like a Search Bar in your header? It allows a user to search within your site”,
“id” => $shortname.”_search_header”,
“default” => “yes”,
“type” => “search”),array( “name” => “User Login / Admin Bar”,
“desc” => “Would you like to display a navigation bar for login/admin pages at the top?”,
“id” => $shortname.”_user_login”,
“default” => “no”,
“type” => “login”),array( “name” => “Socialize Icons”,
“desc” => “Enter Links to Your Twitter, Facebook, and RSS feeds.
If you want to remove the icon, clear the field and save this page”,
“type” => “socialize_icons”),array( “id” => $shortname.”_icon_twitter”,
“default” => “”),
array( “id” => $shortname.”_icon_facebook”,
“default” => “”),
array( “id” => $shortname.”_icon_youtube”,
“default” => “”),
array( “id” => $shortname.”_icon_rss”,
“default” => ”),array( “name” => “Copyright Year”,
“id” => $shortname.”_copy_year”,
“desc” => “Enter the starting year for your copyright. (Used in your footer like \”Copyright © 2009-“.date(‘Y’,time()).”\”)”,
“default” => “”,
“type” => “copyright”),array( “id” => $shortname.”_exclude_pages”,
“default” => “”),array( “id” => $shortname.”_nav_hide_home”,
“default” => “no”),array( “name” => “Number of Posts”,
“desc” => “To limit the number of posts to show on your home, go to Settings: > Reading > edit the ‘Blog pages show at most’ option”,
“id” => $shortname.”_number_posts”,
“default” => “”,
“type” => “posts”),array( “id” => $shortname.”_custom_html_0″,
“default” => “”),
array( “id” => $shortname.”_custom_html_1″,
“default” => “”),
array( “id” => $shortname.”_custom_html_2″,
“default” => “”),
array( “id” => $shortname.”_custom_html_3″,
“default” => “”),
array( “id” => $shortname.”_custom_html_4″,
“default” => “”),
array( “id” => $shortname.”_custom_html_5″,
“default” => “”),
array( “id” => $shortname.”_custom_html_6″,
“default” => “”),
array( “id” => $shortname.”_custom_html_7″,
“default” => “”),
array( “id” => $shortname.”_custom_html_8″,
“default” => “”),
array( “id” => $shortname.”_custom_html_9″,
“default” => “”),
array( “id” => $shortname.”_custom_html_10″,
“default” => “”),array( “id” => $shortname.”_header_image_file”,
“default” => “”),
array( “id” => $shortname.”_footer_image_file”,
“default” => “”),
array( “id” => $shortname.”_background_image_file”,
“default” => “”),
array( “id” => $shortname.”_background_color”,
“default” => “”),
array( “id” => $shortname.”_background_repeat”,
“default” => “”),array( “name” => “Email Optin / Newsletter Sign Up”,
“desc” => “Would you like to collect email address? Show an optin form?”,
“type” => “optin-form”),array( “id” => $shortname.”_optin_form”,
“default” => “yes”),
array( “id” => $shortname.”_optin_image_file”,
“default” => “”),
array( “id” => $shortname.”_optin_img_alignment”,
“default” => “left”),
array( “id” => $shortname.”_optin_img”,
“default” => “yes”),
array( “id” => $shortname.”_optin_text”,
“default” => “”),
array( “id” => $shortname.”_optin_hide_msg”,
“default” => “no”),
array( “id” => $shortname.”_optin_html”,
“default” => “”),array( “name” => “Landing Page Header”,
“desc” => “Select \”Hidden\” to hide the header & logo from your landing page”,
“id” => $shortname.”_landing_header”,
“default” => “displayed”,
“type” => “landing_header”),array( “name” => “Landing Page Footer”,
“desc” => “Select \”Hidden\” to hide the footer from your landing page”,
“id” => $shortname.”_landing_footer”,
“default” => “displayed”,
“type” => “landing_footer”),array( “type” => “close”)
);
add_action(‘admin_head’, ‘wp_admin_js’);
function wp_admin_js() {
if(isset($_GET[‘page’])) {
if(stristr($_GET[‘page’],’tbf-design.php’)) {
echo ‘<script type=”text/javascript” src=”‘; echo bloginfo(‘template_url’); echo ‘/js/design.js”></script>’.”\n”;
}
if(stristr($_GET[‘page’],’tbf-optin.php’)) {
echo ‘<script type=”text/javascript” src=”‘; echo bloginfo(‘template_url’); echo ‘/js/optin-form.js”></script>’.”\n”;
}
}
}function tbf1_head() {
global $shortname, $post;if ( is_page_template(‘template-landing.php’) ) {
$addheight = 0;
} else {
$addheight = 46;
}echo”<style type=\”text/css\”>\n”;
if (get_option($shortname.’_logo_header’) == “yes”) {
list($w, $h) = getimagesize(get_option($shortname.’_logo’));
$height = $h+$addheight;
echo “#globalnav {top: “.$h .”px !important }\n”;
echo “#header {height: “.$height .”px !important }\n”;
echo “#socialize-icons {top: “.($h-40) .”px !important }\n”;
}if (get_option(‘tbf1_user_login’) == “yes”) {
echo ‘#bg {margin-top: 20px} body {background-position: center 20px}’;
}if (get_option($shortname.’_logo_location’) == “middle”) {
echo ” #header {text-align: center }\n”;
echo ” #description { clear:both;text-align: center; }\n”;} elseif(get_option($shortname.’_logo_location’) == “right”) {
echo ” #header {text-align: right }\n”;
echo ” #description { clear:right;float: right; }\n”;} else {
echo ” #header {text-align:left }\n”;
echo ” #description { clear:left;float: left; }\n”;
}
echo”</style>\n”;
}
add_action(‘wp_head’, ‘tbf1_head’);function mytheme_media_buttons_init() {
?>
<script type=”text/javascript”>
/* <![CDATA[ */
function send_to_editor(h) {
var ed;if ( typeof tinyMCE != ‘undefined’ && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
ed.focus();
if (tinymce.isIE)
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);if ( h.indexOf(‘[caption’) === 0 ) {
if ( ed.plugins.wpeditimage )
h = ed.plugins.wpeditimage._do_shcode(h);
} else if ( h.indexOf(‘[gallery’) === 0 ) {
if ( ed.plugins.wpgallery )
h = ed.plugins.wpgallery._do_gallery(h);
}ed.execCommand(‘mceInsertContent’, false, h);
} else if ( typeof edInsertContent == ‘function’ ) {
edInsertContent(edCanvas, h);
} else {
jQuery( edCanvas ).val( jQuery( edCanvas ).val() + h );
}tb_remove();
}
jQuery(function($) {
$(‘div[id=media-buttons] a’).click(function() {
if ( typeof tinyMCE != ‘undefined’ && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
var editor = $(this).parent().next(‘.theEditor:first’);
if (!editor.hasClass(‘theEditor’)) return ;
if (editor.attr(‘id’) == ed.id) return;if ( typeof tinyMCE != ‘undefined’ && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
//var active = tinyMCE.get(editor.attr(‘id’))
tinyMCE.execInstanceCommand(editor.attr(‘id’), ‘mceFocus’)
}}
});
});
/* ]]> */
</script>
<?php
wp_enqueue_style( ‘thickbox’ );
wp_enqueue_script(‘thickbox’);
wp_print_scripts();
wp_print_styles();}
function mytheme_add_admin() {
global $themename, $shortname, $options;
$admin_pages = array(‘tbf-design.php’, ‘tbf-features.php’, ‘tbf-homepage.php’, ‘tbf-optin.php’, ‘tbf-landing.php’);if(isset($_GET[‘page’])) {
if (in_array(trim($_GET[‘page’]), $admin_pages)) {
if(isset($_REQUEST[‘action’])) {
if (‘save’ == $_REQUEST[‘action’]) {
foreach($options as $value) {
if(isset($value[‘id’])) {
if(isset($_REQUEST[ $value[‘id’] ])) {
update_option( $value[‘id’], stripslashes_deep($_REQUEST[ $value[‘id’] ]) );
}
}
}foreach(array(‘logo’, ‘optin_image_file’, ‘header_image_file’, ‘footer_image_file’, ‘background_image_file’) as $file) {
if(!empty($_FILES[$file][“tmp_name”])){
$directory = dirname(__FILE__) . “/uploads/”;
move_uploaded_file($_FILES[$file][“tmp_name”], $directory . $_FILES[$file][“name”]);
update_option(‘tbf1_’.$file, get_option(‘siteurl’). “/wp-content/themes/”. get_option(‘template’).”/uploads/”. $_FILES[$file][“name”]);
}
}if(stristr($_GET[‘page’],’&saved=true’)) {
$location = ‘admin.php?page=’. trim($_GET[‘page’]);
} else {
$location = ‘admin.php?page=’. trim($_GET[‘page’]) . “&saved=true”;
}header(“Location: $location”);
die;
}
}
add_action(‘admin_head’, ‘mytheme_media_buttons_init’);
}
}
// Set all default options
foreach($options as $default) {
if(@get_option($default[‘id’]) == ”) {
@update_option($default[‘id’], $default[‘default’]);
}
}
/*Debug only
// Delete all default options
foreach($options as $default) {
delete_option($default[‘id’],$default[‘default’]);
}
*/add_menu_page(‘Page title’, ‘My Theme’, 10, ‘tbf-design.php’, ‘mytheme_admin’);
add_submenu_page(‘tbf-design.php’, ‘Site Design’, ‘1. Design (Start here)’, 10, ‘tbf-design.php’, ‘mytheme_admin’);
add_submenu_page(‘tbf-design.php’, ‘Site Settings’, ‘2. Settings’, 10, ‘tbf-features.php’, ‘mytheme_admin’);
add_submenu_page(‘tbf-design.php’, ‘Site Homepage’, ‘3. Homepage’, 10, ‘tbf-homepage.php’, ‘mytheme_admin’);
add_submenu_page(‘tbf-design.php’, ‘Email Optin / Newsletter Setting’, ‘4. Optin/Signup Form’, 10, ‘tbf-optin.php’, ‘mytheme_admin’);
add_submenu_page(‘tbf-design.php’, ‘Landing Page’, ‘5. Landing page’, 10, ‘tbf-landing.php’, ‘mytheme_admin’);
}function mytheme_admin() {
global $themename, $shortname, $options;
?>
<style type=”text/css”>
#myForm .inner-sidebar {display: block}
#myForm #post-body {margin-right: 300px}
#headerLogo {overflow: hidden}
#socializediv .form-table th {width:124px; padding: 0; line-height:22px }
#socializediv .form-table {clear:inherit }
#socializediv .form-table td {padding:0 10px }
#background_color {padding-left: 35px; background: url(<?php bloginfo(‘template_url’); ?>/images/admin/back-palette.png) no-repeat}
</style><div class=”wrap”>
<h2><?php echo $themename; ?> Settings
<?php
if(stristr($_GET[‘page’],’tbf-design.php’)) {
echo ‘- Design’;
} elseif(stristr($_GET[‘page’],’tbf-features.php’)) {
echo ‘- Settings & Features’;
} elseif(stristr($_GET[‘page’],’tbf-landing.php’)) {
echo ‘- Landing Page’;
} elseif(stristr($_GET[‘page’],’tbf-optin.php’)) {
echo ‘- Email Optin / Newsletter Setting’;
} else {
echo ‘- Homepage Customization’; }
?>
</h2>
<?php
if (isset($_REQUEST[‘saved’])) echo ‘<div id=”message” class=”updated fade”><p>‘.$themename.’ settings saved.</p></div>’;
?>
<form method=”post” id=”myForm” enctype=”multipart/form-data”>
<div id=”poststuff” class=”metabox-holder”><div id=”side-info-column” class=”inner-sidebar”>
<div id=’side-sortables’ class=’meta-box-sortables’>
<div id=”linksubmitdiv” class=”postbox ” >
<h3 class=’hndle’><span>Current Saved Settings </span></h3>
<div class=”inside”>
<div class=”submitbox” id=”submitlink”>
<div id=”minor-publishing”>
<div id=”misc-publishing-actions”>
<div class=”misc-pub-section misc-pub-section-last”>
<ul style=”padding:10px 0 0 5px;”>
<?php if(stristr($_GET[‘page’],’tbf-design.php’)) { ?>- Skin Color: <?php echo ucwords(get_option($shortname.’_skin_color’)); ?>
- Header Logo: <?php echo ucwords(get_option($shortname.’_logo_header’)); ?>
- <?php if (get_option($shortname.’_logo_header’) == “yes”) { echo “Logo”; } else { echo “Blog Name”; } ?> Location: <?php echo ucwords(get_option($shortname.’_logo_location’)); ?>
- Font Size: <?php if(get_option($shortname.’_font_size’) == “11px”) { echo “11px”; } else { echo ucwords(get_option($shortname.’_font_size’)); } ?>
- Search Bar: <?php if(get_option($shortname.’_logo_location’) == “middle”) { echo “No”; } else { echo ucwords(get_option($shortname.’_search_header’)); } ?>
- Admin Bar: <?php if(get_option($shortname.’_user_login’) == “yes”) { echo “Yes”; } else { echo ucwords(get_option($shortname.’_user_login’)); } ?>
- Number of Posts: <?php echo get_option(‘posts_per_page’); ?>
- Optin/Newsletter Form: <?php echo ucwords(get_option($shortname.’_optin_form’)); ?>
- Using an image: <?php echo ucwords(get_option($shortname.’_optin_img’)); ?>
- Landing Page Header: <?php if(get_option($shortname.’_landing_header’) == “displayed”) { echo “Displayed”; } else { echo ucwords(get_option($shortname.’_landing_header’)); } ?>
- Landing Page Footer: <?php if(get_option($shortname.’_landing_footer’) == “displayed”) { echo “Displayed”; } else { echo ucwords(get_option($shortname.’_landing_footer’)); } ?>
<?php } ?>
<?php if(stristr($_GET[‘page’],’tbf-features.php’)) { ?><?php } ?>
<?php if(stristr($_GET[‘page’],’tbf-homepage.php’)) { ?><?php } ?>
<?php if(stristr($_GET[‘page’],’tbf-optin.php’)) { ?><?php } ?>
<?php if(stristr($_GET[‘page’],’tbf-landing.php’)) { ?><?php } ?>
</div>
</div>
</div><div id=”major-publishing-actions”>
<div id=”delete-action”></div>
<div id=”publishing-action”>
<input name=”save” type=”submit” class=”button-primary” value=”Save changes” />
<input type=”hidden” name=”action” value=”save” />
</div>
<div class=”clear”></div>
</div><div class=”clear”></div>
</div>
</div>
</div>
</div>
</div><div id=”post-body” class=”has-sidebar”>
<div id=”post-body-content” class=”has-sidebar-content”><?php
if(stristr($_GET[‘page’],’tbf-design.php’)) {
foreach($options as $value) {
if(isset($value[‘type’])) {
switch ($value[‘type’]) {case “skin_color”:
?>
<div id=”skin_colordiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<table>
<tr>
<td align=”center” style=”padding-right: 10px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>1″ type=”radio” value=”blue”<?php if(get_option($value[‘id’]) == “blue”) { echo ” checked”; } ?> /> Blue
</td>
<td align=”center” style=”padding-right: 10px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>2″ type=”radio” value=”silver”<?php if(get_option($value[‘id’]) == “silver”) { echo ” checked”; } ?> /> Silver
</td>
<td align=”center” style=”padding-right: 10px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>3″ type=”radio” value=”red”<?php if(get_option($value[‘id’]) == “red”) { echo ” checked”; } ?> /> Red
</td>
<td align=”center” style=”padding-right: 10px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”green”<?php if(get_option($value[‘id’]) == “green”) { echo ” checked”; } ?> /> Green
</td>
</tr>
<tr>
<td style=”padding-right: 10px;”>
<label for=”<?php echo $value[‘id’]; ?>1″><img src=”<?php bloginfo(‘template_url’); ?>/images/admin/screen-blue.png” alt=”Blue” /></label>
</td>
<td style=”padding-right: 10px;”>
<label for=”<?php echo $value[‘id’]; ?>2″><img src=”<?php bloginfo(‘template_url’); ?>/images/admin/screen-silver.png” alt=”Silver” /></label>
</td>
<td style=”padding-right: 10px;”>
<label for=”<?php echo $value[‘id’]; ?>3″><img src=”<?php bloginfo(‘template_url’); ?>/images/admin/screen-red.png” alt=”Red” /></label>
</td>
<td style=”padding-right: 10px;”>
<label for=”<?php echo $value[‘id’]; ?>”><img src=”<?php bloginfo(‘template_url’); ?>/images/admin/screen-green.png” alt=”Green” /></label>
</td>
</tr>
</table>
<p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php
break;case “logo”:
?>
<div id=”logodiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”yes”<?php if(get_option($value[‘id’]) == “yes”) { echo ” checked”; } ?> /> Yes</label> <label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”no”<?php if(get_option($value[‘id’]) == “no”) { echo ” checked”; } ?> /> No (Just show the name of my blog)</label><p><small><?php echo $value[‘desc’]; ?></small></p>
<div id=”headerLogo”>
Choose a file to upload: <input type=”file” name=”logo” id=”logo” />
<?php if(get_option($shortname.’_logo’)) { echo ‘<div><img src=”‘; echo get_option($shortname.’_logo’); echo ‘” style=”margin-top:10px;border:1px solid #aaa;padding:10px;” /></div>’; } ?>
</div>
</div>
</div>
<?php
break;case “logo-location”:
?>
<div id=”locationdiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<table>
<tr>
<td style=”padding-right: 15px;”>
<img src=”<?php bloginfo(‘template_url’); ?>/images/admin/logoleft.png” alt=”Left” />
</td>
<td style=”padding-right: 15px;”>
<img src=”<?php bloginfo(‘template_url’); ?>/images/admin/logoright.png” alt=”Right” />
</td>
<td style=”padding-right: 15px;”>
<img src=”<?php bloginfo(‘template_url’); ?>/images/admin/logomiddle.png” alt=”Centered” />
</td>
</tr>
<tr>
<td align=”center” style=”padding-right: 15px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”left”<?php if(get_option($value[‘id’]) == “left”) { echo ” checked”; } ?> />
</td>
<td align=”center” style=”padding-right: 15px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”right”<?php if(get_option($value[‘id’]) == “right”) { echo ” checked”; } ?> />
</td>
<td align=”center” style=”padding-right: 15px;”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”middle”<?php if(get_option($value[‘id’]) == “middle”) { echo ” checked”; } ?> />
</td>
</tr>
</table>
<p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php break;}
}
}
?><div id=”footer_image_div” class=”stuffbox”>
<h3><label for=”link_url”>Background</label></h3>
<div class=”inside”>
<?php $imageURL = get_option($shortname.’_background_image_file’);?>
Image URL: <input name=”<?php echo $shortname?>_background_image_file” id=”<?php echo $shortname?>_background_image_file” type=”text” size=”50″ value=”<?php echo htmlentities($imageURL);?>”>
<div id=”headerLogo”>
Or, Choose a file to upload: <input type=”file” name=”background_image_file” id=”background_image_file” />
</div>Background Repeat:
<?php $bgr = get_option($shortname.’_background_repeat’);?><input type=”radio” size=”8″ name=”<?php echo $shortname;?>_background_repeat” <?php echo ($bgr == ‘repeat-x’ ? ‘checked=”checked”‘ : ”);?> value=”repeat-x” id=”repeat-x” ><label for=”repeat-x”>Horizontally</label>
<input type=”radio” size=”8″ name=”<?php echo $shortname;?>_background_repeat” <?php echo ($bgr == ‘repeat-y’ ? ‘checked=”checked”‘ : ”);?> value=”repeat-y” id=”repeat-y” ><label for=”repeat-y”>Vertically</label>
<input type=”radio” size=”8″ name=”<?php echo $shortname;?>_background_repeat” <?php echo ($bgr == ‘repeat’ ? ‘checked=”checked”‘ : ”);?> value=”repeat” id=”repeat” ><label for=”repeat”>Tile</label>
<input type=”radio” size=”8″ name=”<?php echo $shortname;?>_background_repeat” <?php echo ($bgr == ‘no-repeat’ ? ‘checked=”checked”‘ : ”);?> value=”no-repeat” id=”no-repeat” ><label for=”no-repeat”>No Repeat</label>Background Color: <input type=”text” size=”8″ name=”<?php echo $shortname;?>_background_color” id=”background_color” value=”<?php echo htmlentities($bgc = get_option($shortname.’_background_color’));?>”> <span id=”background-color-sample” style=”background-color:<?php echo $bgc;?>;padding:0 10px;”> </span>
<div id=”colorPickerDiv” style=”z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;”> </div><?php if ($imageURL):?>
<img src=”<?php echo $imageURL;?>” style=”max-height:50px;max-width:600px;min-width:20px” />
<?php endif;?><span class=”description”>Clear the values to use the default</span>
</div>
</div><div id=”header_image_div” class=”stuffbox”>
<h3><label for=”link_url”>Header Image</label></h3>
<div class=”inside”>
<?php $imageURL = get_option($shortname.’_header_image_file’);?>
Image URL: <input name=”<?php echo $shortname?>_header_image_file” id=”<?php echo $shortname?>_header_image_file” type=”text” size=”50″ value=”<?php echo htmlentities($imageURL);?>”> <small>900px & higher width recommended</small>
<div id=”headerLogo”>
Or, Choose a file to upload: <input type=”file” name=”header_image_file” id=”header_image_file” />
</div>
<?php if ($imageURL):?>
<img src=”<?php echo $imageURL;?>” style=”max-width:600px” />
<?php endif;?><span class=”description”>Clear URL to use the default</span>
</div>
</div><div id=”footer_image_div” class=”stuffbox”>
<h3><label for=”link_url”>Footer Image</label></h3>
<div class=”inside”>
<?php $imageURL = get_option($shortname.’_footer_image_file’);?>
Image URL: <input name=”<?php echo $shortname?>_footer_image_file” id=”<?php echo $shortname?>_footer_image_file” type=”text” size=”50″ value=”<?php echo htmlentities($imageURL);?>”> <small>Recommended size: 900px x 200px</small>
<div id=”headerLogo”>
Or, Choose a file to upload: <input type=”file” name=”footer_image_file” id=”footer_image_file” />
</div>
<?php if ($imageURL):?>
<img src=”<?php echo $imageURL;?>” style=”max-width:600px” />
<?php endif;?><span class=”description”>Clear URL to use the default</span>
</div>
</div><script type=”text/javascript”>
/* <![CDATA[ */
var farbtastic;jQuery(function($) {
$(‘#background_color’).click(function() {
$(‘#colorPickerDiv’).show();
});
farbtastic = jQuery.farbtastic(‘#colorPickerDiv’, function(color) { pickColor(color); });
pickColor(‘<?php echo $bgc ?>’);});
function pickColor(color) {
jQuery(‘#background-color-sample’).css(‘background-color’, color);
jQuery(‘#background_color’).val(color);
farbtastic.setColor(color);
}
jQuery(document).mousedown(function() {
jQuery(‘#colorPickerDiv’).fadeOut(2);
})
/* ]]> */
</script></div></div>
<?php
} elseif(stristr($_GET[‘page’],’tbf-features.php’)) { //Features Pageforeach($options as $value) {
if(isset($value[‘type’])) {
switch ($value[‘type’]) {
case “font_size”:
?>
<div id=”font_sizediv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<span id=”searchHeader”><label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”11px”<?php if(get_option($value[‘id’]) == “11px”) { echo ” checked”; } ?> /> <span style=”font-size:11px”>11px (Small)</span></label> <label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”12px”<?php if(get_option($value[‘id’]) == “12px”) { echo ” checked”; } ?> /> <span style=”font-size:12px”>12px (Default)</span></label> <label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”13px”<?php if(get_option($value[‘id’]) == “13px”) { echo ” checked”; } ?> /> <span style=”font-size:13px”>13px (Large)</span></label> <label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”14px”<?php if(get_option($value[‘id’]) == “14px”) { echo ” checked”; } ?> /> <span style=”font-size:14px”>14px (X-Large)</span></label></span><p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php
break;case “search”:
?>
<div id=”searchdiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<span id=”searchHeader”><label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”yes”<?php if(get_option($value[‘id’]) == “yes”) { echo ” checked”; } ?> /> Yes</label> <label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”no”<?php if(get_option($value[‘id’]) == “no”) { echo ” checked”; } ?> /> No</span></label><p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php
break;case “login”:
?>
<div id=”logindiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”><label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”yes”<?php if(get_option($value[‘id’]) == “yes”) { echo ” checked”; } ?> /> Yes</label> <label><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”no”<?php if(get_option($value[‘id’]) == “no”) { echo ” checked”; } ?> /> No</label>
<p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php break;case “socialize_icons”:
?>
<div id=”socializediv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<table class=”form-table”>
<tbody>
<tr valign=”top”>
<th scope=”row”><label for=”<?php echo $shortname?>_icon_twitter”>Your twitter URL:</label></th>
<td><input id=”<?php echo $shortname?>_icon_twitter” class=”regular-text” type=”text” value=”<?php echo get_option($shortname.’_icon_twitter’); ?>” name=”<?php echo $shortname?>_icon_twitter”/>
<span class=”description”>Eg. https://twitter.com/username</span></td>
</tr>
<tr valign=”top”>
<th scope=”row”><label for=”<?php echo $shortname?>_icon_facebook”>Your facebook URL:</label></th>
<td><input id=”<?php echo $shortname?>_icon_facebook” class=”regular-text” type=”text” value=”<?php echo get_option($shortname.’_icon_facebook’); ?>” name=”<?php echo $shortname?>_icon_facebook”/>
<span class=”description”>Eg. https://www.facebook.com/xxxxxx</span></td>
</tr>
<tr valign=”top”>
<th scope=”row”><label for=”<?php echo $shortname?>_icon_youtube”>YouTube URL:</label></th>
<td><input id=”<?php echo $shortname?>_icon_youtube” class=”regular-text” type=”text” value=”<?php echo get_option($shortname.’_icon_youtube’); ?>” name=”<?php echo $shortname?>_icon_youtube”/>
<span class=”description”>Eg. https://www.youtube.com/user/xxxxxx </span></td>
</tr>
<tr valign=”top”>
<th scope=”row”><label for=”<?php echo $shortname?>_icon_rss”>RSS feed URL:</label></th>
<td><input id=”<?php echo $shortname?>_icon_rss” class=”regular-text” type=”text” value=”<?php echo get_option($shortname.’_icon_rss’); ?>” name=”<?php echo $shortname?>_icon_rss”/>
<span class=”description”>Eg. https://www.yourblog.com/feed/ </span></td>
</tr>
</tbody>
</table>
<p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php break;case “copyright”:
?>
<div id=”logindiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”><input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”text” value=”<?php echo get_option($shortname.’_copy_year’); ?>” />
<p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php break;} //End switch
}
}
?><div id=”navgation_div” class=”stuffbox”>
<h3><label for=”link_url”>Top Navigation</label></h3>
<div class=”inside”>
Click on “Select Page…” to exclude pages from your top navigation.
<?php $excludepages = get_option($shortname.’_exclude_pages’);?>
Page IDs:
<input name=”<?php echo $shortname?>_exclude_pages” id=”<?php echo $shortname?>_exclude_pages” size=”60″ value=”<?php echo htmlentities($excludepages);?>”><?php wp_dropdown_pages(array(‘show_option_none’ => ‘Select Page… ‘));?>
<small>Separate page IDs with a comma (eg. 2,43,16). To reset, simply delete all the IDs</small><p>
</p>Hide “Home” from the top navigation?
<label><input name=”<?php echo $shortname?>_nav_hide_home” id=”<?php echo $shortname?>_nav_hide_home” type=”radio” value=”yes”<?php if(get_option($shortname.’_nav_hide_home’) == “yes”) { echo ” checked”; } ?> /> Yes</label> <label><input name=”<?php echo $shortname?>_nav_hide_home” id=”<?php echo $shortname?>_nav_hide_home” type=”radio” value=”no”<?php if(get_option($shortname.’_nav_hide_home’) == “no”) { echo ” checked”; } ?> /> No</label>
</div>
</div>
<script style=”text/javascript”>
jQuery(function($) {
$(‘#page_id’).change(function() {
var value = $(‘#<?php echo $shortname?>_exclude_pages’).val();
$(‘#<?php echo $shortname?>_exclude_pages’).val( value + (value != ” ? ‘,’ : ”) +$(this).find(‘option:selected’).val());
});
});
</script></div></div>
<?php
} elseif(stristr($_GET[‘page’],’tbf-homepage.php’)) { //tbf-homepage
foreach($options as $value) {
if(isset($value[‘type’])) {
switch ($value[‘type’]) {
case “posts”:
?>
<div id=”postsdiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<div id=”slideshowdiv” class=”stuffbox”>
<h3><label for=”link_url”>Slideshow of Your Posts</label></h3>
<div class=”inside”>
<p><img src=”<?php bloginfo(‘template_url’); ?>/images/admin/screen-slideshow.png” class=”alignright” />If you want to use A slideshow of your posts on your homepage like the picture on the right, follow these steps:</p>
<p>1. Install and activate the “Featured Content Gallery” plugin from this page
2. Once installed, configure it on the /wp-admin/options-general.php?page=featured-content-gallery/options.php”>”Featured Content Gallery” settings page.
3. Add the “articleimg” and “featuredtext” fields in the “Custom field” on your posts (Do this on at least two posts; otherwise, the slideshow will not run).
Recommended dimention of your images (586px in width x 261px in height )
</p>
<p><small>Watch Video Tutorial » (Coming Soon)</small></p>
</div>
</div>
<?php
break;
}
}
}
?>
</div></div><div id=”customhtmldiv” class=”stuffbox”>
<h3>Homepage Custom Content</h3>
<?php
$max = ($max = get_option(‘posts_per_page’)) ? $max : 6;
$baseurl = includes_url(‘js/tinymce’);for ($i=0; $i<$max; $i++):
?>
<div class=”inside”>
Row <?php echo $i+1;?>:
<?php if ( current_user_can( ‘upload_files’ ) ) : ?>
<div id=”media-buttons” class=”hide-if-no-js”>
<?php do_action( ‘media_buttons’ ); ?>
</div>
<?php endif; ?><textarea name=”<?php echo $shortname?>_custom_html_<?php echo $i;?>” id=”<?php echo $shortname?>_custom_html_<?php echo $i;?>”
style=”width:100%;height:75px;” class=”theEditor”
rows=”5″ cols=”80″
><?php echo htmlentities(get_option($shortname.’_custom_html_’.$i));?>
</textarea>
</div>
<?php endfor;?>
</div>
<?php
wp_enqueue_script(‘editor’);
wp_print_scripts();
wp_tiny_mce( );} elseif(stristr($_GET[‘page’],’tbf-optin.php’)) { //tbf-optin
foreach($options as $value) {
if(isset($value[‘type’])) {
switch ($value[‘type’]) {
case “optin-form”:
?>
<div id=”optin-formdiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<p><?php echo $value[‘desc’]; ?></p>
<input name=”<?php echo $shortname?>_optin_form” id=”<?php echo $shortname?>_optin_form” type=”radio” value=”yes”<?php if(get_option($shortname.’_optin_form’) == “yes”) { echo ” checked”; } ?> onClick=”showMe()” /> Yes <input name=”<?php echo $shortname?>_optin_form” id=”<?php echo $shortname?>_optin_form” type=”radio” value=”no”<?php if(get_option($shortname.’_optin_form’) == “no”) { echo ” checked”; } ?> onClick=”showMe()” /> No
<div id=”optinform”>
<p>1. Would you like to upload an image <small>(i.e. eBook cover graphic)</small>?</p>
<input name=”<?php echo $shortname?>_optin_img” id=”<?php echo $shortname?>_optin_img” type=”radio” value=”yes”<?php if(get_option($shortname.’_optin_img’) == “yes”) { echo ” checked”; } ?> onClick=”showMe()” /> Yes <input name=”<?php echo $shortname?>_optin_img” id=”<?php echo $shortname?>_optin_img” type=”radio” value=”no”<?php if(get_option($shortname.’_optin_img’) == “no”) { echo ” checked”; } ?> onClick=”showMe()” /> No<div id=”optindefaultdiv”>
Upload an image: <input type=”file” name=”optin_image_file” id=”optin_image_file” /> Align:
<select name=”<?php echo $shortname?>_optin_img_alignment”>
<option value=”left”<?php if(get_option($shortname.’_optin_img_alignment’) == “left”) { echo ” selected”; } ?>>Left</option>
<option value=”center”<?php if(get_option($shortname.’_optin_img_alignment’) == “center”) { echo ” selected”; } ?>>Center</option>
<option value=”right”<?php if(get_option($shortname.’_optin_img_alignment’) == “right”) { echo ” selected”; } ?>>Right</option>
</select></p>
<?php if(get_option($shortname.’_optin_image_file’)) { echo ‘<div style=”float:right;width:240px;margin:-71px 15px 0 0;”>Current image:
<img src=”‘. get_option($shortname.’_optin_image_file’). ‘” style=”margin-top:10px; padding:10px;” /></div>’; } ?>
</div><p>2. Teaser message <small>(HTML ok)</small>:
<textarea name=”<?php echo $shortname?>_optin_text” id=”<?php echo $shortname?>_optin_text” style=”width:95%;”><?php echo get_option($shortname.’_optin_text’); ?></textarea></p>
<p>3. Do you want to hide the “Get This First” message on the form? <input type=”radio” name=”<?php echo $shortname?>_optin_hide_msg” id=”<?php echo $shortname?>_optin_hide_msg” value=”yes”<?php if(get_option($shortname.’_optin_hide_msg’)==”yes”) {echo ” checked”;} ?> /> Yes
<input type=”radio” name=”<?php echo $shortname?>_optin_hide_msg” id=”<?php echo $shortname?>_optin_hide_msg” value=”no”<?php if(get_option($shortname.’_optin_hide_msg’)==”no”) {echo ” checked”;} ?> /> No </p>
<div id=”optincustomdiv”>
<p>4. Optin HTML code
<textarea name=”<?php echo $shortname?>_optin_html” id=”<?php echo $shortname?>_optin_html” style=”width:95%;”><?php echo get_option($shortname.’_optin_html’); ?></textarea>
<small>(Paste the HTML code given by aWeber, iContact, ConstantContant, or GetResponse, etc)</small></p>
</div>
</div>
</div>
</div><?php
break;
}
}
}} else { //tbf-landing.php
?>
<p>A landing page is a single column layout ideal for salespages, squeeze pages, and etc mostly oftenly used by info marketers. To use this layout, select “Landing Page” from the Template option when editing a page.</p>
<?php
foreach($options as $value) {
if(isset($value[‘type’])) {
switch ($value[‘type’]) {
case “landing_header”:
?>
<div id=”landing_headerdiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>1″ type=”radio” value=”displayed”<?php if(get_option($value[‘id’]) == “displayed”) { echo ” checked”; } ?> /> <label for=”<?php echo $value[‘id’]; ?>1″>Displayed</label> <input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”hidden”<?php if(get_option($value[‘id’]) == “hidden”) { echo ” checked”; } ?> /> <label for=”<?php echo $value[‘id’]; ?>”>Hidden</label><p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php
break;case “landing_footer”:
?>
<div id=”landing_footerdiv” class=”stuffbox”>
<h3><label for=”link_url”><?php echo $value[‘name’]; ?></label></h3>
<div class=”inside”>
<input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>1″ type=”radio” value=”displayed”<?php if(get_option($value[‘id’]) == “displayed”) { echo ” checked”; } ?> /> <label for=”<?php echo $value[‘id’]; ?>1″>Displayed</label> <input name=”<?php echo $value[‘id’]; ?>” id=”<?php echo $value[‘id’]; ?>” type=”radio” value=”hidden”<?php if(get_option($value[‘id’]) == “hidden”) { echo ” checked”; } ?> /> <label for=”<?php echo $value[‘id’]; ?>”>Hidden</label><p><small><?php echo $value[‘desc’]; ?></small></p>
</div>
</div>
<?php
break;
}
}
}
?>
</form>
</div>
<?php
}
}
add_action(‘admin_menu’, ‘mytheme_add_admin’);include(TEMPLATEPATH.’/widgets/widget_youtube.php’);
?>
<?php
if (function_exists(“register_sidebar”)) {
register_sidebar(array(‘name’ => ‘Sidebar’, ‘before_widget’ => ‘<li class=”widget” id=”%1$s”>’, ‘after_widget’ => ”, ‘before_title’ => ‘<h2>‘, ‘after_title’ => ‘</h2>’));
register_sidebar(array(‘name’=>’240×130 Side Banner Space’,));
register_sidebar(array(‘name’ => ‘Footer Left’, ‘before_widget’ => ‘<li class=”widget” id=”%1$s”>’, ‘after_widget’ => ”, ‘before_title’ => ‘<h2>‘, ‘after_title’ => ‘</h2>’));
register_sidebar(array(‘name’ => ‘Footer Middle’, ‘before_widget’ => ‘<li class=”widget” id=”%1$s”>’, ‘after_widget’ => ”, ‘before_title’ => ‘<h2>‘, ‘after_title’ => ‘</h2>’));
register_sidebar(array(‘name’ => ‘Footer Right’, ‘before_widget’ => ‘<li class=”widget” id=”%1$s”>’, ‘after_widget’ => ”, ‘before_title’ => ‘<h2>‘, ‘after_title’ => ‘</h2>’));
}function csv_tags() {
$posttags = get_the_tags();
foreach((array)$posttags as $tag) {
$csv_tags .= $tag->name . ‘,’;
}
echo ‘<meta name=”keywords” content=”‘.$csv_tags.'” />’;
}function theme_excerpt($num) {
global $more;
$more = 1;
$link = get_permalink();
$limit = $num+1;
$excerpt = explode(‘ ‘, strip_tags(get_the_content()), $limit);
array_pop($excerpt);
$excerpt = implode(” “,$excerpt).’… »‘;
echo ‘<p>’.$excerpt.'</p>’;
$more = 0;
}function metaDesc() {
$content = strip_tags(get_the_content());
if (strlen($content) < 155) {
echo $content;
} else {
$desc = substr($content,0,155);
echo $desc.”…”;
}
}function getImage($num) {
global $more;
$more = 1;
$link = get_permalink();
$content = get_the_content();
$count = substr_count($content, ‘<img src=’);
$start = 0;
for($i=1;$i<=$count;$i++) {
$imgBeg = strpos($content, ‘<img’, $start);
$post = substr($content, $imgBeg);
$imgEnd = strpos($post, ‘>’);
$postOutput = substr($post, 0, $imgEnd+1);
$result = preg_match(‘/width=”([0-9]*)” height=”([0-9]*)”/’, $postOutput, $matches);
if ($result) {
$pagestring = $matches[0];
$image[$i] = str_replace($pagestring, “”, $postOutput);
} else {
$image[$i] = $postOutput;
}
$start=$imgEnd+1;
}
if(isset($image)) {
if(stristr($image[$num],'<img src=’)) { echo ‘‘.$image[$num].”“; }
}
$more = 0;
}function tbf1_comment($comment, $args, $depth) {
$GLOBALS[‘comment’] = $comment; ?>
<li <?php comment_class(); ?> id=”li-comment-<?php comment_ID() ?>”>
<div id=”comment-<?php comment_ID(); ?>”>
<div class=”comment-avatar”>
<div class=”pic”><?php echo get_avatar($comment,$size=’36’,$default=” ); ?></div>
<span class=”name”><?php printf(__(‘<cite class=”fn”>%s</cite>’), get_comment_author_link()) ?> says:</span>
</div><?php if ($comment->comment_approved == ‘0’) : ?>
<?php _e(‘Seu comentário está aguardando a aprova??o.’) ?><?php endif; ?>
<div class=”comment-meta commentmetadata”>comment_ID )) ?>”>
<?php printf(__(‘%1$s at %2$s’), get_comment_date(),get_comment_time()) ?><?php edit_comment_link(__(‘(Edit)’),’ ‘,”) ?>
<div class=”comment-text”>
<?php if($args[‘max_depth’]!=$depth) { ?>
<?php if(get_option(‘thread_comments’)) :?>
<span class=”reply”><?php comment_reply_link(array_merge($args, array(‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?></span>
<?php endif; ?>
<?php } ?>
<?php comment_text() ?>
</div>
</div>
<div class=”recover”></div>
</div>
<?php
}add_action(‘admin_print_styles’, create_function(”, “wp_enqueue_script(‘farbtastic’);wp_enqueue_style(‘farbtastic’);”));
add_action(‘admin_print_styles’, create_function(”, “wp_enqueue_script(‘thickbox’);wp_enqueue_style(‘thickbox’);”));//Resize the dimention of youtube videos so that they fit within the left column
function resize_youtube( $content ) {
return str_replace(‘width=”640″ height=”505″></embed>’, ‘width=”500″ height=”395″></embed>’, $content);
}
add_filter(‘the_content’, ‘resize_youtube’, 999);
?>Forum: Themes and Templates
In reply to: How to hide "wp audio player" from resumed post?the content
<div class=”entry_content”>
<?php $more = 0;
the_content(‘<span class=”readmore-icon”>Read more’. get_the_title(”, ”, false). ‘</span>’, FALSE);
wp_link_pages();
?>