PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4", ] ); // --- Fetch newest completed CA entry --- // Assumes h305_ca77_entries is either a view or table already filtered to "completed" rows $sql = " SELECT model_year, model, ADM_StateOrProvince, ADM_Country, condition_value, opinion_value_today FROM h305_ca77_entries ORDER BY submitdate DESC, id DESC LIMIT 1 "; $row = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC); // --- Helpers for casing normalization (same pattern as CB / CL) --- $keepCaps = static function (string $w): bool { // Keep original word case if it's already an acronym (2+ caps) or has a digit return (bool)preg_match('/[A-Z]{2,}/', $w) || (bool)preg_match('/\d/', $w); }; $word = static function (?string $w) use ($keepCaps): string { if ($w === null || $w === '') { return ''; } // Respect hyphenated parts independently if (strpos($w, '-') !== false) { $parts = explode('-', $w); foreach ($parts as &$x) { $x = $keepCaps($x) ? $x : ucfirst(strtolower($x)); } return implode('-', $parts); } // Already looks like an acronym or has digits -> leave alone if ($keepCaps($w)) { return $w; } $dot = substr($w, -1) === '.'; $base = $dot ? substr($w, 0, -1) : $w; $done = ucfirst(strtolower($base)); return $dot ? ($done . '.') : $done; }; $titleCase = static function (?string $s) use ($word): string { if ($s === null) { return ''; } $s = trim($s); if ($s === '') { return ''; } $t = preg_split('/\s+/', $s) ?: []; foreach ($t as &$x) { $x = $word($x); } return trim(implode(' ', $t), ", "); }; // --- Build display line --- if (!$row) { $line = 'Latest Registry Entry: No completed entries found.'; } else { // Location: "WA, Australia" (skip empties, title-case each part) $region = $titleCase($row['ADM_StateOrProvince'] ?? ''); $country = $titleCase($row['ADM_Country'] ?? ''); $loc = trim( implode(', ', array_filter([$region, $country], static fn($v) => $v !== '')), ', ' ); // Normalize opinion_value_today using CL rules: // >=1000 => use as-is ($12500 => $12,500) // 100..999 => treat as dollars ($750 => $750) // 1..99 => treat as thousands (6 => $6,000) // otherwise => "Not Entered" $valFinal = 'Not Entered'; if (isset($row['opinion_value_today']) && $row['opinion_value_today'] !== '') { $n = (float)$row['opinion_value_today']; if ($n >= 1000) { $valFinal = '$' . number_format($n, 0); } elseif ($n >= 100) { $valFinal = '$' . number_format($n, 0); } elseif ($n > 0) { $valFinal = '$' . number_format($n * 1000, 0); } } // Condition decoding (same mapping you provided, with fallback) $condRaw = $row['condition_value'] ?? ''; $condMap = [ 'E' => 'Excellent', 'Exc' => 'Excellent', 'G' => 'Good', 'Goo' => 'Good', 'F' => 'Fair', 'P' => 'Poor', 'Par' => 'Parts Bike', 'R' => 'Restored', 'Res' => 'Restored', 'Rat' => 'Rat', ]; $condNice = $condMap[$condRaw] ?? ($condRaw !== '' ? $condRaw : 'Not Entered'); // Gracefully handle blanks so we don't get double-spaces like " Honda " $yr = isset($row['model_year']) ? trim((string)$row['model_year']) : ''; $model = isset($row['model']) ? trim((string)$row['model']) : ''; $bikePart = trim($yr . ' Honda ' . $model); $locPart = $loc !== '' ? (' — ' . $loc) : ''; $line = 'Latest Registry Entry: ' . $bikePart . $locPart . ' — Condition: ' . $condNice . ' — Value: ' . $valFinal; } // --- Build final HTML snippet (static, safe to INCLUDEPHP in phpBB) --- $builtTs = (new DateTime('now'))->format('Y-m-d H:i:s T'); // These first two lines are harmless in phpBB output: and $charset = ''; $stamp = ''; $htmlOut = $charset . "\n" . $stamp . "\n" . $line . "\n"; // --- Write atomically to shared include dir --- $jobDir = __DIR__; // wherever this script lives $includeDir = '/home/mstoic3/public_html/shared/include'; $includeTmp = $includeDir . '/latest_ca77.tmp'; $includeDst = $includeDir . '/latest_ca77.html'; $jsonPath = $jobDir . '/latest_ca77.json'; $logPath = $jobDir . '/logs/latest_ca77.log'; // reserved for future logging if (!is_dir($includeDir)) { if (!mkdir($includeDir, 0755, true) && !is_dir($includeDir)) { throw new RuntimeException("Failed to create include dir: $includeDir"); } } if (file_put_contents($includeTmp, $htmlOut, LOCK_EX) === false) { throw new RuntimeException('Failed to write temp include file'); } if (!rename($includeTmp, $includeDst)) { @unlink($includeTmp); throw new RuntimeException('Failed to move include into place'); } // --- Optional JSON breadcrumb for debugging / external consumption --- @file_put_contents( $jsonPath, json_encode( [ 'line' => $line, 'stamp' => $builtTs, 'ts' => date('c'), ], JSON_UNESCAPED_UNICODE ) ); // --- Done --- echo "OK\n"; exit(0); } catch (Throwable $e) { // Minimal error surface; log server-side, generic public output error_log("[generate_latest_ca77.php] " . $e->getMessage()); if (function_exists('http_response_code')) { @http_response_code(500); } echo "ERROR\n"; exit(1); }

Cracked piston pin bosses

Post Reply
User avatar
Jethro
honda305.com Member
Posts: 351
Joined: Fri Dec 25, 2009 1:26 am
Location: Helena, Montana

Cracked piston pin bosses

Post by Jethro » Wed Nov 24, 2010 8:50 pm

Not sure if this is a common find or not, I searched the forum and couldn't find anything about it. I hope these pics come through. What does the 5 inside of this standard piston mean?

Jethro
Attachments
IMG_0924.jpg
IMG_0922.jpg
IMG_0929.jpg
IMG_0925.jpg
Last edited by Jethro on Thu Nov 25, 2010 12:53 am, edited 4 times in total.

LOUD MOUSE
honda305.com Member
Posts: 7818
Joined: Mon Aug 15, 2005 8:23 am
Location: KERRVILLE, TEXAS

Re: Cracked piston pin bosses

Post by LOUD MOUSE » Wed Nov 24, 2010 9:00 pm

Nothing there. .............lm

Jethro wrote:Not sure if this is a common find or not, I searched the forum and couldn't find anything about it. I hope these pics come through. What does the 5 inside of this standard piston mean?

Jethro

[/img/Users/JeffHahlbohm/Pictures/iPhoto Library/Originals/2010/Nov 23, 2010/IMG_0925.JPG

[img/Users/JeffHahlbohm/Pictures/iPhoto Library/Originals/2010/Nov 23, 2010/IMG_0922.JPG

[/img/Users/JeffHahlbohm/Pictures/iPhoto Library/Originals/2010/Nov 23, 2010/IMG_0929.JPG

User avatar
Jethro
honda305.com Member
Posts: 351
Joined: Fri Dec 25, 2009 1:26 am
Location: Helena, Montana

Post by Jethro » Thu Nov 25, 2010 12:47 am

Sorry that was my first attempt at that feature. Got a couple of pics up this time.

Jethro

jensen
honda305.com Member
Posts: 1143
Joined: Tue Feb 12, 2008 2:51 pm
Location: netherlands, huizen
Contact:

Post by jensen » Thu Nov 25, 2010 2:25 am

Hi,

No info about the 5, but I have seen these cracks more then once, sometimes (mostly) they will run to the piston floor. The strangest thing is that the cracked piston is found mostly om the right side by me.

Jensen
assembly of Japanese motorcycles requires great peace of mind (Pirsig)

LOUD MOUSE
honda305.com Member
Posts: 7818
Joined: Mon Aug 15, 2005 8:23 am
Location: KERRVILLE, TEXAS

Re: Cracked piston pin bosses

Post by LOUD MOUSE » Thu Nov 25, 2010 7:57 am

It is a mold identifier.
Can ya send that piston to me?. ..............lm

Jethro wrote:Not sure if this is a common find or not, I searched the forum and couldn't find anything about it. I hope these pics come through. What does the 5 inside of this standard piston mean?

Jethro

User avatar
Jethro
honda305.com Member
Posts: 351
Joined: Fri Dec 25, 2009 1:26 am
Location: Helena, Montana

Post by Jethro » Thu Nov 25, 2010 3:20 pm

Sure LM, I'll get it in the mail some time next week. Any significance?, or just wanting to take a gander? So one of the pistons from this engine has both bosses cracked and the other piston has just a small hairline in one boss. I am assuming that these pistons are useless. What causes the cracks?

Jethro

LOUD MOUSE
honda305.com Member
Posts: 7818
Joined: Mon Aug 15, 2005 8:23 am
Location: KERRVILLE, TEXAS

Post by LOUD MOUSE » Thu Nov 25, 2010 4:35 pm

I would really like to look at both pistons for sure.
Were the pins difficult to remove?. ..........lm

Jethro wrote:Sure LM, I'll get it in the mail some time next week. Any significance?, or just wanting to take a gander? So one of the pistons from this engine has both bosses cracked and the other piston has just a small hairline in one boss. I am assuming that these pistons are useless. What causes the cracks?

Jethro

Post Reply

Return to “Motors - 247cc | 305cc | 337cc | 350cc”