Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
szk11001 committed Oct 23, 2014
2 parents 0223f07 + d709d7c commit 67f2daf
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 98 deletions.
15 changes: 9 additions & 6 deletions css/uup.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
.uup-list .uup-item .uup-text > span {
display: block;
}
.uup-list .uup-item .uup-text a .uup-name {
display: inline;
}
.uup-list .uup-item .uup-text .uup-name {
font-weight: bold;
}
Expand Down Expand Up @@ -58,21 +61,21 @@
/*
Profile Page
*/
.uup-user {
.page-template-page-user-profile-php .uup-user {
padding: 1em;
}
.uup-user > span {
.page-template-page-user-profile-php .uup-user > span {
display: block;
}
.uup-user .uup-image {
.page-template-page-user-profile-php .uup-user .uup-image {
margin-bottom: 1em;
}
.uup-user .uup-name {
.page-template-page-user-profile-php .uup-user .uup-name {
font-weight: bold;
}
.uup-user .uup-name .uup-first:after {
.page-template-page-user-profile-php .uup-user .uup-name .uup-first:after {
content: ' ';
}
.uup-user .uup-phones .uup-phone2 {
.page-template-page-user-profile-php .uup-user .uup-phones .uup-phone2 {
display: block;
}
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</footer>
</div><!-- #footers -->
</div><!-- #page -->

<!--[if lte IE 9]></div><![endif]-->
<?php wp_footer(); ?>

</body>
Expand Down
9 changes: 9 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ function cs_scripts() {
wp_enqueue_script( 'cs', get_template_directory_uri() . '/js/cs.js', array( 'jquery' ));
wp_enqueue_script( 'cs-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'cs-bootstrap-js'), '20120206', true );
wp_enqueue_script( 'cs-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );

$outboundtracking = get_option( 'outbound_tracking','');
if($outboundtracking == 'yes') wp_enqueue_script('uc-link-tracking', get_bloginfo('template_url').'/js/linktracking.js', array('jquery'));

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
Expand Down Expand Up @@ -162,6 +165,12 @@ function ieBootstrap(){
require get_template_directory() . '/inc/bootstrap-forms.php';


/**
* Custom site settings
*/
require get_template_directory() . '/inc/settings.php';


// Change what's hidden by default
add_filter('default_hidden_meta_boxes', 'be_hidden_meta_boxes', 10, 2);
function be_hidden_meta_boxes($hidden, $screen) {
Expand Down
16 changes: 5 additions & 11 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@
*
*/
include 'inc/vars.php';

?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html <?php language_attributes(); ?> class="ie lte9 lte8 lte7 lte6"> <![endif]-->
<!--[if IE 7]> <html <?php language_attributes(); ?> class="ie ie7 lte9 lte8 lte7"> <![endif]-->
<!--[if IE 8]> <html <?php language_attributes(); ?> class="ie ie8 lte9 lte8"> <![endif]-->
<!--[if IE 9]> <html <?php language_attributes(); ?> class="ie ie9 lte9"> <![endif]-->
<!--[if gt IE 9]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" />
Expand All @@ -24,12 +17,13 @@
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?> >

<body <?php body_class(); ?>>
<!--[if lt IE 7]> <div class="ie lte9 lte8 lte7 lte6"> <![endif]-->
<!--[if IE 7]> <div class="ie ie7 lte9 lte8 lte7"> <![endif]-->
<!--[if IE 8]> <div class="ie ie8 lte9 lte8"> <![endif]-->
<!--[if IE 9]> <div class="ie ie9 lte9"> <![endif]-->
<nav id="skiplinks">
<a href="#site-navigation">Skip to Navigation</a>
<a href="#uc-search">Skip to UConn Search</a>
Expand Down
37 changes: 37 additions & 0 deletions inc/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Class for adding a link tracking to the options-general.php page
*/
class Add_Settings_Field {

/**
* Class constructor
*/
public function __construct() {
add_filter( 'admin_init' , array( &$this , 'register_fields' ) );
}

/**
* Add new fields to wp-admin/options-general.php page
*/
public function register_fields() {
register_setting( 'general', 'outbound_tracking', 'esc_attr' );
add_settings_field(
'fav_color',
'<label for="outbound_tracking">' . __( 'Track Outbound Links' , 'outbound_tracking' ) . '</label>',
array( &$this, 'fields_radio' ),
'general'
);
}

/**
* HTML for extra settings
*/
public function fields_radio() {
$value = get_option( 'outbound_tracking', '' );
echo '<input type="radio" id="outbound_tracking_no" name="outbound_tracking" value="no"'.(strlen(esc_attr( $value )) == 0 || esc_attr( $value ) == 'no'?' checked':'' ).' /> No <input type="radio" id="outbound_tracking_yes" name="outbound_tracking" value="yes"'.(esc_attr( $value ) == 'yes'?' checked':'' ).' /> Yes ';
}

}
new Add_Settings_Field();
?>
30 changes: 30 additions & 0 deletions js/linktracking.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Attach tracking to all download & external links */
var _gaq = _gaq || [];

function _gaLt(event){
var el = event.srcElement || event.target;

/* Loop up the tree through parent elements if clicked element is not a link (eg: an image in a link) */
while(el && (typeof el.tagName == 'undefined' || el.tagName.toLowerCase() != 'a' || !el.href))
el = el.parentNode;

if(el && el.href){
if(el.href.indexOf(location.host) == -1){ /* external link */
_gaq.push(["_trackEvent", "Outgoing Links", el.href, document.location.pathname + document.location.search]);
/* if target not set then delay opening of window by 0.5s to allow tracking */
if(!el.target || el.target.match(/^_(self|parent|top)$/i)){
setTimeout(function(){
document.location.href = el.href;
}.bind(el),500);
/* Prevent standard click */
event.preventDefault ? event.preventDefault() : event.returnValue = !1;
}
}

}
}

/* Attach the event to all clicks in the document after page has loaded */
var w = window;
w.addEventListener ? w.addEventListener("load",function(){document.body.addEventListener("click",_gaLt,!1)},!1)
: w.attachEvent && w.attachEvent("onload",function(){document.body.attachEvent("onclick",_gaLt)});
1 change: 1 addition & 0 deletions page-blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<div class="col-sm-<?php echo (is_active_sidebar( $sidebar )?9:12); ?>">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php the_content();?>
<?php query_posts('post_type=post&post_status=publish&paged='. get_query_var('paged')); ?>
<?php if( have_posts() ): ?>
<?php while( have_posts() ): the_post(); ?>
Expand Down
75 changes: 38 additions & 37 deletions page-home.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
<?php
/**
Template Name: Home
* The template for displaying the homepage.
*
* @package cornerstone
*/
$rows = get_theme_mod('homepagerows');
$count = 1;
get_header(); ?>

<div id="page-home">
<?php while ( have_posts() ) : the_post(); ?>
<?php for($i=0; $i<$rows; $i++){ /* Begin Homepage Builder... */?>
<div class="row">
<?php
$widths = get_theme_mod('homepage_'.$i);
$widths = explode(',',$widths);
foreach($widths as $width){
if($width == 0) break;
?>
<div class="col-sm-<?php echo $width; ?>">
<div class="home-section" id="home-section-<?php echo $count; ?>">
<?php if ( is_active_sidebar( 'home'.$count ) ) { ?>
<?php dynamic_sidebar( 'home'.$count ); ?>
<?php } else { ?>
<?php }; ?>
</div>
</div>
<?php $count ++; } ?>
</div>
<!-- /row-->
<?php } /* ... end Homepage Builder */?>
<?php endwhile; // end of the loop. ?>
</div>
<?php get_footer(); ?>
<?php
/**
Template Name: Home
* The template for displaying the homepage.
*
* @package cornerstone
*/
$rows = get_theme_mod('homepagerows');
$count = 1;
get_header(); ?>

<div id="page-home">
<?php while ( have_posts() ) : the_post(); ?>
<?php for($i=0; $i<$rows; $i++){ /* Begin Homepage Builder... */?>
<div class="row">
<?php
$widths = get_theme_mod('homepage_'.$i);
$widths = explode(',',$widths);
if(count($widths) == 1) $widths[0] = 12;
foreach($widths as $width){
if($width == 0) break;
?>
<div class="col-sm-<?php echo $width; ?>">
<div class="home-section" id="home-section-<?php echo $count; ?>">
<?php if ( is_active_sidebar( 'home'.$count ) ) { ?>
<?php dynamic_sidebar( 'home'.$count ); ?>
<?php } else { ?>
<?php }; ?>
</div>
</div>
<?php $count ++; } ?>
</div>
<!-- /row-->
<?php } /* ... end Homepage Builder */?>
<?php endwhile; // end of the loop. ?>
</div>
<?php get_footer(); ?>
72 changes: 38 additions & 34 deletions sass/uup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
& > span {
display:block;
}

a .uup-name {
display:inline;
}
.uup-name {
font-weight:bold;

Expand Down Expand Up @@ -99,40 +101,42 @@
/*
Profile Page
*/
.uup-user {
padding: 1em;
& > span {
display:block;
}
.uup-image{
margin-bottom:1em;
}
.uup-name {
font-weight:bold;

.uup-first {
&:after {
content:' ';
.page-template-page-user-profile-php {
.uup-user {
padding: 1em;
& > span {
display:block;
}
.uup-image{
margin-bottom:1em;
}
.uup-name {
font-weight:bold;

.uup-first {
&:after {
content:' ';
}
}
.uup-last {}
}
.uup-last {}
}
.uup-title {
}
.uup-phones {
.uup-phone1 {}
.uup-phone2 {
display:block;
.uup-title {
}
.uup-phones {
.uup-phone1 {}
.uup-phone2 {
display:block;
}
}
.uup-email {
}
.uup-fax {
}
.uup-office-location {
}
.uup-office-hours {
}
.uup-mailing-address {
}
}
.uup-email {
}
.uup-fax {
}
.uup-office-location {
}
.uup-office-hours {
}
.uup-mailing-address {
}
}
}
5 changes: 3 additions & 2 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', 'search' ); ?>

<h3><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h3>
<p><?php the_excerpt(); ?></p>

<?php endwhile; ?>

Expand Down
2 changes: 1 addition & 1 deletion sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package cornerstone
*/
?>
<div id="secondary" class="col-sm-3 widget-area" role="complementary">
<div id="secondary" class="col-md-3 widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar' ) ) : ?>

<aside id="search" class="widget widget_search">
Expand Down
Loading

0 comments on commit 67f2daf

Please sign in to comment.