January 14, 2023
Paper Republic

Found a great source for leather notebook covers and folios by accident from an Instagram ad recently. I love this company now.


January 14, 2023
Site has been updated

The first round of site updates are done. I didn't go with the infinite scroll, I got lazy and used the old tried-and-true Paginator I wrote well over a decade ago. It has been updated with baked-in bootstrap pagination classes. If you're interested, here's the code:


class Paginator
{

	public $current_page = 1;
	public $total_pages = 1;
	public $total_records = 0;
	public $display_total_only = 0;
	public $query_string = 0;
	public $singular_record_text = "";
	public $plural_record_text = "";
	private $inc = 1;			// inc = increment by N page - used in prev/next
	private $fp = 1;			// fp = first page
	public $threshold = 1;		// th = threshold (keep pages visible +/- from current)
	public $end_threshold = 1; // st = starter threshold - keep first page visible up to Nth page.

	public function __construct($thispage=1,$totalpages=1,$totalrecords=0,$singular_text="record",$plural_text="records",$query_string=0)
	{ 
		$this->current_page = $thispage;
		$this->total_pages = $totalpages;
		$this->total_records = $totalrecords;
		$this->singular_record_text = $singular_text;
		$this->plural_record_text = $plural_text;
		$this->query_string = $query_string;
	}

	public function getFirst()
	{
		return $this->fp;
	}

	public function getLast()
	{
		return $this->total_pages;
	}

	public function getPrev()
	{
		if (($this->current_page - $this->inc) >= $this->fp)
		{
			if ($this->current_page - $this->inc > $this->total_pages)
			{
				return $this->total_pages;
			} else {
				return $this->current_page - $this->inc;
			}
		} else {
			return $this->fp;
		}
	}

	public function getNext()
	{
		if (($this->current_page + $this->inc) > $this->total_pages)
		{
			return $this->total_pages;
		} else {
			return $this->current_page + $this->inc;
		}
	}

	public function getMin()
	{
		if ($this->current_page <= $this->end_threshold)
		{
			return $this->fp;
		} else {
			return $this->current_page - $this->threshold;
		}
	}

	public function getMax()
	{

		if ($this->total_pages <= $this->end_threshold) {
			$max = $this->total_pages;
		} else {
			// if ($this->current_page < $this->end_threshold) { // commented out mb 090616
			//	$max = $this->end_threshold;
			//} else {
				if ($this->current_page > ($this->total_pages - $this->threshold)) {
					$max = $this->total_pages;
				} else {
					if ($this->total_pages - $this->current_page == $this->threshold+1)
					{
						$max = $this->current_page + $this->threshold+1;
					} else {
						$max = $this->current_page + $this->threshold;
					}
				}
		//	}
		}

		return $max;
	}

	public function getNextBreak()
	{
		return ($this->getMax() < $this->total_pages)?1:0;
	}

	public function getPrevBreak()
	{
		return ($this->getMin() > 1)?1:0;
	}
	
	public function getPageLink($page)
	{
		return "/".$this->query_string . "/page/" . $page;
		// return ($this->query_string?$this->query_string."&":"?")."page=" . $page;
	}
	
	public function getHTML()
	{
		$previouspage = $this->getPrev();
		$currentpage = $this->current_page;
		$nextpage = $this->getNext();
		$firstpage = $this->getFirst();
		$min = $this->getMin();
		$max = $this->getMax();
		$shownextbreak = $this->getNextBreak();
		$showprevbreak = $this->getPrevBreak();
		
		$html = '';
		
		$html .= "<div class=\"text-center\">\n";
		if ($this->display_total_only != 1)
		{
			$html .= "<ul class=\"pagination justify-content-center\">\n";

			// first page link - mb 100723
			if ($this->current_page != $this->getFirst() && $min > $this->getFirst() && $this->threshold != 0)
				$html .= "<li class='page-item'><a class='page-link' href=\"" . $this->getPageLink($this->getFirst()) . "\">«</a></li>\n";

			if ($this->current_page != $this->getFirst())
				$html .= "<li class='page-item'><a class='page-link' href=\"" . $this->getPageLink($previouspage) . "\">‹</a></li>\n";

			for ($i=$min;$i<=$max;$i++)
			{
				if ($this->current_page == $i)
				{
					$html .= "<li class='page-item active'><a class='page-link' href=\"" . $this->getPageLink($currentpage) . "\">" . //"<span".($this->threshold==0?"":" class=\"This-page\"").">".
							($this->threshold==0?"Page ":"").$this->current_page.
							($this->threshold==0?" of ".$this->total_pages:"").
						 "</a></li>\n";
				} else {
					if ($this->threshold!=0) $html .= "<li class='page-item'><a class='page-link' href=\"" . $this->getPageLink($i) . "\">$i</a></li>\n";
				}
			}

			if ($this->current_page != $this->total_pages && $this->current_page < $this->total_pages)
				$html .= "<li class='page-item'><a class='page-link' href=\"" . $this->getPageLink($nextpage) . "\">›</a></li>\n";
		
			// last page link - mb 100723
			if ($this->current_page != $this->getLast() && $max < $this->getLast() && $this->threshold != 0)
				$html .= "<li class='page-item'><a class='page-link' href=\"" . $this->getPageLink($this->getLast()) . "\">»</a></li>\n";
	
			$html .= "</ul>\n";
		}

		if ($this->total_records)
		{
			$html .= "<div class='Results'>" . 
			number_format($this->total_records) . " " . 
			($this->total_records <> 1?$this->plural_record_text:$this->singular_record_text) . 
			"</div>\n";
		} 
		
		$html .= "</div>\n";
		
		return $html;
	}

} // end of class

Here's how it's used with a Smarty template:

	if ( $total_pages > 1) {
		$pagin = new Paginator($current_page,$total_pages);
		$smarty->assign("paginator",$pagin->getHTML());
	}

January 1, 2023
Bring it on, 2023!

Last year was a whirlwind of a year. Lots of ups and downs and even a few lefts and rights. There were a lot of changes in my life and in the lives of people around me.

This year there will also be some exciting new changes made to this site. Here's what I'm thinking of doing:

Public changes

  • Merging and archiving the photos, scribbles and writing sections of the site
  • Changing the site to simply posts and about
  • Posts will be a stream or feed (chronologically ordered, newest first)
  • Posts will have infinite scroll instead of paging

Admin changes

  • Making post titles optional (or just getting rid of them altogether, not sure yet)
  • Better handling of image attachments

What will stay the same

  • The home page and about page
  • The design (for now)
  • The site will continue to be ad-free

Starting immediately, the Contact area of the /about page will link to my Buy Me a Coffee profile.


December 26, 2022
Peggy's Cove

A quick 10 minute sketch of one of my favourite places in the world.


December 4, 2022
Big Mac No Meat

Yesterday I ate a Big Mac No Meat. It was oddly satisfying. Would recommend if you want junk food but don't eat meat.


November 30, 2022
The Old Shed

These daily scribbles are somewhat therapeutic.


November 29, 2022
My favourite view

A view from the dock at the island.


September 29, 2022
Peggy's Cove Revisited

We went back for sunset last night.


September 28, 2022

September 17, 2022
The garage demolition

My dad's iconic garage has to be rebuilt due to fire damage back in February. This week demolition was finally started.


September 7, 2022
City of Drying

I mean Dragons...


September 3, 2022
Contrast

This caught my eye today.


August 30, 2022
Pre-storm bike ride

We made it.


August 26, 2022
Broccoli Island

My brother took some drone shots of the island tonight. This one is my favourite.


August 24, 2022
Paddle boating leads to rock climbing

Went paddle boating across the bay to see a beaver dam. John found a rock he then scaled which was a feat, in and out of the paddle boat, wearing slides. He was very proud of himself.


August 21, 2022
The light rn

The light is amazing here.


August 21, 2022

August 20, 2022
Headed North

Headed up to the island for a week.


August 14, 2022
Parkway Social

Today we went bowling at Parkway Social with family friends.


August 14, 2022
Beach sunset

Taken during my walk with Junior last night.