PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4", ] ); // newest completed CA entry (via view) $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); // casing helpers (same pattern as CB / CL) $keepCaps = static function (string $w): bool { 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 ''; if (strpos($w, '-') !== false) { $parts = explode('-', $w); foreach ($parts as &$x) { $x = $keepCaps($x) ? $x : ucfirst(strtolower($x)); } return implode('-', $parts); } if ($keepCaps($w)) return $w; $dot = substr($w, -1) === '.'; $base = $dot ? substr($w, 0, -1) : $w; $done = ucfirst(strtolower($base)); return $dot ? ($done . '.') : $done; }; $title = 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), ", "); }; if (!$row) { $line = 'Latest Registry Entry: No completed entries found.'; } else { // location like "WA, Australia" $region = $title($row['ADM_StateOrProvince'] ?? ''); $country = $title($row['ADM_Country'] ?? ''); $loc = trim( implode(', ', array_filter([$region, $country], fn($v) => $v !== '')), ', ' ); // normalize opinion_value_today using the same rules as CL: // - >=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 code translation — same dictionary as CL plus "Rat" $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'); $line = 'Latest Registry Entry: ' . ($row['model_year'] ?? '') . ' Honda ' . ($row['model'] ?? '') . ' — ' . $loc . ' — Condition: ' . $condNice . ' — Value: ' . $valFinal; } // stamp + UTF-8 $built = (new DateTime('now'))->format('Y-m-d H:i:s T'); $stamp = ""; $charset = ''; $html = $charset . "\n" . $stamp . "\n" . $line . "\n"; // write to shared include $jobDir = __DIR__; $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'; // future optional 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, $html, 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'); } @file_put_contents($jsonPath, json_encode([ 'line' => $line, 'stamp' => $built, 'ts' => date('c'), ], JSON_UNESCAPED_UNICODE)); echo "OK\n"; } catch (Throwable $e) { error_log("[generate_latest_ca77.php] " . $e->getMessage()); if (function_exists('http_response_code')) { @http_response_code(500); } echo "ERROR\n"; exit(1); }

Search found 10 matches

by helmetsplitter
Fri May 23, 2025 11:33 pm
Forum: Honda Scrambler - CL72 | CL77
Topic: Purchased Today - CL77 Engine with Tach Drive !!!
Replies: 0
Views: 26564

Purchased Today - CL77 Engine with Tach Drive !!!

Strange appearance CL77E 305 engine with tachometer drive. The drive has a tiny factory block off plate where the cable drive would normally connect. These markings I am not familiar... https://i.postimg.cc/BbTVvPq1/New-305-Engine-c.jpg https://i.postimg.cc/fT0b8w8S/New-305-Engine-b.jpg https://i.po...
by helmetsplitter
Tue Nov 14, 2017 8:33 pm
Forum: Carburation - Fuel
Topic: Anyone Have a Set of Carb Slides CL77 or CB77
Replies: 3
Views: 2794

Anyone Have a Set of Carb Slides CL77 or CB77

Anyone have a set of carb slides for CL77 or CB77 ?
Carb tops? Springs?
Just bought a scrambler that is missing the entire throttle assembly.
by helmetsplitter
Thu Nov 02, 2017 4:13 pm
Forum: Everything Else
Topic: NB399 key from H76 Blank - It Works
Replies: 0
Views: 1361

NB399 key from H76 Blank - It Works

I have made an NB399 key from H70J Blank.
What was the blank number that they used years ago?


Year? VIN CL77 104XXXX
Had to file off the top rib and .010 or so off one side.

https://s1.postimg.org/124ye72xsf/Honda ... _399_a.jpg
https://s1.postimg.org/7y9lydwia7/Honda ... _399_b.jpg
by helmetsplitter
Fri Sep 29, 2017 4:41 pm
Forum: Carburation - Fuel
Topic: CL72 Petcock Kit
Replies: 0
Views: 1562

CL72 Petcock Kit

My 250 doesn't have the "B" nut connector to attach petcock to tank.
So I order a kit like a Super 90 petcock ?
by helmetsplitter
Wed Sep 13, 2017 8:53 pm
Forum: Motors - 247cc | 305cc | 337cc | 350cc
Topic: Superhawk 305 What Thread Size of Starter Clutch Puller Tool
Replies: 2
Views: 1476

Thank You !
by helmetsplitter
Wed Sep 13, 2017 6:25 pm
Forum: Motors - 247cc | 305cc | 337cc | 350cc
Topic: Superhawk 305 What Thread Size of Starter Clutch Puller Tool
Replies: 2
Views: 1476

Superhawk 305 What Thread Size of Starter Clutch Puller Tool

What thread size bolt will pull the flywheel for a starter clutch service ?
by helmetsplitter
Tue Nov 27, 2012 12:13 pm
Forum: Motors - 247cc | 305cc | 337cc | 350cc
Topic: Engine Swap Easy?
Replies: 9
Views: 4700

Engine Swap

There is one in Indiana too.
We are in Tennessee (everything rusts)

Go to advanced search