Seite 1 von 1

RPG Mod Anpassung

Verfasst: 11.03.2007 16:35
von JulianS
Ja und zwar wollte ich meinen RPG Mod, spezifisch das Charakterprofil anpassen.
Leider hab ich zu wenig Ahnung, um selbst was zu versuchen , deswegen hoffe ich auf schnelle und qualifizierte Hilfe

Also
[ externes Bild ]

-So statt Beruf schreib ich noch Wappen

- ich wollte Bilder einbauen , für das Digimon und das Wappen , allerdings sollte das Bild des Digimon sich am Namen orientieren,also automatisch nach Namen eines einfügen
Beispiel: User gibts Muster als Name ein und Bild sollte images/muster.gif sein

- Das Wappenbild, für das bräuchte ich noch einen neuen Profilpunkt nämlich auch Bild
- das sollte genauso wie oben ablaufen

Meine Frage: Ist das iwie möglich und was müsste ich dann ändern

Hab mal die 2 Dateien für das Profil hier rein kopiert

Code: Alles auswählen

<?php
/***************************************************************************
 *                             rpg_watch_char.php
 *                            -------------------
 *   copyright            : (C) 2005 Christian Knerr (CBACK)
 *   email                : webmaster@cback.de
 *   website              : http://www.cback.de
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_RPG);
init_userprefs($userdata);
//
// End session management
//

$gen_simple_header = TRUE;
$page_title = $lang['rpg_char_info'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$userid = '';
$userid = $_GET['u'];
$userid = addslashes(trim(htmlspecialchars($userid)));

$sql = "SELECT user_rpg FROM " . USERS_TABLE . " WHERE user_id ='" . $userid . "';";
if( !($result = $db->sql_query($sql)) )
{
  message_die(GENERAL_ERROR, 'Could not obtain user rpg Information', '', __LINE__, __FILE__, $sql);
}

$rpgrow = $db->sql_fetchrow($result);
$charinfo = '';
$charinfo = $rpgrow['user_rpg'];

for ($i=0; $i<=7; $i++)
{
  $value[$i] = '';
}

$value = explode('|', $charinfo);

$template->set_filenames(array(
	'body' => 'rpg_watch_char.tpl')
);

$template->assign_vars(array(
    'L_CINFO'   => $lang['rpg_char_info'],
    'L_CNAME'   => $lang['rpg_cname'],
    'L_CJOB'    => $lang['rpg_cjob'],
    'L_CALTER'  => $lang['rpg_calter'],
    'L_CRASSE'  => $lang['rpg_crasse'],
    'L_CWEAPON' => $lang['rpg_cweapon'],
    'L_KK'      => $lang['rpg_kk'],
    'L_DHV'     => $lang['rpg_dhv'],
    'L_STR'     => $lang['rpg_str'],
    'L_CLOSE'   => $lang['rpg_close'],

    'VALUE_1'   => $value[0],
    'VALUE_2'   => $value[1],
    'VALUE_3'   => $value[2],
    'VALUE_4'   => $value[3],
    'VALUE_5'   => $value[4],
    'VALUE_6'   => $value[5],
    'VALUE_7'   => $value[6],
    'VALUE_8'   => $value[7])
);

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>


Code: Alles auswählen

<?php
/***************************************************************************
 *                             char_settings.php
 *                            -------------------
 *   copyright            : (C) 2005 Christian Knerr (CBACK)
 *   email                : webmaster@cback.de
 *   website              : http://www.cback.de
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);


//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_RPG);
init_userprefs($userdata);
if (!$userdata['session_logged_in'])
{
  redirect(append_sid("login.$phpEx?redirect=char_settings.$phpEx", true));
}
//
// End session management
//


$gen_simple_header = FALSE;
$page_title = $lang['rpg_char_info'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$userid = '';
$userid = $userdata['user_id'];

//
// Did the User submitted? If yes, then we generate the new Array with the Post values, remove the char (|) and save
// this into the Database.
//
$mode = '';
$mode = $_GET['mode'];

if($mode == 'submit')
{
  for ($i=0; $i<=7; $i++)
  {
    $value[$i] = '';
  }

  $value[0] = addslashes(htmlspecialchars($HTTP_POST_VARS['val1']));
  $value[1] = addslashes(htmlspecialchars($HTTP_POST_VARS['val2']));
  $value[2] = addslashes(htmlspecialchars($HTTP_POST_VARS['val3']));
  $value[3] = addslashes(htmlspecialchars($HTTP_POST_VARS['val4']));
  $value[4] = addslashes(htmlspecialchars($HTTP_POST_VARS['val5']));
  $value[5] = addslashes(htmlspecialchars($HTTP_POST_VARS['val6']));
  $value[6] = addslashes(htmlspecialchars($HTTP_POST_VARS['val7']));
  $value[7] = addslashes(htmlspecialchars($HTTP_POST_VARS['val8']));

  $writedb = '';

  for ($i=0; $i<=7; $i++)
  {
    $value[$i] = str_replace('|', '', $value[$i]);
    if($i != 7)
    {
      $writedb .= $value[$i] . '|';
    }
    else
    {
      $writedb .= $value[$i];
    }
  }

  $sql = "UPDATE " . USERS_TABLE . " SET user_rpg = '" . $writedb . "' WHERE user_id ='" . $userid . "';";
  if( !($result = $db->sql_query($sql)) )
  {
    message_die(GENERAL_ERROR, 'Could not save user rpg Information', '', __LINE__, __FILE__, $sql);
  }
}

//
// END Submission
//


$sql = "SELECT user_rpg FROM " . USERS_TABLE . " WHERE user_id ='" . $userid . "';";
if( !($result = $db->sql_query($sql)) )
{
  message_die(GENERAL_ERROR, 'Could not obtain user rpg Information', '', __LINE__, __FILE__, $sql);
}

$rpgrow = $db->sql_fetchrow($result);
$charinfo = '';
$charinfo = $rpgrow['user_rpg'];

for ($i=0; $i<=7; $i++)
{
  $value[$i] = '';
}

$value = explode('|', $charinfo);

//
// SELECT BOX GENERATION
//
$percent = '<select name="val6">';
$selected = '';
for($i=0; $i<=100; $i++)
{
  if($value[5] == $i)
  {
    $selected = ' selected="true"';
  }
  else
  {
    $selected = '';
  }
  $percent .= '<option value="' . $i . '"' . $selected . '>' . $i . ' %</option>';
}
  $percent .= '</select>';

$percent1 = '<select name="val7">';
$selected = '';
for($i=0; $i<=100; $i++)
{
  if($value[6] == $i)
  {
    $selected = ' selected="true"';
  }
  else
  {
    $selected = '';
  }
  $percent1 .= '<option value="' . $i . '"' . $selected . '>' . $i . ' %</option>';
}
  $percent1 .= '</select>';

$percent2 = '<select name="val8">';
$selected = '';
for($i=0; $i<=100; $i++)
{
  if($value[7] == $i)
  {
    $selected = ' selected="true"';
  }
  else
  {
    $selected = '';
  }
  $percent2 .= '<option value="' . $i . '"' . $selected . '>' . $i . ' %</option>';
}
  $percent2 .= '</select>';
// END SELECT BOX GENERATION

$template->set_filenames(array(
	'body' => 'char_settings.tpl')
);

$template->assign_vars(array(
    'L_CINFO'   => $lang['rpg_cprofile'],
    'L_CDESC'   => $lang['rpg_cpdesc'],
    'L_CNAME'   => $lang['rpg_cname'],
    'L_CJOB'    => $lang['rpg_cjob'],
    'L_CALTER'  => $lang['rpg_calter'],
    'L_CRASSE'  => $lang['rpg_crasse'],
    'L_CWEAPON' => $lang['rpg_cweapon'],
    'L_KK'      => $lang['rpg_kk'],
    'L_DHV'     => $lang['rpg_dhv'],
    'L_STR'     => $lang['rpg_str'],
    'L_SAVE'    => $lang['rpg_savec'],

    'FORM_ACT'  => append_sid('char_settings.' . $phpEx . '?mode=submit'),
    'SELECT_1'  => $percent,
    'SELECT_2'  => $percent1,
    'SELECT_3'  => $percent2,

    'VALUE_1'   => $value[0],
    'VALUE_2'   => $value[1],
    'VALUE_3'   => $value[2],
    'VALUE_4'   => $value[3],
    'VALUE_5'   => $value[4],
    'VALUE_6'   => $value[5],
    'VALUE_7'   => $value[6],
    'VALUE_8'   => $value[7])
);

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>







Code: Alles auswählen

<table width="100%" border="0" cellspacing="0" cellpadding="10" class="forumline">
	<tr>
		<td class="row1"><center><span class="gen"><b>{L_CINFO}</b></span></center><br>
		<table width="100%" border="0" cellspacing="1" cellpadding="6">
			<tr>
				<td class="row1"><table border="0" width="100%" class="forumline" cellspacing="1" cellpadding="4">
					<tr>
					  <td class="row2" align="right" valign="top" width="10%"><span class="gensmall"><b>{L_CNAME}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_1}</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_CALTER}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_3}</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_CRASSE}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_4}</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_CJOB}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_2}</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_CWEAPON}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_5}</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_KK}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_6}%</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_DHV}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_7}%</span></td>
					</tr>
					<tr>
					  <td class="row2" align="right" valign="top"><span class="gensmall"><b>{L_STR}:</font></b></span></td>
					  <td class="row1"><span class="gensmall">{VALUE_8}%</span></td>
					</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="row1" align="center"><br /><span class="nav"><a href="javascript:window.close();" class="genmed">{L_CLOSE}</a></span></td>
			</tr>
		</table></td>
	</tr>
</table>
Für die TPL Datei