﻿﻿





















/**
 * 投稿者を投稿数でソートして出力する
 * 投稿数0の投稿者は表示しない
 * @param ソースを置き換えるhtmlタグのID
 */
function putAuthors(id){
	var source = '<ul>';
	var authors = new Array();
		authors.push(new Author("ao","ao",4,""));
		authors.push(new Author("atsuhashi","atsuhashi",0,""));
		authors.push(new Author("benko","benko",0,"/2007/03/benkoprofile.html"));
		authors.push(new Author("boku","boku",2,"/2007/03/_1967.html"));
		authors.push(new Author("faces","FACEs",1,"/2006/07/facesprofile.html"));
		authors.push(new Author("gen","gen",0,"/"));
		authors.push(new Author("hara","hara",0,"2007/01/haraprofile.html"));
		authors.push(new Author("harayoki","harayoki",0,"/2006/07/harayokiprofile.html"));
		authors.push(new Author("harry","harry",0,""));
		authors.push(new Author("iida","iida",0,""));
		authors.push(new Author("jailbird","kameda",1,"/2006/10/kameda.html"));
		authors.push(new Author("kamp","kamp",3,"/2006/08/kampprofile.html"));
		authors.push(new Author("kanega","Shin",0,"http://faces2.bascule.co.jp/2006/10/post_9.html"));
		authors.push(new Author("kaw","mochizuki",0,""));
		authors.push(new Author("kazuhisa","maegawa",0,"/2006/07/post_2.html"));
		authors.push(new Author("key","key",0,"/2006/08/keyprofile.html"));
		authors.push(new Author("maki","maki",0,""));
		authors.push(new Author("motose","motose",1,""));
		authors.push(new Author("ryo","ryo",0,""));
		authors.push(new Author("tanaka","tanaka",1,""));
		authors.push(new Author("tobimayo","tobimayo",0,""));
		authors.push(new Author("watanabe","nabe",0,"/2006/10/nabe.html"));
	
	authors.sort(
		function(a,b){
			if(a.getEntryCount()>b.getEntryCount()) return -1;
			if(a.getEntryCount()<b.getEntryCount()) return 1;
			return 0;
		}
	);
	//↓includeProfileToEntryCount 1 or 0 @see siteVars.module
	var minEntrieCount = 0;
	for(var i in authors){
		var author = authors[i];
		if(author.getEntryCount()>minEntrieCount && author.getName().toLowerCase()!="faces"){
			//					  ↑1件はprofile
			var iconFile = "http://faces.jp/img/faceIcons/"+author.getName()+".png";
			source += '<li><div class="authorArea">';
			source += '<div class="iconImgArea" style="background-image:url(\''+iconFile+'\');">';
			source += getProfileLinkTag(author.getURL(),"")+'</div>';
			var latestEntry = authorEntryList.getLatestEntry(author.getName(),8);
			if(latestEntry!=null){
				source += '<div class="authorLatestEntry">'
				if(latestEntry.isNew()){
					source += '<img src="http://alt.faces.jp/img/new_icon.png" class="newmark" />'
				}
				source += '<a href="'+latestEntry.url+'">'+latestEntry.title+'</a>';
				source+="</div>";
			}
			source += '<div class="authorDescription">';
			source += getProfileLinkTag(author.getURL(),author.getNickName()+'('+(author.getEntryCount()-minEntrieCount)+'件)');
			source += '</div>';/*-1はprofile分*/
			source += '</div></li>';
		}else{
		}
	}
	source +='</ul>\n';
	document.getElementById(id).innerHTML = source;
}

//authorクラス
function Author(name,nickName,entryCount,url){
	this.name = name;
	this.nickName = nickName;
	this.count = entryCount;
	if(url==""){
		//url = "http://alt.faces.jp/2006/02/noprofile.html";
	}
	this.url = url;
}
Author.prototype.getName = function(){
	return this.name;
}
Author.prototype.getNickName = function(){
	return this.nickName;
}
Author.prototype.getEntryCount = function(){
	return this.count;
}
Author.prototype.getURL = function(){
	return this.url;
}
Author.prototype.toString = function(){
	return this.name+"("+this.nickName+"):"+this.count;
}
