Location: PHPKode > scripts > OekakiPoteto > oekakipoteto/cpanel.php
<?
include('dbconn.php');
include('flagchk.php');
$result = mysql_query("SELECT usrname,usrpass, usrflags FROM ".$OekakiPoteto_MemberPrefix."oekaki WHERE usrname='$OekakiU'");
$row = mysql_fetch_array($result);
$usrflags = $row[usrflags];
if($OekakiPass != $row[usrpass]){
header('Location: index.php');
exit;
}
if (!check_flag('O')) {
	header('Location: error.php?error='.urlencode("You do not have the credentials to access the control panel."));
exit;
}
mysql_close($dbconn);


//User submits information
if($Submit == "Submit"){
	/* Create a dbconn.php file used to maintain database connections */
	$fp = fopen("dbconn.php","w");
	fwrite($fp,"<? \$dbhost=\"".$dbhost."\"; \n \$dbuser=\"".$dbuser."\"; \n \$dbpass=\"".$dbpass."\"; \n \$dbname=\"".$dbname."\"; \n \$OekakiPoteto_Prefix=\"".$dbprefix."\"; \n \$OekakiPoteto_MemberPrefix=\"".$OekakiPoteto_MemberPrefix."\"; \n \$dbconn = mysql_connect(\$dbhost,\$dbuser,\$dbpass) or die(\"Could not connect to the MySQL database.\");\n\$mySQLDB = mysql_select_db(\$dbname);?>"); 
	fclose($fp); 
	/* Create a configuration file with specified settings */ 
	$fp = fopen("config.php","w"); 
	fwrite($fp,"<?\n \$saltenc=\"".$saltstr."\"; \n \$OPpics=\"".$OPpics."\"; \n \$killuser=\"".$killuser."\"; \n \$template=\"".$template."\"; \n \$BBStitle=\"".$BBStitle."\"; \n \$eaddr=\"".$eaddr."\"; \n \$okurl=\"".$okurl."\"; \n \$apostrophes=\"".$apostrophes."\"; \n \$pstore=\"".$pstore."\"; \n \$ppage=\"".$ppage."\"; \n \$approval=\"".$approval."\"; \n \$drawaccess=\"".$drawaccess."\"; \n \$animationaccess=\"".$animationaccess."\"; \n \$xCanvas=\"".$xCanvas."\"; \n \$yCanvas=\"".$yCanvas."\"; \n \$xDefault=\"".$xDefault."\"; \n \$yDefault=\"".$yDefault."\"; \n \$chatMax=\"".$chatMax."\"; \n \$chatDisp=\"".$chatDisp."\"; \n \$language=\"".$language."\"; \n \$archivedir=\"".$archivedir."\"; \n \$guestpost=\"".$guestpost."\";\n \$anisize=\"".$anisize."\"; \n \$jpgcompression=\"".$jpgcompression."\"; \n \$jpgcompressqual=\"".$jpgcompressqual."\";?>"); 
	fclose($fp); 

	if($jpgcompression == "yes"){
		header('Location: compress.php');
		exit;
	}

}
include('header.php');

?>
<br><br>


<form name="form1" method="post" action="cpanel.php">
  <table width="75%" align="center" cellpadding="<?=$hCellPadding?>">
    <tr> 
      <td height="1576"> 
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr> 
            <td width="455" valign="top" class="header"><b><?=$langop_install_information?></b></td>
          </tr>
          <tr> 
            <td valign="top"> 
              <table width="75%" border="0" cellspacing="0" cellpadding="0" align="center" class="infotable">
                <tr> 
                  <td><em><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_cpanel_mysqlinfo?></font></em><br> </td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="-1"><?=$langop_install_dbhostname?></font></td>
                </tr>
                <tr> 
                  <td> <p><font color="#FFFFFF" face="Arial, Helvetica, sans-serif">&nbsp; 
                      <input type="text" name="dbhost" size="40" style="font-color:red;" value="<?=$dbhost?>" class="txtinput">
                      </font></p></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="-1"><?=$langop_install_dbname?></font></td>
                </tr>
                <tr> 
                  <td> <font color="#FFFFFF" face="Arial, Helvetica, sans-serif">&nbsp; 
                    <input type="text" name="dbname" size="40" value="<?=$dbname?>" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="-1"><?=$langop_install_dbusername?></font></td>
                </tr>
                <tr> 
                  <td> <p> <font color="#FFFFFF" face="Arial, Helvetica, sans-serif">&nbsp; 
                      <input type="text" name="dbuser" size="40" value="<?=$dbuser?>" class="txtinput">
                      </font></p></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="-1"><?=$langop_install_dbpass?></font></td>
                </tr>
                <tr> 
                  <td> <font color="#FFFFFF" face="Arial, Helvetica, sans-serif">&nbsp; 
                    <input type="password" name="dbpass" size="40" value="<?=$dbpass?>" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="-1"><?=$langop_install_prefix?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em><?=$langop_install_prefixsub?></em></font></td>
                </tr>
                <tr> 
                  <td>&nbsp;<font color="#FFFFFF"> 
                    <input type="text" name="dbprefix" size="40" value="<?=$OekakiPoteto_Prefix?>" class="txtinput">
                    </font></td>
                </tr>
                <tr>
                  <td class="infotable"><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_mdbprefix?><br>
                    &nbsp;<em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?=$langop_install_mdbprefixsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF"> &nbsp; 
                    <input name="OekakIPoteto_MemberPrefix" type="text" class="txtinput" id="OekakIPoteto_MemberPrefix" value="<?=$OekakiPoteto_MemberPrefix?>" size="40">
                    </font></td>
                </tr>
                <tr> 
                  <td> <font color="#FFFFFF">&nbsp; </font></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr> 
            <td class="header"><b><?=$langop_install_opconf?></b></td>
          </tr>
          <tr> 
            <td valign="top"> <br>
              <table width="75%" border="0" cellspacing="0" cellpadding="2" align="center" class="infotable">
<tr> 
                  <td class="header"><strong><?=$langop_install_dispreg?></font></strong></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_opurl?></font></td>
                </tr>
                <tr> 
                  <td height="24"><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="okurl" type="text" id="OPpics24" value="<?=$okurl?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_email?><br>
                    <em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$langop_install_emailsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="eaddr" type="text" id="OPpics2223" value="<?=$eaddr?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td class="header"><strong><?=$langop_install_general?></strong></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_picstore?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp;&nbsp;<?=$langop_install_picstoresub?></em></font></td>
                </tr>
                <tr> 
                  <td>&nbsp;<font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    <input name="pstore" type="text" id="OPpics32" value="<?=$pstore?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input type="hidden" name="saltstr" value="<?=$saltenc?>">
                    <input type="hidden" name="OPpics" value="<?=$OPpics?>">
                    <input name="archivedir" type="hidden" value="<?=$archivedir?>">
                    </font></td>
                </tr>
                <tr> 
                  <td class="header"><strong><?=$langop_install_reg?></strong></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_adel?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp; <?=$langop_install_adelsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="killuser" type="text" id="OPpics23" value="<?=$killuser?>" size="40" class="txtinput">
                   <?=$langop_install_adelsub2?> </font></td>
                </tr>
                <tr> 
                  <td valign="top"><p><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_gallow?><br>
                      <em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$langop_install_gallowsub?></em></font></p></td>
                </tr>
                <tr> 
                  <td valign="top">&nbsp; <select name="guestpost" id="guestpost" class="multiline">
                      <? if($guestpost == "yes") { ?>
                      <option value="yes" selected><?=$langop_word_yes?></option>
                      <option value="no"><?=$langop_word_no?></option>
                      <? } else { ?>
                      <option value="yes"><?=$langop_word_yes?></option>
                      <option value="no" selected><?=$langop_word_no?></option>
                      <? } ?>
                    </select></td>
                </tr>
                <tr> 
                  <td valign="top"> <p><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_rapproval?><br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><?=$langop_install_rapprovalsub?></em></font></p></td>
                </tr>
                <tr> 
                  <td> &nbsp; <select name="approval" id="approval" class="multiline">
                      <? if($approval == "yes") { ?>
                      <option value="yes" selected><?=$langop_word_yes?></option>
                      <option value="no"><?=$langop_word_no?></option>
                      <? } else { ?>
                      <option value="yes"><?=$langop_word_yes?></option>
                      <option value="no" selected><?=$langop_word_no?></option>
                      <? } ?>
                    </select> </td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_daccess?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em><?=$langop_install_daccesssub?></em></font></td>
                </tr>
                <tr> 
                  <td>&nbsp; <select name="drawaccess" id="drawaccess" class="multiline">
                      <? if($drawaccess == "yes") { ?>
                      <option value="yes" selected><?=$langop_word_yes?></option>
                      <option value="no"><?=$langop_word_no?></option>
                      <? } else { ?>
                      <option value="yes"><?=$langop_word_yes?></option>
                      <option value="no" selected><?=$langop_word_no?></option>
                      <? } ?>
                    </select></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_aaccess?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em><?=$langop_install_aaccesssub?></em></font> 
                  </td>
                </tr>
                <tr> 
                  <td>&nbsp; <select name="animationaccess" id="animationaccess" class="multiline">
                      <? if($animationaccess == "yes") { ?>
                      <option value="yes" selected><?=$langop_word_yes?></option>
                      <option value="no"><?=$langop_word_no?></option>
                      <? } else { ?>
                      <option value="yes"><?=$langop_word_yes?></option>
                      <option value="no" selected><?=$langop_word_no?></option>
                      <? } ?>
                    </select></td>
                </tr>
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td class="header"><strong><?=$langop_install_dispgen?></strong></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_deftem?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><?=$langop_install_deftemsub?></em></font></td>

                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif">&nbsp; 
                    <select name="template" id="template" class="multiline">
                      <?	if ($handle = opendir('templates')) {
    
  		/* This is the correct way to loop over the directory. */
    		while (false !== ($file = readdir($handle))) { 
			if(substr($file,-4) == ".php"){ ?>
                      <? if(substr($file,0,-4) == $template) { ?>
                      <option value="<?=substr($file,0,-4)?>" selected> 
                      <?=substr($file,0,-4)?>
                      </option>
                      <? } else { ?>
                      <option value="<?=substr($file,0,-4)?>"> 
                      <?=substr($file,0,-4)?>
                      </option>
                      <?

		}
			}
		}
		
		closedir($handle); 
   	}?>
                    </select>
                    </font></td>
                </tr>

                <tr> 
                  <td height="40"><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_title2?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$langop_install_title2sub?></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="BBStitle" type="text" id="BBStitle" value="<?=$BBStitle?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td height="21"> <p><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_nopics?><br>
                      </font></p></td>
                </tr>
                <tr> 
                  <td>&nbsp;<font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    <input name="ppage" type="text" id="ppage2" value="<?=$ppage?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; </font></td>
                </tr>
                <tr> 
                  <td class="header"><strong><?=$langop_install_dispchat?></strong></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_displinesmax?></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="chatMax" type="text" id="chatMax" value="<?=$chatMax?>" size="40" class="txtinput">
                    </font></td>

                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_displines?></font></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="chatDisp" type="text" id="chatDisp" value="<?=$chatDisp?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td class="header"><strong><?=$langop_install_appletset?></strong></td>
                </tr>
                <tr>
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_animax?><br>
                    <em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=$langop_install_animaxsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
<input name="anisize" type="text" id="xCanvas2" value="<?=$anisize?>" size="40" class="txtinput">
                    <?=$langop_install_bytes?></font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_canvwid?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp;&nbsp;<?=$langop_install_canvwidsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="xCanvas" type="text" id="xCanvas" value="<?=$xCanvas?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_canvhei?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp;&nbsp;<?=$langop_install_canvheisubm?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="yCanvas" type="text" id="yCanvas" value="<?=$yCanvas?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_dcanvwid?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp;&nbsp;<?=$langop_install_dcanvwidsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="xDefault" type="text" id="xDefault" value="<?=$xDefault?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_dcanvhei?><br>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>&nbsp;&nbsp;<?=$langop_install_dcanvheisub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <input name="yDefault" type="text" id="yDefault" value="<?=$yDefault?>" size="40" class="txtinput">
                    </font></td>
                </tr>
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td class="header"><strong><?=$langop_install_miscsettings?></strong></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_install_apstrophesm?><br>


                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em><?=$langop_install_apstrophesmsub?></em></font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <select name="apostrophes" id="apostrophes" class="multiline">
                      <? if($apostrophes == "1") { ?>
                      <option value="1" selected>Mode 1</option>
                      <option value="0">Mode 0</option>
                      <? } else { ?>
                      <option value="1">Mode 1</option>
                      <option value="0" selected>Mode 0</option>
                      <? } ?>
                    </select>
                    </font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"><?=$langop_cpanel_deflang?></font></td>
                </tr>
                <tr> 
                  <td> <p> <font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">&nbsp; 
                      </font><font size="-1" face="Arial, Helvetica, sans-serif"> 
                      <select name="language" id="select" class="multiline">
                        <?	if ($handle = opendir('language')) {
    
  		/* This is the correct way to loop over the directory. */
    		while (false !== ($file = readdir($handle))) { 
			if(substr($file,-4) == ".php"){ ?>
                        <? if(substr($file,0,-4) == $language) { ?>
                        <option value="<?=substr($file,0,-4)?>" selected> 
                        <?=substr($file,0,-4)?>
                        </option>
                        <? } else { ?>
                        <option value="<?=substr($file,0,-4)?>"> 
                        <?=substr($file,0,-4)?>
                        </option>
                        <?
		}
			}
		}
		
		closedir($handle); 
   	}?>
                      </select>
                      </font><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                      </font></p></td>
                </tr>
              </table>

              <table width="75%" border="0" cellspacing="0" cellpadding="0" align="center">
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td class="header" ><font size="-1" face="Arial, Helvetica, sans-serif"><strong> 
                    <?=$langop_compress_title?>
                    </strong></font></td>
                </tr>
                <tr> 
                  <td><em><font size="-1" face="Arial, Helvetica, sans-serif"> 
                    <?=$langop_compress_disc?>
                    </font></em></td>
                </tr>
                <tr> 
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"> 
                    <?=$langop_compress_enjpg?>
                    </font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"> 
                    &nbsp; 
                    <select name="jpgcompression" id="animationaccess" class="multiline">
                      <? if($jpgcompression == "yes") { ?>
                      <option value="yes" selected>Yes</option>
                      <option value="no">No</option>
                      <? } else { ?>
                      <option value="yes">Yes</option>
                      <option value="no" selected>No</option>
                      <? } ?>
                    </select>
                    </font></td>
                </tr>
                <tr> 
                  <td><font size="-1" face="Arial, Helvetica, sans-serif"> 
                    <?=$langop_compress_qual?>
                    </font></td>
                </tr>
                <tr> 
                  <td><font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif">&nbsp; 
                    <input name="jpgcompressqual" type="text" id="ppage" value="<?=$jpgcompressqual?>" size="40" class="txtinput">
                    <?=$langop_compress_range?>
                    </font></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td> <font face="Arial, Helvetica, sans-serif"><br>
                    <input type="submit" name="Submit" value="Submit" class="submit">
                    </font></td>
                </tr>
              </table></td>
          </tr>
        </table>
        <div align="left"></div>
      </td>
    </tr>
  </table>
</form>

</body>
<?
mysql_close($dbconn);
 include('footer.php'); ?>
Return current item: OekakiPoteto