Location: PHPKode > projects > News Publishing Content Management System > news-publishing-content-management-system/jpowered/newscms/admin/include/utils.php
<?php 
function systemError($errorMessage,$dberror) {echo $errorMessage."<br>\n";return;}function formatDate($strdate) {$dt = strtotime($strdate);return date("D d M Y H:i",$dt);}function testSession() {checkSetUp();$userid = 0;session_start();$userid = $_SESSION['userid'];return $userid;}function testLogin($usernameentered,$passwordentered) {$passwordentered = md5($passwordentered);$user = getRecordByColname("userdetails","username",$usernameentered);if (!$user["userid"]) {return false;}if (strcmp($passwordentered,$user["password"])<>0) {
return false;}return true;}function checkSetUp() {global $JPN_PARAMETERS;if (strcmp($JPN_PARAMETERS["setup"],"yes")<>0) {$fullpage = "";$filename = "./templates/setup.htm";$lines = file($filename);foreach ($lines as $line) {$line = str_replace("[VERSION]",   "v2.3",   $line);$fullpage = str_replace("[MESSAGE]",  "", $fullpage);$fullpage = str_replace("[USERNAME]", "", $fullpage);$fullpage = str_replace("[FULLNAME]", "", $fullpage);$fullpage = str_replace("[EMAIL1]",   "", $fullpage);$fullpage = str_replace("[EMAIL2]",   "", $fullpage);
$fullpage = $fullpage.$line;}echo $fullpage;exit;}enhanceParams();return;}function initialiseSession(&$user) {session_start();$_SESSION['accesslevel'] = $user["accesslevelid"];$_SESSION['name']        = $user["name"];$_SESSION['lastlogin']   = $user["lastlogin"];$_SESSION['userid']      = $user["userid"];$dt = strtotime($_SESSION['lastlogin']);$_SESSION['lastlogin'] = date("D d M Y H:i",$dt);return;}function logonPage($errormessage) {global $JPN_PARAMETERS;$fullpage = "";$filename = "./templates/adminlogin.htm";
$lines = file($filename);foreach ($lines as $line) {$line = str_replace("[VERSION]",   "v2.3",   $line);$line = str_replace("[ERRORMESSAGE]",   $errormessage,   $line);$fullpage = $fullpage.$line;}echo $fullpage;return;}function forgotpasswordPage($errormessage,$username) {$fullpage = "";$filename = $templatesDir."./templates/forgotpass.htm";$lines = file($filename);foreach ($lines as $line) {$line = str_replace("[VERSION]",   "v2.3",   $line);$line = str_replace("[MESSAGE]",   $errormessage,   $line);
$line = str_replace("[USERNAME]",   $username,   $line);$fullpage = $fullpage.$line;}echo $fullpage;return;}function createPage($pagename,$replacearray) {global $SystemVersion;global $JPN_PARAMETERS;$fckeditor = false;switch ($pagename) {case "noaccess":  $templatefile = "noaccess.htm";break;case "start": $templatefile = "start.htm";break;case "user":         $templatefile = "user.htm";break;case "category":     $templatefile = "category.htm";break;case "categoryadd":  $templatefile = "categoryadd.htm";break;
case "categoryedit": $templatefile = "categoryedit.htm";break;case "categorymove": $templatefile = "categorymove.htm";break;case "categorysort": $templatefile = "categorysort.htm";break;case "article":       $templatefile = "article.htm";break;case "articleadd":    $templatefile = "articleadd.htm";break;case "articleedit":   $templatefile = "articleedit.htm";break;case "articledelete": $templatefile = "articledelete.htm";break;case "settings":           $templatefile = "settings.htm";break;case "settingsgeneral":    $templatefile = "settingsgeneral.htm";break;
case "settingslinks":      $templatefile = "settingslinksandbg.htm";break;case "settingssearchbox":  $templatefile = "settingssearchbox.htm";break;case "settingscategory":   $templatefile = "settingscategory.htm";break;case "settingsheadline":   $templatefile = "settingsheadlines.htm";break;case "settingssummary":    $templatefile = "settingssummary.htm";break;case "settingsfullstory":  $templatefile = "settingsfullstory.htm";break;case "settingsscrollingnews":  $templatefile = "settingsscrollingnews.htm";break;
case "settingsheadfoot":       $templatefile = "settingsheadfoot.htm";break;case "linkshtml":    $templatefile = "linkshtml.htm";break;case "reports":      $templatefile = "reports.htm";break;case "help":         $templatefile = "help.htm";break;case "helppage":     $templatefile = $replacearray[0];break;default:$templatefile = "start.htm";}$filename = "./templates/".$templatefile;$username  = $_SESSION['name'];$lastlogon = $_SESSION['lastlogon'];$menu = $_SESSION['adminmenu']->generateMenuHtml();
$content = "";$lines = file($filename);foreach ($lines as $line) {if (count($replacearray)>1) {for ($i=0;$i<count($replacearray);$i=$i+2) {if (strcmp($replacearray[$i],"[INSERTFCKEDITOR]")==0) {$fckeditor = true;}else {$line = str_replace($replacearray[$i],   $replacearray[$i+1],   $line);}}}$content = $content.$line;}$fullpage = "";$filename = "./templates/outer.htm";$lines = file($filename);foreach ($lines as $line) {$line = str_replace("[CONTENT]",   $content,   $line);$line = str_replace("[MENU]",      $menu,      $line);
$line = str_replace("[USERNAME]",  $username,  $line);$line = str_replace("[LASTLOGON]", $lastlogon, $line);$line = str_replace("[VERSION]",   $SystemVersion,   $line);$fullpage = $fullpage.$line;}if ($fckeditor) {$fckhead = "<script type=\"text/javascript\" src=\"./FCKeditor/fckeditor.js\"></script>\n"."<script type=\"text/javascript\">\n"."window.onload = function()\n"."{\n"."var oFCKeditor = new FCKeditor( 'fulltext' ) ;\n"."oFCKeditor.Width = 740 ; \n"."oFCKeditor.Height = 400 ; \n"."oFCKeditor.ToolbarSet = \"newsadmin\" ;\n".
"oFCKeditor.BasePath = \"./FCKeditor/\" ;\n"."oFCKeditor.ReplaceTextarea() ;\n"."\n"."var o2FCKeditor = new FCKeditor( 'summary' ) ;\n"."o2FCKeditor.Width = 740 ; \n"."o2FCKeditor.Height = 200 ; \n"."o2FCKeditor.ToolbarSet = \"newsadmin\" ;\n"."o2FCKeditor.BasePath = \"./FCKeditor/\" ;\n"."o2FCKeditor.ReplaceTextarea() ;\n"."\n"."}\n"."</script>\n"."</HEAD>    \n";$fckfoot = "</body>";$fullpage = str_replace("</HEAD>",   $fckhead,   $fullpage);$fullpage = str_replace("</body>",   $fckfoot,   $fullpage);
}$supportinfo = "";if (!$JPN_PARAMETERS["support"]) {$supportinfo = "<table width='500' border='0' cellspacing='0' cellpadding='1' bgcolor='#18397B'>\n"."  <tr> \n"."    <td> \n"."      <table width='100%' border='0' cellspacing='0' cellpadding='4' bgcolor='#FFFFFF'>\n"."        <tr class='tabletitle' bgcolor='#006666' align='center'> \n"."          <td><font color='#99FFFF'><b>Support and Maintenance has Expired.</b></font></td>\n"."        </tr>\n"."        <tr align='left' bgcolor='#DDFFFF'> \n".
"          <td> \n"."            <p>Your support and maintenance period for this product has expired. For details of the benefits and how to renew <a href='helpsupport.php?action=helprenew'>click \n"."              here &raquo;</a></p>\n"."          </td>\n"."        </tr>\n"."      </table>\n"."    </td>\n"."  </tr>\n"."</table>\n";}$fullpage = str_replace("[SUPPORT]",   $supportinfo,   $fullpage);echo $fullpage;return;}function  validEmail($email) {$atpos = strpos($email, "@");$lastatpos = strrpos($email, "@");
$lastpoint = strrpos($email, ".");if (!$atpos)     {return false;}if (!$lastpoint) {return false;}if ($atpos > $lastpoint) {return false;}if ($atpos != $lastatpos) {return false;}if ( ($lastpoint+1) >= strlen($email)) {return false;}if (strpos($email, "\r")) {return false;}if (strpos($email, "\n")) {return false;}if (strpos($email, "\\")) {return false;}if (strpos($email, "\'")) {return false;}if (strpos($email, "\/")) {return false;}if (strpos($email, " "))  {return false;}if (strpos($email, "\"")) {return false;}
if (strpos($email, ";"))  {return false;}if (strpos($email, ":"))  {return false;}if (strpos($email, "?"))  {return false;}if (strpos($email, "!"))  {return false;}if (strpos($email, "("))  {return false;}if (strpos($email, ")"))  {return false;}if (strpos($email, "["))  {return false;}if (strpos($email, "]"))  {return false;}if (strpos($email, "{"))  {return false;}if (strpos($email, "}"))  {return false;}if (strpos($email, "^"))  {return false;}if (strpos($email, "|"))  {return false;}return true;
}function updatepassword($userid,$password) {$user = getRecordByID("userdetails",$userid);$user["password"] = md5($password);updateRecord("userdetails",$user);return;}function generatePassword() {$password = "";for ($i=0;$i<8;$i++) {$password .= chr(rand(97,122));}return $password;}function enhanceParams() {global $JPN_PARAMETERS;if (strlen($JPN_PARAMETERS["licensekey"])<9) {unlic();}$elements = undoK($JPN_PARAMETERS["licensekey"]);if (count($elements)<4) {unlic();}if (isset($_SERVER["HTTP_HOST"])) {
$host  = $_SERVER["HTTP_HOST"];}else {$host  = $HTTP_SERVER_VARS["HTTP_HOST"];}$pos = strpos($host, $elements[2]);if ($pos === false) {unlic();}$expday = mktime ( 23, 59, 59, substr($elements[3],5,2), substr($elements[3],8,2), substr($elements[3],0,4) );if (strcmp($elements[0],"full")<>0 && strtotime("now")>$expday) {unlic();}if (strcmp($elements[1],"PHPcmsNews01")<>0) {unlic();}$JPN_PARAMETERS["support"] = false;if (strcmp($elements[0],"full")<>0) {$JPN_PARAMETERS["support"] = true;}if (strcmp($elements[0],"full")==0 && strtotime("now")<$expday) {
$JPN_PARAMETERS["support"] = true;}return;}function undoK($lkey) {$ekey = substr($lkey,0,10);$lkey = substr($lkey,10);$temp = "";for ($i=0;$i<strlen($lkey);$i++) {$asciivalue = ord( substr($lkey,$i,1) );if ($asciivalue>64 && $asciivalue<75) {$asciivalue = $asciivalue-17;}else {$asciivalue = $asciivalue-10;}$temp .= chr($asciivalue);}$lkey = $temp;$temp = "";for ($i=0;$i<strlen($lkey);$i=$i+2) {$asciivalue = hexdec(substr($lkey,$i,2));$temp .= chr($asciivalue);}$lkey = $temp;$temp = "";$keycount = 0;
for ($i=0;$i<strlen($lkey);$i++) {$newasciivalue = ord(substr($lkey,$i,1)) - ord(substr($ekey,$keycount,1));$temp .= chr($newasciivalue);$keycount++;if ($keycount>9) {$keycount = 0;}}$lkey = $temp;$elements = explode("|",$lkey);return $elements;}function unlic() {$fullpage = "";$filename = "./templates/expire.htm";$lines = file($filename);foreach ($lines as $line) {$line = str_replace("[VERSION]",   "v2.3",   $line);$fullpage = $fullpage.$line;}echo $fullpage;exit;}function isKeyValid($lkey) {if (strlen($lkey)<9) {
return false;}$elements = undoK($lkey);if (count($elements)<4) {return false;}if (isset($_SERVER["HTTP_HOST"])) {$host  = $_SERVER["HTTP_HOST"];}else {$host  = $HTTP_SERVER_VARS["HTTP_HOST"];}$pos = strpos($host, $elements[2]);if ($pos === false) {return false;}if (strcmp($elements[1],"PHPcmsNews01")<>0) {return false;}return true;}function createHeadFootFile($filename,$content) {$filename = "../data/articles/".$filename;stripslashes($content);$handle = fopen($filename, "w+b");fwrite($handle, $content);
fclose($handle);return;}function getHeadFootFile($filename) {$filename = "../data/articles/".$filename;$lines = file($filename);if (!$lines) {return "";}$content = "";foreach($lines as $line) {$content .= $line;}stripslashes($content);return $content;}function createArticleFile($filename,$article) {$filename = "../data/articles/".$filename;stripslashes($article["summary"]);stripslashes($article["fulltext"]);$handle = fopen($filename, "w+b");fwrite($handle, "<SUMMARY>\n");fwrite($handle, $article["summary"]);
if (strcmp("\n",substr($article["summary"],strlen($article["summary"])-1)) == 0) {fwrite($handle, "<\SUMMARY>\n");}else {fwrite($handle, "\n<\SUMMARY>\n");}fwrite($handle, "<FULLTEXT>\n");fwrite($handle, $article["fulltext"]);if (strcmp("\n",substr($article["fulltext"],strlen($article["fulltext"])-1)) == 0) {fwrite($handle, "<\FULLTEXT>\n");}else {fwrite($handle, "\n<\FULLTEXT>\n");}fclose($handle);return;}function getArticleFile($filename) {$filename = "../data/articles/".$filename;$lines = file($filename);
if (!$lines) {return false;}$article["summary"]  = "";$article["fulltext"] = "";$summary  = false;$fulltext = false;foreach($lines as $line) {if (strcmp("<\SUMMARY>\n",$line)==0)  {$summary  = false;}if (strcmp("<\FULLTEXT>\n",$line)==0) {$fulltext  = false;}if ($summary) {$article["summary"] .= $line;}if ($fulltext) {$article["fulltext"] .= $line;}if (strcmp("<SUMMARY>\n",$line)==0)  {$summary  = true;}if (strcmp("<FULLTEXT>\n",$line)==0) {$fulltext  = true;}}stripslashes($article["summary"]);stripslashes($article["fulltext"]);
return $article;}function deleteArticleFile($filename) {$filename = "../data/articles/".$filename;unlink($filename);return;}function generateFontFaceOptions($fontselected) {$content = "";$fontFace[0]["value"] = "Arial, sans-serif";$fontFace[0]["name"]  = "Arial";$fontFace[1]["value"] = "Avant Garde Gothic, sans-serif";$fontFace[1]["name"]  = "Avant Garde Gothic";$fontFace[2]["value"] = "Bodoni, serif";$fontFace[2]["name"]  = "Bodoni";$fontFace[3]["value"] = "Courier, monospace";$fontFace[3]["name"]  = "Courier";
$fontFace[4]["value"] = "Courier New, monospace";$fontFace[4]["name"]  = "Courier New";$fontFace[5]["value"] = "Everson Mono, monospace";$fontFace[5]["name"]  = "Everson Mono";$fontFace[6]["value"] = "Futura, sans-serif";$fontFace[6]["name"]  = "Futura";$fontFace[7]["value"] = "Garamond, serif";$fontFace[7]["name"]  = "Garamond";$fontFace[8]["value"] = "Georgia, serif";$fontFace[8]["name"]  = "Georgia";$fontFace[9]["value"] = "Helvetica, sans-serif";$fontFace[9]["name"]  = "Helvetica";$fontFace[10]["value"] = "Minion Web, serif";
$fontFace[10]["name"]  = "Minion Web";$fontFace[11]["value"] = "Prestige, monospace";$fontFace[11]["name"]  = "Prestige";$fontFace[12]["value"] = "Stone Sans, sans-serif";$fontFace[12]["name"]  = "Stone Sans";$fontFace[13]["value"] = "Stone Serif, serif";$fontFace[13]["name"]  = "Stone Serif";$fontFace[14]["value"] = "Times New Roman, serif";$fontFace[14]["name"]  = "Times New Roman";$fontFace[15]["value"] = "Trebuchet, sans-serif";$fontFace[15]["name"]  = "Trebuchet";$fontFace[16]["value"] = "Univers, sans-serif";
$fontFace[16]["name"]  = "Univers";$fontFace[17]["value"] = "Verdana, sans-serif";$fontFace[17]["name"]  = "Verdana";$selectedindex = 0;$fontselected = trim($fontselected);for ($i=0;$i<count($fontFace);$i++) {if (strcmp($fontFace[$i]["value"],$fontselected) == 0) {$selectedindex = $i;}}for ($i=0;$i<count($fontFace);$i++) {if ($selectedindex == $i) {$content .= "<option value='".$fontFace[$i]["value"]."' selected>".$fontFace[$i]["name"]."</option>";}else {$content .= "<option value='".$fontFace[$i]["value"]."'>".$fontFace[$i]["name"]."</option>";
}}return $content;}function generateFontSizeOptions($fontsize) {$content = "";$fontSize[0]["value"] = "8";$fontSize[0]["name"]  = "8";$fontSize[1]["value"] = "9";$fontSize[1]["name"]  = "9";$fontSize[2]["value"] = "10";$fontSize[2]["name"]  = "10";$fontSize[3]["value"] = "11";$fontSize[3]["name"]  = "11";$fontSize[4]["value"] = "12";$fontSize[4]["name"]  = "12";$fontSize[5]["value"] = "14";$fontSize[5]["name"]  = "14";$fontSize[6]["value"] = "16";$fontSize[6]["name"]  = "16";$fontSize[7]["value"] = "18";
$fontSize[7]["name"]  = "18";$fontSize[8]["value"] = "20";$fontSize[8]["name"]  = "20";$fontSize[9]["value"] = "22";$fontSize[9]["name"]  = "22";$fontSize[10]["value"] = "24";$fontSize[10]["name"]  = "24";$fontSize[11]["value"] = "28";$fontSize[11]["name"]  = "28";$fontSize[12]["value"] = "32";$fontSize[12]["name"]  = "32";$selectedindex = 2;$fontsize = trim($fontsize);for ($i=0;$i<count($fontSize);$i++) {if (strcmp($fontSize[$i]["value"],$fontsize) == 0) {$selectedindex = $i;}}for ($i=0;$i<count($fontSize);$i++) {
if ($selectedindex == $i) {$content .= "<option value='".$fontSize[$i]["value"]."' selected>".$fontSize[$i]["name"]."</option>";}else {$content .= "<option value='".$fontSize[$i]["value"]."'>".$fontSize[$i]["name"]."</option>";}}return $content;}function generateFontStyleOptions($fontstyle) {$content = "";$fontStyle[0]["value"] = "normal";$fontStyle[0]["name"]  = "none";$fontStyle[1]["value"] = "italic";$fontStyle[1]["name"]  = "italic";$fontStyle[2]["value"] = "oblique";$fontStyle[2]["name"]  = "oblique";
$selectedindex = 0;$fontstyle = trim($fontstyle);for ($i=0;$i<count($fontStyle);$i++) {if (strcmp($fontStyle[$i]["value"],$fontstyle) == 0) {$selectedindex = $i;}}for ($i=0;$i<count($fontStyle);$i++) {if ($selectedindex == $i) {$content .= "<option value='".$fontStyle[$i]["value"]."' selected>".$fontStyle[$i]["name"]."</option>";}else {$content .= "<option value='".$fontStyle[$i]["value"]."'>".$fontStyle[$i]["name"]."</option>";}}return $content;}function generateFontWeightOptions($fontweight) {$content = "";
$fontWeight[0]["value"] = "normal";$fontWeight[0]["name"]  = "normal";$fontWeight[1]["value"] = "bold";$fontWeight[1]["name"]  = "bold";$fontWeight[2]["value"] = "bolder";$fontWeight[2]["name"]  = "bolder";$fontWeight[3]["value"] = "lighter";$fontWeight[3]["name"]  = "lighter";$selectedindex = 0;$fontweight = trim($fontweight);for ($i=0;$i<count($fontWeight);$i++) {if (strcmp($fontWeight[$i]["value"],$fontweight) == 0) {$selectedindex = $i;}}for ($i=0;$i<count($fontWeight);$i++) {if ($selectedindex == $i) {
$content .= "<option value='".$fontWeight[$i]["value"]."' selected>".$fontWeight[$i]["name"]."</option>";}else {$content .= "<option value='".$fontWeight[$i]["value"]."'>".$fontWeight[$i]["name"]."</option>";}}return $content;}function generateSpeedOptions($scrollingnewsspeed) {$content = "";$scrollingnewsspeed = trim($scrollingnewsspeed);if ($scrollingnewsspeed > 65) {$content .= "<option value='slower' selected> Slower </option>\n";}else {$content .= "<option value='slower'> Slower </option>\n";
}if ($scrollingnewsspeed < 66 && $scrollingnewsspeed > 50) {$content .= "<option value='slow' selected> Slow </option>\n";}else {$content .= "<option value='slow'> Slow </option>\n";}if ($scrollingnewsspeed < 51 && $scrollingnewsspeed > 30) {$content .= "<option value='normal' selected> Normal </option>\n";}else {$content .= "<option value='normal'> Normal </option>\n";}if ($scrollingnewsspeed < 31 && $scrollingnewsspeed > 15) {$content .= "<option value='fast' selected> Fast </option>\n";}else {
$content .= "<option value='fast'> Fast </option>\n";}if ($scrollingnewsspeed < 16) {$content .= "<option value='faster' selected> Faster </option>\n";}else {$content .= "<option value='faster'> Faster </option>\n";}return $content;}function verifyColor($inputcolor) {$outputcolor = "#FFFFFF";if (strlen($inputcolor)<1) {$inputcolor = "#FFFFFF";}$inputcolor = trim($inputcolor);if (strcmp(substr($inputcolor,0,1),"#")<>0) {$inputcolor = "#".$inputcolor;}while (strlen($inputcolor)<7) {$inputcolor .= "0";
}if (strlen($inputcolor)>7) {$inputcolor = substr($inputcolor,0,7);}$inputcolor = strtoupper($inputcolor);$outputcolor = "#";for ($i=1;$i<7;$i++) {$asciivalue = ord(substr($inputcolor,$i,1));if ( ($asciivalue>=48 && $asciivalue <=57) ||($asciivalue>=65 && $asciivalue <=70) ) {$outputcolor .= substr($inputcolor,$i,1);}else {$outputcolor .= "0";}}return $outputcolor;}function verifyInteger($inputstr,$minvalue,$maxvalue) {$inputstr = strtolower(trim($inputstr));$intnumber = (int)round($inputstr);if ($intnumber<$minvalue) {
$intnumber = $minvalue;}if ($intnumber>$maxvalue) {$intnumber = $maxvalue;}return $intnumber;}function verifySpeedOptions($inputstr) {$inputstr = strtolower(trim($inputstr));$speed = 40;switch ($inputstr) {case "slower":$speed = 80;break;case "slow":$speed = 65;break;case "normal":$speed = 50;break;case "fast":$speed = 30;break;case "faster":$speed = 15;break;}return $speed;}function verifyURL($urlentered) {if (strcmp(substr($urlentered, strlen($urlentered)-1),"/") <> 0) {$urlentered .= "/";}return $urlentered;
}function getSystemParameters() {global $JPN_PARAMETERS;global $JPN_PARAMNAMES;$JPN_PARAMNAMES[0]   = "ArticlesPerPage";$JPN_PARAMNAMES[1]   = "HeadlinesPerCat";$JPN_PARAMNAMES[2]   = "SearchResultsPerPage";$JPN_PARAMNAMES[3]   = "baseurl";$JPN_PARAMNAMES[120] = "licensekey";$JPN_PARAMNAMES[121] = "setup";$JPN_PARAMNAMES[4] = "LinksColor";$JPN_PARAMNAMES[5] = "LinksHoverColor";$JPN_PARAMNAMES[6] = "JPNleftBGColor";$JPN_PARAMNAMES[7] = "JPNcenterBGColor";$JPN_PARAMNAMES[8] = "JPNrightBGColor";$JPN_PARAMNAMES[9] = "JPNBorderColor";
$JPN_PARAMNAMES[10] = "SearchBoxBorderColor";$JPN_PARAMNAMES[11] = "SearchBoxBgColor";$JPN_PARAMNAMES[12] = "SearchBoxFontColor";$JPN_PARAMNAMES[13] = "SearchBoxFontFace";$JPN_PARAMNAMES[14] = "SearchBoxFontSize";$JPN_PARAMNAMES[15] = "SearchBoxFontStyle";$JPN_PARAMNAMES[16] = "SearchBoxFontWeight";$JPN_PARAMNAMES[17] = "SearchBoxHeaderBgColor";$JPN_PARAMNAMES[18] = "SearchBoxHeaderFontColor";$JPN_PARAMNAMES[19] = "SearchBoxHeaderFontFace";$JPN_PARAMNAMES[20] = "SearchBoxHeaderFontSize";$JPN_PARAMNAMES[21] = "SearchBoxHeaderFontStyle";
$JPN_PARAMNAMES[22] = "SearchBoxHeaderFontWeight";$JPN_PARAMNAMES[23] = "SearchBoxInputBgColor";$JPN_PARAMNAMES[24] = "SearchBoxInputBorderColor";$JPN_PARAMNAMES[25] = "SearchBoxInputFontColor";$JPN_PARAMNAMES[26] = "SearchBoxInputFontFace";$JPN_PARAMNAMES[27] = "SearchBoxInputFontSize";$JPN_PARAMNAMES[28] = "SearchBoxInputFontStyle";$JPN_PARAMNAMES[29] = "SearchBoxInputFontWeight";$JPN_PARAMNAMES[30] = "SearchBoxButtonBgColor";$JPN_PARAMNAMES[31] = "SearchBoxButtonBorderColor";$JPN_PARAMNAMES[32] = "SearchBoxButtonFontColor";
$JPN_PARAMNAMES[33] = "SearchBoxButtonFontFace";$JPN_PARAMNAMES[34] = "SearchBoxButtonFontSize";$JPN_PARAMNAMES[35] = "SearchBoxButtonFontStyle";$JPN_PARAMNAMES[36] = "SearchBoxButtonFontWeight";$JPN_PARAMNAMES[37] = "CatLinksFontColor";$JPN_PARAMNAMES[38] = "CatLinksFontFace";$JPN_PARAMNAMES[39] = "CatLinksFontSize";$JPN_PARAMNAMES[40] = "CatLinksFontStyle";$JPN_PARAMNAMES[41] = "CatLinksFontWeight";$JPN_PARAMNAMES[42] = "CatBGcolor";$JPN_PARAMNAMES[43] = "HeadlinesCatFontColor";$JPN_PARAMNAMES[44] = "HeadlinesCatFontFace";
$JPN_PARAMNAMES[45] = "HeadlinesCatFontSize";$JPN_PARAMNAMES[46] = "HeadlinesCatFontStyle";$JPN_PARAMNAMES[47] = "HeadlinesCatFontWeight";$JPN_PARAMNAMES[48] = "HeadlinesFontFace";$JPN_PARAMNAMES[49] = "HeadlinesFontSize";$JPN_PARAMNAMES[50] = "HeadlinesFontStyle";$JPN_PARAMNAMES[51] = "HeadlinesFontWeight";$JPN_PARAMNAMES[52] = "HeadlinesBGcolor";$JPN_PARAMNAMES[53] = "MainCatFontColor";$JPN_PARAMNAMES[54] = "MainCatFontFace";$JPN_PARAMNAMES[55] = "MainCatFontSize";$JPN_PARAMNAMES[56] = "MainCatFontStyle";
$JPN_PARAMNAMES[57] = "MainCatFontWeight";$JPN_PARAMNAMES[58] = "MainHeadlineFontColor";$JPN_PARAMNAMES[59] = "MainHeadlineFontFace";$JPN_PARAMNAMES[60] = "MainHeadlineFontSize";$JPN_PARAMNAMES[61] = "MainHeadlineFontStyle";$JPN_PARAMNAMES[62] = "MainHeadlineFontWeight";$JPN_PARAMNAMES[63] = "MainDateFontColor";$JPN_PARAMNAMES[64] = "MainDateFontFace";$JPN_PARAMNAMES[65] = "MainDateFontSize";$JPN_PARAMNAMES[66] = "MainDateFontStyle";$JPN_PARAMNAMES[67] = "MainDateFontWeight";$JPN_PARAMNAMES[68] = "MainSummaryFontColor";
$JPN_PARAMNAMES[69] = "MainSummaryFontFace";$JPN_PARAMNAMES[70] = "MainSummaryFontSize";$JPN_PARAMNAMES[71] = "MainSummaryFontStyle";$JPN_PARAMNAMES[72] = "MainSummaryFontWeight";$JPN_PARAMNAMES[73] = "MainViewLinkFontColor";$JPN_PARAMNAMES[74] = "MainViewLinkFontFace";$JPN_PARAMNAMES[75] = "MainViewLinkFontSize";$JPN_PARAMNAMES[76] = "MainViewLinkFontStyle";$JPN_PARAMNAMES[77] = "MainViewLinkFontWeight";$JPN_PARAMNAMES[78] = "MainBGcolor";$JPN_PARAMNAMES[79] = "ArticleCatFontColor";$JPN_PARAMNAMES[80] = "ArticleCatFontFace";
$JPN_PARAMNAMES[81] = "ArticleCatFontSize";$JPN_PARAMNAMES[82] = "ArticleCatFontStyle";$JPN_PARAMNAMES[83] = "ArticleCatFontWeight";$JPN_PARAMNAMES[84] = "ArticleHeadlineFontColor";$JPN_PARAMNAMES[85] = "ArticleHeadlineFontFace";$JPN_PARAMNAMES[86] = "ArticleHeadlineFontSize";$JPN_PARAMNAMES[87] = "ArticleHeadlineFontStyle";$JPN_PARAMNAMES[88] = "ArticleHeadlineFontWeight";$JPN_PARAMNAMES[89] = "ArticleDateFontColor";$JPN_PARAMNAMES[90] = "ArticleDateFontFace";$JPN_PARAMNAMES[91] = "ArticleDateFontSize";
$JPN_PARAMNAMES[92] = "ArticleDateFontStyle";$JPN_PARAMNAMES[93] = "ArticleDateFontWeight";$JPN_PARAMNAMES[94] = "ArticleSummaryFontColor";$JPN_PARAMNAMES[95] = "ArticleSummaryFontFace";$JPN_PARAMNAMES[96] = "ArticleSummaryFontSize";$JPN_PARAMNAMES[97] = "ArticleSummaryFontStyle";$JPN_PARAMNAMES[98] = "ArticleSummaryFontWeight";$JPN_PARAMNAMES[99]  = "ArticleFullTextFontColor";$JPN_PARAMNAMES[100] = "ArticleFullTextFontFace";$JPN_PARAMNAMES[101] = "ArticleFullTextFontSize";$JPN_PARAMNAMES[102] = "ArticleFullTextFontStyle";
$JPN_PARAMNAMES[103] = "ArticleFullTextFontWeight";$JPN_PARAMNAMES[104] = "ScrollingNewsCatFontColor";$JPN_PARAMNAMES[105] = "ScrollingNewsCatFontFace";$JPN_PARAMNAMES[106] = "ScrollingNewsCatFontSize";$JPN_PARAMNAMES[107] = "ScrollingNewsCatFontStyle";$JPN_PARAMNAMES[108] = "ScrollingNewsCatFontWeight";$JPN_PARAMNAMES[109] = "ScrollingNewsHeadLineLinkColor";$JPN_PARAMNAMES[110] = "ScrollingNewsHeadLineHoverColor";$JPN_PARAMNAMES[111] = "ScrollingNewsHeadLineFontFace";$JPN_PARAMNAMES[112] = "ScrollingNewsHeadLineFontSize";
$JPN_PARAMNAMES[113] = "ScrollingNewsHeadLineFontStyle";$JPN_PARAMNAMES[114] = "ScrollingNewsHeadLineFontWeight";$JPN_PARAMNAMES[115] = "ScrollingNewsSpeed";$JPN_PARAMNAMES[116] = "ScrollingNewsWidth";$JPN_PARAMNAMES[117] = "ScrollingNewsHeight";$JPN_PARAMNAMES[118] = "ScrollingNewsBGColor";$JPN_PARAMNAMES[119] = "ScrollingNewsBorderColor";$JPN_PARAMETERS["ArticlesPerPage"] = 10;$JPN_PARAMETERS["HeadlinesPerCat"] = 3;$JPN_PARAMETERS["SearchResultsPerPage"] = 10;$JPN_PARAMETERS["baseurl"] = "http://localhost:8080/";
$JPN_PARAMETERS["licensekey"] = " ";$JPN_PARAMETERS["setup"] = "no";$JPN_PARAMETERS["LinksColor"]      = "#0000FF";$JPN_PARAMETERS["LinksHoverColor"] = "#FF0000";$JPN_PARAMETERS["JPNleftBGColor"]   = "#F8F8F8";$JPN_PARAMETERS["JPNcenterBGColor"] = "#FFFFFF";$JPN_PARAMETERS["JPNrightBGColor"]  = "#F8F8F8";$JPN_PARAMETERS["JPNBorderColor"]   = "#666666";$JPN_PARAMETERS["SearchBoxBorderColor"] = "#000066";$JPN_PARAMETERS["SearchBoxBgColor"]     = "#DEEFFF";$JPN_PARAMETERS["SearchBoxFontColor"]   = "#666666";
$JPN_PARAMETERS["SearchBoxFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["SearchBoxFontSize"]    = "10";$JPN_PARAMETERS["SearchBoxFontStyle"]   = "normal";$JPN_PARAMETERS["SearchBoxFontWeight"]  = "bold";$JPN_PARAMETERS["SearchBoxHeaderBgColor"]    = "#000099";$JPN_PARAMETERS["SearchBoxHeaderFontColor"]  = "#DEEFFF";$JPN_PARAMETERS["SearchBoxHeaderFontFace"]   = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["SearchBoxHeaderFontSize"]   = "12";$JPN_PARAMETERS["SearchBoxHeaderFontStyle"]  = "normal";
$JPN_PARAMETERS["SearchBoxHeaderFontWeight"] = "bold";$JPN_PARAMETERS["SearchBoxInputBgColor"]     = "#FFFFFF";$JPN_PARAMETERS["SearchBoxInputBorderColor"] = "#000099";$JPN_PARAMETERS["SearchBoxInputFontColor"]   = "#000099";$JPN_PARAMETERS["SearchBoxInputFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["SearchBoxInputFontSize"]    = "12";$JPN_PARAMETERS["SearchBoxInputFontStyle"]   = "normal";$JPN_PARAMETERS["SearchBoxInputFontWeight"]  = "bold";$JPN_PARAMETERS["SearchBoxButtonBgColor"]     = "#FFFFFF";
$JPN_PARAMETERS["SearchBoxButtonBorderColor"] = "#000099";$JPN_PARAMETERS["SearchBoxButtonFontColor"]   = "#000099";$JPN_PARAMETERS["SearchBoxButtonFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["SearchBoxButtonFontSize"]    = "12";$JPN_PARAMETERS["SearchBoxButtonFontStyle"]   = "normal";$JPN_PARAMETERS["SearchBoxButtonFontWeight"]  = "bold";$JPN_PARAMETERS["CatLinksFontColor"]      = "#FF0088"; $JPN_PARAMETERS["CatLinksFontFace"]       = "Verdana, Arial, Helvetica, sans-serif";
$JPN_PARAMETERS["CatLinksFontSize"]       = "12";$JPN_PARAMETERS["CatLinksFontStyle"]      = "none";$JPN_PARAMETERS["CatLinksFontWeight"]     = "bold";$JPN_PARAMETERS["CatBGcolor"]             = "#999999"; $JPN_PARAMETERS["HeadlinesCatFontColor"]   = "#666666";$JPN_PARAMETERS["HeadlinesCatFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["HeadlinesCatFontSize"]    = "12";$JPN_PARAMETERS["HeadlinesCatFontStyle"]   = "none";$JPN_PARAMETERS["HeadlinesCatFontWeight"]  = "bold";$JPN_PARAMETERS["HeadlinesFontFace"]       = "Verdana, Arial, Helvetica, sans-serif";
$JPN_PARAMETERS["HeadlinesFontSize"]       = "11";$JPN_PARAMETERS["HeadlinesFontStyle"]      = "none";$JPN_PARAMETERS["HeadlinesFontWeight"]     = "normal";$JPN_PARAMETERS["HeadlinesBGcolor"]        = "#999999"; $JPN_PARAMETERS["MainCatFontColor"]   = "#888888";$JPN_PARAMETERS["MainCatFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["MainCatFontSize"]    = "12";$JPN_PARAMETERS["MainCatFontStyle"]   = "none";$JPN_PARAMETERS["MainCatFontWeight"]  = "bold";$JPN_PARAMETERS["MainHeadlineFontColor"]   = "#000000";
$JPN_PARAMETERS["MainHeadlineFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["MainHeadlineFontSize"]    = "16";$JPN_PARAMETERS["MainHeadlineFontStyle"]   = "none";$JPN_PARAMETERS["MainHeadlineFontWeight"]  = "bold";$JPN_PARAMETERS["MainDateFontColor"]   = "#006666";$JPN_PARAMETERS["MainDateFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["MainDateFontSize"]    = "10";$JPN_PARAMETERS["MainDateFontStyle"]   = "none";$JPN_PARAMETERS["MainDateFontWeight"]  = "normal";
$JPN_PARAMETERS["MainSummaryFontColor"]   = "#000000";$JPN_PARAMETERS["MainSummaryFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["MainSummaryFontSize"]    = "12";$JPN_PARAMETERS["MainSummaryFontStyle"]   = "none";$JPN_PARAMETERS["MainSummaryFontWeight"]  = "normal";$JPN_PARAMETERS["MainViewLinkFontColor"]   = "#000000";$JPN_PARAMETERS["MainViewLinkFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["MainViewLinkFontSize"]    = "10";$JPN_PARAMETERS["MainViewLinkFontStyle"]   = "none";
$JPN_PARAMETERS["MainViewLinkFontWeight"]  = "bold";$JPN_PARAMETERS["MainBGcolor"]             = "#999999";  $JPN_PARAMETERS["ArticleCatFontColor"]   = "#888888";$JPN_PARAMETERS["ArticleCatFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["ArticleCatFontSize"]    = "12";$JPN_PARAMETERS["ArticleCatFontStyle"]   = "none";$JPN_PARAMETERS["ArticleCatFontWeight"]  = "bold";$JPN_PARAMETERS["ArticleHeadlineFontColor"]   = "#000000";$JPN_PARAMETERS["ArticleHeadlineFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";
$JPN_PARAMETERS["ArticleHeadlineFontSize"]    = "18";$JPN_PARAMETERS["ArticleHeadlineFontStyle"]   = "none";$JPN_PARAMETERS["ArticleHeadlineFontWeight"]  = "bold";$JPN_PARAMETERS["ArticleDateFontColor"]   = "#006666";$JPN_PARAMETERS["ArticleDateFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["ArticleDateFontSize"]    = "10";$JPN_PARAMETERS["ArticleDateFontStyle"]   = "none";$JPN_PARAMETERS["ArticleDateFontWeight"]  = "normal";$JPN_PARAMETERS["ArticleSummaryFontColor"]   = "#000000";
$JPN_PARAMETERS["ArticleSummaryFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["ArticleSummaryFontSize"]    = "12";$JPN_PARAMETERS["ArticleSummaryFontStyle"]   = "none";$JPN_PARAMETERS["ArticleSummaryFontWeight"]  = "bold";$JPN_PARAMETERS["ArticleFullTextFontColor"]   = "#000000";$JPN_PARAMETERS["ArticleFullTextFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["ArticleFullTextFontSize"]    = "12";$JPN_PARAMETERS["ArticleFullTextFontStyle"]   = "none";
$JPN_PARAMETERS["ArticleFullTextFontWeight"]  = "normal";$JPN_PARAMETERS["ScrollingNewsCatFontColor"]  = "#666666";$JPN_PARAMETERS["ScrollingNewsCatFontFace"]   = "Verdana, Arial, Helvetica, sans-serif";$JPN_PARAMETERS["ScrollingNewsCatFontSize"]   = "12";$JPN_PARAMETERS["ScrollingNewsCatFontStyle"]  = "none";$JPN_PARAMETERS["ScrollingNewsCatFontWeight"] = "bold";$JPN_PARAMETERS["ScrollingNewsHeadLineLinkColor"]   = "#0000FF";$JPN_PARAMETERS["ScrollingNewsHeadLineHoverColor"]  = "#FF0000";$JPN_PARAMETERS["ScrollingNewsHeadLineFontFace"]    = "Verdana, Arial, Helvetica, sans-serif";
$JPN_PARAMETERS["ScrollingNewsHeadLineFontSize"]    = "12";$JPN_PARAMETERS["ScrollingNewsHeadLineFontStyle"]   = "none";$JPN_PARAMETERS["ScrollingNewsHeadLineFontWeight"]  = "normal";$JPN_PARAMETERS["ScrollingNewsSpeed"]       = "50";$JPN_PARAMETERS["ScrollingNewsWidth"]       = "180";$JPN_PARAMETERS["ScrollingNewsHeight"]      = "200";$JPN_PARAMETERS["ScrollingNewsBGColor"]     = "#FFFFFF";$JPN_PARAMETERS["ScrollingNewsBorderColor"] = "#999999";$sysrec = getAllRecords("system","systemid","numberasc");
for ($i=0;$i<count($sysrec);$i++) {if ($sysrec[$i]["systemid"]>0) {$JPN_PARAMETERS[$sysrec[$i]["paramname"]]  = $sysrec[$i]["paramvalue"];}}return;}function updateSystemParameters() {global $JPN_PARAMETERS;global $JPN_PARAMNAMES;for ($i=0;$i<count($JPN_PARAMNAMES);$i++) {$sysrec = getRecordByColname("system","paramname",$JPN_PARAMNAMES[$i]);if (!$sysrec["systemid"]) {$sysrec["paramname"]  = $JPN_PARAMNAMES[$i];$sysrec["paramvalue"] = $JPN_PARAMETERS[$JPN_PARAMNAMES[$i]];addRecord("system",$sysrec);
}else {$sysrec["paramvalue"] = $JPN_PARAMETERS[$JPN_PARAMNAMES[$i]];;updateRecord("system",$sysrec);}}return;}
?>
Return current item: News Publishing Content Management System