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); }

Tank Badges Needed

Looking for Bikes, Parts, Etc.? Post it here or try the New Honda305.com Auctions !!!
Post Reply
User avatar
Paul Strassmaier
honda305.com Member
Posts: 240
Joined: Thu Aug 21, 2008 11:46 am
Location: Portland, OR

Tank Badges Needed

Post by Paul Strassmaier » Thu Nov 15, 2012 11:45 am

I'm looking for a new or very nice set of "Dream 250" badges. Can anyone spare a set? Many thanks, Paul
CB72, CL72, CS72, CYP77
C71,JC57,D, 4E, Z50m

rrietman
honda305.com Member
Posts: 561
Joined: Mon Oct 13, 2008 6:45 pm
Location: bellingham wa.

Post by rrietman » Thu Nov 15, 2012 11:57 am

the repops from Ray are pretty good. I have a few sets from him on my bikes. price is right too. rrhbyrne@aol.com.
Randy

User avatar
Paul Strassmaier
honda305.com Member
Posts: 240
Joined: Thu Aug 21, 2008 11:46 am
Location: Portland, OR

Post by Paul Strassmaier » Thu Nov 15, 2012 12:25 pm

The repops are good, but he doesn't make the "Dream 250" type yet...
CB72, CL72, CS72, CYP77
C71,JC57,D, 4E, Z50m

rrietman
honda305.com Member
Posts: 561
Joined: Mon Oct 13, 2008 6:45 pm
Location: bellingham wa.

Post by rrietman » Thu Nov 15, 2012 4:32 pm

I got a set about a year ago for my CB72 that say "dream 250". the only issue with Ray's badges is I have had some that cracked after a while . I now fill the backs with epoxy andmake sure the holes are a bit oversize . no problems now.
Randy

User avatar
Paul Strassmaier
honda305.com Member
Posts: 240
Joined: Thu Aug 21, 2008 11:46 am
Location: Portland, OR

Post by Paul Strassmaier » Thu Nov 15, 2012 6:01 pm

I'll try again. He may just be out...
CB72, CL72, CS72, CYP77
C71,JC57,D, 4E, Z50m

chrisnoel
honda305.com Member
Posts: 63
Joined: Sat Sep 11, 2010 12:19 pm
Location: Colorado Springs, CO

CB badges

Post by chrisnoel » Fri Nov 16, 2012 7:44 pm

Don't know if this site can help but it would be my first go to place for hard to find badges. I have a set of CB750 K0 badges that were restored by him and I bet he can do a thing or two for your model. Possibly restore or reproduce something for you.


http://www.badgereplicas.com.au/badges_honda.htm

User avatar
G-Man
honda305.com Member
Posts: 5681
Joined: Wed Mar 25, 2009 5:17 pm
Location: Derby, UK
Contact:

Post by G-Man » Sat Nov 17, 2012 7:37 pm

I got mine from Ray.

Image
C72 Tank with panels and badges by graham.curtis, on Flickr

G
'60 C77 '60 C72 '62 C72 Dream '63 CL72
'61 CB72 '64 CB77 '65 CB160
'66 Matchless 350 '67 CL77
'67 S90 '77 CB400F

Post Reply

Return to “Wanted - Parts | Bikes | Services”