main
Robert 5 hours ago
parent 4d062b4d83
commit ebb5f46379
  1. 3
      protected/src/Configs/on_HTML.php
  2. 5
      protected/src/Controllers/App/HomeController.php
  3. 45
      protected/src/Templates/main.php
  4. 67
      protected/src/Views/Common/App/Home/Index.php
  5. 44
      public/assets/css/index.css
  6. 13
      public/index.php

@ -13,7 +13,8 @@ use IOcornerstone\Framework\Configure;
Configure::set('html', array(
'author' => 'Robert Strutts',
'title' => 'StickingToGoal.com',
'javascript' => array(), //'js/analytics.js'=>'project'
// 'javascript' => ['js/analytics.js'=>'project''],
'css' => ['css/index.css'=>'project'],
'robots' => 'noindex',
'keywords' => 'goal, setting',
'description' => 'Goals site',

@ -35,9 +35,14 @@ class HomeController extends BaseController
{
Security::initSessions();
$this->html->addToJavascript("function filterTag(tag){ \r\n window.location='?tag='+encodeURIComponent(tag); \r\n }");
$pdo = Configure::get('db');
$model = new HomeFetchModel($pdo);
$this->view->set('html', $this->html);
$this->view->setPhpTemplate('main');
$this->view->setView("App/Home/Index");
$this->view->set("Model", $model);

@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts
* @copyright (c) 2026, Robert Strutts
* @license MIT
*/
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<base href="<?= PROJECT_ASSETS_BASE_REF; ?>/">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="<?= $html->getKeywords(); ?>">
<meta name="description" content="<?= $html->getDescription(); ?>">
<meta name="author" content="<?= $html->getAuthor(); ?>">
<meta name="language" content="english">
<meta name="robots" content="<?= $html->getRobots(); ?>">
<meta name="copyright" content="2014-<?= date('Y'); ?>">
<title><?= $html->getTitle(); ?></title>
<!--
<link rel="apple-touch-icon" sizes="180x180" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/favicon-16x16.png">
<link rel="icon" type="image/ico" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/favicon.ico">
<link rel="manifest" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/site.webmanifest">
-->
<?= $html->getHead(); ?>
<?= $html->getMainStyles(); ?>
<?= $html->getStyles(); ?>
<?= $html->getMainScripts(); ?>
</head>
<body <?= $html->getBody(); ?>>
<?= $local->pageOutput ?>
<?= $html->getFooter(); ?>
<?= $html->getScripts(); ?>
<?= $html->getJsOnReady(); ?>
</body>
</html>

@ -11,69 +11,8 @@ declare(strict_types=1);
function end_of_the_line(): void
{
echo "</div>" . PHP_EOL . "</body>" . PHP_EOL . "</html>";
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>StickingToGoals.com</title>
<style>
body {font-family:Arial;background:#f4f6f9;margin:0}
.container {max-width:900px;margin:30px auto;background:#fff;padding:20px;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,.1)}
input,textarea{width:100%;padding:10px;margin:8px 0;border-radius:6px;border:1px solid #ccc}
button{background:#4CAF50;color:#fff;border:none;padding:10px;border-radius:6px;cursor:pointer}
button:hover{background:#45a049}
.goal-item{padding:10px;border-bottom:1px solid #eee}
.advice-box{border:1px solid #ddd;border-radius:8px;padding:15px;margin-top:15px;background:#fafafa}
.vote{background:#eee;padding:5px 10px;border-radius:6px;display:inline-block}
.comment{margin-left:20px;border-left:2px solid #ccc;padding-left:8px;margin-top:5px}
.tag{display:inline-block;background:#3498db;color:#fff;padding:3px 8px;border-radius:5px;margin:2px;font-size:12px;cursor:pointer}
.auth-container {
display: flex;
gap: 20px;
}
.btn {
padding: 12px 24px;
font-size: 16px;
border: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
color: white;
}
.login-btn {
background: #3498db;
}
.login-btn:hover {
background: #2980b9;
transform: translateY(-2px);
}
.register-btn {
background: #2ecc71;
}
.register-btn:hover {
background: #27ae60;
transform: translateY(-2px);
}
</style>
</head>
<body>
<script>
function filterTag(tag){
window.location='?tag='+encodeURIComponent(tag);
}
</script>
<?= $Auth ?>
@ -102,9 +41,9 @@ if ($Tags !== true && $Tags !== false) {
<?php endforeach; ?>
<?php
if ($Uid['MyUUID'] === false) { end_of_the_line(); }
if ($Uid['MyUUID'] === false) { end_of_the_line(); } else {
$goal = $Model->GetGoal($Uid);
if ($goal === false) { end_of_the_line(); }
if ($goal === false) { end_of_the_line(); } else {
//<h3>GOAL ID = $myuuid
?>
@ -136,3 +75,5 @@ foreach($comments as $c): ?>
<?php endforeach; ?>
</div>
<?php } } ?>

@ -0,0 +1,44 @@
body {font-family:Arial;background:#f4f6f9;margin:0}
.container {max-width:900px;margin:30px auto;background:#fff;padding:20px;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,.1)}
input,textarea{width:100%;padding:10px;margin:8px 0;border-radius:6px;border:1px solid #ccc}
button{background:#4CAF50;color:#fff;border:none;padding:10px;border-radius:6px;cursor:pointer}
button:hover{background:#45a049}
.goal-item{padding:10px;border-bottom:1px solid #eee}
.advice-box{border:1px solid #ddd;border-radius:8px;padding:15px;margin-top:15px;background:#fafafa}
.vote{background:#eee;padding:5px 10px;border-radius:6px;display:inline-block}
.comment{margin-left:20px;border-left:2px solid #ccc;padding-left:8px;margin-top:5px}
.tag{display:inline-block;background:#3498db;color:#fff;padding:3px 8px;border-radius:5px;margin:2px;font-size:12px;cursor:pointer}
.auth-container {
display: flex;
gap: 20px;
}
.btn {
padding: 12px 24px;
font-size: 16px;
border: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
color: white;
}
.login-btn {
background: #3498db;
}
.login-btn:hover {
background: #2980b9;
transform: translateY(-2px);
}
.register-btn {
background: #2ecc71;
}
.register-btn:hover {
background: #27ae60;
transform: translateY(-2px);
}

@ -3,6 +3,19 @@
declare(strict_types=1);
define("BaseDir", dirname(__DIR__)); // Project DIR
define("PROJECT_ASSETS_DIR", BaseDir . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR);
$server_port = $_SERVER['SERVER_PORT'] ?? 80;
$secure_port_on = $_SERVER['HTTPS'] ?? "off";
$use_secure = ($server_port == "443" || $secure_port_on == "on");
$protocol = ($use_secure) ? "https://" : "http://";
$domain_name = $_SERVER['HTTP_HOST'] ?? "";
define("HTTP_PROT", $protocol);
define("PROJECT_ASSETS_BASE_REF", $protocol . $domain_name ."/assets");
define("ASSETS_DIR", PROJECT_ASSETS_DIR);
define('ASSETS_BASE_REF', $protocol . $domain_name . "/assets");
const IO_CORNERSTONE_PROJECT = BaseDir . DIRECTORY_SEPARATOR . "protected". DIRECTORY_SEPARATOR. "src" . DIRECTORY_SEPARATOR;
const IO_CORNERSTONE_FRAMEWORK = BaseDir . DIRECTORY_SEPARATOR . "protected" . DIRECTORY_SEPARATOR . "src" . DIRECTORY_SEPARATOR . "IOcornerstone" . DIRECTORY_SEPARATOR;

Loading…
Cancel
Save