This allowed me to take and parse a .csv file and create a roster page (complete with flag images) similar to these
h**p://***.soccermanager.com/screenshots.php
you can click on the roster or table screenshots to get a better idea
I was wondering if there was a way to do the same here. Basically I save the rosters in Excel (or Open Office) then export them as a .csv file - The script parses the csv file and outputs the tables with the associated graphics
Here is a sample of the code - It would need to be modified but I am posting it in hopes someone may be able to look at it and tell me if doing this is possible in Icy Phoenix
I appreciate the help and time
Code: [Download] [Hide] [Select]
echo '<img src="h**p://all-time-baseball.com/FW/image/728.png" />';
global $settings;
$countries = array (
'Brazilian' => 'br',
'Spanish' => 'es',
'German' => 'de',
'Polish' => 'pl',
'Czech' => 'cz',
'Swiss' => 'ch',
'Ivory Coast' => 'ci',
'French' => 'fr',
'Italian' => 'it',
'Portuguese' => 'pt',
'Bosnian' => 'ba',
'Malian' => 'my',
'Netherlands' => 'nl',
'Belarusian' => 'by',
'English' => 'uk',
'Danish' => 'dk',
'Croatian' => 'cr',
'Togolese' => 'tg',
'Argentinean' => 'ar',
'Romanian' => 'ru',
'Georgian' => 'ge',
'Cameroonian' => 'cm',
'Mexican' => 'mx',
);
$flag_dir = $settings ='Themes/halflife_11final_tp/images/flags/';
$bg[0] = 'windowbg';
$bg[1] = 'windowbg2';
// define path & filename to read
$filename = '../FW/roster/Tottenham.csv';
// read file in as array of line strings
$lines = file($filename);
// explode first line for table header (this also decides number of columns)
$data = explode(",", $lines[0]);
$columns = sizeof($data)-1;
// start table structure
echo'<table cellspacing="1" cellpadding="4" width="100%">';
echo '<tr>';
// put exploded first line in as <th> element
for ($j = 0; $j <= $columns; $j++) {
$data[$j] = str_replace('"','',$data[$j]);
echo '<th>' . $data[$j] . '</th>';
}
// end first table row
echo '</tr>';
$win = 0;
// run through remaining lines
for ($i = 1; $i <= sizeof($lines)-1; $i++) {
// explode line
$data = explode(",", $lines[$i]);
// start new row
echo '<tr class="' . $bg[$win] . '">';
// put exploded data in as <td> element
for ($j = 0; $j <= $columns; $j++) {
$data[$j] = str_replace('"','',$data[$j]);
if ($j == 2)
echo '<td><img src="' . $flag_dir . $countries[$data[$j]] . '.png" alt="' . $data[$j] . '" /></td>';
else
echo '<td>' . $data[$j] . '</td>';
}
// end row
echo '</tr>';
$win == 1 ? $win = 0 : $win = 1;
}
// close table tag
echo '</table>';
global $settings;
$countries = array (
'Brazilian' => 'br',
'Spanish' => 'es',
'German' => 'de',
'Polish' => 'pl',
'Czech' => 'cz',
'Swiss' => 'ch',
'Ivory Coast' => 'ci',
'French' => 'fr',
'Italian' => 'it',
'Portuguese' => 'pt',
'Bosnian' => 'ba',
'Malian' => 'my',
'Netherlands' => 'nl',
'Belarusian' => 'by',
'English' => 'uk',
'Danish' => 'dk',
'Croatian' => 'cr',
'Togolese' => 'tg',
'Argentinean' => 'ar',
'Romanian' => 'ru',
'Georgian' => 'ge',
'Cameroonian' => 'cm',
'Mexican' => 'mx',
);
$flag_dir = $settings ='Themes/halflife_11final_tp/images/flags/';
$bg[0] = 'windowbg';
$bg[1] = 'windowbg2';
// define path & filename to read
$filename = '../FW/roster/Tottenham.csv';
// read file in as array of line strings
$lines = file($filename);
// explode first line for table header (this also decides number of columns)
$data = explode(",", $lines[0]);
$columns = sizeof($data)-1;
// start table structure
echo'<table cellspacing="1" cellpadding="4" width="100%">';
echo '<tr>';
// put exploded first line in as <th> element
for ($j = 0; $j <= $columns; $j++) {
$data[$j] = str_replace('"','',$data[$j]);
echo '<th>' . $data[$j] . '</th>';
}
// end first table row
echo '</tr>';
$win = 0;
// run through remaining lines
for ($i = 1; $i <= sizeof($lines)-1; $i++) {
// explode line
$data = explode(",", $lines[$i]);
// start new row
echo '<tr class="' . $bg[$win] . '">';
// put exploded data in as <td> element
for ($j = 0; $j <= $columns; $j++) {
$data[$j] = str_replace('"','',$data[$j]);
if ($j == 2)
echo '<td><img src="' . $flag_dir . $countries[$data[$j]] . '.png" alt="' . $data[$j] . '" /></td>';
else
echo '<td>' . $data[$j] . '</td>';
}
// end row
echo '</tr>';
$win == 1 ? $win = 0 : $win = 1;
}
// close table tag
echo '</table>';