Removed leftovers
Update content.php and index.php
This commit is contained in:
@@ -18,27 +18,11 @@ abstract class ContentDisplayType {
|
||||
const ARTICLE = 2;
|
||||
const APPLICATION = 3;
|
||||
}
|
||||
/*abstract class ContentSubType {
|
||||
const NONE = CONTENT_NONE;
|
||||
const PUREBASIC = 1;
|
||||
const PYTHON = 2;
|
||||
const JAVA = 3;
|
||||
const OTHER_LANGUAGE = 4;
|
||||
const APPLICATION = 5;
|
||||
const TOOL = 6;
|
||||
const TUTORIAL = 7;
|
||||
const IOT = 8;
|
||||
const EXPERIMENTS = 9;
|
||||
const HAM = 10;
|
||||
const ALL = 11;
|
||||
const DOCKER = 11;
|
||||
}*/
|
||||
|
||||
// Preparing default variables.
|
||||
$requested_content_type = ContentType::NONE;
|
||||
$requested_content_display_type = ContentDisplayType::NONE;
|
||||
$requested_tags = array();
|
||||
//$requested_content_sub_type = ContentSubType::NONE;
|
||||
$content_has_error = false;
|
||||
$_content_error_message_key = "error.content.none";
|
||||
$content_error_message = "";
|
||||
@@ -75,30 +59,21 @@ if($requested_content_type == ContentType::BLOG) {
|
||||
|
||||
if(str_starts_with($content_requested_url_part, "/applications/")) {
|
||||
$requested_tags[] = "application";
|
||||
//$requested_content_sub_type = ContentSubType::APPLICATION;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/tutorials/")) {
|
||||
$requested_tags[] = "tutorial";
|
||||
//$requested_content_sub_type = ContentSubType::TUTORIAL;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/tools/")) {
|
||||
$requested_tags[] = "tool";
|
||||
//$requested_content_sub_type = ContentSubType::TOOL;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/purebasic/")) {
|
||||
$requested_tags[] = "purebasic";
|
||||
//$requested_content_sub_type = ContentSubType::PUREBASIC;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/python/")) {
|
||||
$requested_tags[] = "python";
|
||||
//$requested_content_sub_type = ContentSubType::PYTHON;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/java/")) {
|
||||
$requested_tags[] = "java";
|
||||
//$requested_content_sub_type = ContentSubType::JAVA;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/others/")) {
|
||||
$requested_tags[] = "miscellaneous";
|
||||
//$requested_content_sub_type = ContentSubType::OTHER_LANGUAGE;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/docker/")) {
|
||||
$requested_tags[] = "docker";
|
||||
//$requested_content_sub_type = ContentSubType::DOCKER;
|
||||
} else {
|
||||
//$requested_content_sub_type = ContentSubType::ALL;
|
||||
$content_has_error = true;
|
||||
$_content_error_message_key = "error.content.detect.subtype";
|
||||
goto content_end;
|
||||
@@ -110,15 +85,11 @@ if($requested_content_type == ContentType::BLOG) {
|
||||
|
||||
if(str_starts_with($content_requested_url_part, "/iot/")) {
|
||||
$requested_tags[] = "iot";
|
||||
$requested_content_sub_type = ContentSubType::IOT;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/experiments/")) {
|
||||
$requested_tags[] = "experiment";
|
||||
$requested_content_sub_type = ContentSubType::EXPERIMENTS;
|
||||
} elseif(str_starts_with($content_requested_url_part, "/ham/")) {
|
||||
$requested_tags[] = "ham";
|
||||
$requested_content_sub_type = ContentSubType::HAM;
|
||||
} else {
|
||||
//$requested_content_sub_type = ContentSubType::ALL;
|
||||
$content_has_error = true;
|
||||
$_content_error_message_key = "error.content.detect.subtype";
|
||||
goto content_end;
|
||||
@@ -132,7 +103,6 @@ if($requested_content_display_type == ContentDisplayType::NONE) {
|
||||
goto content_end;
|
||||
}
|
||||
|
||||
//if($requested_content_type != ContentType::BLOG && $requested_content_sub_type == ContentSubType::NONE) {
|
||||
if(count($requested_tags) == 0) {
|
||||
// Failed to detect the subtype of content requested when not a blog post.
|
||||
$content_has_error = true;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
<p>REQUEST_URI: <?php echo($_SERVER['REQUEST_URI']); ?></p>
|
||||
<p>$requested_content_type: <?php echo($requested_content_type); ?></p>
|
||||
<p>$requested_content_display_type: <?php echo($requested_content_display_type); ?></p>
|
||||
<p>$requested_content_sub_type: <i>Undefined</i></p>
|
||||
<p>$requested_tags: [<?php echo(implode(", ", $requested_tags)); ?>]</p>
|
||||
<p>$content_has_error: <?php echo($content_has_error); ?></p>
|
||||
<p>$_content_error_message_key: <?php echo($_content_error_message_key); ?></p>
|
||||
|
Reference in New Issue
Block a user