Okay, this topic is also not what you need ...
I will show what I could find. There is a script:
- Code:
$(function(){
var a=$('.zerstorer').get();
for(i=0;i<a.length;i++) {
var b=a[i].firstChild;
var uid=b.href.substring(b.href.indexOf('/u')+2);
$( $('.okeys')[i]).append('<a class="inprf" href="/u' + uid + 'contact">Contact</a>');
}
});
This is the first:
- Code:
var a=$('.zerstorer').get(); - Here is the class the user nickname is wrapped in. |
This is the second:
- Code:
$( $('.zerstorer')[i]).append('<a class="inprf" href="/u' + uid + 'contact">Contact</a>'); - Here is the diva class in front of which you need to put the created element containing the desired fragment, and of course the fragment itself |
This script inserts a link to the contact page on the user list page next to the name of each user, while the links are correct and each has its own link to its contact page.
- Code:
$(function(){
var a=$('.zerstorer').get();
for(i=0;i<a.length;i++) {
var b=a[i].firstChild;
var uid=b.href.substring(b.href.indexOf('/u')+2);
$( $('.okeys')[i]).append('<a class="inprf" href="/u' + uid + 'contact">Contact</a>');
}
});
Now ... I need to change this script so that it does not display a link to the contact page, namely the user rating. If this does not work, then you can at least have a field, for example, field_id-12 from the user’s page, and I’ll already insert the header there. The main thing is that it is displayed next to the username in the list of users.
My template looks like this:
- Code:
<h1 class="page-title solo">{PAGE_TITLE}</h1>
<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1" id="memberlist">
<thead>
<tr>
<th class="number">#</th>
<th class="name">{L_AVATAR} - {L_USERNAME}</th>
<!-- BEGIN switch_th_group -->
<th class="group">{L_GROUPS}</th>
<!-- END switch_th_group -->
<th class="interests">{L_INTERESTS}</th>
<th class="joined">{L_JOINED}</th>
<th class="active">{L_VISITED}</th>
<th class="posts">{L_POSTS}</th>
<th class="pm">{L_PM}</th>
<th class="website">{L_WEBSITE}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN memberrow -->
<tr class="{memberrow.ROW_CLASS}">
<td> {memberrow.ROW_NUMBER} </td>
<td class="avatar-mini"><div class="zerstorer"><a href="{memberrow.U_VIEWPROFILE}">{memberrow.AVATAR_IMG} {memberrow.USERNAME}</a></div><div class="okeys"></div></td>
<!-- BEGIN switch_td_group -->
<td>{memberrow.GROUPS}</td>
<!-- END switch_td_group -->
<td>{memberrow.INTERESTS}</td>
<td>{memberrow.JOINED}</td>
<td>{memberrow.LASTVISIT}</td>
<td>{memberrow.POSTS}</td>
<td> {memberrow.PM_IMG} </td>
<td> {memberrow.WWW_IMG} </td>
</tr>
<!-- END memberrow -->
<!-- BEGIN switch_no_user -->
<tr class="row1">
<td colspan="{switch_no_user.COLSPAN_NUMBER}">{switch_no_user.L_NO_USER}</td>
</tr>
<!-- END switch_no_user -->
</tbody>
</table>
<span class="corners-bottom"><span></span></span></div>
</div>
- Code:
<td class="avatar-mini"><div class="zerstorer"><a href="{memberrow.U_VIEWPROFILE}">{memberrow.AVATAR_IMG} {memberrow.USERNAME}</a></div><div class="okeys"></div></td> |
As you can see, the necessary divas stand still. If you paste the script into the console on this page, it displays a link to his contacts next to the user’s name, but I need a rank or at least a profile field in which I will put the user’s rank ...
I also tried to use something like this, but the console throws an error and indicates something is wrong. This should fulfill the function .load but the error ...
- Code:
$(function(){
var thfield = 'field_id-12';
$('#memberlist .zerstorer a[href^="/u"]').each(function(index){
var prof = jQuery(this).attr('href');
$(.okeys).load(prof + ' #' + thfield');
});
});
});
please help who can ... I’ve been unable to find a solution for two weeks ... I thought I could, but it didn’t work out ... It will be useful for many who want to add new fields to the list of users, while the script is simple and will not huge load ...
If I load the rank separately for each user in the list of users, it will be a very huge script, for example, I have 2000 users ... I can’t do this ... Why don’t I want to use the Mood field? Because I already use it for another.
I want to change the structure of the user list and make it more beautiful and adaptive, so I ask for help ... I really don’t know how to change the script