Daran soll's nicht liegen. Ich habe es mittlerweile geschafft den Parameter
in den Link einzufügen. Das ganze sieht nun so aus:
Code: Alles auswählen
if ( $stock_exchange )
{
$template->set_filenames(array(
'body' => 'vault_exchange_body.tpl')
);
$start = ( isset($HTTP_GET_VARS['start']) ) ? doubleval($HTTP_GET_VARS['start']) : 0;
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? htmlspecialchars($HTTP_POST_VARS['mode']) : htmlspecialchars($HTTP_GET_VARS['mode']);
}
else
{
$mode = 'stock_exchange';
}
$sql = "SELECT *
FROM " . VAULT_EXCHANGE_TABLE ." ORDER BY stock_id
LIMIT " . $start . "," . $board_config['topics_per_page'] . "";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't obtain stock exchange from database", "", __LINE__, __FILE__, $sql);
}
$exchange = $db->sql_fetchrowset($result);
for($i = 0; $i < count($exchange); $i++)
{
$a = $exchange[$i]['stock_id'];
$stock_language[$a] = isset($lang1[$exchange[$i]['stock_language']]) ? $lang1[$exchange[$i]['stock_language']] : $exchange[$i]['stock_language'];
$stock_name_max[$a] = isset($lang1[$exchange[$i]['stock_name_max']]) ? $lang1[$exchange[$i]['stock_name_max']] : $exchange[$i]['stock_name_max'];
$stock_name_max_free[$a] = isset($lang1[$exchange[$i]['stock_name_max_free']]) ? $lang1[$exchange[$i]['stock_name_max_free']] : $exchange[$i]['stock_name_max_free'];
$actions_owned[$a] = $owned['stock_amount'];
// --- Berechnung der kplt. Anzahl verkaufter Aktien --- Start ---
$sql = "SELECT sum(stock_amount) AS stock_amount_sum FROM " . VAULT_EXCHANGE_USERS_TABLE ."
WHERE stock_id = " . $a . "
GROUP by stock_id";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, 'Could not obtain avarade stock_amount_sum information', "", __LINE__, __FILE__, $sql);
}
$query = mysql_query($sql);
$array = mysql_fetch_array($query);
$stock_amount_sum = $array[0];
$stock_name_max_sum[$a] = $stock_amount_sum;
// --- Berechnung der kplt. Anzahl verkaufter Aktien --- Ende ---
$buy_item[$a] = "";
$buy_item[$a] = '<input class="post" type="text" maxlength="12" size="12" name="buy_item'.$a.'" style="text-align: right;" />';
$sell_item[$a] = "";
$sell_item[$a] = '<input class="post" type="text" maxlength="12" size="12" name="sell_item'.$a.'" style="text-align: right;" />';
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$sql = "SELECT * FROM " . VAULT_EXCHANGE_USERS_TABLE ."
WHERE stock_id = ".$exchange[$i]['stock_id']."
AND user_id = ".$user_id;
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't obtain stock exchange from database", "", __LINE__, __FILE__, $sql);
}
$owned = $db->sql_fetchrow($result);
$actions_owned = $owned['stock_amount'];
$bought_owned = $owned['price_transaction'];
$stock_owned_act = $actions_owned * $exchange[$i]['stock_price'];
if ( $stock_price_avg > $stock_avg/100 * 90 )
{
$stock_amount_dax = $lang['Vault_exchange_dax_0'] . number_format($stock_price_avg,2, ",", ".");
}
else if ( $stock_price_avg <= $stock_avg/100 * 90 && $stock_price_avg >= $stock_avg/100 * 50)
{
$stock_amount_dax = $lang['Vault_exchange_dax_1'] . number_format($stock_price_avg,2, ",", ".");
}
else if ( $stock_price_avg < $stock_avg/100 * 50 )
{
$stock_amount_dax = $lang['Vault_exchange_dax_2'] . number_format($stock_price_avg,2, ",", ".");
}
if ( !$actions_owned )
{
$actions_owned = $lang['Vault_exchange_none'];
}
if ( $exchange[$i]['stock_price'] > $exchange[$i]['stock_previous_price'] )
{
$stock_amount_stat = $lang['Vault_exchange_actions_amount_0'];
}
else if ( $exchange[$i]['stock_price'] == $exchange[$i]['stock_previous_price'] )
{
$stock_amount_stat = $lang['Vault_exchange_actions_amount_1'];
}
else if ( $exchange[$i]['stock_price'] < $exchange[$i]['stock_previous_price'] )
{
$stock_amount_stat = $lang['Vault_exchange_actions_amount_2'];
}
$template->assign_block_vars("exchange", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"STOCK_ID" => vault_get_lang($exchange[$i]['stock_id']),
'STOCK_LANGUAGE' => ( vault_get_lang($exchange[$i]['stock_language']) == '' ) ? '<img src="./images/flags/no_flag_img.png" width="18" height="12" alt="" border="0" />' : '<img src="images/flags/' . vault_get_lang($exchange[$i]['stock_language']) . '.png" width="18" height="12" alt="" border="0" />',
"STOCK_NAME" => vault_get_lang($exchange[$i]['stock_name']),
"STOCK_NAME_MAX" => number_format(vault_get_lang($exchange[$i]['stock_name_max']),0, ",", "."),
"STOCK_NAME_MAX_FREE" => number_format(vault_get_lang($exchange[$i]['stock_name_max_free']),0, ",", "."),
"STOCK_NAME_MAX_SUM" => number_format($stock_name_max_sum[$a],0, ",", "."),
"STOCK_DESC" => vault_get_lang($exchange[$i]['stock_desc']),
"STOCK_AMOUNT" => number_format($exchange[$i]['stock_price'],2, ",", "."),
"STOCK_BOUGHT" => number_format($bought_owned,2, ",", "."),
"STOCK_AMOUNT_STAT" => $stock_amount_stat,
"STOCK_PREVIOUS" => number_format($exchange[$i]['stock_previous_price'],2, ",", "."),
"STOCK_WORST" => number_format($exchange[$i]['stock_worst_price'],2, ",", "."),
"STOCK_BEST" => number_format($exchange[$i]['stock_best_price'],2, ",", "."),
"STOCK_BUY" => $buy_item[$a],
"STOCK_SELL" => $sell_item[$a],
"STOCK_OWNED_ACT" => number_format($stock_owned_act,2, ",", "."),
"STOCK_OWNED" => number_format($actions_owned,0, ",", "."))
);
}
// Begin Pagination
$sql = 'SELECT count(stock_id) AS total FROM ' . VAULT_EXCHANGE_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error getting total', '', __LINE__, __FILE__, $sql);
}
if ( $total = $db->sql_fetchrow($result) )
{
$total_page_items = $total['total'];
$pagination = generate_pagination(append_sid("vault.$phpEx?from=stock_exchange&mode=$mode"), $total_page_items, $board_config['topics_per_page'], $start);
}
$template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], $current_page, $total_pages)
));
// End Pagination
$template->assign_vars(array(
'L_STOCK_EXCHANGE_ACTIONS' => $lang['Vault_exchange_actions'],
'L_STOCK_EXCHANGE_DAX' => $lang['Vault_exchange_dax'],
'L_STOCK_ID' => $lang['Vault_exchange_id'],
'L_STOCK_LANGUAGE' => $lang['Vault_exchange_language'],
'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'],
'L_STOCK_NAME_MAX' => $lang['Vault_exchange_actions_name_max'],
'L_STOCK_NAME_MAX_FREE' => $lang['Vault_exchange_actions_name_max_free'],
'L_STOCK_NAME_BUYS' => $lang['Vault_exchange_actions_name_buys'],
'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'],
'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'],
'L_STOCK_BOUGHT' => $lang['Vault_exchange_actions_bought'],
'L_STOCK_PREVIOUS' => $lang['Vault_exchange_previous_price'],
'L_STOCK_WORST' => $lang['Vault_exchange_worst_price'],
'L_STOCK_BEST' => $lang['Vault_exchange_best_price'],
'L_STOCK_OWNED' => $lang['Vault_exchange_owned'],
'L_STOCK_BUY' => $lang['Vault_exchange_buy'],
'L_STOCK_SELL' => $lang['Vault_exchange_sell'],
'L_SUBMIT' => $lang['Submit'],
'STOCK_AVG' => $stock_amount_dax)
);
}
Jetzt bin ich aber mit meinem Latein völlig am Ende. Warum wird dieser Block trotzdem nicht korrekt ausgeführt?