• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Request] [Gesior] How many ppl do the quest.

raelpsf

Member
Joined
Jul 3, 2010
Messages
166
Reaction score
5
Need one page for my gesior 0.3.6, for show, how many ppl do the each quest..

If it is possible, need too, if you click in quest (link), show the name of players are be completed the quest.

Tks a lot, sorry for the english.

:)
 
ok, test this
probably has lots of bugs and can be improved, first time i try something in php/html
PHP:
<?PHP

	$id = intval($_REQUEST['id']);
	$i = 0;
	$quests = $config['site']['quests'];

	$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white COLSPAN=';
	if(!is_int($id) || !in_array($id, $quests)) {
		$main_content .= '2><B>Quests</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=80%><B>Name</B></TD><TD><B>Players done</B></TD></TR>';
		foreach ($quests as $name => $storage) {
			$i++;
			$main_content .= '<TR BGCOLOR="'.(is_int($i / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']).'"><TD WIDTH=80%><a href="?subtopic=quests&id='.$storage.'" >'.$name.'</a></TD>';
			$n = $SQL->query('SELECT COUNT(`key`) as `count` FROM `player_storage` WHERE `key` = '.$storage.' AND `value` > 0;')->fetch();
			$main_content .= '<TD><CENTER>'.$n['count'].'</CENTER></TD></TR>';
		}
	}
	else {
		$main_content .= '3><B>Players who done '.array_search($id, $quests).' Quest</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=70%><B>Name</B></TD><TD WIDTH="10%"><B>Level</B></TD><TD WIDTH="20%"><B>Vocation</B></TD></TR>';
		$list = $SQL->query('SELECT `name`, `level`, `vocation`, `promotion` FROM `players` WHERE (SELECT `value` FROM `player_storage` WHERE `player_id` = `players`.`id` AND `key` = '.$id.' LIMIT 1) > 0;')->fetchAll();
		foreach($list as $player) {
			$i++;
			$main_content.= '<TR BGCOLOR='.(is_int($i / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']).'><TD WIDTH=70%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].'</A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.$vocation_name[0][$player['promotion']][$player['vocation']].'</TD></TR>';
		}
	}
	$main_content .= '</TABLE>';
?>
(Don't forget to add required lines to index.php & layout.php)
 
Last edited:
I have problem:

Code:
Warning: in_array() expects parameter 2 to be array, null given in quest maker.php on line 8

Warning: Invalid argument supplied for foreach() in quest maker.php on line 10
 
Back
Top