Skip to content
The Working K9 University
The Working K9 University

Don’t Raise Your Voice, Raise Your Level

  • Training
    • Group Classes
  • Service Dogs
    • Ada
  • Outreach
  • Blog
    • Biggie – 3 Week Service Dog Training
    • – Raven – 3 Week Service Dog Board and Train
  • Breeding
  • Boarding
  • Adoptions
  • Contact Us
  • Log In

Life with Lemons

Being a service dog trainer is my passion. However, it started when I became disabled and had to traverse a world full of plot holes and misguiding information. So I became the person I needed and I am going to help you guys navigate through the murky waters so you can go straight to living your best lives making lemonade!

Free Shipping on $75+ at West Paw!
EzyDog Active Dog Gear - Free US Shipping!
sprinkle-sweep.com
All Season Paw Protection. FREE SHIPPING TODAY on ALL Ruffwear Dog Boots!

// If you change the boolean in the function call from true to false  it will output full pagination links (eg. < Prev | 1 | 2 | 3 | Next >)
$strHtml = str_replace("", getPawPagination($strHtml, true), $strHtml);

// Stream back the response
echo $strHtml;

function getPawPagination($strHtml, $blnSimpleStyle)
{
	$strPaginationHtml = "";
	$intPaginationStart = strpos($strHtml, "");
	$intPaginationStart = ($intPaginationStart + 24);
	$intLength = $intPaginationEnd - $intPaginationStart;
	$strPagination = substr($strHtml, $intPaginationStart, $intLength);
	$arrPagination = explode("|", $strPagination);
	$intProductsPerPage = intval($arrPagination[0]);
	$intProductCount = intval($arrPagination[1]);
	$intPage = intval($arrPagination[2]);
	if ($intPage == 0) { $intPage = 1; }

	// Find the root URL for this page
	if (isset($_SERVER["REQUEST_URI"])) {
		$strRootUrl = $_SERVER["REQUEST_URI"];

		// Strip off any parameters from our root URL, those will
		// be re-added correctly below
		$intPos = strpos($strRootUrl, "?");
		if ($intPos !== false) {
			$strRootUrl = substr($strRootUrl, 0, $intPos);
		}
	}
	else {
		$strRootUrl = $_SERVER["PHP_SELF"];
	}

	$strParams = "?";
	$intParamCount = 0;
	foreach ($_GET as $key => $value) {
		if ($key != "paw_page") {
			if ($intParamCount == 0) { $strParams .= $key . "=" . $value; }
			else { $strParams .= "&" . $key . "=" . $value; }
		}
		$intParamCount++;
	}

	if ($strParams == "?") { $strPaginationUrl = $strRootUrl . $strParams . "paw_page="; }
	else { $strPaginationUrl = $strRootUrl . $strParams . "&paw_page="; }

	if ($intProductCount > $intProductsPerPage) {
		$intTotalPages = ceil($intProductCount/$intProductsPerPage);
	}
	else { $intTotalPages = 0; }

	if ($intTotalPages > 0) {
		if ($intPage > 1) { $strPaginationHtml = "< Prev "; }
		else { $strPaginationHtml = "< Prev "; }

		if (!$blnSimpleStyle) {
			for ($i=1; $i<=($intTotalPages); $i++)
			{
				if ($intPage == $i) { $strPaginationHtml .= " | " . $i . " "; }
				else { $strPaginationHtml .= " | " . $i . " "; }
			}

			$strPaginationHtml .= " | ";
		}

		if (($intPage + 1) <= $intTotalPages) { $strPaginationHtml .= " Next >"; }
		else { $strPaginationHtml .= " Next >"; }
	}

	return($strPaginationHtml);
}

?>
<?php
// Construct the full URL of your Product Ad Widget request
// NOTE: You will have to add http: or https:
$strUrl = "//www.avantlink.com/product_ad_widget/paw.php?pawid=168385&pw=293373&output=html&page=" . intval($_GET['paw_page']);

// If you want your Product Ad Widget to use an internal redirect for the links instead of
// direct outbound affiliate links, uncomment the following four lines
//$paw_redirect_url = $_SERVER['PHP_SELF'];
//if ($_SERVER['QUERY_STRING'] != '') { $paw_redirect_url .= '?' . $_SERVER['QUERY_STRING']; }
//$strUrl .= "&paw_redirect_url=" . urlencode($paw_redirect_url);
//if (isset($_GET['redirect_url'])) { header("Location: " . urldecode($_GET['redirect_url'])); }

// Uncomment the next line if you want to add a rel="nofollow" attribute to your links
//$strUrl .= "&nofollow=1";

// Make the actual Product Ad Widget request
$strHtml = file_get_contents($strUrl);

// If your Product Ad Widget will contain more then one page of results you can include
// the following function call to add pagination to your display.
//
// The default is to show simple pagination links like: < Prev Next >
// If you change the boolean in the function call from true to false  it will output full pagination links (eg. < Prev | 1 | 2 | 3 | Next >)
$strHtml = str_replace("<!--[PAW_PAGINATION]-->", getPawPagination($strHtml, true), $strHtml);

// Stream back the response
echo $strHtml;

function getPawPagination($strHtml, $blnSimpleStyle)
{
	$strPaginationHtml = "";
	$intPaginationStart = strpos($strHtml, "<!--START_PAW_PAGINATION");
	$intPaginationEnd = strpos($strHtml, "END_PAW_PAGINATION-->");
	$intPaginationStart = ($intPaginationStart + 24);
	$intLength = $intPaginationEnd - $intPaginationStart;
	$strPagination = substr($strHtml, $intPaginationStart, $intLength);
	$arrPagination = explode("|", $strPagination);
	$intProductsPerPage = intval($arrPagination[0]);
	$intProductCount = intval($arrPagination[1]);
	$intPage = intval($arrPagination[2]);
	if ($intPage == 0) { $intPage = 1; }

	// Find the root URL for this page
	if (isset($_SERVER["REQUEST_URI"])) {
		$strRootUrl = $_SERVER["REQUEST_URI"];

		// Strip off any parameters from our root URL, those will
		// be re-added correctly below
		$intPos = strpos($strRootUrl, "?");
		if ($intPos !== false) {
			$strRootUrl = substr($strRootUrl, 0, $intPos);
		}
	}
	else {
		$strRootUrl = $_SERVER["PHP_SELF"];
	}

	$strParams = "?";
	$intParamCount = 0;
	foreach ($_GET as $key => $value) {
		if ($key != "paw_page") {
			if ($intParamCount == 0) { $strParams .= $key . "=" . $value; }
			else { $strParams .= "&" . $key . "=" . $value; }
		}
		$intParamCount++;
	}

	if ($strParams == "?") { $strPaginationUrl = $strRootUrl . $strParams . "paw_page="; }
	else { $strPaginationUrl = $strRootUrl . $strParams . "&paw_page="; }

	if ($intProductCount > $intProductsPerPage) {
		$intTotalPages = ceil($intProductCount/$intProductsPerPage);
	}
	else { $intTotalPages = 0; }

	if ($intTotalPages > 0) {
		if ($intPage > 1) { $strPaginationHtml = "<a href=\"" . $strPaginationUrl . ($intPage - 1) . "\">< Prev</a> "; }
		else { $strPaginationHtml = "< Prev "; }

		if (!$blnSimpleStyle) {
			for ($i=1; $i<=($intTotalPages); $i++)
			{
				if ($intPage == $i) { $strPaginationHtml .= " | " . $i . " "; }
				else { $strPaginationHtml .= " | <a href=\"" . $strPaginationUrl . $i . "\">" . $i . "</a> "; }
			}

			$strPaginationHtml .= " | ";
		}

		if (($intPage + 1) <= $intTotalPages) { $strPaginationHtml .= "<a href=\"" . $strPaginationUrl . ($intPage + 1) . "\"> Next ></a>"; }
		else { $strPaginationHtml .= " Next >"; }
	}

	return($strPaginationHtml);
}

?>
Copyright © 2026 The Working K9 University