diff --git a/.gitignore b/.gitignore index f8ff8f89..d1d11368 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ gitignore/ .vscode/ src/themes/bluegrid *savemenu.sql -vendor/ \ No newline at end of file +vendor/ +/.idea/ diff --git a/src/_functions.php b/src/_functions.php index 4b8e3070..fd42aea0 100644 --- a/src/_functions.php +++ b/src/_functions.php @@ -1,285 +1,295 @@ , ", and ' symbols -function filterArray($arrValues) { - $newArray = array(); - foreach($arrValues as $key => $value) { - $temp = str_replace("<", "<", $value); + function filterArray($arrValues) + { + $newArray = array(); + foreach ($arrValues as $key => $value) { + $temp = str_replace("<", "<", $value); + $value = str_replace(">", ">", $temp); + $temp = str_replace("'", "'", $value); + $value = str_replace('"', '"', $temp); + $temp = str_replace("·", "·", $value); + $temp = str_replace("»", "»", $temp); + $temp = str_replace("«", "«", $temp); + + $newArray[$key] = $temp; + } + return $newArray; + } + + function filterText($strText) + { + if ($strText === null) { + return ''; // Return an empty string or some default value if $strText is null + } + + $temp = str_replace("<", "<", $strText); $value = str_replace(">", ">", $temp); $temp = str_replace("'", "'", $value); $value = str_replace('"', '"', $temp); $temp = str_replace("·", "·", $value); $temp = str_replace("»", "»", $temp); $temp = str_replace("«", "«", $temp); - - $newArray[$key] = $temp; + return $temp; } - return $newArray; -} - -function filterText($strText) { - $temp = str_replace("<", "<", $strText); - $value = str_replace(">", ">", $temp); - $temp = str_replace("'", "'", $value); - $value = str_replace('"', '"', $temp); - $temp = str_replace("·", "·", $value); - $temp = str_replace("»", "»", $temp); - $temp = str_replace("«", "«", $temp); - return $temp; -} - -function getPreciseTime($intTime, $timeFormat="", $bypassTimeDiff=false) { - $timeDiff = (!$bypassTimeDiff) ? time() - $intTime : 99999; - - if($timeDiff < 3) { - $dispLastDate = "just now"; - } - elseif($timeDiff < 60) { - $dispLastDate = "$timeDiff seconds ago"; - } - elseif($timeDiff < 3600) { - $minDiff = round($timeDiff/60); - $dispMinute = "minutes"; - if($minDiff == 1) { - $dispMinute = "minute"; + + + function getPreciseTime($intTime, $timeFormat = "", $bypassTimeDiff = false) + { + $timeDiff = (!$bypassTimeDiff) ? time() - $intTime : 99999; + + if ($timeDiff < 3) { + $dispLastDate = "just now"; + } elseif ($timeDiff < 60) { + $dispLastDate = "$timeDiff seconds ago"; + } elseif ($timeDiff < 3600) { + $minDiff = round($timeDiff / 60); + $dispMinute = "minutes"; + if ($minDiff == 1) { + $dispMinute = "minute"; + } + + $dispLastDate = "$minDiff $dispMinute ago"; + } elseif ($timeDiff < 86400) { + $hourDiff = round($timeDiff / 3600); + $dispHour = "hours"; + if ($hourDiff == 1) { + $dispHour = "hour"; + } + + $dispLastDate = "$hourDiff $dispHour ago"; + } else { + + if ($timeFormat == "") { + $timeFormat = "D M j, Y g:i a"; + } + + + $dispLastDate = date($timeFormat, $intTime); + } - $dispLastDate = "$minDiff $dispMinute ago"; + return $dispLastDate; } - elseif($timeDiff < 86400) { - $hourDiff = round($timeDiff/3600); - $dispHour = "hours"; - if($hourDiff == 1) { - $dispHour = "hour"; - } - $dispLastDate = "$hourDiff $dispHour ago"; + function getDateUTC($time, $timeFormat = "D M j, Y g:i a") + { + $date = new DateTime(); + $date->setTimezone(new DateTimeZone("UTC")); + $date->setTimestamp($time); + + return $date->format($timeFormat); } - else { - if($timeFormat == "") { - $timeFormat = "D M j, Y g:i a"; + + function parseBBCode($strText) + { + global $MAIN_ROOT; + + // Basic Codes + + $arrBBCodes['Bold'] = array("bbOpenTag" => "[b]", "bbCloseTag" => "[/b]", "htmlOpenTag" => "", "htmlCloseTag" => ""); + $arrBBCodes['Italic'] = array("bbOpenTag" => "[i]", "bbCloseTag" => "[/i]", "htmlOpenTag" => "", "htmlCloseTag" => ""); + $arrBBCodes['Underline'] = array("bbOpenTag" => "[u]", "bbCloseTag" => "[/u]", "htmlOpenTag" => "", "htmlCloseTag" => ""); + $arrBBCodes['Image'] = array("bbOpenTag" => "[img]", "bbCloseTag" => "[/img]", "htmlOpenTag" => ""); + $arrBBCodes['CenterAlign'] = array("bbOpenTag" => "[center]", "bbCloseTag" => "[/center]", "htmlOpenTag" => "
", "htmlCloseTag" => "
- Loading + Loading
- No special member access rules set! -
+ No special member access rules set! +
OR
".$componentInfo['options']['section_title']."
" . $componentInfo['options']['section_title'] . "
".$componentInfo['options']['section_description']."
" . $componentInfo['options']['section_description'] . "
- ".$this->saveMessage." + " . $this->saveMessage . "
Comments (".$this->countComments().")
Comments (" . $this->countComments() . ")
- ".$dispPrevPage.$pageSpacer.$dispNextPage." -
+ ".$dispPrevPage.$pageSpacer.$dispNextPage." +
@@ -115,7 +115,7 @@
@@ -120,8 +123,8 @@
- No ".strtolower($noItemName)."s added yet! + No " . strtolower($noItemName) . "s added yet!
Loading...
Successfully created a new poll! @@ -130,56 +126,54 @@
- ".$hourOptions." : - ".$minuteOptions." - AMPM -
+ " . $hourOptions . " : + " . $minuteOptions . " + AMPM +
Use this section to set whether a specific member is allowed to access this poll.
Members Only Tagger: ".$actualPageName."
Members Only Tagger: " . $actualPageName . "
Current Status: ".$pageTagStatus."Return to Member's Only Pages
Current Status: " . $pageTagStatus . "Return to Member's Only Pages