From 688e097089a5845fb96924486222ba70d3321bd2 Mon Sep 17 00:00:00 2001 From: Kazuki Suzuki Przyborowski Date: Fri, 8 Apr 2022 16:24:18 -0500 Subject: [PATCH] Add files via upload --- inc/misc/utf8.php | 135 +++++++++++++++++++++++++++++++++++++++++++++++++ inc/versioninfo.php | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100644 inc/misc/utf8.php create mode 100644 inc/versioninfo.php diff --git a/inc/misc/utf8.php b/inc/misc/utf8.php new file mode 100644 index 0000000..7bfbf4b --- /dev/null +++ b/inc/misc/utf8.php @@ -0,0 +1,135 @@ += 3) { + $end = func_get_arg(2); + return join("",array_slice($ar[0],$start,$end)); + } else { + return join("",array_slice($ar[0],$start)); + } +} + +function pre_substr($string,$start,$length) { + global $chkcharset; + if($chkcharset=="UTF-8") { + if(!defined('UTF8_NOMBSTRING')&&function_exists('mb_substr')) { + return mb_substr($string,$start,$length,'utf-8'); } + else { return utf8_substr($string,$start,$length); } } + if($chkcharset!="UTF-8") { return substr($string,$start,$length); } } + if(isset($_GET['text'])) { + echo pre_substr($_GET['text'],0,6); } + +// author: Scott Michael Reynen "scott@randomchaos.com" +// url: http://www.randomchaos.com/document.php?source=php_and_unicode +function utf8_strpos($haystack, $needle,$offset=0) { + if(!defined('UTF8_NOMBSTRING')&&function_exists('mb_strpos')) { + return mb_strpos($haystack,$needle,$offset,'utf-8'); } + $haystack = utf8_to_unicode($haystack); + $needle = utf8_to_unicode($needle); + $position = $offset; + $found = false; + while( (! $found ) && ( $position < count( $haystack ) ) ) { + if ( $needle[0] == $haystack[$position] ) { + for ($i = 1; $i < count( $needle ); $i++ ) { + if ( $needle[$i] != $haystack[ $position + $i ] ) break; + } // for + if ( $i == count( $needle ) ) { + $found = true; + $position--; + } // if + } // if + $position++; + } // while + return ( $found == true ) ? $position : false; +} // strpos_unicode + +// author: Scott Michael Reynen "scott@randomchaos.com" +// url: http://www.randomchaos.com/document.php?source=php_and_unicode +function utf8_to_unicode( $str ) { + $unicode = array(); + $values = array(); + $lookingFor = 1; + for ($i = 0; $i < strlen( $str ); $i++ ) { + $thisValue = ord( $str[ $i ] ); + if ( $thisValue < 128 ) $unicode[] = $thisValue; + else { + if ( count( $values ) == 0 ) $lookingFor = ( $thisValue < 224 ) ? 2 : 3; + $values[] = $thisValue; + if ( count( $values ) == $lookingFor ) { + $number = ( $lookingFor == 3 ) ? + ( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ): + ( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 ); + $unicode[] = $number; + $values = array(); + $lookingFor = 1; + } // if + } // if + } // for + return $unicode; +} // utf8_to_unicode + +// author: Scott Michael Reynen "scott@randomchaos.com" +// url: http://www.randomchaos.com/document.php?source=php_and_unicode +function unicode_to_utf8( $str ) { + $utf8 = ''; + foreach( $str as $unicode ) { + if ( $unicode < 128 ) { + $utf8.= chr( $unicode ); + } elseif ( $unicode < 2048 ) { + $utf8.= chr( 192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ) ); + $utf8.= chr( 128 + ( $unicode % 64 ) ); + } else { + $utf8.= chr( 224 + ( ( $unicode - ( $unicode % 4096 ) ) / 4096 ) ); + $utf8.= chr( 128 + ( ( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ) ); + $utf8.= chr( 128 + ( $unicode % 64 ) ); + } // if + } // foreach + return $utf8; +} // unicode_to_utf8 +?> \ No newline at end of file diff --git a/inc/versioninfo.php b/inc/versioninfo.php new file mode 100644 index 0000000..018e174 --- /dev/null +++ b/inc/versioninfo.php @@ -0,0 +1,141 @@ +".$AltGM2k.""; +$iDBTheme = "iDB"; $AltiDBTheme = "Gray"; +$UserAgentName = "iDB-Forum"; $AltUserAgentName = "DF2k-Forum"; +if(!isset($Settings['usealtname'])) { $Settings['usealtname'] = "no"; } +if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { +if(isset($iDBAltName['VER1'][0])) { $VER1[0] = $iDBAltName['VER1'][0]; } +if(isset($iDBAltName['VER1'][1])) { $VER1[1] = $iDBAltName['VER1'][1]; } +if(isset($iDBAltName['VER1'][2])) { $VER1[2] = $iDBAltName['VER1'][2]; } +if(isset($iDBAltName['VER1'][0])&& + isset($iDBAltName['VER1'][1])&& + isset($iDBAltName['VER1'][2])) { + $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2]; } +if(isset($iDBAltName['VER2'][0])) { $VER2[0] = $iDBAltName['VER2'][0]; } +if(isset($iDBAltName['VER2'][1])) { $VER2[1] = $iDBAltName['VER2'][1]; } +if(isset($iDBAltName['VER2'][2])) { $VER2[2] = $iDBAltName['VER2'][2]; } +if(isset($iDBAltName['SubVerN'])) { $SubVerN = $iDBAltName['SubVerN']; } +if(isset($iDBAltName['SVNDay'][0])) { $SVNDay[0] = $iDBAltName['SVNDay'][0]; } +if(isset($iDBAltName['SVNDay'][1])) { $SVNDay[1] = $iDBAltName['SVNDay'][1]; } +if(isset($iDBAltName['SVNDay'][2])) { $SVNDay[2] = $iDBAltName['SVNDay'][2]; } +if(isset($iDBAltName['SVNDay'][0])&& + isset($iDBAltName['SVNDay'][1])&& + isset($iDBAltName['SVNDay'][2])) { + $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; } +if(isset($iDBAltName['AltName'])) { $AltName = $iDBAltName['AltName']; } +if(isset($iDBAltName['AltName2'])) { $AltName2 = $iDBAltName['AltName2']; } +if(isset($iDBAltName['AltFullName'])) { $AltFullName = $iDBAltName['AltFullName']; } +if(isset($iDBAltName['AltVerCheckName'])) { $AltVerCheckName = $iDBAltName['AltVerCheckName']; } +if(isset($iDBAltName['AltUserAgentName'])) { $AltUserAgentName = $iDBAltName['AltUserAgentName']; } +if(isset($iDBAltName['AltiDBHome'])) { $AltiDBHome = $iDBAltName['AltiDBHome']; } +if(isset($iDBAltName['AltGM2k'])) { $AltGM2k = $iDBAltName['AltGM2k']; } +if(isset($iDBAltName['AltGM2kHome'])) { $AltGM2kHome = $iDBAltName['AltGM2kHome']; } +if(isset($iDBAltName['AltGM2kURL'])) { $AltGM2kURL = $iDBAltName['AltGM2kURL']; } +if(isset($iDBAltName['AltiDBTheme'])) { $AltiDBTheme = $iDBAltName['AltiDBTheme']; } +if(isset($iDBAltName['VerCheckURL'])) { $Settings['VerCheckURL'] = $iDBAltName['VerCheckURL']; } } +if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { + $RName = $AltName2; $SFName = $AltName; $RFullName = $AltFullName; $VerCheckName = $AltVerCheckName; $UserAgentName = $AltUserAgentName; } +$VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false); +$VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,$VER2[2]); +$VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false); +$VerInfo['iDB_Full_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,$VER2[2]); +$VerInfo['iDB_Ver_Show'] = $VerInfo['iDB_Ver_SVN']; $VerInfo['iDB_Full_Ver_Show'] = $VerInfo['iDB_Full_Ver_SVN']; +define("_iDB_Ver_", $VerInfo['iDB_Ver']); define("_iDB_Ver_SVN_", $VerInfo['iDB_Ver_SVN']); +define("_iDB_Full_Ver_", $VerInfo['iDB_Full_Ver']); define("_iDB_Full_Ver_SVN_", $VerInfo['iDB_Full_Ver_SVN']); +define("_iDB_Ver_Show_", $VerInfo['iDB_Ver_Show']); define("_iDB_Full_Ver_Show_", $VerInfo['iDB_Full_Ver_Show']); +/* +URLs and names and stuff. :P +$KSP = "Kazuki Suzuki Przyborowski"; +$KSPAlt = "Kazuki Suzuki Przyborowski"; +*/ +$iDBHome = "https://idb.osdn.jp/"; $DF2kHome = "https://idb.osdn.jp/"; +$OrgName = "iDB"; $AltOrgName = "DF2k"; $AltiDB = "Discussion Forums 2k"; +$AltSQLDumper = null; +if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { +if(isset($iDBAltName['AltOrgName'])) { $AltOrgName = $iDBAltName['AltOrgName']; } +if(isset($iDBAltName['AltiDB'])) { $AltiDB = $iDBAltName['AltiDB']; } +if(isset($iDBAltName['AltSQLDumperName'])) { $AltSQLDumper = $iDBAltName['AltSQLDumperName']; } } +if(!isset($Settings['VerCheckURL'])|| + $Settings['VerCheckURL']==="") { +$VerCheckURL = $iDBHome."?act=vercheck"; } +if(isset($Settings['VerCheckURL'])&& + $Settings['VerCheckURL']!=="") { +$VerCheckURL = $Settings['VerCheckURL']; } +$VerCheckQuery = parse_url($VerCheckURL); +$VerCheckQuery = $VerCheckQuery['query']; +if($VerCheckQuery=="") { $VerCheckURL = $VerCheckURL."?"; } +if(!isset($Settings['IPCheckURL'])|| + $Settings['IPCheckURL']==="") { +$IPCheckURL = 'http://cqcounter.com/whois/?query=%s'; } +if(isset($Settings['IPCheckURL'])&& + $Settings['IPCheckURL']!=="") { +$IPCheckURL = $Settings['IPCheckURL']; } +$CD2k = "Kazuki Przyborowski"; $CD2k_Full = "Kazuki Suzuki Przyborowski"; +$GM2k = "Game Maker 2k"; $iDB_Author = "Kazuki"; +$iDB = "Internet Discussion Boards"; $iTB = "Internet Tag Boards"; +$DF2k = "Discussion Forums 2k"; $TB2k = "Tag Boards 2k"; +$TheProgrammerNaps = "The programmer has a nap. \nHold out! Programmer! "; +if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { + $iDB = $AltiDB; $OrgName = $AltOrgName; $iDBTheme = $AltiDBTheme; } +$iDBURL1 = ""; $iDBURL2 = $iDBURL1.$iDB.""; +$DF2kURL1 = ""; $DF2kURL2 = $DF2kURL1.$DF2k.""; +$GM2kHome = $iDBHome."support/category.php?act=view&id=2"; +$GM2kURL = "".$GM2k.""; +$iDBURL3 = "".$iDB.""; +$PHPQA = "PHP-Quick-Arcade|http://quickarcade.jcink.com/"; $TFBB = "TextFileBB|https://launchpad.net/tfbb"; +$PHPQA = explode("|",$PHPQA); $TFBB = explode("|",$TFBB); +$PHPQA = "".$PHPQA[0].""; +$TFBB = "".$TFBB[0].""; +if(isset($Settings['usealtname'])&&$Settings['usealtname']=="yes") { + $iDBHome = $AltiDBHome; $GM2k = $AltGM2k; $GM2kHome = $AltGM2kHome; $GM2kURL = $AltGM2kURL; } +$PHPV1 = phpversion(); $PHPV2 = "PHP ".$PHPV1; $OSType = @php_uname("s"); $OSType .= " ".@php_uname("r"); +$OSType .= " ".@php_uname("m"); if($OSType==""||!isset($OSType)) { $OSType = PHP_OS; } // Check OS Name +if($OSType=="WINNT") { $OSType="Windows NT"; } if($OSType=="WIN32") { $OSType="Windows 9x"; } +$OSType2 = $PHPV2." / ".$OSType; $ZENDV1 = zend_version(); $ZENDV2 = "Zend engine ".$ZENDV1; +// Show or hide the version number +if($Settings['showverinfo']=="on") { +//header("X-".$RName."-Powered-By: ".$VerInfo['iDB_Ver_Show']); +header("Generator: ".$VerInfo['iDB_Ver_Show']); } +if($Settings['showverinfo']!="on") { +//header("X-".$RName."-Powered-By: ".$RName); +//header("X-Powered-By: PHP"); +header("Generator: ".$RName); } +if(!isset($Settings['hideverinfohttp'])) { + $Settings['hideverinfohttp'] = "off"; } +if($Settings['hideverinfohttp']=="on") { +header("X-Powered-By: "); +header("Generator: "); } +?> -- 2.11.0