Browse Source

add bm to desk

windhamdavid 2 years ago
parent
commit
072003d7c6
2 changed files with 36 additions and 15 deletions
  1. 16 3
      inc/utils.php
  2. 20 12
      page-desk.php

+ 16 - 3
inc/utils.php

@@ -78,18 +78,18 @@ function _s_backbone_get_request_parameters() {
 **********************/
 **********************/
 
 
 function pull_til() {
 function pull_til() {
-	include('lib/html_dom.php');
+	require_once('lib/html_dom.php');
 
 
 	$url = 'https://davidawindham.com/til/index.html';
 	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$html = file_get_html($url);
 	$i = 0;
 	$i = 0;
 	foreach ($html->find('ul li ul li') as $li) {
 	foreach ($html->find('ul li ul li') as $li) {
 	    echo $li;
 	    echo $li;
-		if (++$i == 17) break;
+		if (++$i == 20) break;
 	}
 	}
 }
 }
 function pull_til_all() {
 function pull_til_all() {
-	include('lib/html_dom.php');
+	require_once('lib/html_dom.php');
 
 
 	$url = 'https://davidawindham.com/til/index.html';
 	$url = 'https://davidawindham.com/til/index.html';
 	$html = file_get_html($url);
 	$html = file_get_html($url);
@@ -98,6 +98,19 @@ function pull_til_all() {
 	    echo $li;
 	    echo $li;
 	}
 	}
 }
 }
+function bookmarks_pull() {
+	require_once('lib/html_dom.php');
+
+	$url = 'https://davidawindham.com/bookmarks/';
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('.linklist-item-title h2 a') as $li) {
+	    if (!empty($html)) {
+			echo $li . '<br />';
+			if (++$i == 20) break;
+		}
+	}
+}
 function bookmarks_all() {
 function bookmarks_all() {
 	require_once('lib/html_dom.php');
 	require_once('lib/html_dom.php');
 
 

+ 20 - 12
page-desk.php

@@ -11,14 +11,20 @@ get_header(); ?>
 				<h1 id="desk" class="cm-sans wow fadeInLeft">Desk</h1>
 				<h1 id="desk" class="cm-sans wow fadeInLeft">Desk</h1>
 			</div>
 			</div>
 		</div>
 		</div>
-		<div class="row desk">
+		<div class="row desk pt-5">
 			<div class="col-md-5">
 			<div class="col-md-5">
 				<div class="entry-content">
 				<div class="entry-content">
 					<h4 class="georgia spread"><em><span class="firstcharacter">T</span>he internet is ok if you look in the right places. It's also awash with nonsense</em>. I'm just hoping not to contribute to the nonsense. I publish little essays, notes, ideas, images, or pretty much anything else I want to share here. This site started with mostly computer related ramblings, but I went elsewhere with it after I quit the social networks. I wrote a <a href="/my-personal-website/">post about this website</a>. The easiest way to quickly scan everything on it is through the <a href="/archive/">archive</a> or <a href="/sitemap/">sitemap</a> pages.
 					<h4 class="georgia spread"><em><span class="firstcharacter">T</span>he internet is ok if you look in the right places. It's also awash with nonsense</em>. I'm just hoping not to contribute to the nonsense. I publish little essays, notes, ideas, images, or pretty much anything else I want to share here. This site started with mostly computer related ramblings, but I went elsewhere with it after I quit the social networks. I wrote a <a href="/my-personal-website/">post about this website</a>. The easiest way to quickly scan everything on it is through the <a href="/archive/">archive</a> or <a href="/sitemap/">sitemap</a> pages.
             <br /><br />Feel free to <a href="/contact/">contact me</a> if you have any feedback, questions, or just want to say hello. <br /><br />Thanks for the visit,</h4>
             <br /><br />Feel free to <a href="/contact/">contact me</a> if you have any feedback, questions, or just want to say hello. <br /><br />Thanks for the visit,</h4>
 					<img src="<?php echo get_template_directory_uri() . '/img/dw_signature.png'; ?>" alt="David Windham Signature"/>
 					<img src="<?php echo get_template_directory_uri() . '/img/dw_signature.png'; ?>" alt="David Windham Signature"/>
-					<img src="<?php echo get_template_directory_uri() . '/img/desk.png'; ?>" alt="Who Needs a Computer Anyway?" width="90%" style="margin:100px 10px;border:3px solid #cecece"/>
+					<img src="<?php echo get_template_directory_uri() . '/img/desk.png'; ?>" alt="Who Needs a Computer Anyway?" width="90%" style="margin:50px 10px 20px;border:3px solid #cecece"/>
 				</div>
 				</div>
+				<div class="studio-tools d-none d-lg-block">	
+						<ul>
+							<li><u>Recent Bookmarks</u></li>
+							<?php bookmarks_pull(); ?>
+						</ul>
+					</div>
 			</div>
 			</div>
 			<div class="col-md-4 studio-tools">
 			<div class="col-md-4 studio-tools">
 				<ul>
 				<ul>
@@ -32,11 +38,10 @@ get_header(); ?>
 					  <?php endforeach; ?>
 					  <?php endforeach; ?>
           <br>
           <br>
           <?php } ?>
           <?php } ?>
-					<li>Recent Posts</li>
+					<li><u>Recent Posts</u></li>
 					<?php $recentposts = get_posts('numberposts=68'); foreach ($recentposts as $post) : setup_postdata($post); ?>
 					<?php $recentposts = get_posts('numberposts=68'); foreach ($recentposts as $post) : setup_postdata($post); ?>
 					       <li style="color:#777"><?php echo get_the_date('m/d/y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
 					       <li style="color:#777"><?php echo get_the_date('m/d/y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
 					<?php endforeach; ?>
 					<?php endforeach; ?>
-					<li class="pull-right"><a href="<?php echo site_url(); ?>/archive/"><b>All Posts -></b></a></li>
 				</ul>
 				</ul>
 			</div>
 			</div>
 			<div class="col-md-3">
 			<div class="col-md-3">
@@ -44,22 +49,22 @@ get_header(); ?>
 					<?php get_search_form(); ?>
 					<?php get_search_form(); ?>
 				</div>
 				</div>
 				<div class="row">
 				<div class="row">
-					<div class="col-md-6 studio-tools">
+				<div class="col-xs-6 studio-tools">
 						<ul>
 						<ul>
-							<?php wp_list_categories('orderby=name&exclude=1,7,44&title_li=Topics'); ?>
+							<li>Year</li>
+							<?php wp_get_archives( array( 'type' => 'yearly') ); ?>
 						</ul>
 						</ul>
 					</div>
 					</div>
 					<div class="col-xs-6 studio-tools">
 					<div class="col-xs-6 studio-tools">
 						<ul>
 						<ul>
-							<li>Year</li>
-							<?php wp_get_archives( array( 'type' => 'yearly') ); ?>
+							<?php wp_list_categories('orderby=name&exclude=1,7,44&title_li=Topics'); ?>
 						</ul>
 						</ul>
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row">
 				<div class="row">
-					<div class="col-xs-12 studio-tools">
+					<div class="col-xs-6 studio-tools">
 						<ul class="tags">
 						<ul class="tags">
-							<li>Tags</li>
+							<li><u>Tags</u></li>
 							<?php $tags = get_tags(); if ( $tags ) : foreach ( $tags as $tag ) : ?>
 							<?php $tags = get_tags(); if ( $tags ) : foreach ( $tags as $tag ) : ?>
 							<a href="<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>" title="<?php echo esc_attr( $tag->name ); ?>"><?php echo esc_html( $tag->name ); ?></a>,
 							<a href="<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>" title="<?php echo esc_attr( $tag->name ); ?>"><?php echo esc_html( $tag->name ); ?></a>,
 							<?php endforeach; endif; ?>
 							<?php endforeach; endif; ?>
@@ -68,14 +73,17 @@ get_header(); ?>
 				</div>
 				</div>
 				<div class="row">
 				<div class="row">
 					<div class="col-md-12 studio-tools">
 					<div class="col-md-12 studio-tools">
-						<h5>Today I Learned</h5>
+						<h5><u>Today I Learned</u></h5>
 						<ul>
 						<ul>
 							<?php pull_til(); ?>
 							<?php pull_til(); ?>
-							<li class="pull-right"><a href="https://davidawindham.com/til/"><b>All TIL -></b></a></li>
 						</ul>
 						</ul>
 					</div>
 					</div>
 				</div>
 				</div>
 			</div>
 			</div>
+
+		</div>
+		<div class="row justify-content-end mt-3">
+			<a href="/archive/" type="button" class="btn btn-danger">Archive</a>
 		</div>
 		</div>
 	</div>
 	</div>
 	<div class="container">
 	<div class="container">