function File_Lock(&$filehandle, $fop) { switch ($fop) { case "LOCK_SH": $fop = 1; break; case "LOCK_EX": $fop = 2; break; case "LOCK_UN": $fop = 3; } flock($filehandle, $fop) or die(Go_Error("flock")); }
function query($sql) { $return = mysql_query($sql, $this->cn) or die(Go_Error(mysql_errno())); return $return; }
function Format_to_Images() { global $OPTION; $this->count_orig = $this->count_array; // Attempt to fix image url if broken by default if (!file_exists($OPTION['Images_Dir'].'0'.$OPTION['Image_ext'])) $OPTION['Images_Dir'] = $OPTION['Absolute_Path'].$OPTION['Images_Dir']; $CounterImage=getimagesize($OPTION['Images_Dir'].'0'.$OPTION['Image_ext']) or die(Go_Error("image_404")); for ($i=0; $i<4; $i++) { for ($j=0; $j<10; $j++) $this->count_array[$i] = str_replace($j, "~~".$j."~~", $this->count_array[$i]); for ($j=0; $j<10; $j++) $this->count_array[$i] = str_replace("~~".$j."~~", "<img src=\"".$OPTION['Images_Dir'].$j.$OPTION['Image_ext']."\">", $this->count_array[$i]); for ($j=0; $j<($OPTION['Counter_Spaces']-strlen($this->count_orig[$i])); $j++) $this->count_array[$i] = "<img src=\"".$OPTION['Images_Dir'].'0'.$OPTION['Image_ext']."\">".$this->count_array[$i]; $this->count_array[$i]=str_replace(">", $CounterImage[3].">", $this->count_array[$i]); } }