Академический Документы
Профессиональный Документы
Культура Документы
1. Admin dashboard
<?php
$admired_themename = "Admired";
$admired_shortname = "admired";
$admired_option_group = $admired_shortname.'_theme_option_group';
$admired_option_name = $admired_shortname.'_theme_options';
// Create custom settings menu
add_action('admin_menu', 'admired_create_menu');
function admired_create_menu() {
global $admired_themename;
//create new top-level menu
$page = add_theme_page( __( $admired_themename.' Admired Options' ),
__( 'Admired Options','admired' ), 'edit_theme_options', basename(__FILE__),
'admired_settings_page' );
/* Using registered $page handle to hook script load */
add_action('admin_print_styles-' . $page, 'admired_add_init');
}
// Load stylesheet and jscript
function admired_add_init() {
$file_dir = get_template_directory_uri();
wp_enqueue_style('thickbox');
wp_enqueue_style("admired-Opt-Css", $file_dir."/admin/admiredoptions.css");
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script("admired-jq-cookie", $file_dir."/admin/js/jquerycookie.js");
wp_enqueue_script('admired-jq-checkboxs',
$file_dir.'/admin/js/jquery.Checkbox.js');
wp_enqueue_script('admired-jq-select',
$file_dir.'/admin/js/jquery.selectBox.js');
wp_enqueue_script("admired-color-Script",
$file_dir."/admin/js/jquery.colorpicker.js");
wp_enqueue_script("admired-Opt-Script", $file_dir."/admin/js/admiredoptions.js");
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
}
// Register settings
add_action( 'admin_init', 'register_settings' );
function register_settings() {
global $admired_themename, $admired_shortname, $version,
$admired_settings, $admired_option_group, $admired_option_name;
//register our settings
register_setting( $admired_option_group, $admired_option_name,
'admired_theme_options_validate');
}
// Create theme options
global $admired_settings;
$admired_settings = array (
// *************************** Skin & Layout
***********************************
array("name" => __( "",'admired'), "id" =>"", "type" => "header",
"desc" => __( "",'admired'),"std" => ""),
array( "id" => $admired_shortname."-tab-1",
"type" => "open-tab"),
array("name" => __('<font size=4 color=#464646>Skin &
Layout</font>','admired'),
"type" => "section"),
array("name" => __('<font size=2 color=#464646>Settings that change the
look of your site.</font>','admired'),
"desc" => __( "Color of the secondary menu bar text item
when not hovering. (#EEEEEE)",'admired'),
"std" => "#EEEEEE"),
array("name" => __( "Normal Menu Text",'admired'), "id" =>
$admired_shortname."_normal_menu_text", "type" => "checkbox",
"desc" => __( "Check to use normal font style for menu
text instead of bold.",'admired')),
array( "name" => __( 'Disable Superfish Menu Effects','admired'), 'id'
=> $admired_shortname.'_remove_superfish', 'type' => 'checkbox',
"desc" => __( 'Removes the arrows next to your menu
items.','admired')),
array( "name" => __( 'Superfish Colors','admired'), 'id' =>
$admired_shortname.'_superfish_arrow_color', 'type' => 'select',
"desc" => __( 'Color of the Superfish arrows on the menu
bar.','admired'),
'std' => 'White',
'value' => array( 'White', 'Silver', 'Blue', 'Red', 'Black')),
array( "name" => __( 'Site Title','admired'), 'id' =>
$admired_shortname.'_title_color', 'type' => 'ctext',
"desc" => __( "Color of the blog's main title in header.
(#F7F7F7)",'admired'),
'std' => '#F7F7F7'),
array( "name" => __( 'Site Title Hover','admired'), 'id' =>
$admired_shortname.'_title_hover_color', 'type' => 'ctext',
"desc" => __( "Color of the blog's main title in header on
mouse hover. (#1982D1)",'admired'),
'std' => '#1982D1'),
array( "name" => __( 'Site Description','admired'), 'id' =>
$admired_shortname.'_description_color', 'type' => 'ctext',
"desc" => __( "Color of the blog's description in header.
(#C4C4C4)",'admired'),
'std' => '#C4C4C4'),
array( "name" => __( 'Hide Title and Discription','admired'), 'id' =>
$admired_shortname.'_hide_title_discription', 'type' => 'checkbox',
"desc" => __( 'Hides the site title and discription from the
header.','admired')),
array( "name" => __( 'Search Bar Placement','admired'), 'id' =>
$admired_shortname.'_search_placement', 'type' => 'select',
"desc" => __( 'Where would you like the search bar? Menu,
header, or none at all.','admired'),
'std' => 'Menu',
'value' => array( __('Menu','admired'),
__('Header','admired'), __('None','admired'))),
array("type" => "close"),
array( "type" => "save-opts"),
array( "type" => "close-tab"),
// ***************************** Sidebar Options
**********************************
array( "id" => $admired_shortname."-tab-5",
"type" => "open-tab"),
array("name" => __('<font size=4 color=#464646>Sidebar
Options</font>','admired'),
"type" => "section"),
array("name" => __('<font size=2 color=#464646>Settings that
change the look of your sidebar.</font>','admired'),
"type" => "section-desc"),
array("type" => "open"),
array( "name" => __( 'Widget Title Background Color','admired'), 'id'
=> $admired_shortname.'_widget_title_bgcolor', 'type' => 'ctext',
"desc" => __( 'This will change the background color of the
widget title. (#66686E)','admired'),
'std' => '#66686E'),
array( "name" => __( 'Widget Title Text Color','admired'), 'id' =>
$admired_shortname.'_widget_title_txtcolor', 'type' => 'ctext',
"desc" => __( 'This will change the text color of the widget
title. (#FFFFFF)','admired'),
'std' => '#FFFFFF'),
array( "name" => __( 'widget List Bullet','admired'), 'id' =>
$admired_shortname.'_widget_bullet_color', 'type' => 'select',
"desc" => __( 'Bullet used for Unorderd Lists in sidebar
area.','admired'),
'std' => 'default',
'value' => array( __('default','admired'),
__('circle','admired'), __('disc','admired'), __('square','admired'), __('circle-
function admired_settings_page() {
global $admired_themename, $admired_shortname, $version,
$admired_settings, $admired_option_group, $admired_option_name;
?>
<div class="wrap">
<div class="options_wrap">
<?php screen_icon(); ?>
<h2><?php echo $admired_themename; ?>
<?php _e('Theme Options','admired'); ?>
</h2>
<p class="top-notice">
<?php _e('Customize the look of your theme with these settings.
','admired'); ?>
</p>
<?php if ( isset ( $_POST['reset'] ) ): ?>
<?php // Delete Settings
global $wpdb, $admired_themename,
$admired_shortname, $version, $admired_settings, $admired_option_group,
$admired_option_name;
delete_option('admired_theme_options');
wp_cache_flush(); ?>
<div class="updated fade">
<p><strong>
<?php _e( 'Admired options reset.','admired' ); ?>
</strong></p>
</div>
<?php elseif ( isset ( $_REQUEST['updated'] ) ): ?>
<div class="updated fade">
<p><strong>
<?php _e( 'Admired options saved.','admired' ); ?>
</strong></p>
</div>
<?php endif; ?>
<div id="ultra-header">
<div id="ultra-logo"></div>
</div>
<div id="tabs" style="clear:both;">
<ul class="tabNavigation">
<li><a href="#admired-tab-1"><span>
<?php _e('Layout','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-2"><span>
<?php _e('General','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-3"><span>
<?php _e('Fonts','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-4"><span>
<?php _e('Header','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-5"><span>
<?php _e('Sidebar','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-6"><span>
<?php _e('Comments','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-7"><span>
<?php _e('Footer','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-8"><span>
<?php _e('Pagination','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-9"><span>
<?php _e('Social','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-10"><span>
<?php _e('Advanced','admired'); ?>
</span></a></li>
<li><a href="#admired-tab-11"><span>
<?php _e('Analytics','admired'); ?>
</span></a></li>
</ul>
<div class="tabContainer">
<script type="text/javascript">
jQuery(document).ready(function($){
// Enable selectBox control
and bind events
$("#create").click( function()
{
$
("SELECT").selectBox();
});
$
("#serialize").click( function() {
$
("#console").append('<br />-- Serialized data --<br />' + $
("FORM").serialize().replace(/&/g, '<br />') + '<br /><br />');
$("#console")
[0].scrollTop = $("#console")[0].scrollHeight;
});
$("SELECT")
.selectBox()
.focus( function() {
$
("#console").append('Focus on ' + $(this).attr('name') + '<br />');
$("#console")
[0].scrollTop = $("#console")[0].scrollHeight;
})
.blur( function() {
$
("#console").append('Blur on ' + $(this).attr('name') + '<br />');
$("#console")
[0].scrollTop = $("#console")[0].scrollHeight;
})
.change( function() {
$
("#console").append('Change on ' + $(this).attr('name') + ': ' + $(this).val()
+ '<br />');
$("#console")
[0].scrollTop = $("#console")[0].scrollHeight;
});
});
// CheckBox - Show standard
CheckBox to IE8 and under.
jQuery(document).ready(function($){
if ($.browser.msie &&
$.browser.version.substr(0,1)<9) {
} else {
$
('input[type=checkbox]').Checkbox({labels:['Enable','Disable']});
}
});
// Media Uploader
jQuery(document).ready(function()
{
window.formfield = '';
jQuery('.upload_image_button').live('click', function() {
window.formfield =
jQuery('.upload_field',jQuery(this).parent());
tb_show('', 'mediaupload.php?type=image&TB_iframe=true');
return false;
});
window.original_send_to_editor =
window.send_to_editor;
window.send_to_editor =
function(html) {
if (window.formfield) {
imgurl =
jQuery('img',html).attr('src');
window.formfield.val(imgurl);
tb_remove();
}
else {
window.original_send_to_editor(html);
}
window.formfield = '';
window.imagefield = false;
}
});
</script>
<form method="post" action="options.php">
<?php settings_fields( $admired_option_group ); ?>
<?php $options = get_option( $admired_option_name ); ?>
<?php foreach ($admired_settings as $value) {
if ( isset($value['id']) ) { $valueid =
$value['id'];}
switch ( $value['type'] ) {
case "section": ?>
<div class="section_wrap">
<h3 class="section_title"><?php echo $value['name']; ?>
<?php break;
case "sectiondesc": ?>
<span><?php echo $value['name']; ?></span> </h3>
<div class="section_body">
<?php
break;
case "opentab": ?>
<div id="<?php echo $value['id']; ?>">
<?php break;
case "closetab": ?>
</div>
<?php break;
case 'text':
//
Text Box
?>
<div class="options_input options_text">
<div class="options_desc"><?php echo $value['desc']; ?></div>
<span class="labels">
<label for="<?php echo $admired_option_name.'['.$valueid.']'; ?
>"><?php echo $value['name']; ?></label>
</span>
<input name="<?php echo $admired_option_name.'['.
$valueid.']'; ?>" id="<?php echo $admired_option_name.'['.$valueid.']'; ?>"
type="<?php echo $value['type']; ?>" value="<?php if
( isset( $options[$valueid]) ){ esc_attr_e( stripslashes($options[$valueid])); }
else { esc_attr_e( stripslashes($value['std'])); } ?>" />
</div>
<?php
break;
case 'ctext':
//
Color Picker
?>
<div class="options_input options_text">
<div class="options_desc"><?php echo $value['desc']; ?></div>
<span class="labels">
<label for="<?php echo $admired_option_name.'['.$valueid.']'; ?
>"><?php echo $value['name']; ?></label>
</span>
<input class="ctext-color" style="background-color:<?php if
( isset( $options[$valueid]) ){ esc_attr_e (stripslashes($options[$valueid])); }
else { esc_attr_e($value['std']); } ?>;" name="<?php echo
$admired_option_name.'['.$valueid.']'; ?>" id="<?php echo
$admired_option_name.'['.$valueid.']'; ?>" type="<?php echo $value['type'];
?>" maxlength="7" value="<?php if ( isset( $options[$valueid]) )
?>
<div class="options_input options_select">
<div class="options_desc"><?php echo $value['desc']; ?></div>
<span class="radio-labels">
<label for="<?php echo $admired_option_name.'['.$valueid.']'; ?
>"><?php echo $value['name']; ?></label>
</span>
<div style="width:700px; clear:both;"></div>
<?php foreach ($value['options'] as $key=>$option) {
$radio_setting = $options[$valueid]; ?>
<div style="width:150px; float:left; margin-top: 15px;"> <img
src="<?php echo esc_url( get_template_directory_uri() . '/admin/images/'.
$key ); ?>.png" width="136" height="122" style="border: 1px solid #888;"
alt="" />
<input type="radio" id="<?php echo $admired_option_name.'['.
$valueid.']'; ?>" name="<?php echo $admired_option_name.'['.$valueid.']'; ?
>" value="<?php echo $key; ?>" <?php
if($radio_setting != '') { checked($key, $options[$valueid]); } else
{ checked($key, $value['std']); } ?> />
<?php echo $option; ?><br />
</div>
<?php } ?>
</div>
<?php
break;
case "radio2":
// Radio Buttons
?>
<div class="font_options_input options_select">
<div class="options_desc"><?php echo $value['desc']; ?></div>
<span class="radio-labels">
<label for="<?php echo $admired_option_name.'['.$valueid.']'; ?
>"><?php echo $value['name']; ?></label>
</span>
<div style="width:700px; clear:both;"></div>
<?php foreach ($value['options'] as $key=>$option) {
$radio_setting = $options[$valueid]; ?>
<div style="width:230px; float:left; margin-top: 15px;">
<input type="radio" id="<?php echo $admired_option_name.'['.
$valueid.']'; ?>" name="<?php echo $admired_option_name.'['.$valueid.']'; ?
>" value="<?php echo $key; ?>" <?php
2. Home page
<?php
/**
* The Header for our theme.
*
* @since admired 1.0
*/
?>
<!DOCTYPE html>
<!--[if IE 6]> <html id="ie6" class="no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7]> <html id="ie7" class="no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8]> <html id="ie8" class="no-js" <?php language_attributes(); ?>> <![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
<html class="no-js" <?php language_attributes(); ?>>
<!--<![endif]-->
<ul class="admired-social">
<?php // Pinterest
if ( isset ($options['admired_pinterest_id']) &&
($options['admired_pinterest_id']!="") ) {
$output = '<li><a target="_blank" href="http://pinterest.com/'."";
$output .= $options['admired_pinterest_id'] ."";
$output .= '" id="admired-pinterest"
title="Pinterest"></a></li>'."";
echo stripslashes($output);
} // Youtube
if ( isset ($options['admired_youtube_id']) &&
($options['admired_youtube_id']!="") ) {
$output = '<li><a target="_blank"
href="http://youtube.com/user/'."";
$output .= $options['admired_youtube_id'] ."";
$output .= '" id="admired-youtube" title="Youtube"></a></li>'."";
echo stripslashes($output);
} // Vimeo
if ( isset ($options['admired_vimeo_id']) &&
($options['admired_vimeo_id']!="") ) {
$output = '<li><a target="_blank" href="http://vimeo.com/'."";
$output .= $options['admired_vimeo_id'] ."";
$output .= '" id="admired-buzz" title="Vimeo"></a></li>'."";
echo stripslashes($output);
} // Google Plus
if ( isset ($options['admired_google_plus_id']) &&
($options['admired_google_plus_id']!="") ) {
$output = '<li><a target="_blank"
href="http://plus.google.com/'."";
$output .= $options['admired_google_plus_id'] ."";
$output .= '" id="admired-plus" title="Google Plus"></a></li>'."";
echo stripslashes($output);
} // Twitter
if ( isset ($options['admired_twitter_id']) &&
($options['admired_twitter_id']!="") ) {
$output = '<li><a target="_blank" href="http://twitter.com/'."";
$output .= $options['admired_twitter_id'] ."";
$output .= '" id="admired-twitter" title="Twitter"></a></li>'."";
echo stripslashes($output);
} // Facebook
if ( isset ($options['admired_facebook_id']) &&
($options['admired_facebook_id']!="") ) {
$output = '<li><a target="_blank" href="http://facebook.com/'."";
$output .= $options['admired_facebook_id'] ."";
$output .= '" id="admired-facebook"
title="Facebook"></a></li>'."";
echo stripslashes($output);
} // Rss
if ( isset ($options['admired_rss_feed']) &&
($options['admired_rss_feed']!="") ) {
echo ('<li><a target="_blank" href="');
echo ( bloginfo( 'rss_url'));
echo ('" id="admired-rss" title="RSS"></a></li>');
}
?>
</ul>
</div>
<!-- .admired-social -->
3. Payment
<?php
/**
* Template Name: Payment
*/
?>
<?php get_header(); ?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#amnt').change(function(){
var a = jQuery('#amnt').val();
alert(a);
var b = jQuery('#amount').val(a);
alert(b);
})
jQuery('#sub').click(function(){
var data1 = jQuery("#frm").serialize();
jQuery.ajax({
url:'<?php bloginfo('template_directory')?>/insert.php',
method:'post',
data:data1,
}).done(function(msg){
alert('Hello');
jQuery("#pay_form").submit();
});
});
});
</script>
<style>
td {
padding: 10px 10px 10px 20px;
}
</style>
<?php $rand = rand(); ?>
<form method="post" action="" name="frm" id="frm">
<table width="500">
<tr>
<td colspan="2" align="center"></td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="name1" id="name1" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="email" name="email" id="email" /></td>
</tr>
<tr>
<td>Contact no</td>
<td><input type="text" name="phone" id="phone" /></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="address" id="address" /></td>
</tr>
<tr>
<td>Payment Amount</td>
<td><select name="amnt" id="amnt">
<option value="0">0</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150"></option>
150
</select></td>
</tr>
<tr>
<td>Age</td>
<td><input type="text" name="age" id="age" /></td>
</tr>
<tr>
<td><input type="hidden" name="rand" id="rand" value ="<?php echo $rand; ?>"/></td>
</tr>
<tr>
<td><input type="button" name="sub" id="sub" value="Save"/></td>
</tr>
</table>
</form>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"
name="pay_form" id="pay_form">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="amount" id="amount" value="">
<input type="hidden" name="business" value="anshul1987@gmail.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://paperrockpictures.com/paymentsuccess/?
message=success&randid=<?php echo $rand;?>">
<input type="hidden" name="cancel_return" value="http://paperrockpictures.com/bridepayment/">
</form>
<?php get_footer(); ?>
<?php
get_header();
$message = $_REQUEST['message'];
$randid = $_REQUEST['randid'];
mysql_connect('localhost', 'ethtown_rocks', 'z68hqsZRboGM');
mysql_select_db('ethtown_rocks');
$update = "UPDATE bride_payment SET status = '$message' where rand_id = '$randid'";
$result = mysql_query($update);
if($result){
echo "payment Success";
} else {
echo "Payment Not Success";
}
get_footer();
?>