﻿﻿





















/**
 * 投稿者を投稿数でソートして出力する
 * 投稿数0の投稿者は表示しない
 * @param ソースを置き換えるhtmlタグのID
 */
function putAuthors(id){
	var source = '<ul>';
	var authors = new Array();
		authors.push(new Author("","",0,""));
		authors.push(new Author("ao","ao",32,""));
		authors.push(new Author("atsuhashi","atsuhashi",0,""));
		authors.push(new Author("benko","benko",2,"/2007/03/benkoprofile.html"));
		authors.push(new Author("boku","boku",1,"/2007/03/_1967.html"));
		authors.push(new Author("faces","FACEs",52,"/2006/07/facesprofile.html"));
		authors.push(new Author("gen","gen",0,"/"));
		authors.push(new Author("hara","hara",1,"2007/01/haraprofile.html"));
		authors.push(new Author("harayoki","harayoki",5,"/2006/07/harayokiprofile.html"));
		authors.push(new Author("harry","harry",1,""));
		authors.push(new Author("hide","hide",3,""));
		authors.push(new Author("iida","iida",0,""));
		authors.push(new Author("jailbird","kameda",2,"/2006/10/kameda.html"));
		authors.push(new Author("kamp","kamp",26,"/2006/08/kampprofile.html"));
		authors.push(new Author("kanega","Shin",2,"http://faces2.bascule.co.jp/2006/10/post_9.html"));
		authors.push(new Author("kaw","mochizuki",0,""));
		authors.push(new Author("kazuhisa","maegawa",3,"/2006/07/post_2.html"));
		authors.push(new Author("kdmytk","kodama",0,""));
		authors.push(new Author("key","key",8,"/2006/08/keyprofile.html"));
		authors.push(new Author("motose","motose",0,""));
		authors.push(new Author("naggg","naggg",2,"/2007/04/nagggprofile.html"));
		authors.push(new Author("nakata","nakata",2,""));
		authors.push(new Author("nobody","nobody",0,""));
		authors.push(new Author("ryo","ryo",0,""));
		authors.push(new Author("sasae","sasae",0,""));
		authors.push(new Author("shigeon","shigeon",2,"/2006/07/shigeonprofile.html"));
		authors.push(new Author("tobimayo","tobimayo",0,""));
		authors.push(new Author("watanabe","nabe",4,"/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 = 1;
	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(),1);
			if(latestEntry!=null){
				source += '<div class="authorLatestEntry">'
				if(latestEntry.isNew()){
					source += '<img src="http://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://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;
}
