Skip to content

Commit

Permalink
catch-up commit
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 10, 2020
1 parent 5b8ab5b commit ba37494
Show file tree
Hide file tree
Showing 29 changed files with 1,977 additions and 1,647 deletions.
1 change: 1 addition & 0 deletions ads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google.com, pub-8327564465991193, DIRECT, f08c47fec0942fa0
453 changes: 218 additions & 235 deletions archive.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
</div><!-- end div.container -->
</div>
<a class="exit-off-canvas"></a>
<a class="exit-off-canvas"></a>
<!-- END DB FOOTER -->

<!-- closing off-canvas-wrap db-off-canvas-wrap db-wrapper db-content inner wrap-->
Expand All @@ -24,7 +24,7 @@
<?php roots_footer(); ?>
<span style="clear:both;display:block;"></span>
<script src="https://cdn.jsdelivr.net/foundation/5.5.3/js/foundation.min.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/app.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/app.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/vendor/jquery.lightSlider.js"></script>


Expand Down
57 changes: 52 additions & 5 deletions front-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
$opinion_cat = get_category_by_slug('opinion')->term_id;
?>
<div class="row db-story" data-equalizer>

<div class="large-6 medium-8 large-push-2 medium-push-4 columns db-story-center" data-equalizer-watch>
<?php
$args = array( 'numberposts' => 1, 'tag' => 'db-story-c1' );
Expand Down Expand Up @@ -177,8 +178,8 @@
<div>
<?php $quadid = get_cat_ID( 'The Quad' ); ?>
<div>
<a href="http://dailybruin.com/category/quad/">
<img src="http://dailybruin.com/images/2015/12/Quad-explainerbelow-01.png">
<a href="https://dailybruin.com/category/quad/">
<img src="https://dailybruin.com/images/2015/12/Quad-explainerbelow-01.png">
</a>
</div>
</div>
Expand Down Expand Up @@ -213,13 +214,14 @@

<!-- this used to be a MOJO refer
<div class="row db-image text-center hide-for-medium hide-for-small">
<a href="http://mojo.dailybruin.com"><img src="/img/mojo-webfiller.jpg"/></a>
<a href="https://mojo.dailybruin.com"><img src="/img/mojo-webfiller.jpg"/></a>
</div> -->
<div class="db-ad" style="margin-top: 1rem;">
<?php get_template_part('ad','side'); ?>
</div>
</div>
</div>
<!-- <img src="https://i.imgur.com/IKDfEji.jpg" style="max-width: 728px; margin: auto;"> -->
<div class="row db-divide"></div>
<div class="row">
<div class="db-story-m large-9 medium-12 columns hide-for-small">
Expand Down Expand Up @@ -473,15 +475,16 @@
<a href="//prime.dailybruin.com"><img src="/img/prime-webbanner.jpg"/></a>
</div>
<div class="row" id="featuredProject">
<div style="padding: 5px 20px;">
<!-- <div style="padding: 5px 20px;">
<h1>atomic city</h1>
<a href="//stack.dailybruin.com" class="right"><h4>More features</h4></a>
<span style="display:block;width:100%;clear:both;"></span>
<img style="height: 199px;" src="https://assets.dailybruin.com/images/enterprise.lanl/enterprise.news.plutonium.illo-a4cd6c02bf2186e201c355c82babc012.png" />
<p>The current contract for the Los Alamos National Laboratory expires in September 2018, and the UC, which has been involved in the management of the lab since its inception in varying capacities, submitted a bid last year to manage the lab.</p>
<a href="https://features.dailybruin.com/2018/atomic-city/index.html" class="featuredlink">View the stories, videos and graphics &nbsp;&raquo;</a>
<span style="display:block;width:100%;clear:both"></span>
</div>
</div> -->
<a href="https://prime.dailybruin.com"><img src="https://dailybruin.com/images/2020/01/Image-from-iOS-3.jpg" style="width: 100%;"></a>
</div><!-- end div#featuredProject -->
<div class="row">
<div class="large-12 columns advertisment featured-ads">
Expand Down Expand Up @@ -513,4 +516,48 @@
<?php wp_reset_query(); ?>
</div><!-- end div.container -->

<!-- NEWSLETTER POPUP -->
<script src="./js/newsletter.js?v=12"></script>
<div id="smokescreen" onclick="closeNewsletterPopup()" style="z-index: 10000; height: 100vh; width: 100vw; display: none; background-color: #0006; position: fixed; top: 0; left: 0; right: 0;"></div>
<div id="newsletterPopup" style="z-index: 10001; position: fixed; width: 80%; display: none; max-width: 550px; left: 0px; right: 0px; top: 100px; background-color: rgb(255, 255, 255); padding: 20px; margin: auto; text-align: center; box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 4px;">
<div style="
border: 3px solid #c4c4c4;
padding: 10px;
"><div style="text-align: left; width: 100%;"><div style="font-weight: bold; font-size: 16px; font-family: arial, sans serif; cursor: pointer" onclick="closeNewsletterPopup()">X</div></div>
<form action="//dailybruin.us15.list-manage.com/subscribe/post?u=15fa3629ea46e975a3174fe51&amp;id=ee621e262a" method="post" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate="">
<div style="
text-align: left;
padding: 0 10px;
"><h2 style="
font-size: 2.75rem;
font-family: 'Playfair Display', serif;
font-weight: bold;
color: #0080c6;
">Get what's Bruin,</h2>
<h3 style="
font-family: 'PT Serif', serif;
font-weight: bold;
font-size: 2rem;
color: #5f5f5f;
">every morning,<br>
right in your inbox.</h3>
</div>

<div style="
display: flex;
align-items: stretch;
font-family: 'PT Serif', serif;
padding: 10px;
"><input type="email" value="" name="EMAIL" class="required email" placeholder="Enter your e-mail" style="
font-size: 1rem;
border: 3px solid #c4c4c4;
margin: 0;
height: 38px;
">
<input type="submit" value="Subscribe" name="subscribe" class="button" onclick="subscribeToNewsletter()" style="background-color: #0080c6;margin: 0 0 0 20px;padding: 5px 30px;font-family: 'PT Serif', serif;"></div>



</form></div></div>

<?php get_footer(); ?>
106 changes: 105 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Roots functions
*/

if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
// DEPRECATED:
// if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }

require_once locate_template('/inc/util.php'); // Utility functions
require_once locate_template('/inc/config.php'); // Configuration and constants
Expand Down Expand Up @@ -61,3 +62,106 @@ function roots_setup() {
}

add_action('after_setup_theme', 'roots_setup');

// Re-adds Shortlinks
add_filter( 'get_shortlink', function( $shortlink ) {return $shortlink;} );


// !!! Rest API Routes !!!

register_sidebar( array(
'name' => __( 'REST API', 'caeruleum' ),
'id' => 'rest-api',
) );

// Add Media Email to View
register_rest_field( 'user', 'media_email',
array(
'get_callback' => function ( $user ) {
return $user['email'];
},
'update_callback' => null,
'schema' => null,
)
);

// Add Coauthors
if ( function_exists('get_coauthors') ) {
add_action( 'rest_api_init', 'custom_register_coauthors' );
function custom_register_coauthors() {
register_rest_field( 'post',
'coauthors',
array(
'get_callback' => 'custom_get_coauthors',
'update_callback' => null,
'schema' => null,
)
);
}
function custom_get_coauthors( $object, $field_name, $request ) {
$coauthors = get_coauthors($object['id']);

$authors = array();
foreach ($coauthors as $author) {
$authors[] = array(
'display_name' => $author->display_name,
'user_nicename' => $author->user_nicename,
'id' => $author->ID,
);
};
return $authors;
}
}

// Fetch NexGenGallery
function fetch_gallery( $request ) {
//get parameters from request
$params = $request->get_params();
$gallery = $params[id];
if ($gallery != '-1') //THIS PART DONE BY NEIL 2012
// // echo do_shortcode('[nggallery id='.$gallery.' template="galleryview" images=0]');
global $nggdb;
$galleryt = $nggdb->get_gallery($gallery, 'sortorder', 'ASC', true, 0, 0);
$images = array();
foreach($galleryt as $image) {
array_push($images, array(
'image' => $image->imageURL,
'caption' => $image->description,
'credit' => '('.$image->alttext .'/Daily Bruin)',
));
}
return $images;
}

add_action( 'rest_api_init', function () {
register_rest_route( 'db/v1', '/gallery/(?P<id>\d+)', array(
'methods' => 'GET',
'callback' => 'fetch_gallery',
'args' => array(
'id' => array(
'validate_callback' => function($param, $request, $key) {
return is_numeric( $param );
}
),
),
) );
});

/*
register_rest_field( 'post',
'blocks',
array(
'get_callback' => 'rest_get_blocks',
'update_callback' => null,
'schema' => null,
));
*/

/*
function rest_get_blocks($object) {
$post = get_post($object['id']);
if ($post instanceof WP_Post) {
return parse_blocks($post->post_content);
}
return array(["missed if statement"]);
}*/
18 changes: 15 additions & 3 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<script src="<?php echo get_template_directory_uri(); ?>/js/vendor/modernizr-2.5.3.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,700&display=swap" rel="stylesheet">

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/>
<link href='https://cdn.jsdelivr.net/animatecss/3.4.0/animate.min.css' rel='stylesheet'/>
<!--<script>window.jQuery || document.write('<script src="<?php echo get_template_directory_uri(); ?>/js/vendor/jquery-1.7.2.min.js"><\/script>')</script>-->
Expand Down Expand Up @@ -41,21 +43,29 @@
<link rel="apple-touch-icon" sizes="72x72" href="/img/apple-touch-icon-72x72-precomposed.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/img/apple-touch-icon-114x114-precomposed.png" />
<script src="//cdn.rawgit.com/namuol/cheet.js/master/cheet.min.js"type="text/javascript"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-28181852-28"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-28181852-28');
</script>

<!--<script src="//monitor404.s3.amazonaws.com/monitor404.min.js"></script>
<script>_404_SETTINGS = {exclude: '#wpadminbar a, .dropdown-toggle'}</script>-->

<meta name="apple-itunes-app" content="app-id=548832108">

<?php roots_head(); ?>
<?php wp_head(); ?>

<!-- Press Plus script -->
<script type="text/javascript" src="http://s.ppjol.net/pp.js">{
<!-- <script type="text/javascript" src="http://s.ppjol.net/pp.js">{
'zone':"qnbBZ63hK_pL2086YoKj3J",
'mode':"meter",
'debug':0
}</script>
}</script> -->

<!-- Wordpress Open Graph -->
<?php if(has_post_thumbnail() && !(is_front_page())) :
Expand Down Expand Up @@ -94,6 +104,8 @@
<meta name="twitter:site" content="@dailybruin"/>
<meta name="twitter:creator" content="@dailybruin"/>
<meta property="fb:pages" content="47311244274"/>
<?php wp_head(); ?>


</head>

Expand Down
Binary file added img/db_logo_HALLOWEEN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions img/quotationmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions img/quotationmark4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions img/quotationmarks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions inc/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ function has_post_thumbnail_caption() {
}
}


function the_post_thumbnail_caption() {
global $post;

$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));

if ($thumbnail_image && isset($thumbnail_image[0])) {
echo '<span>'.$thumbnail_image[0]->post_excerpt.'</span>';
}
}
// DEPRECATED
// function the_post_thumbnail_caption() {
// global $post;
//
// $thumbnail_id = get_post_thumbnail_id($post->ID);
// $thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));
//
// if ($thumbnail_image && isset($thumbnail_image[0])) {
// echo '<span>'.$thumbnail_image[0]->post_excerpt.'</span>';
// }
// }


// Adds a link to the WordPress web production doc from the admin bar
Expand Down
12 changes: 7 additions & 5 deletions inc/scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ function roots_scripts() {
// If you're not using Bootstrap, include HTML5 Boilerplate's main.css:
// wp_enqueue_style('roots_h5bp', get_template_directory_uri() . '/css/main.css', false, null);

wp_enqueue_style('roots_app', get_template_directory_uri() . '/css/app.css', false, "1425333448");

// wp_enqueue_style('roots_app', get_template_directory_uri() . '/css/app.css', false, "1425333448");
wp_enqueue_style('roots_app', get_template_directory_uri() . '/css/app.css', false, time(), false);


// Load style.css from child theme
if (is_child_theme()) {
Expand All @@ -42,8 +43,9 @@ function roots_scripts() {
}

wp_register_script('roots_plugins', get_template_directory_uri() . '/js/plugins.js', false, null, false);
wp_register_script('roots_main', get_template_directory_uri() . '/js/main.js', false, null, false);

wp_register_script('roots_main', get_template_directory_uri() . '/js/main.js', false, time(), false);
wp_register_script('newsletter_main', get_template_directory_uri() . '/js/newsletter.js', false, time(), false);

wp_register_script('galleryview_main', get_template_directory_uri() . '/js/vendor/jquery.galleryview-3.0-dev.js', false, null, false);
wp_register_script('galleryview_easing', get_template_directory_uri() . '/js/vendor/jquery.easing.1.3.js', false, null, false);
wp_register_script('galleryview_timers', get_template_directory_uri() . '/js/vendor/jquery.timers-1.2.js', false, null, false);
Expand All @@ -55,4 +57,4 @@ function roots_scripts() {
wp_enqueue_script('galleryview_timers');
}

add_action('wp_enqueue_scripts', 'roots_scripts', 100);
add_action('wp_enqueue_scripts', 'roots_scripts', 100);
2 changes: 1 addition & 1 deletion js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Foundation JavaScript
// Documentation can be found at: http://foundation.zurb.com/docs
$(document).foundation({
jQuery(document).foundation({
reveal : {
animation:'fade'
}
Expand Down
Loading

0 comments on commit ba37494

Please sign in to comment.