Who is online?
In total there are 2 users online :: 1 Registered, 0 Hidden and 1 Guest

Unknown Data

[ View the whole list ]


Most users ever online was 246 on Tue Jan 31, 2012 2:47 am
Statistics
We have 107 registered users
The newest registered user is KAN_GU_ROO

Our users have posted a total of 1539 messages in 169 subjects
Latest topics
» Welcome To AvacWeb!
by KAN_GU_ROO Today at 12:17 pm

» affiliate space???
by LGforum Today at 10:10 am

» Print a Particular Post
by ion-cube Mon Feb 20, 2012 6:45 am

» Tooltips..................
by CraZy.CloWn Wed Feb 15, 2012 3:03 am

» AvacDom Selector Method
by LGforum Tue Feb 14, 2012 11:08 pm

18. A New PHPBB3 Memberlist

View previous topic View next topic Go down

18. A New PHPBB3 Memberlist

Post by LGforum on Fri Jan 27, 2012 2:02 pm

18. A New PHPBB3 Memberlist
(phpbb3 only)

For a demo, visit the memberlist on this board. This will give you one similar.

First of all visit your CSS for the styling and add this:
Code:

.membox {
  float: left;
  padding: 5px;
  border: 1px solid #105289;
  background: #e1ebf2;
  margin: 10px;
  height: 115px;
  width: 165px;
  border-radius: 3px;
  box-shadow: 2px 2px 2px #105289;
}
.membox:hover {  border: 1px solid #c05; }
.membox .showinfo>a img {
  display: block;
  height: 90px;
  width: 90px;
}
.membox .showinfo td {  float: right; }
.membox .showinfo a {  font-weight: bold;  font-size: 11px;}
#memberlist { padding: 15px 5px; margin-bottom: 30px; }
#memberlist .row1, #memberlist .row2, #memberlist tbody, #memberlist thead {display:none}
.memopt {  display: block; }
.memopthead {  text-decoration: underline;  display: block; }
.meminner {
  position: absolute;
  z-index: 999;
  border: 1px solid #c05;
  background: #e1ebf2;
  box-shadow: 2px 2px 2px #666;
  border-radius: 3px;
  padding: 5px;
  width: 120px;
  margin-left: 15px;
}

This is the exact same styling used on the memberlist on this board. Edit it how you please, however a few things in there could completely mess up your display, so your better just to mess with the colors really.

Next go to any Javascript which you have in All Pages. (if you don't have any, create a new one)
And then add this to it:
Code:

function sortMemlist() {
  var x=document.getElementById('memberlist'),
      y=x.getElementsByTagName('tr'),
      headers=y[0].getElementsByTagName('th'); 
  for(i=1;i<y.length;i++) {
    var outer=document.createElement('div'); outer.className="membox";
    var td=y[i].getElementsByTagName('td');
    outer.innerHTML+="<div onmouseover=\"$('#meminfo"+i+"').show();\" onmouseout=\"$('#meminfo"+i+"').hide();\" class=\"showinfo\">"+ td[1].innerHTML+ "</div>";
    var inner=document.createElement('div'); inner.className="meminner";
    inner.id="meminfo"+i; inner.style.display="none";
    for(j=3;j<td.length-2;j++) {
          if(td[j].innerHTML!='' && td[j].innerHTML!='  ') {
              inner.innerHTML+="<span class='memopthead'>"+headers[j].innerHTML+":</span>";
          }
        inner.innerHTML+="<span class='memopt'>"+td[j].innerHTML+"</span><br>";
    }
    outer.appendChild(inner);
    x.appendChild(outer);
    $($('.showinfo')[i-1]).append(td[td.length-2]).append(td[td.length-1]);
  }
}

That is the function which will loop through all the rows in the memberlist, each time creating the nice little box.

Now to call that function at the right time. Visit your Javascript and take a look at them.
If you have a Javascript that it set for 'All Pages' and you can see this line in there: $(function(){

Then what you need to do is add this underneath it:
Code:
if(document.getElementById('memberlist')){sortMemlist();}


If you can't find that line, then add to your Javascript file this:
Code:
$(function(){if(document.getElementById('memberlist')){sortMemlist();}});


And you should be done Wink
As i say visit the memberlist on this forum for a demo of what it looks like.

LGforum

Status Status: Hope you like the new design of this board.
Forum Version: Phpbb3
Posts: 600
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: 18. A New PHPBB3 Memberlist

Post by CraZy.CloWn on Sat Jan 28, 2012 12:59 am

is there one for punbb

CraZy.CloWn

Posts: 15
Join date: 2012-01-17

View user profile

Back to top Go down

Re: 18. A New PHPBB3 Memberlist

Post by Flora on Tue Jan 31, 2012 4:03 am

Nice demo! Thank you LG! Now if I could only get... lol Just kidding. Smile

Flora

Status Status: If you like gardening, please join my site. Ty. :)
Forum Version: Phpbb3
Posts: 115
Join date: 2011-11-18
Location: USA

View user profile http://www.chlorisgarden.com

Back to top Go down

Re: 18. A New PHPBB3 Memberlist

Post by Anita on Sat Feb 11, 2012 1:56 am

Hey! Very Happy
Thank you very very much for this useful tutorial!

I just wanted to make a questions about the location of the last alternative link you provided in case there were no other scripts in all pages with the $(function(){: If I were to add it to the same script you provided in the second step, would I add it before the closing } ?

I'm afraid I only get an empty table header, no more. So I guess I'm screwing it up somewhere... as usual! Razz

Thanks for this useful tutorial! Very Happy

Anita

Posts: 2
Join date: 2012-02-11

View user profile

Back to top Go down

Re: 18. A New PHPBB3 Memberlist

Post by LGforum on Sat Feb 11, 2012 10:59 am

No it would go after that last closing bracket. It would need to be below it as a separate chunk of script.

This:
Code:

$(function(){if(document.getElementById('memberlist')){sortMemlist();}});


Well done for trying though Smile

LGforum

Status Status: Hope you like the new design of this board.
Forum Version: Phpbb3
Posts: 600
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: 18. A New PHPBB3 Memberlist

Post by Anita on Sun Feb 12, 2012 1:57 am

I see!! Very Happy Thank you!!

Anita

Posts: 2
Join date: 2012-02-11

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum