function search($search, $limit = 10, $page = 0) { global $roster; $first = $page * $limit; $sql = "SELECT `players`.`name`, `players`.`member_id`, `players`.`server`, `players`.`region`, `items`.*" . " FROM `" . $roster->db->table('items') . "` AS items,`" . $roster->db->table('players') . "` AS players" . " WHERE `items`.`member_id` = `players`.`member_id`" . " AND (`items`.`item_name` LIKE '%{$search}%' OR `items`.`item_tooltip` LIKE '%{$search}%')" . ($this->minlvl != '' ? " AND `items`.`level` >= '{$this->minlvl}'" : '') . ($this->maxlvl != '' ? " AND `items`.`level` <= '{$this->maxlvl}'" : '') . $this->quality_sql . " ORDER BY `items`.`item_name` ASC" . ($limit > 0 ? " LIMIT {$first}," . $limit : '') . ';'; //calculating the search time $this->start_search = format_microtime(); $result = $roster->db->query($sql); $this->stop_search = format_microtime(); $this->time_search = $this->stop_search - $this->start_search; $nrows = $roster->db->num_rows($result); $x = $limit > $nrows ? $nrows : ($limit > 0 ? $limit : $nrows); if ($nrows > 0 && $limit > 0) { while ($x > 0) { $row = $roster->db->fetch($result); $icon = new item($row); $item['html'] = '<td class="SearchRowCell">' . $icon->out(true) . '</td>' . '<td class="SearchRowCell">' . $icon->requires_level . '</td>' . '<td class="SearchRowCell"><span style="color:#' . $icon->color . '">[' . $icon->name . ']</span></td>' . '<td class="SearchRowCellRight"><a href="' . makelink('char-info&a=c:' . $row['member_id']) . '"><strong>' . $row['name'] . '</strong></a></td>'; $this->add_result($item); unset($item); $x--; } } else { $this->result_count = $nrows; } $roster->db->free_result($result); }
$roster->tpl->assign_block_vars('bankers', array('NAME' => $muleRow['member_name'], 'LINK' => makelink('&mode=' . ($gbank_mode == 1 ? 'full' : 'inv') . '#c_' . $muleRow['member_id']))); // Parse the note field for possible html characters $prg_find = array('/"/', '/&/', '|\\>|', '|\\<|', "/\\n/"); $prg_rep = array('"', '&', '>', '<', '<br />'); $note = preg_replace($prg_find, $prg_rep, $muleRow['member_note']); $date_char_data_updated = date_char_updated($muleRow['dateupdatedutc']); $itemsOnMuleQuery = "SELECT i.*,LEFT(i.item_id, (LOCATE(':',i.item_id)-1)) AS real_itemid,sum(i.item_quantity) AS total_quantity" . " FROM `" . $roster->db->table('items') . "` AS i" . " WHERE " . $muleRow['member_id'] . " = i.member_id" . " AND i.item_parent!='bags'" . " AND i.item_parent!='equip'" . " AND (i.item_tooltip" . " NOT LIKE '%" . $roster->locale->wordings[$muleRow['clientLocale']]['tooltip_soulbound'] . "%'" . " OR i.item_tooltip" . " LIKE '%" . $roster->locale->wordings[$muleRow['clientLocale']]['tooltip_boe'] . "%')" . " GROUP BY real_itemid" . " ORDER BY i.item_name"; $itemsOnMule = $roster->db->query($itemsOnMuleQuery); $roster->tpl->assign_block_vars('bank', array('ID' => $muleRow['member_id'], 'NAME' => $muleRow['member_name'], 'LINK' => makelink('char-info&a=c:' . $muleRow['member_id']), 'NOTE' => $note, 'UPDATED' => $date_char_data_updated, 'MONEY_G' => $muleRow['gold'], 'MONEY_S' => $muleRow['silver'], 'MONEY_C' => $muleRow['copper'], 'S_ITEMS' => (bool) $roster->db->num_rows(), 'L_NO_INFO' => sprintf($roster->locale->act['gbank_not_loaded'], $muleRow['member_name']))); if ($itemsOnMule) { $column_counter = 1; $striping_counter = 1; while ($itemRow = $roster->db->fetch($itemsOnMule)) { $itemRow['item_quantity'] = $itemRow['total_quantity']; $item = new item($itemRow); $roster->tpl->assign_block_vars('bank.items', array('ITEM' => $item->out(), 'ITEM_TOOLTIP' => $item->html_tooltip, 'ROW_CLASS' => $roster->switch_row_class(), 'COUNT' => $column_counter)); if ($column_counter == $columns) { $column_counter = 0; } $column_counter++; } } } $roster->tpl->set_handle('body', $addon['basename'] . '/guildbank.html'); $roster->tpl->display('body'); /** * Gets the last upload date for a character * * @param int $id | Member ID * @return string */
echo '<td class="membersKeyRow' . $rownum . '">'; echo '<div class="bagSlot">'; $setpiecename = explode("|", $setpiece); // Modification for french localization, thx to Ansgar if (isset($SetAlternateName[$setpiecename[0]])) { $iquery = "SELECT * FROM `" . $items_table . "` WHERE (item_name = '" . $setpiecename[0] . "' OR item_name = '" . $SetAlternateName[$setpiecename[0]] . "') AND member_id = '" . $row['member_id'] . "'"; } else { $iquery = "SELECT * FROM `" . $items_table . "` WHERE item_name = '" . $setpiecename[0] . "' AND member_id = '" . $row['member_id'] . "'"; } $iresult = $roster->db->query($iquery) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $iquery); $idata = $roster->db->fetch($iresult, SQL_ASSOC); // if (!$idata) print "Empty idata"; else {print "\$idata = "; print_r($idata); } if ($idata) { $item = new item($idata); if ($item->name) { print $item->out(); } else { echo '<center>N/A</center>'; } } else { if ($setpiecename[0]) { echo '<span style="z-index: 1000;" onMouseover="return overlib(\'<span class="tooltipheader" style="color:#0070dd; font-weight: bold">' . $setpiecename[0] . '</span><br><span class="tooltipline" style="color:#ffffff; font-size: 10px;">' . $roster->locale->act['DropsFrom'] . ' <b>' . $setpiecename[1] . '</b></span><br><span class="tooltipline" style="color:#ffffff; font-size: 10px;">' . $roster->locale->act['DropsIn'] . ' <b>' . $setpiecename[2] . '</b></span>\');" onMouseout="return nd();"><center>X</center></span>'; } else { echo '<center>N/A</center>'; } } echo '</td>' . "\n\n"; echo '</div>'; echo '</div>'; } // Close the Row