Seite 1 von 2

Who's playing what - funzt nicht - Fehler behoben

Verfasst: 07.07.2007 12:21
von powersilie
Hallo!

Habe den kleinen Who's playing what Mod für den Arcade Mod eingebaut.
Hab die includes/functions_arcade.php und die includes/page_header.php laut Anleitung geändert und beim Aufrufen des Forums kommt eine weiße Seite.....
Hab das wieder rausgenommen und das Forum öffnet wieder einwandfrei.
Verwende arcade Mod 2.1.8.
Hab auch den Intro und Portal-Mod eingebaut.
Muß ich da in der portal.php auch was ändern?

Code: Alles auswählen

#-----[ OPEN ]------------------------------------------ 
# 

OPEN includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
# 

if (defined('SHOW_ONLINE'))
{

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 

  include_once($phpbb_root_path.'includes/functions_arcade.'.$phpEx);

# 
#-----[ FIND ]------------------------------------------ 
# 

	$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
	FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
    WHERE u.user_id = s.session_user_id
	AND s.session_time >= ".( time() - 300 ) . "
	$user_forum_sql
	ORDER BY u.username ASC, s.session_ip ASC";

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

	$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip, g.game_name, g.game_path, g.image_path, g.game_desc
	FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
	LEFT JOIN ".iNA_SESSIONS." z ON u.user_id = z.user_id
	LEFT JOIN ".iNA_GAMES." g ON z.game_name = g.game_name
    WHERE u.user_id = s.session_user_id
	AND s.session_time >= ".( time() - 300 ) . "
	$user_forum_sql
	ORDER BY u.username ASC, s.session_ip ASC";

# 
#-----[ FIND ]------------------------------------------ 
# 

		if ( $row['session_logged_in'] )
		{

# 
#-----[ AFTER ADD ]------------------------------------------ 
# 

		  $image_path = ina_find_image($row['game_path'],$row['game_name'],$row['image_path'],'./../');

# 
#-----[ FIND ]------------------------------------------ 
# 

				if ( $row['user_allow_viewonline'] )
				{
					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
					$logged_visible_online++;
				}

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

				if ( $row['user_allow_viewonline'] )
				{
				  if($row['game_name'])
				  {
            $user_online_link = '<img src="'.$image_path.'" alt="'.$row['game_desc'].'" border="0" width="15" height="15" /> <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
  				}
  				else
  				{
  					$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
          }
					
					$logged_visible_online++;
				}

# 
#-----[ SAVE AND CLOSE ]------------------------------------------ 
Warum funzt das nicht?

lg
Powersilie

Verfasst: 07.07.2007 12:32
von Andi1111
das würde mich auch interessieren, bei mir gehts auch nicht, sobald die zeile
include_once($phpbb_root_path.'includes/functions_arcade.'.$phpEx); in der portal.php oder der page_header.php ist habe ich auch nur noch eine weisse seite. seltsamerweise geht es bei sile und sausebaby, obwohl wir alle die gleiche version von der php dimension haben.

Verfasst: 07.07.2007 12:43
von powersilie
Hallo Andi!

Hm, ja, diese Stelle in der portal.php ist es, stimmts?

Code: Alles auswählen

// OUTPUT PAGE HEADER START
define('SHOW_ONLINE', true);
$page_title = $lang['IntroPortalMOD2'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
lg
Powersilie

Verfasst: 07.07.2007 12:46
von Andi1111
völlig egal wo, sobald ich die functions_arcade include bleibt die portal seite weiss, in der index.php geht es aber, muss also an meinem portal liegen.

Verfasst: 08.07.2007 10:50
von powersilie
Hi Andi!

Hab Chucky PN geschrieben ..... aber keine Antwort bekommen.
Wenn ich nur wüßte, was es mit diesem CH Mod auf sich hat.

Aber Sile und Chucky haben ja auch phpBB und dort klappts, ich versteh das nicht. Im Arcade Support (hab mich da jetzt reingelesen) haben auch einige das Problem und Def konnte es nicht lösen....

lg
Powersilie

Verfasst: 08.07.2007 10:53
von Andi1111
ich habs aufgegeben, wahrscheinlich stört irgendein anderer mod, z.b. die neueste spiele anzeige muss auch raus wenn man den einbaut.

Re: Who's playing what - Mod funzt nicht

Verfasst: 08.07.2007 11:37
von easygo
rofl.. neuer Thread, neues Glück? @ powersilie

Ok mal abgesehn von anderen Fehlerquellen.. (die man ja nie ausschließen sollte)
so ganz sauber funktioniert das Add-on sicher nicht oder nicht mehr.
powersilie hat geschrieben: FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
LEFT JOIN ".iNA_SESSIONS." z ON u.user_id = z.user_id
Folgt deine MySQL-Version dem SQL:2003 Standard, wird der JOIN so nicht funktionieren,
denn das unscheinbare Komma hat eine höhere Priorität als das Schlüsselwort JOIN.

Hier mal nur eine von X möglichen Lösungen als Beispiel -->

Code: Alles auswählen

	FROM ( ".USERS_TABLE." u, ".SESSIONS_TABLE." s )
	LEFT JOIN ".iNA_SESSIONS." z ON u.user_id = z.user_id

Verfasst: 25.07.2007 13:19
von powersilie
Hi Easygo!

*LOL* von neuem GLÜCK kann man da leider nicht reden.

Ich hab da noch was gefunden. Würde ja auch reichen, daß nur bei "Who is online" beim jeweiligen Namen das Minibild des Spieles dabei ist.


Defender hat folgendes geschrieben:

I think i've seen what they want.

[ ] dEfEndEr, [ ] wizzzzzzz,

Inside the [] is a picture of the game they are playing in a 10x10 or 5x5 window.

So the thing to do would be to find the 'Who is Online' code and get it to look at the ina_sessions table AND the ina_games table and then use the 'NEW' function in 2.1.6 Wink to get the image, then simply display a small version of it

Code:

Code: Alles auswählen

ina_find_image($game_path, $game_name, $image_path = "", $phpbb_root_path = './')

This returns the image AND path for use in a

img src="$image_path" border="0" width="5" height="5"


Nur, WO man das genau einfügen soll, hat er leider nicht geschrieben. Ich nehme an, es soll dann so aussehen wie auf dieser Seite:

http://www.free-game.co.uk/index.php


lg
Powersilie

Verfasst: 29.08.2007 14:10
von powersilie
Hallo!

Erfolgsmeldung - ich habs geschafft, daß der Mod endlich funzt :wink:

Und zwar bin ich durch Ausprobieren draufgekommen, daß man die Einbauanleitung vergessen kann und in der includes/functions_arcade.php die Stelle NICHT vor dem ?> einfügen darf, sondern nur diese Stelle in der functions_arcade.php:

Code: Alles auswählen

function ina_find_image($game_path, $game_name, $image_path = "", $phpbb_root_path = './')
{
  global $arcade;
  
	if ( empty($image_path) )
	{
 		if( @file_exists($phpbb_root_path . $arcade->arcade_config['games_path'] . $game_name .".gif") )
  	{
    	return ($phpbb_root_path . $arcade->arcade_config['games_path'] . $game_name . '.gif');
 		}
  	else if( @file_exists($phpbb_root_path . $game_path . $game_name .".gif") )
		{
      @copy($phpbb_root_path . $game_path . $game_name .".gif", $phpbb_root_path . $arcade->arcade_config['games_path'] . $game_name .".gif");
			return ($phpbb_root_path . $game_path . $game_name . '.gif');
		}
	}
	else if (( strlen( $image_path ) < 5 ) && @file_exists($phpbb_root_path . $game_path . $game_name . $image_path))
	{
		return ($phpbb_root_path . $game_path . $game_name . $image_path);
	}
	else if ( @file_exists($phpbb_root_path . $image_path))
	{
    return ($phpbb_root_path . $image_path);
  }
	else if ( @file_exists($image_path))
	{
    return ($image_path);
  }
	else if ( @file_exists($phpbb_root_path . $game_path . '/' . $game_name . $image_path))
	{
    return ($phpbb_root_path . $game_path . '/' . $game_name . $image_path);
  }
//
//  OK, so we've checked what we can, give up and look for the default
//
  if ( @file_exists($arcade->arcade_config['games_default_img']))
	{
		return ($arcade->arcade_config['games_default_img']);
	}
  return FALSE;
}
rausnehmen muß und durch folgende ersetzen muß:

Code: Alles auswählen


function ina_find_image($game_path, $game_name, $image_path = "", $phpbb_root_path = './')
{
  global $arcade;
 
   if ( $image_path == "")
   {
       if( @file_exists($phpbb_root_path . $arcade->arcade_config['games_path'] . $game_name .".gif") )
     {
       $image_path = $phpbb_root_path . $arcade->arcade_config['games_path'] . $game_name . '.gif';
       }
     else if( @file_exists($phpbb_root_path . $game_path . $game_name .".gif") )
      {
         $image_path = $phpbb_root_path . $game_path . $game_name . '.gif';
      @copy($image_path, $arcade->arcade_config['games_path'] . $game_name .".gif");
      }
      else
      {
         $image_path = $phpbb_root_path . $arcade->arcade_config['games_default_img'];
      }
   }
   else if ( strlen( $image_path ) <5>arcade_config['games_path'] . $game_name .".gif") )
     {
       return ($phpbb_root_path . $arcade->arcade_config['games_path'] . $game_name . '.gif');
       }
     else if( @file_exists($phpbb_root_path . $game_path . $game_name .".gif") )
      {
      @copy($phpbb_root_path . $game_path . $game_name .".gif", $arcade->arcade_config['games_path'] . $game_name .".gif");
         return ($phpbb_root_path . $game_path . $game_name . '.gif');
      }
   }
   else if (( strlen( $image_path ) < 5 ) && @file_exists($phpbb_root_path . $game_path . $game_name . $image_path))
   {
      return ($phpbb_root_path . $game_path . $game_name . $image_path);
   }
   else if ( @file_exists($phpbb_root_path . $image_path))
   {
    return ($phpbb_root_path . $image_path);
  }
   else if ( @file_exists($image_path))
   {
    return ($image_path);
  }
   else if ( @file_exists($phpbb_root_path . $game_path . '/' . $game_name . $image_path))
   {
    return ($phpbb_root_path . $game_path . '/' . $game_name . $image_path);
  }
//
//  OK, so we've checked what we can, give up and look for the default
//
  if ( @file_exists($arcade->arcade_config['games_default_img']))
   {
      return ($arcade->arcade_config['games_default_img']);
   }
  return FALSE;
} 
Den Einbau in der includes/ page_header.php nach Anleitung machen.

Die Bilder zu den Spielen erscheinen dann vor dem Namen des Users - auch im Portal.

Im IE erscheint der "Alt"-Text (welches Spiel das ist), wenn man mit der Maus über das Bild fährt, im Firefox leider nicht. Laut Defender ist da ein Bug im Firefox. Wenn man das auch noch beheben könnte, wäre die Sache perfekt.

lg
Powersilie

Verfasst: 07.09.2007 17:15
von powersilie
Soo, nun ist es perfekt, weil ich hab auch dafür eine Lösung gefunden. Es gibt für Firefox ein Addon, das man sich hier:

http://piro.sakura.ne.jp/xul/_popupalt.html.en


runterladen kann (dauert 1 Minute). Und es funzt, Firefox zeigt mit diesem Addon auch "alt" - Texte bei Bildern usw. an.
Somit kann man auch sehen, wer was gerade spielt :wink:

lg
Powersilie