Changing link to an image.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Changing link to an image.

Post by MIGhunter »

I'm using eqdkp and I want to alter part of the table. Their forums suck and it's hard to get answers to php questions. What I am trying to do is change the code so that instead of showing a link it shows an image. The code looks like this.

Code: Select all

 
<td width="100" nowrap="nowrap">{members_row.RANK}</td>
 
What I want it to do is show an image based on that rank.

Code: Select all

 
<td width="100" nowrap="nowrap"><img src="/images/{members_row.RANK}.jpg"</td>
 
That is what I want it to do but I can't get it to work. In Coldfusion you would just put #members_row.RANK#.jpg and it would work. PHP I can't get it to work. I even tried:

Code: Select all

 
<td width="100" nowrap="nowrap"><img src="/images/" . {members_row.RANK} . ".jpg"</td>
 
Didn't work. Thanks for the hopeful help.
MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

Nobody knows how to do this?
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: Changing link to an image.

Post by watson516 »

Have you tried closing your img tag?
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Changing link to an image.

Post by semlar »

MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

watson516 wrote:Have you tried closing your img tag?
Sorry that was a typo. The img tag was closed. The problem is that {members_row.RANK} is an array that creates a link. All I need is the name minus the link and junk. It pulls the rank from a table column but I can't just use the table column in the url. Atleast I can't get it to work that way.

semlar wrote:http://instantrimshot.com

..too soon?
Sorry my mistake, I thought this was a professional forum and not a breeding ground for little kids.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: Changing link to an image.

Post by Bill H »

Sorry my mistake, I thought this was a professional forum and not a breeding ground for little kids.
Judging an entire forum based on a post by someone showing a post count of 3 posts is a bit odd.
MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

Bill H wrote:
Sorry my mistake, I thought this was a professional forum and not a breeding ground for little kids.
Judging an entire forum based on a post by someone showing a post count of 3 posts is a bit odd.
True but most of the other forums I use mod them quickly to keep the trash down.
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Changing link to an image.

Post by semlar »

Yeah and shamelessly bumping your topic the same day you post it asking "Nobody knows how to do this?" is real mature.

You haven't provided enough information to answer your question. You haven't said what the variable {members_row.RANK} contains, you haven't said what does happen when you modify it either.

That's like saying "I have $var, but when I change it to <img src='{$var}'> it doesn't work!"
MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

Well I work night shift. I posted this one night and then checked it the next night when I came back and saw no answer.

I provided the information at hand. {members_row.RANK} posts the word of the rank you put in the config file. So if you say, Uber, Smarty, etc for member 1, 2, 3 alike, the table will look like:
Name---------Rank
m1-----------Uber
m2-----------Smarty
m3-----------etc

All I want to do is change it so that it comes accross as <img src="/images/uber.jpg>
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Changing link to an image.

Post by semlar »

Okay, I went and tested this myself, {members_row.RANK} contains (as an example) <a href="listmembers.php?s=&rank=Member&show=">Member</a>

That means you're trying to stick that string into the source attribute of an image tag.

Anyway, open eqdkp/listmembers.php, find

Code: Select all

'RANK'          => ( !empty($row['rank_name']) ) ? (( $row['rank_hide'] == '1' ) ? '<i>' . '<a href="'.$u_rank_search.'">' . stripslashes($row['rank_name']) . '</a>' . '</i>'  : '<a href="'.$u_rank_search.'">' . stripslashes($row['rank_name']) . '</a>') : '&nbsp;',
(it was line 300 in this version)

replace with

Code: Select all

'RANK'          => ( !empty($row['rank_name']) ) ? (( $row['rank_hide'] == '1' ) ? '<i>' . '<a href="'.$u_rank_search.'"><img src="/images/' . stripslashes($row['rank_name']) . '.jpg"/></a>' . '</i>'  : '<a href="'.$u_rank_search.'"><img src="/images/' . stripslashes($row['rank_name']) . '.jpg"/></a>') : '&nbsp;',
MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

Thank you.

When I try it, it doesn't work and I get this when I view source:

Code: Select all

 
<img src="http://www.botdls.com/beaconpointssat/templates/default/images/Linkshell/($row['rank_name']).jpg">
 
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Changing link to an image.

Post by semlar »

Did you change my text? Because I know that works.
Attachments
eqdkp.jpg
eqdkp.jpg (94.31 KiB) Viewed 1024 times
MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

I copied and pasted it directly from what you posted.

Does it matter that there is only 1 single quote mark around the <img tag?

Here is the copy and pasted version from my page:

Code: Select all

 
'RANK'          => ( !empty($row['rank_name']) ) ? (( $row['rank_hide'] == '1' ) ? '<i>' . '<a href="'.$u_rank_search.'"><img src="/images/' . stripslashes($row['rank_name']) . '.jpg"/></a>' . '</i>'  : '<a href="'.$u_rank_search.'"><img src="/images/' . stripslashes($row['rank_name']) . '.jpg"/></a>') : '&nbsp;',
 
Last edited by MIGhunter on Sun Feb 22, 2009 6:48 am, edited 1 time in total.
semlar
Forum Commoner
Posts: 61
Joined: Fri Feb 20, 2009 10:45 pm

Re: Changing link to an image.

Post by semlar »

The single quote represents the beginning or end of the string, the dots glue the string and variables together. It's not the way I would have done this particular code but it's how they did it.

In other words it's broken up into literal strings and variables like this..

Code: Select all

'<a href="'
.$u_rank_search
.'"><img src="/images/'
.stripslashes($row['rank_name'])
.'.jpg"/></a>'
translates to this

Code: Select all

<a href="searchurlthing"><img src="/images/Member.jpg"/></a>
If you don't keep the variables separated you end up with this.. (similar to what you're getting)

Code: Select all

<a href="$u_rank_search"><img src="/images/stripslashes($row['rank_name'])"/></a>
It's possible there's a difference in the version you're using, what is the unmodified line you have?
MIGhunter
Forum Newbie
Posts: 13
Joined: Thu Jul 31, 2008 10:49 pm

Re: Changing link to an image.

Post by MIGhunter »

Here's the entire page:

Code: Select all

<?php
/******************************
 * EQdkp
 * Copyright 2002-2005
 * Licensed under the GNU GPL.  See COPYING for full terms.
 * ------------------
 * listmembers.php
 * begin: Wed December 18 2002
 * 
 * $Id: listmembers.php,v 1.46 2005/05/16 12:22:12 thundarr Exp $
 * 
 ******************************/
 
define('EQDKP_INC', true);
$eqdkp_root_path = './';
include_once($eqdkp_root_path . 'common.php');
 
$user->check_auth('u_member_list');
 
$sort_order = array(
    0 => array('member_name', 'member_name desc'),
    1 => array('member_earned desc', 'member_earned'),
    2 => array('member_spent desc', 'member_spent'),
    3 => array('member_adjustment desc', 'member_adjustment'),
    4 => array('member_current desc', 'member_current'),
    5 => array('member_lastraid desc', 'member_lastraid'),
    6 => array('member_level desc', 'member_level'),
    7 => array('member_class', 'member_class desc'),
    8 => array('rank_name', 'rank_name desc'),
    9 => array('class_armor_type', 'class_armor_type desc')
);
 
$current_order = switch_order($sort_order);
 
$cur_hash = hash_filename("listmembers.php");
 
//
// Compare members
//
if ( isset($_POST['submit']) && ($_POST['submit'] == $user->lang['compare_members']) && isset($_POST['compare_ids']) )
{
    // To compare members, we take the post checkboxes,
    // serialize them and pass them to the script again through _GET
    $compare_ids = serialize($_POST['compare_ids']);
    $compare_ids = urlencode($compare_ids);
 
    redirect('listmembers.php?compare='.$compare_ids);
}
elseif ( isset($_GET['compare']) )
{
    $s_compare = true;
    $uri_addon = '';
    
    $compare_ids = urldecode(stripslashes($_GET['compare']));
    $compare_ids = unserialize($compare_ids);
    
    // Find 30 days ago, then find how many raids occurred in those 30 days
    // Do the same for 60 and 90 days
    $thirty_days = mktime(0, 0, 0, date('m'), date('d')-30, date('Y'));
    $ninety_days = mktime(0, 0, 0, date('m'), date('d')-90, date('Y'));
    
    $raid_count_30 = $db->query_first('SELECT count(*) FROM ' . RAIDS_TABLE . ' WHERE raid_date BETWEEN '.$thirty_days.' AND '.time());
    $raid_count_90 = $db->query_first('SELECT count(*) FROM ' . RAIDS_TABLE . ' WHERE raid_date BETWEEN '.$ninety_days.' AND '.time());
    
    // Build an SQL query that includes each of the compare IDs
    $sql = 'SELECT m.*, (member_earned-member_spent+member_adjustment) AS member_current, c.class_name AS member_class
            FROM ' . MEMBERS_TABLE . ' m, ' .CLASS_TABLE. " c 
            WHERE ( member_id='".$compare_ids[0]."'";
    $cid_count = count($compare_ids);
    for ( $i = 1; $i < $cid_count; $i++ )
    {
        $sql .= " OR member_id='".$compare_ids[$i]."'";
    }
    $sql .= " ) AND m.member_class_id = c.class_id";
    $sql .= " ORDER BY ".$current_order['sql'];
    $result = $db->query($sql);
 
    // Output each row
    while ( $row = $db->fetch_record($result) )
    {
        $individual_raid_count_30 = 0;
        $individual_raid_count_90 = 0;
        
        $rc_sql = 'SELECT count(*)
                   FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
                   WHERE (ra.raid_id = r.raid_id)
                   AND (ra.member_name='".$row['member_name']."')
                   AND (r.raid_date BETWEEN ".$thirty_days.' AND '.time().')';
        $individual_raid_count_30 = $db->query_first($rc_sql);
        
        $rc_sql = 'SELECT count(*)
                   FROM ' . RAIDS_TABLE . ' r, ' . RAID_ATTENDEES_TABLE . " ra
                   WHERE (ra.raid_id = r.raid_id)
                   AND (ra.member_name='".$row['member_name']."')
                   AND (r.raid_date BETWEEN ".$ninety_days.' AND '.time().')';
        $individual_raid_count_90 = $db->query_first($rc_sql);
        
        // Prevent division by 0
        $percent_of_raids_30 = ( $raid_count_30 > 0 ) ? round(($individual_raid_count_30 / $raid_count_30) * 100) : 0;
        $percent_of_raids_90 = ( $raid_count_90 > 0 ) ? round(($individual_raid_count_90 / $raid_count_90) * 100) : 0;
        
        // If the member's spent is greater than 0, see how long ago they looted an item
        if ( $row['member_spent'] > 0 )
        {
            $ll_sql = 'SELECT max(item_date) AS last_loot
                       FROM ' . ITEMS_TABLE . "
                       WHERE item_buyer='".$row['member_name']."'";
            $last_loot = $db->query_first($ll_sql);
        }
        
        $tpl->assign_block_vars('members_row', array(
            'ROW_CLASS'       => $eqdkp->switch_row_class(),
            'ID'              => $row['member_id'],
            'NAME'            => $row['member_name'],
            'LEVEL'           => ( $row['member_level'] > 0 ) ? $row['member_level'] : '&nbsp;',
            'CLASS'           => ( !empty($row['member_class']) ) ? $row['member_class'] : '&nbsp;',
            'EARNED'          => $row['member_earned'],
            'SPENT'           => $row['member_spent'],
            'ADJUSTMENT'      => $row['member_adjustment'],
            'CURRENT'         => $row['member_current'],
            'LASTRAID'        => ( !empty($row['member_lastraid']) ) ? date($user->style['date_notime_short'], $row['member_lastraid']) : '&nbsp;',
            'LASTLOOT'        => ( isset($last_loot) ) ? date($user->style['date_notime_short'], $last_loot) : '&nbsp;',
            'RAIDS_30_DAYS'   => sprintf($user->lang['of_raids'], $percent_of_raids_30),
            'RAIDS_90_DAYS'   => sprintf($user->lang['of_raids'], $percent_of_raids_90),
            'C_ADJUSTMENT'    => color_item($row['member_adjustment']),
            'C_CURRENT'       => color_item($row['member_current']),
            'C_LASTRAID'      => 'neutral',
            'C_RAIDS_30_DAYS' => color_item($percent_of_raids_30, true),
            'C_RAIDS_90_DAYS' => color_item($percent_of_raids_90, true),
            'U_VIEW_MEMBER'   => 'viewmember.php'.$SID . '&' . URI_NAME . '='.$row['member_name'])
        );
        unset($last_loot);
    }
    $db->free_result($result);
    $footcount_text = $user->lang['listmembers_compare_footcount'];
    
    $encoded_ids = urlencode(serialize($compare_ids));
    $tpl->assign_vars(array(
        'U_COMPARE_MEMBERS' => 'listmembers.php' . $SID . '&compare=' . $encoded_ids . '&')
    );
}
//
// Normal member display
//
else
{
 
    $s_compare = false;
    
    $member_count = 0;
    $previous_data = '';
    
    // Figure out what data we're comparing from member to member
    // in order to rank them
    $sort_index = explode('.', $current_order['uri']['current']);
    $previous_source = preg_replace('/( (asc|desc))?/i', '', $sort_order[$sort_index[0]][$sort_index[1]]);
    
    $show_all = ( (!empty($_GET['show'])) && ($_GET['show'] == 'all') ) ? true : false;
    
    //
    // Filtering
    //
 
    $filter = ( isset($_GET['filter']) ) ? urldecode($_GET['filter']) : 'none';
    $filter = ( preg_match('#\-{1,}#', $filter) ) ? 'none' : $filter;
 
 
    // Grab class_id
 
    if ( isset($_GET['filter']) ) {
 
    $temp_filter = $_GET['filter'];
 
       // Just because filter is set doesn't mean its valid - clear it if its set to none
    
       if ( preg_match('/ARMOR_/', $temp_filter) ) {
 
    $temp_filter = preg_replace('/ARMOR_/', '', $temp_filter);  
 
    $query_by_armor = 1;
        $query_by_class = 0;
 
        $id = $temp_filter;
 
 
    } elseif ( $temp_filter == "none" ) {
    
            $temp_filter = "";
        $query_by_armor = 0;
            $query_by_class = 0;
 
       } else {
        
            $query_by_class = 1;
            $query_by_armor = 0;
            $id = $temp_filter;
       }
 
}
 
    $tpl->assign_block_vars('filter_row', array(
        'VALUE'    => strtolower("None"),
        'SELECTED' => ( $filter == strtolower("None") ) ? ' selected="selected"' : '',
        'OPTION'   => str_replace('_', ' ', "None"))
    );
 
    // Add in the cute ---- line, filter on None if some idiot selects it
 
    $tpl->assign_block_vars('filter_row', array(
        'VALUE'    => strtolower("None"),
        'SELECTED' => ( $filter == strtolower("NULL") ) ? ' selected="selected"' : '',
        'OPTION'   => str_replace('_', ' ', "--------"))
    );
 
    // Grab generic armor information
 
    $sql = 'SELECT class_armor_type FROM ' . CLASS_TABLE .'';
    $sql .= ' GROUP BY class_armor_type';
    $result = $db->query($sql);
 
        while ( $row = $db->fetch_record($result) )
        {
 
          $tpl->assign_block_vars('filter_row', array(
              'VALUE'    => "ARMOR_" . strtolower($row['class_armor_type']),
              'SELECTED' => ( $filter == strtolower($row['class_armor_type']) ) ? ' selected="selected"' : '',
              'OPTION'   => str_replace('_', ' ', $row['class_armor_type']))
          );
 
        }
 
    // Add in the cute ---- line, filter on None if some idiot selects it
 
    $tpl->assign_block_vars('filter_row', array(
        'VALUE'    => strtolower("None"),
        'SELECTED' => ( $filter == strtolower("NULL") ) ? ' selected="selected"' : '',
        'OPTION'   => str_replace('_', ' ', "--------"))
    );
 
    // Moved the class/race/faction information to the database
 
        $sql = 'SELECT class_name, class_id, class_min_level, class_max_level FROM ' . CLASS_TABLE .'';
        $sql .= ' GROUP BY class_name';
        $result = $db->query($sql);
 
        while ( $row = $db->fetch_record($result) )
        {
 
 
            $tpl->assign_block_vars('filter_row', array(
                'VALUE' => $row['class_name'],
                'SELECTED' => ( $filter == strtolower($row['class_name']) ) ? ' selected="selected"' : '',
                'OPTION'   => ( !empty($row['class_name']) ) ? stripslashes($row['class_name']) : '(None)' )
                );
 
 
        }
 
        $db->free_result($result);
 
    // end database move of race/class/faction
 
    // Build SQL query based on GET options
    $sql = 'SELECT m.*, (m.member_earned-m.member_spent+m.member_adjustment) AS member_current, 
           member_status, r.rank_name, r.rank_hide, r.rank_prefix, r.rank_suffix, 
                   c.class_name AS member_class, 
                   c.class_armor_type AS armor_type,
           c.class_min_level AS min_level,
           c.class_max_level AS max_level
            FROM ' . MEMBERS_TABLE . ' m, ' . MEMBER_RANKS_TABLE . ' r, ' . CLASS_TABLE . ' c
        WHERE c.class_id = m.member_class_id
            AND (m.member_rank_id = r.rank_id)';
    if ( !empty($_GET['rank']) )
    {
        $sql .= " AND r.rank_name='" . urldecode($_GET['rank']) . "'";
    }
 
    if ( $query_by_class == '1' )
    {
        //$sql .= " AND m.member_class_id =  $id";
        $sql .= " AND c.class_name =  '$id'";
 
    }
 
    if ( $query_by_armor == '1' )
    {
        $sql .= " AND c.class_armor_type =  '".$temp_filter."'";
    }
 
    $sql .= ' ORDER BY '.$current_order['sql'];
    
 
    
    if ( !($members_result = $db->query($sql)) )
    {
        message_die('Could not obtain member information', '', __FILE__, __LINE__, $sql);
    }
 
    while ( $row = $db->fetch_record($members_result) )
    {
        // Figure out the rank search URL based on show and filter
        $u_rank_search  = 'listmembers.php' . $SID . '&rank=' . urlencode($row['rank_name']);
        $u_rank_search .= ( ($eqdkp->config['hide_inactive'] == 1) && (!$show_all) ) ? '&show=' : '&show=all';
        $u_rank_search .= ( $filter != 'none' ) ? '&filter=' . $filter : '';
        
        if ( member_display($row) )
        {
            $member_count++;
 
            $tpl->assign_block_vars('members_row', array(
                'ROW_CLASS'     => $eqdkp->switch_row_class(),
                'ID'            => $row['member_id'],
                //'COUNT'         => ($row[$previous_source] == $previous_data) ? '&nbsp;' : $member_count,
                'COUNT'         => $member_count,
                'NAME'          => $row['rank_prefix'] . (( $row['member_status'] == '0' ) ? '<i>' . $row['member_name'] . '</i>' : $row['member_name']) . $row['rank_suffix'],
                'RANK'          => ( !empty($row['rank_name']) ) ? (( $row['rank_hide'] == '1' ) ? '<i>' . '<a href="'.$u_rank_search.'"><img src="/images/' . stripslashes($row['rank_name']) . '.jpg"/></a>' . '</i>'  : '<a href="'.$u_rank_search.'"><img src="/images/' . stripslashes($row['rank_name']) . '.jpg"/></a>') : '&nbsp;',
                'LEVEL'         => ( $row['member_level'] > 0 ) ? $row['member_level'] : '&nbsp;',
                'CLASS'         => ( !empty($row['member_class']) ) ? $row['member_class'] : '&nbsp;',
            'ARMOR'     => ( !empty($row['armor_type']) ) ? $row['armor_type'] : '&nbsp;',
                'EARNED'        => $row['member_earned'],
                'SPENT'         => $row['member_spent'],
                'ADJUSTMENT'    => $row['member_adjustment'],
                'CURRENT'       => $row['member_current'],
                'LASTRAID'      => ( !empty($row['member_lastraid']) ) ? date($user->style['date_notime_short'], $row['member_lastraid']) : '&nbsp;',
                'C_ADJUSTMENT'  => color_item($row['member_adjustment']),
                'C_CURRENT'     => color_item($row['member_current']),
                'C_LASTRAID'    => 'neutral',
                'U_VIEW_MEMBER' => 'viewmember.php' . $SID . '&' . URI_NAME . '='.$row['member_name'])
            );
            $u_rank_search = '';
            unset($last_loot);
            
            // So that we can compare this member to the next member,
            // set the value of the previous data to the source
            $previous_data = $row[$previous_source];
        }
    }
    
    $uri_addon  = ''; // Added to the end of the sort links
    $uri_addon .= '&filter=' . urlencode($filter);
    $uri_addon .= ( isset($_GET['show']) ) ? '&show=' . $_GET['show'] : '';
    
    if ( ($eqdkp->config['hide_inactive'] == 1) && (!$show_all) )
    {
        $footcount_text = sprintf($user->lang['listmembers_active_footcount'], $member_count, 
                                  '<a href="listmembers.php' . $SID . '&' . URI_ORDER . '=' . $current_order['uri']['current'] . '&show=all" class="rowfoot">');
    }
    else
    {
        $footcount_text = sprintf($user->lang['listmembers_footcount'], $member_count);
    }
    $db->free_result($members_result);
}
 
$tpl->assign_vars(array(
    'F_MEMBERS' => 'listmembers.php'.$SID,
    'V_SID'     => str_replace('?' . URI_SESSION . '=', '', $SID),
    
    'L_FILTER'        => $user->lang['filter'],
    'L_NAME'          => $user->lang['name'],
    'L_RANK'          => $user->lang['rank'],
    'L_LEVEL'         => $user->lang['level'],
    'L_CLASS'         => $user->lang['class'],
    'L_ARMOR'         => $user->lang['armor'],
    'L_EARNED'        => $user->lang['earned'],
    'L_SPENT'         => $user->lang['spent'],
    'L_ADJUSTMENT'    => $user->lang['adjustment'],
    'L_CURRENT'       => $user->lang['current'],
    'L_LASTRAID'      => $user->lang['lastraid'],
    'L_LASTLOOT'      => $user->lang['lastloot'],
    'L_RAIDS_30_DAYS' => sprintf($user->lang['raids_x_days'], 30),
    'L_RAIDS_90_DAYS' => sprintf($user->lang['raids_x_days'], 90),
    'BUTTON_NAME'     => 'submit',
    'BUTTON_VALUE'    => $user->lang['compare_members'],
    
    'O_NAME'       => $current_order['uri'][0],
    'O_RANK'       => $current_order['uri'][8],
    'O_LEVEL'      => $current_order['uri'][6],
    'O_CLASS'      => $current_order['uri'][7],
    'O_ARMOR'      => $current_order['uri'][9],
    'O_EARNED'     => $current_order['uri'][1],
    'O_SPENT'      => $current_order['uri'][2],
    'O_ADJUSTMENT' => $current_order['uri'][3],
    'O_CURRENT'    => $current_order['uri'][4],
    'O_LASTRAID'   => $current_order['uri'][5],
    
    'URI_ADDON'      => $uri_addon,
    'PAGE_HASH'     => $cur_hash,
    'U_LIST_MEMBERS' => 'listmembers.php' . $SID . '&',
    
    'S_COMPARE' => $s_compare,
    'S_NOTMM'   => true,
    
    'LISTMEMBERS_FOOTCOUNT' => ( isset($_GET['compare']) ) ? sprintf($footcount_text, sizeof($compare_ids)) : $footcount_text)
);
 
$eqdkp->set_vars(array(
    'page_title'    => sprintf($user->lang['title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['listmembers_title'],
    'template_file' => 'listmembers.html',
    'display'       => true)
);
 
function member_display(&$row)
{
    global $eqdkp;
    global $query_by_armor, $query_by_class, $filter, $filters, $show_all, $id;
    
    // Replace space with underscore (for array indices)
    // Damn you Shadow Knights!
    $d_filter = ucwords(str_replace('_', ' ', $filter));
    $d_filter = str_replace(' ', '_', $d_filter);
    
    $member_display = null;
    
    // We're filtering based on class
 
    if ( $filter != 'none'  ) {
 
       if ( $query_by_class == 1  )
       {
 
       // Check for valid level ranges
       //if ( $row['member_level'] > $row['min_level'] && $row['member_level'] <= $row['max_level'] ) {
    
              $member_display = ( ($row['member_class'] == $id ) ) ? true : false;
 
      // }
 
       } elseif ( $query_by_armor == 1 ) {
 
       $rows = strtolower($row['armor_type']);
 
       // Check for valid level ranges
       if ( $row['member_level'] > $row['min_level'] && $row['member_level'] <= $row['max_level'] ) {
 
             $member_display = ( $rows == $id  ) ? true : false;
 
       }
          
       } 
      } else {
           // Are we showing all?
           if ( $show_all )
           {
               $member_display = true;
           }
           else
           {
               // Are we hiding inactive members?
               if ( $eqdkp->config['hide_inactive'] == '0' )
               {
                   //Are we hiding their rank?
                   $member_display = ( $row['rank_hide'] == '0' ) ? true : false;
               }
               else
               {
                   // Are they active?
                   if ( $row['member_status'] == '0' )
                   {
                       $member_display = false;
                   }
                   else
                   {
                       $member_display = ( $row['rank_hide'] == '0' ) ? true : false;
                   } // Member inactive
               } // Not showing inactive members
           } // Not showing all
       } // Not filtering by class
    
    return $member_display;
}
 
?>
 
Post Reply