Im using IPB 1.3.. and trying to code a module, except im having some issues, Like im including a file into the skin file which is working fine, except I cant make any functions.
I need to make a function, but if i put it in the file im including, the page stops loading and stays white, Now if i remove the function, itll still be white until i comment out all the calls to the function...
Now of course the error is saying 'unknown function blah blah', but i dont see this on my screen, ive even changed the error_reporting stuff in index.php yet still doesnt show.
Anyone know how I can show errors? And anyone care to help with classes & functions.
in skin_ffxi.php i have
class skin_ffxi {
function main(){
global $ibforums;
@include ("/home/wwwfane/www/eov/ffxi.php");
return "
<table cellspacing=0 cellpadding=0 width='100%'>
<tr>
<!------ ---- ---------->
<!------ MENU ---------->
<td id=ucpmenu valign=top>
$thelinks
</td>
<!--- -->
<!--- ENDMENU -->
<td style='padding:.5px'><!-- --></td>
<!-- Start main CP area -->
<td id=ucpcontent valign=top>
<div class='maintitle'>FFXi - $pagetitle</div>
<table width='100%' border=0 cellspacing=0 cellpadding=4>
<tr>
<td width=100%>
$output
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end main CP area -->
<br clear=all />
</div>";
}
}
the function im needing to use:
function CheckValue($x){
$x=eval("return $x;");
if (preg_match ("/[^0-9]/",$x)){
if($x > 106 || $x < 0){
return false;
}else{
return true;
}
}else{
return false;
}
}
the file im including, well a chunk of it where my problem is:
if($show == 'profile'){
$output="";
$tst=mysql_query("SELECT * FROM `ibf_ffxi` WHERE `id`='$mid'");
if(mysql_num_rows($tst) == 0) { mysql_query("INSERT INTO `ibf_ffxi` SET `id`='$mid'");}
$output .= mysql_error();
if($mgroup == 1 || $mgroup == 2){ $output=$redirectlogin;exit;}
if($profile == 'editcrafting'){
$pagetitle="Editing Crafting Info";
if($_POST[Alchemy] || $_POST[Bonecraft] || $_POST[Clothcraft] ||
$_POST[Cooking] || $_POST[Goldsmithing] || $_POST[Leathercraft] ||
$_POST[Smithing] || $_POST[Woodworking] || $_POST[Fishing]){
$errormsg="<font color=red>Invalid Ammount: Must be 0-106 or xxx+x, Max value of 106.</font>";
/*if(CheckVar($_POST[Alchemy])){ $error1=$errormsg;}
if(CheckVar($_POST[Bonecraft])){ $error2=$errormsg;}
if(CheckVar($_POST[Clothcraft])){ $error3=$errormsg;}
if(CheckVar($_POST[Cooking])){ $error4=$errormsg;}
if(CheckVar($_POST[Goldsmithing])){ $error5=$errormsg;}
if(CheckVar($_POST[Leathercraft])){ $error6=$errormsg;}
if(CheckVar($_POST[Smithing])){ $error7=$errormsg;}
if(CheckVar($_POST[Woodworking])){ $error8=$errormsg;}
if(CheckVar($_POST[Fishing])){ $error9=$errormsg;}
*/
How Can i be able to use this function inside this file? Should it be in a class and I need to call the class some how?