Seite 1 von 2

Bar Mod: weisse Seite im ACP

Verfasst: 29.04.2008 15:54
von wwwthomasbauerattf
hi bei mir ist das linke frame im ACP weiß nachdem ich shop-bar installiert habe... der fehler liegt an der functions.php. weil sobald ich die gänderte datei hochlade das frame weiß wird...

in der installation steht aber nur eine änderung zu der datei:

Code: Alles auswählen

# 
#-----[ OPEN ]------------------------------------------------ 
#
 includes/functions.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
if ( !(function_exists(duration)) )
{
	function duration($seconds)
	{
		global $lang;

		if ( $seconds > 86399 )
		{
			$days = floor($seconds / 86400);
			$seconds = ($seconds - ($days * 86400));
			$string .= ( $days > 1 ) ? $days .' ' . $lang['jobs_days'] . ', ' : $days .' ' . $lang['jobs_day'] . ', ';
		}
		if ( $seconds > 3599 )
		{
			$hours = floor($seconds / 3600);

			if ( $seconds != 0 )
			{
				$string .= ( $hours > 1 ) ? $hours .' ' . $lang['jobs_hours'] . ', ' : $hours .' ' . $lang['jobs_hour'] . ', ';
			}

			$seconds = ( $days > 0 ) ? 0 : ( $seconds - ($hours * 3600) );
		}
		if ( $seconds > 59 )
		{
			$minutes = floor($seconds / 60);
			if ( $seconds != 0 )
			{
				$string .= ( $minutes > 1) ? $minutes .' ' . $lang['jobs_minutes'] . ', ' : $minutes .' ' . $lang['jobs_minute'] . ', ';
			}

			$seconds = ( $hours > 0 ) ? 0 : ($seconds - ($minutes * 60));
		}
		if ( $seconds > 0 )
		{
			$string .= ( $seconds > 1 ) ? $seconds . ' ' . $lang['jobs_seconds'] . ', ' : $seconds . ' ' . $lang['jobs_second'] . ', ';
		}

		$string = substr($string, 0, -2);
		return $string;
	}
}

//
// Start drunk create functions...
//
function drunk_letters($rand, $higher)
{
	$alpha = array_merge(range("a", "z"));
	$return_alpha = array();
	for ($i = 0; $i < 26; $i++)
	{
		if ( rand(1,$rand) > $higher ) { $return_alpha[] = $alpha[$i]; }
	}
	return $return_alpha;
}

function drunk_replace($alpha)
{
	$alpha_count = count($alpha);
	$replaces = array();
	for ($i = 0; $i < $alpha_count; $i++)
	{
		$replaces[] = "/" . $alpha[$i] . "/";
	}

	return $replaces;
}
function drunk_replaces($alpha)
{
	//
	// Create drunk replacement vars!
	//
	$drunk_a = array('aa', 'ah', 'oa', 'aa', 'ah', 'oa', 'A', 'ahhh');
	$drunk_b = array('B', 'vb', 'vb');
	$drunk_c = array('C', 'cj', 'sj', 'zj', 'cj', 'sj', 'zj');
	$drunk_d = array('D');
	$drunk_e = array('E', 'eh', 'eh');
	$drunk_f = array('F', 'fFf', 'fff', 'fFf', 'fff');
	$drunk_g = array('G');
	$drunk_h = array('H', 'hh', 'hhh', 'Hhh', 'HhH', 'hh', 'hhh', 'Hhh', 'HhH');
	$drunk_i = array('I', 'Ii', 'ii', 'Iii', 'iI', 'Ii', 'ii', 'Iii', 'iI');
	$drunk_j = array('J', 'jj', 'Jj', 'jj', 'Jj');
	$drunk_k = array('K');
	$drunk_l = array('L');
	$drunk_m = array('M', 'mM', 'MmM', 'mm', 'mmm', 'mmmm', 'mmmmm', 'mM', 'MmM', 'mm', 'mmm', 'mmmm', 'mmmmm');
	$drunk_n = array('N', 'Nn', 'nn', 'nnn', 'nNn', 'Nn', 'nn', 'nnn', 'nNn');
	$drunk_o = array('ao', 'oo', 'aOoo', 'ooo', 'Ooo', 'ooOo');
	$drunk_p = array('P', 'pah');
	$drunk_q = array('Q', 'ku', 'kukeleku', 'ququ', 'ku', 'kukeleku', 'ququ');
	$drunk_r = array('R', 'erR', 'Rr');
	$drunk_s = array('ss', 'sSss', 'ZSssS', 'sSzzsss', 'zzZzssZ');
	$drunk_t = array('T');
	$drunk_u = array('U', 'Uh', 'uhhu', 'uhU', 'Uhuhhuh');
	$drunk_v = array('V', 'vz');
	$drunk_w = array('W', 'Ww');
	$drunk_x = array('X', 'xz', 'kz', 'iks', 'xz', 'kz', 'iks');
	$drunk_y = array('Y');
	$drunk_z = array('Z', 'zZ', 'Zzz', 'ZSz', 'ZzzZz', 'szz', 'sZZz', 'Zsszzsz', 'zZ', 'Zzz', 'ZSz', 'ZzzZz', 'szz', 'sZZz', 'Zsszzsz');
	//
	// End drunk replacement vars!
	//

	$alpha_count = count($alpha);
	$replaces = array();
	for ($i = 0; $i < $alpha_count; $i++)
	{
		$temp_var = 'drunk_' . $alpha[$i];
		$rand = rand(0, count(${$temp_var})-1);
		$replaces[] = ${$temp_var}[$rand];
	}

	return $replaces;
}
//
// End drunk create functions...
//
hier der dl-link:
http://www.zarath.com/mods/shop_bar_1.0.0.zip

Verfasst: 29.04.2008 16:23
von Würzi
Na also alles Erziehungssache 8) :D

Also ich hatte damals das gleiche Problem, kann mich allerdings nur noch wage daran erinnern, weil es schon zu lang her ist. Ich glaube mit php4 ging es aber mit php5 nicht.

Allerdings ging es dann plötzlich doch mit php5. :lol:

Deswegen nun meine Frage: Hast du auch den Job Mod eingebaut?
Wie gesagt es ging irgendwann wieder, ich könnte mir vorstellen, daß es nach Einbau vom Job Mod wieder ging, weiss es aber nicht mehr genau. :-?

Bis ich das zum laufen gebracht habe hatte ich damals folgendes gemacht. Aber.... ohne Gewähr ist echt schon ewig her!

Suche:

Code: Alles auswählen

if ( !(function_exists(duration)) ) 
{ 
   function duration($seconds) 
   { 
      global $lang;
Ersetze mit:

Code: Alles auswählen

if ( !(function_exists(duration)) )
{ 
 return TRUE;
	function duration($seconds)
	{  
		global $lang;
Ob da noch die volle Funktionsweise vorhanden ist, weiss ich auch nicht mehr sorry :lol:

Ich habe auf jeden Fall von zarath drin: Shop 3.0.6, Bar/Tavern Shop, Effects Shop, Jobs System und Lotterie.

Falls du den Job Mod nicht drin hast würde ich den mal testweise installieren.

Hoff dies hilft dir alles ein wenig weiter. :wink:

Verfasst: 29.04.2008 17:44
von wwwthomasbauerattf
hallo!

hat tatsächlich geklappt. danke
shop bar kann auch aufgerufen werden. aber wo bitte stellt man die "Intoxication Duration:" ein. weil da ist der wert auf "None". dann kann man quasi soviel bier trinken wie man will und man ist nicht besoffen...^^
hab im ACP auch nichts gefunden zum einstellen...

Verfasst: 29.04.2008 17:57
von Andi1111
die zeit wie lange der drink wirken soll gibts du bei "Kurze Beschreibung (max 80 Buchstaben/Ziffern)" ein, also zeit in sekunden, du kannst auch getränke zum ausnüchtern rein machen dann kommt ein - vor die zahl.

Verfasst: 29.04.2008 18:33
von wwwthomasbauerattf
sobald ich das mache (habe 3600 eingegeben)

kommt wenn ich auf shop_bar.php gehe die meldung:

Fatal error: Call to undefined function duration() in /usr/export/www/vhosts/funnetwork/hosting/bauerthomas/Forum/shop_bar.php on line 85

zuvor is bei der kurzen beschreibung "Bier" gestanden

sobald irgendwas anderes steht als das gleiche wie beim "Artikel Name" kommt der fehler... ???

Zeile 85:
for ($i = 0; $i < $sql_count; $i++)
{
if (!( $row = $db->sql_fetchrow($result) ))
{
message_die(GENERAL_ERROR, "Error getting alcohols!", '', __LINE__, __FILE__, $sql);
}

$rownum = ( $i % 2 ) ? "row1" : "row2";

if ( $row['sdesc'] < 0 )
{
$duration = '-' . duration($row['sdesc'] * -1);
}
else
{
$duration = ( !is_numeric($row['sdesc']) || $row['sdesc'] < 1 ) ? $lang['bar_none'] : duration($row['sdesc']);
}
Zeile 85:
$duration = ( !is_numeric($row['sdesc']) || $row['sdesc'] < 1 ) ? $lang['bar_none'] : duration($row['sdesc']);


edit:

ok wenn ich zb "3600 Sekunden" eingib. funktionierts.
aber wenn ich dann nach der meldung auf zurück zur bar gehe kommt die meldung:

Fatal error: Call to undefined function duration() in /usr/export/www/vhosts/funnetwork/hosting/bauerthomas/Forum/shop_bar.php on line 106

Verfasst: 29.04.2008 20:59
von Würzi
Hier mal meine Einstellungen

[ externes Bild ]

[ externes Bild ]

Wenn du dann noch nen Fehler hast, dann weiss ich nicht mehr weiter.
Wenn du den Job Mod schon drin hast, hat der nicht damals auch ne Änderung an der functions.php verlangt?

Nicht dass du plötzlich eine Teil doppelt drin hast.

Verfasst: 29.04.2008 21:53
von Boecki91
Suche mal:

Code: Alles auswählen

if ( !(function_exists(duration)) )
{
   function duration($seconds)
   {
      global $lang;

      if ( $seconds > 86399 )
      {
         $days = floor($seconds / 86400);
         $seconds = ($seconds - ($days * 86400));
         $string .= ( $days > 1 ) ? $days .' ' . $lang['jobs_days'] . ', ' : $days .' ' . $lang['jobs_day'] . ', ';
      }
      if ( $seconds > 3599 )
      {
         $hours = floor($seconds / 3600);

         if ( $seconds != 0 )
         {
            $string .= ( $hours > 1 ) ? $hours .' ' . $lang['jobs_hours'] . ', ' : $hours .' ' . $lang['jobs_hour'] . ', ';
         }

         $seconds = ( $days > 0 ) ? 0 : ( $seconds - ($hours * 3600) );
      }
      if ( $seconds > 59 )
      {
         $minutes = floor($seconds / 60);
         if ( $seconds != 0 )
         {
            $string .= ( $minutes > 1) ? $minutes .' ' . $lang['jobs_minutes'] . ', ' : $minutes .' ' . $lang['jobs_minute'] . ', ';
         }

         $seconds = ( $hours > 0 ) ? 0 : ($seconds - ($minutes * 60));
      }
      if ( $seconds > 0 )
      {
         $string .= ( $seconds > 1 ) ? $seconds . ' ' . $lang['jobs_seconds'] . ', ' : $seconds . ' ' . $lang['jobs_second'] . ', ';
      }

      $string = substr($string, 0, -2);
      return $string;
   }
}
Durch:

Code: Alles auswählen

   function duration($seconds)
   {
      global $lang;

      if ( $seconds > 86399 )
      {
         $days = floor($seconds / 86400);
         $seconds = ($seconds - ($days * 86400));
         $string .= ( $days > 1 ) ? $days .' ' . $lang['jobs_days'] . ', ' : $days .' ' . $lang['jobs_day'] . ', ';
      }
      if ( $seconds > 3599 )
      {
         $hours = floor($seconds / 3600);

         if ( $seconds != 0 )
         {
            $string .= ( $hours > 1 ) ? $hours .' ' . $lang['jobs_hours'] . ', ' : $hours .' ' . $lang['jobs_hour'] . ', ';
         }

         $seconds = ( $days > 0 ) ? 0 : ( $seconds - ($hours * 3600) );
      }
      if ( $seconds > 59 )
      {
         $minutes = floor($seconds / 60);
         if ( $seconds != 0 )
         {
            $string .= ( $minutes > 1) ? $minutes .' ' . $lang['jobs_minutes'] . ', ' : $minutes .' ' . $lang['jobs_minute'] . ', ';
         }

         $seconds = ( $hours > 0 ) ? 0 : ($seconds - ($minutes * 60));
      }
      if ( $seconds > 0 )
      {
         $string .= ( $seconds > 1 ) ? $seconds . ' ' . $lang['jobs_seconds'] . ', ' : $seconds . ' ' . $lang['jobs_second'] . ', ';
      }

      $string = substr($string, 0, -2);
      return $string;
    }
Dann ist die Überprüfung auf die eventuell schon vorhandene Funktion weg.

Edit: Ich habe die Blöcke vertauscht :roll:

Verfasst: 29.04.2008 22:00
von wwwthomasbauerattf
@Boecki91

also das versteh ich nicht... meine functions schaut so aus:

http://bauerthomas.ba.funpic.de/functions.txt

@Würzi

was hat das eigentlich mit dem job mod zu tun... liegt der fehler vl daran? also jetzt versteh ich eigentlich gar nix mehr...

Verfasst: 29.04.2008 22:02
von Boecki91
Ansatt das von mir zu suchen, such mal das was du durch Würzi verändert hast, mache es rückgängig und suche dann erneut nach meinem gesuchtem Code.

Verfasst: 29.04.2008 22:05
von wwwthomasbauerattf
Boecki91 hat geschrieben:Ansatt das von mir zu suchen, such mal das was du durch Würzi verändert hast, mache es rückgängig und suche dann erneut nach meinem gesuchtem Code.
das ergibt ja keinen sinn wenn ich das mit dem alten überschreibe.
dann schauts in der function.php mal so aus:

Code: Alles auswählen

if ( !(function_exists(duration)) ) 
{ 
if ( !(function_exists(duration)) ) 
{ 
   function duration($seconds) 
   { 
      global $lang; 

      if ( $seconds > 86399 ) 
      { 
         $days = floor($seconds / 86400); 
         $seconds = ($seconds - ($days * 86400)); 
         $string .= ( $days > 1 ) ? $days .' ' . $lang['jobs_days'] . ', ' : $days .' ' . $lang['jobs_day'] . ', '; 
      } 
      if ( $seconds > 3599 ) 
      { 
         $hours = floor($seconds / 3600); 

         if ( $seconds != 0 ) 
         { 
            $string .= ( $hours > 1 ) ? $hours .' ' . $lang['jobs_hours'] . ', ' : $hours .' ' . $lang['jobs_hour'] . ', '; 
         } 

         $seconds = ( $days > 0 ) ? 0 : ( $seconds - ($hours * 3600) ); 
      } 
      if ( $seconds > 59 ) 
      { 
         $minutes = floor($seconds / 60); 
         if ( $seconds != 0 ) 
         { 
            $string .= ( $minutes > 1) ? $minutes .' ' . $lang['jobs_minutes'] . ', ' : $minutes .' ' . $lang['jobs_minute'] . ', '; 
         } 

         $seconds = ( $hours > 0 ) ? 0 : ($seconds - ($minutes * 60)); 
      } 
      if ( $seconds > 0 ) 
      { 
         $string .= ( $seconds > 1 ) ? $seconds . ' ' . $lang['jobs_seconds'] . ', ' : $seconds . ' ' . $lang['jobs_second'] . ', '; 
      } 

      $string = substr($string, 0, -2); 
      return $string; 
   } 

// 
// Start drunk create functions... 
// 
usw. ...