Ir para conteúdo
Darciio

Quando aclico em Admin Page nao abre nada

Posts Recomendados

Galera quando clico em Admin Page pra dar ponstos etc para os players  faz isso

1.jpg

 

isso acontece

Please login or register to see this attachment.

 

se alguen souber como resolve da uma ajuda ai

Please login or register to see this attachment.

Please login or register to see this attachment.

Editado por Darciio

Compartilhar este post


Link para o post
Compartilhar em outros sites

Arrumado coloca asim no admin.php

 

<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; protect_page();admin_only($user_data);// Encryption (if select field has $key 0, it will return false, so add $enc + $key will return 100, subtract and you get 0, not false). $enc = 100;// Don't bother to think about cross site scripting here, since they can't access the page unless they are admin anyway.// startif (empty($_POST) === false) {	// BAN system!	if (!empty($_POST['ban_char']) && !empty($_POST['ban_type']) && !empty($_POST['ban_action']) && !empty($_POST['ban_reason']) && !empty($_POST['ban_time']) && !empty($_POST['ban_comment'])) {		if (user_character_exist($_POST['ban_char'])) {						// Decrypt and store values			$charname = $_POST['ban_char'];			$typeid = (int)$_POST['ban_type'] - $enc;			$actionid = (int)$_POST['ban_action'] - $enc;			$reasonid = (int)$_POST['ban_type'] - $enc;			$time = (int)$_POST['ban_time'] - $enc;			$comment = $_POST['ban_comment'];			//var_dump($charname, $typeid, $actionid, $reasonid, $time, $comment);						if (set_rule_violation($charname, $typeid, $actionid, $reasonid, $time, $comment)) {				$errors[] = 'Violation entry has been set for '. $charname .'.';			} else {				$errors[] = 'Website character name: '. $config['website_char'] .' does not exist. Create this character name or configure another name in config.php';				$errors[] = 'Website failed to recognize a character it can represent while inserting a rule violation.';			}					} else {			$errors[] = 'Character '. getValue($_POST['ban_char']) .' does not exist.';		}	}			// delete character:	if (empty($_POST['del_name']) === false) {		if (user_character_exist($_POST['del_name'])) {			user_delete_character(user_character_id($_POST['del_name']));			$errors[] = 'Character '. getValue($_POST['del_name']) .' permanently deleted.';		} else {			$errors[] = 'Character '. getValue($_POST['del_name']) .' does not exist.';		}	}		// Reset password for char name	if (empty($_POST['reset_pass']) === false && empty($_POST['new_pass']) === false) {		// reset_pass = character name		if (user_character_exist($_POST['reset_pass'])) {			$acc_id = user_character_account_id($_POST['reset_pass']);						if ($acc_id != $session_user_id) {				if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') {					user_change_password($acc_id, $_POST['new_pass']);				} else if ($config['TFSVersion'] == 'TFS_03') {					user_change_password03($acc_id, $_POST['new_pass']);				}				$errors[] = 'The password to the account of character name: '. getValue($_POST['reset_pass']) .' has been set to: '. getValue($_POST['new_pass']) .'.';			} else {				header('Location: changepassword.php');				exit();			}		}	}	// Give points to character	if (empty($_POST['points_char']) === false && empty($_POST['points_value']) === false) {		$char = sanitize($_POST['points_char']);		$points = (int)$_POST['points_value'];		data_dump($_POST, false, "post data");		$account = mysql_select_single("SELECT `account_id` FROM `players` WHERE `name`='$char' LIMIT 1;");		data_dump($account, false, "fetching account id from players table");		$znote_account = mysql_select_single("SELECT `id`, `points` FROM `znote_accounts` WHERE `account_id`='". $account['account_id'] ."';");		data_dump($znote_account, false, "Fetching existing points from znote_accounts");		data_dump(			array(				'Old:' => $znote_account['points'], 				'New:' => $points, 				'Total:' => ($znote_account['points'] + $points)				),			false,			"Points calculation:");		$points += $znote_account['points'];		mysql_update("UPDATE `znote_accounts` SET `points`='$points' WHERE `account_id`='". $account['account_id'] ."';");	}		// Set character position	if (empty($_POST['position_name']) === false && empty($_POST['position_type']) === false) {		if (user_character_exist($_POST['position_name'])) {			if (array_key_exists($_POST['position_type'], $config['ingame_positions'])) {				if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') {					set_ingame_position($_POST['position_name'], $_POST['position_type']);				} else if ($config['TFSVersion'] == 'TFS_03') {					set_ingame_position03($_POST['position_name'], $_POST['position_type']);				}				$pos = 'Undefined';				foreach ($config['ingame_positions'] as $key=>$value) {					if ($key == $_POST['position_type']) {						$pos = $value;					}				}				$errors[] = 'Character '. getValue($_POST['position_name']) .' recieved the ingame position: '. $pos .'.';			}		} else {			$errors[] = 'Character '. getValue($_POST['position_name']) .' does not exist.';		}	}		// Teleport Player// If empty post}// Display whatever output we figure out to addif (empty($errors) === false){	echo '<font color="red"><b>';	echo output_errors($errors);	echo '</b></font>';}// end?><h1>Admin Page.</h1><p><?php$basic = user_znote_data('version', 'installed', 'cached');if ($basic['version'] !== $version) {	mysql_update("UPDATE `znote` SET `version`='$version';");	$basic = user_znote_data('version', 'installed', 'cached');}echo "Running Znote AAC Version: ". $basic['version'] .".<br>";echo "Last cached on: ". getClock($basic['cached'], true) .".<br>";?></p><ul>	<li>		<b>Permanently delete/erase character from database:</b> 		<form type="submit" action="" method="post">			<input type="text" name="del_name" placeholder="Character name...">		</form>	</li>	<li>		<b>Ban character and/or account:</b>		<form action="" method="post">			<table style="background-color:lightblue;">				<!-- row 1 -->				<tr>					<td>						<input type="text" name="ban_char" placeholder="Character name...">					</td>				</tr>								<!-- row 2 -->				<tr>					<td>						<select name="ban_type">							<?php							foreach ($config['ban_type'] as $key=>$value) {								echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";							}							?>						</select>						<select name="ban_action">							<?php							foreach ($config['ban_action'] as $key=>$value) {								echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";							}							?>						</select>						<select name="ban_time">							<?php							foreach ($config['ban_time'] as $key=>$value) {								echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";							}							?>						</select>					</td>				</tr>								<!-- row 3 -->				<tr>					<td>						Ban reason: 						<select name="ban_reason">							<?php							foreach ($config['ban_reason'] as $key=>$value) {								echo "<option value=\"". ($enc + $key) ."\">". $value ."</option>";							}							?>						</select>					</td>				</tr>								<!-- row 4 -->				<tr>					<td>						Violation comment: (max 60 cols).						<input type="text" name="ban_comment" maxlength="60" placeholder="Ban for botting rotworms.">						<input type="submit" value="Set Violation">					</td>				</tr>			</table>		</form>	</li>	<li>		<b>Reset password to the account of character name:</b>		<form action="" method="post">			<input type="text" name="reset_pass" placeholder="Character name">			<input type="text" name="new_pass" placeholder="New password">			<input type="submit" value="Change Password">		</form>	</li>	<li>		<b>Set character name to position:</b>		<?php		if ($config['TFSVersion'] == 'TFS_03' && count($config['ingame_positions']) == 5) {			?>			<font color="red">ERROR: You forgot to add (Senior Tutor) rank in config.php!</font>			<?php		}		?>		<form action="" method="post">			<input type="text" name="position_name" placeholder="Character name">			<select name="position_type">				<?php				foreach ($config['ingame_positions'] as $key=>$value) {					echo "<option value=\"". $key ."\">". $value ."</option>";				}				?>			</select>			<input type="submit" value="Set Position">		</form>	</li>	<li>		<b>Give shop points to character:</b>		<form action="" method="post">			<input type="text" name="points_char" placeholder="Character name">			<input type="text" name="points_value" placeholder="Points">			<input type="submit" value="Give Points">		</form>	</li>	<li>		<b>Teleport Player</b>		<form action="" method="post">			<table>				<tr>					<td>Type:</td>					<td>						<select name="from">							<option value="all">All</option>							<option value="only">Only</option>						</select>					</td>				</tr>				<tr>					<td>Player</td>					<td><input type="text" name="player_name" placeholder="Player Name"></td>				</tr>				<tr>					<td>To</td>					<td>						<select name="to">							<option value="home">Hometown</option>							<option value="town">Specific Town</option>							<option value="xyz">Specific Position</option>						</select>					</td>				</tr>				<tr>					<td>Town</td>					<td>					<select name="town">						<?php							foreach($config['towns'] as $townId => $townName) {								echo '<option value="' . $townId . '">' . $townName . '</option>';							}						?>					</select>					</td>				</tr>				<tr>					<td>Position</td>					<td>						<input type="text" name="x" placeholder="Position X">						<input type="text" name="y" placeholder="Position Y">						<input type="text" name="z" placeholder="Position Z">					</td>				</tr>				<tr>					<td></td>					<td><input type="submit" value="teleport"></td></td>				</tr>				</tr>			</table>		</form>	</li></ul><?php include 'layout/overall/footer.php'; ?>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por Walox
      Galera alguém aqui poderia me ajudar ? estou tendo alguns problemas com meu Znote!!
      Meu servidor é de poketibia mas parece que o Znote não tem suporte para isso  
      meus problemas devem ser básicos ou sla mas não consigo resolver eles, já resolvi quase todos mas sobraram esses!
      Quem puder ajudar ficaria muito grato, ou se for um freela que faça as modificações também estou aberto a isso, só preciso concertar isso com urgencia!!.
       
      Meus problemas são quais ? 
       
      Basicamente quando eu crio um personagem no Znote, o personagem não consegue receber pokémons de npcs não sei porque!!
      Meu tsf é o 3.6
      Já configurei tudo mas os pokémons nenhum npc consegue entregar para o personagem criado no ZNOTE.
       
      SEGUNDO PROBLEMA
       
      eu tentei adicionar a jánela do Discord mas aparentemente não está funcionando!!
      Também não sei o porque  

      Please login or register to see this link.
       
      Ultimo problema é que eu queria remover esta barra cinza feia e colocar uma imagem repetida como a marrom a cima da barra cinza!!
       

      Please login or register to see this link.
       
      Quem poder me ajudar ficaria muito grato!!
      E se provavelmente aparecer algum freela pode ser também!
    • Por Sammy
      Este script carrega Spells.xml quando solicitado pelo usuário no painel admin, e cria um arquivo php salvando todas as magias em arrays. 
      Ele tem opções de classificação exatamente como a página do Tibia. Ele funciona com ambas as distribuições 0.2 e 0.3.
       
      Preview:


       
      Vamos ao tutorial:
       
      Configuração:
       
      engine/function/general.php
       
      Em
      ?> Adicione
      function build_spells($xml, $display_groups) { $t_count = 0; $rune = array(); $string = '<?php'."\n".'#Generated spells file from admin panel'."\n".'#Edit at your own risk!'; $string .= "\n".'$show_spells_groups = '.($display_groups ? 'true' : 'false').';'."\n".'$spells = array('; foreach($xml as $key => $value) { if($value['lvl']) { if($key == 'rune') { if($display_groups) { if($value['group'] == NULL) { echo '<span style="color:orange;font-weight:bold">WARNING: Group not found at spell "'.$value['name'].'", set to "Attack".</span><br>'; } $rune[(string)$value['name']] = ($value['group'] == NULL) ? 'Attack' : $value['group']; } continue; } $t_count++; $string .= "\n\t".'array('; if($display_groups) { $string .= "\n\t\t".'"group" => '; { if($value['function'] == 'conjureRune') { $string .= '\''.ucfirst($rune[(string)$value['name']]).'\''; } else { if($value['group'] == NULL) { echo '<span style="color:orange;font-weight:bold">WARNING: Group not found at spell "'.$value['name'].'", set to "Attack".</span><br>'; } $string .= '\''.ucfirst(($value['group'] == NULL) ? 'Attack' : $value['group']).'\''; } } $string .= ','; } $string .= "\n\t\t".'"type" => '; if(config('TFSVersion') == 'TFS_02') { $string .= (($value['function'] == 'conjureRune') ? '\'Rune\'' : '\'Instant\''); } if(config('TFSVersion') == 'TFS_03') { $string .= (($value['value'] == 'conjureRune') ? '\'Rune\'' : '\'Instant\''); } $string .= ','; $string .= "\n\t\t".'"name" => "'.$value['name'].'",'; $string .= "\n\t\t".'"words" => \''.$value['words'].'\','; $string .= "\n\t\t".'"level" => '.$value['lvl'].','; $string .= "\n\t\t".'"mana" => '; $string .= (($value['mana'] == NULL) or ($value['mana'] == '')) ? '\'Var.\'' : $value['mana']; $string .= ','; $string .= "\n\t\t".'"premium" => '; if($value['prem']) { $string .= ($value['prem'] == 1) ? '\'yes\'' : '\'no\''; } else { $string .= '\'no\''; } $string .= ','; $vocs = array(); $string .= "\n\t\t".'"vocation" => array('; foreach($value->vocation as $vocation) { if(config('TFSVersion') == 'TFS_02') { $vocs[] = '\''.$vocation[0]['name'].'\''; } elseif(config('TFSVersion') == 'TFS_03') { if(strpos($vocation[0]['id'], ';') !== FALSE) { $array = explode(';', $vocation[0]['id']); foreach($array as $voc) { $vocs[] = '\''.vocation_id_to_name($voc).'\''; } } else { $vocs[] = '\''.vocation_id_to_name((int)$vocation[0]['id']).'\''; } } } if(count($vocs) < 1) foreach(config('vocations') as $id => $name) if($id > 0) $vocs[] = '\''.$name.'\''; $string .= implode(', ',$vocs).')'."\n\t".'),'; } } $string .= "\n".'); ?>'; echo('Loaded '. $t_count .' spells!<br>'); echo 'File "spell.php" '.(file_exists('spell.php') ? 'updated' : 'created').'!<br>'; $file = fopen('spell.php', 'w'); fwrite($file, $string); fclose($file); } admin.php
      Antes
      </ul> <?php include 'layout/overall/footer.php'; ?> Adicione
      <li> <b>Update spells from file:</b><br> <?php if (!isset($_POST['action'])) { $_POST['action'] = 'undefine'; } if ($_POST['action'] == 'upload') { $xml = $_FILES['file']; $_POST['action'] = 'undefine'; if($xml['tmp_name']) { if($xml['name'] == 'spells.xml') { $groups = (isset($_POST['show_groups']) && $_POST['show_groups'] == 'yes') ? true : false; echo 'Successfully fetched spells.xml!<br>'; echo 'Using temporal file: '. $_FILES['file']['tmp_name'] .'<br>'; build_spells(simplexml_load_file($xml['tmp_name']), $groups); } else { echo '<span style="color:red;font-weight:bold">ERROR: File "spells.xml" not found.</span>'; } } else { echo '<span style="color:red;font-weight:bold">ERROR: Upload failed.</span>'; } } ?> <form enctype='multipart/form-data' method='POST'> <input type='checkbox' name='show_groups' value='yes'> Show spells groups (Only for TFS 0.2.9+)<br> <input type='hidden' name='action' value='upload' /> <input type='file' name='file' /> <input type='submit' value='Submit' /> </form> </li> Crie o arquivo Spell.php e adicione dentro:
       
      <?php require_once 'engine/init.php'; include 'layout/overall/header.php'; echo '<h1>Spells</h1>'; if(file_exists('spell.php')) { require_once 'spell.php'; ?> <table> <tr class="yellow"> <td><b>Name</b></td> <?php if($show_spells_groups) echo '<td><b>Group</b></td>'; ?> <td><b>Type</b></td> <td><b>Exp Lvl</b></td> <td><b>Mana</b></td> <td><b>Premium</b></td> </span> </tr> <?php @$sort = $_REQUEST['sort']; if(!isset($sort)) $sort = 'name'; @$vocation = $_REQUEST['vocation']; if(!isset($vocation)) $vocation = 'vall'; if($show_spells_groups) { @$group = $_REQUEST['_group']; if(!isset($group)) $group = 'gall'; } @$type = $_REQUEST['_type']; if(!isset($type)) $type = 'tall'; @$premium = $_REQUEST['_premium']; if(!isset($premium)) $premium = 'pall'; $order = array(); foreach($spells as $key => $row) { $order[$key] = $row[$sort]; } array_multisort($order, SORT_ASC, $spells); foreach($spells as $spell) { if($vocation != 'vall') { if(!in_array($vocation, $spell['vocation'])) continue; } if($show_spells_groups && $group != 'gall') { if($spell['group'] != $group) continue; } if($type != 'tall') { if($spell['type'] != $type) continue; } if($premium != 'pall') { if($spell['premium'] != $premium) continue; } ?> <tr> <td><?php echo '<b>'.$spell['name'].'</b> ('.$spell['words'].')'; ?></td> <?php if($show_spells_groups) echo '<td>'.$spell['group'].'</td>'; ?> <td><?php echo $spell['type']; ?></td> <td><?php echo $spell['level']; ?></td> <td><?php echo $spell['mana']; ?></td> <td><?php echo $spell['premium']; ?></td> </tr> <?php } echo '</table>'; ?> <form action='spells.php' method='post'> <table> <tr class="yellow"> <td colspan=4><b>Spell Search</b></td></tr> <tr class="yellow"> <?php if($show_spells_groups) { echo'<td width=25%><b>vocation</b></td> <td width=25%><b>group</b></td> <td width=25%><b>type</b></td> <td width=25%><b>premium</b></td>';} else { echo'<td width=40%><b>vocation</b></td> <td width=30%><b>type</b></td> <td width=30%><b>premium</b></td>';}?> </tr> <tr> <td valign='top'> <input type='radio' name='vocation' value='vall' checked> all<br> <?php foreach(config('vocations') as $id => $vocation) { if($id > 0) { echo "<input type='radio' name='vocation' value='".$vocation."'> ".$vocation."<br>"; } } ?> </td> <?php if($show_spells_groups) echo" <td valign='top'> <input type='radio' name='_group' value='gall' checked> all<br> <input type='radio' name='_group' value='Attack'> attack<br> <input type='radio' name='_group' value='Healing'> healing<br> <input type='radio' name='_group' value='Support'> support</td>"; ?> <td valign='top'> <input type='radio' name='_type' value='tall' checked> all<br> <input type='radio' name='_type' value='Instant'> instant<br> <input type='radio' name='_type' value='Rune'> rune </td> <td valign='top'> <input type='radio' name='_premium' value='pall' checked> all<br> <input type='radio' name='_premium' value='no'> no<br> <input type='radio' name='_premium' value='yes'> yes </td> </tr> <tr> <td>sort by: <select name='sort'> <option value='name' selected>name <option value='words'>words <?php if($show_spells_groups) echo "<option value='group' >group"; ?> <option value='type' >type <option value='level' >exp lvl <option value='mana' >mana <option value='premium' >premium </select> </td> <td colspan='3'> <input type='submit' name='submit'> </td> </tr> </table> </form> <?php } else { echo 'This page has not been configured yet.'; }; include 'layout/overall/footer.php'; ?> Depois Adicionar o link da página ao seu layout
      layout padrão: /layout/menu.php
      Adicione na lista de páginas: 
      <li><a href="spells.php">Spells</a></li> Fim do Tutorial ?
       
      Eu não posso garantir que ele vai trabalhar com todas as distros TFS.
      Lembre-se que você pode editar seu arquivo spell.php, principalmente necessário se você usar spells personalizadas.
       
       
      Créditos: 
      cbrm(otland)
×
×
  • Criar Novo...