1. #1
    Deleted

    Guildroster on Website

    Hey guys,

    dont know if thats the right place, if not pls move to the right one.


    I'm currently creating a website using wordpress for my guild and i want to add our roster to the website.


    Currently I'm using the following plugin

    https://de.wordpress.org/plugins/wowpi/

    It works so far but i got one question (i asked the author aswell, but he didn't reply.) atm it pulls every character out of the armory(including alts, socials etc.) but i want to pull only specific ranks.


    Can anybody help me, how can add a restriction to it, so it pulls only specific ranks?


    Thanks in advance!

  2. #2
    Hmm, without having a setting in the plugins options, you'd need to dig under the hood into the raw code. I don't actually have a wordpress site up (as I thoroughly hate it), so I wouldn't be able to look into the code. Are you able to upload the plugins code to pastebin.com?

    If I can view the source I can try to limit it to a certain rank.

    - - - Updated - - -

    In the file wowpi/includes/wowpi_data_processing.php - on line 209 - it has a members array.

    Line 211 it has the members rank. So you'd want to work out how it's getting the rank (e.g is it a number? 0 = Guild Master? or is it getting the title for the rank? so Guild Master, Initiate, etc?)

    Then, if it returns a number (and you wanted ranks 0-3)

    it'd look like:

    Code:
    if ($member->rank <= 3) {
    $members[] = array(
    etc
    );
    }
    Or if it's a string (e.g the actual rank name), you'll want:

    Code:
    if ($member->rank == 'Guild Master' || $member->rank == 'Initiate' || etc) {
    $members[] = array(
    etc
    );
    }
    I believe this will help, but I haven't tested it.

  3. #3
    Deleted
    First of all massive thanks. It works. Now i got another question. I got this right now.


    Code:
    if ($member->rank <= 7) {
    $members[] = array(
    etc
    );
    }
    It shows me Rank 0 - Rank 7 -> How do i exclude now a specific rank in that range?

  4. #4
    Why not just combine some clauses?
    e.g. I use this:
    Code:
    if (($memberItem['rank'] == '4') || ($memberItem['rank'] == '5') || ($memberItem['rank'] < '3'))

    Or, given your example, where you really just want to exclude one single rank:
    Code:
    if ($member->rank <= 7 && $member->rank != 4) {
    Last edited by Rici; 2016-08-17 at 01:52 PM.

  5. #5
    Deleted
    thx!

    now i want to give out the real ranknames instead of 1, 2, 3 etc.

    In the originalcode its already done for rank0

    Code:
    $output .= '<td class="grank grank_'.$member['rank'].'">';
          $output .= ($member['rank']=='0' ? '<img src="http://eu.battle.net/wow/static/images/guild/icon-guildmaster.gif" alt="Guild master" /> '.__('Guild master','wowpi') : __('Rank','wowpi').' '.$member['rank']);
          $output .= '</td>';
    I tried to copy this line and replaced the rank but i doesn't work.

    Any suggestions? :/

  6. #6
    Quote Originally Posted by Bloodwork91 View Post
    thx!

    now i want to give out the real ranknames instead of 1, 2, 3 etc.

    In the originalcode its already done for rank0

    Code:
    $output .= '<td class="grank grank_'.$member['rank'].'">';
          $output .= ($member['rank']=='0' ? '<img src="http://eu.battle.net/wow/static/images/guild/icon-guildmaster.gif" alt="Guild master" /> '.__('Guild master','wowpi') : __('Rank','wowpi').' '.$member['rank']);
          $output .= '</td>';
    I tried to copy this line and replaced the rank but i doesn't work.

    Any suggestions? :/
    He's statically saying Guild Master. I presume he cannot grab the actual rank names from the blizzard API. Just put them in statically yourself.

  7. #7
    Deleted
    I tried. But don't know how. :/

  8. #8
    Maybe this helps understanding the line
    Code:
    ($member['rank']=='0' ? '<img src="http://eu.battle.net/wow/static/images/guild/icon-guildmaster.gif" alt="Guild master" /> '.__('Guild master','wowpi') : __('Rank','wowpi').' '.$member['rank']);
    is the same as
    Code:
    if ($member['rank']=='0') {
         '<img src="http://eu.battle.net/wow/static/images/guild/icon-guildmaster.gif" alt="Guild master" /> '.__('Guild master','wowpi')
    }
    else {
         __('Rank','wowpi').' '.$member['rank']);
    }


    So this should do it:
    Code:
    $output .= '<td class="grank grank_'.$member['rank'].'">';
    
    if ($member['rank']=='0') {
            $output .= __('Guild master','wowpi');
    }
    elseif($member['rank']=='1') {
            $output .= __('rank 1 name','wowpi');
    }
    elseif($member['rank']=='2') {
            $output .= __('rank 2 name','wowpi');
    }
    else {
            $output .= __('Rank','wowpi').' '.$member['rank']);
    }
    $output .= '</td>';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •