Basically I have a list of particular members that I am calling with their member ID, and displaying the td's afterwards on each one..
So I have the table like this
<table id="sortable" class="tablesorter" width="100%">
<thead>
<tr>
<th class="header"><strong>Game Username</strong></th>
<th class="header"><strong>Rank</strong></th>
<th class="header"><strong>Game Played</strong></th>
<th class="header"><strong>Playing On</strong></th>
<th class="header"><strong>Age</strong></th>
<th class="header"><strong>Time On</strong></th>
<th class="header"><strong>Location</strong></th>
</tr>
</thead>
<tbody>
<?php include ("users.php"); ?>
</tbody>
And the users.php file looks like this, but right now at over 50 lines of the same code as below, with only the $id= number changed..
<tr><td class="username"><a href="<?php $id='1'; include ("fields.php"); ?>
<tr><td class="username"><a href="<?php $id='2'; include ("fields.php"); ?>
<tr><td class="username"><a href="<?php $id='3'; include ("fields.php"); ?>
<tr><td class="username"><a href="<?php $id='4'; include ("fields.php"); ?>
<tr><td class="username"><a href="<?php $id='5'; include ("fields.php"); ?>
The fields.php file is the remainder of the table rows etc., starting with the below code to close off this td.
<?php echo $domain; $member_id = $id; $user_info = get_userdata($id);echo $user_info-> user_login.""; ?>"><?php echo xprofile_get_field_data( "$field_gamename" , $member_id); ?></a>
</td>
I'm trying to avoid including the fields.php file over 50 times in the users.php file. Anyone got an idea of the most efficient way?
Thanks!