The idea here is naming the forum's icon with its ID
First, create a folder under the theme's folder called "FORUM", then save forum's icons there with name is forum's ID and extension is "GIF"

Second, assign the
forumIcon.ID with the forum's ID in
ForumList1_ItemCreated method in "
/controls/ForumList.ascx.cs"
forumIcon.ID = Convert.ToString(row["ForumID"]);
forumIcon.ThemeTag = "FORUM";
forumIcon.LocalizedTitlePage = "ICONLEGEND";
forumIcon.LocalizedTitleTag = "NO_NEW_POSTS";
try
{
Third, add the following lines into
GetCurrentThemeItem method in "
\YAF.Controls\ThemeImage.cs"
protected string GetCurrentThemeItem()
{
string strForumIcon = PageContext.Theme.ThemeDir + "forum/" + ID + ".gif";
System.IO.FileInfo fi = new System.IO.FileInfo(Page.Server.MapPath(strForumIcon));
if (fi.Exists) return strForumIcon;
if (!String.IsNullOrEmpty(this._themePage) && !String.IsNullOrEmpty(this._themeTag))
{
Finally, recompile the project and copy "YAF.Controls.dll" to the "Bin" folder