YAFLogo

Posted by: mdlesk - Friday, 7 November 2008 07:16:59
We just finished up the coding for the initial release of our ShoutBox Control for YAF 1.9.3. The zip file is attached and instructions are included. If you are looking to implement a shoutbox please give it a shot and provide any feedback. Thanks:!: Screenshot: [img]http://www.dlesktech.com/dlesktech/ProductImages/DLESKTECH_ShoutBox/DLESKTECH_ShoutBox_Screenshot.jpg[/img]

Posted by: vash - Saturday, 8 November 2008 15:29:23
Are the smilies implemented on this version?

Posted by: mdlesk - Saturday, 8 November 2008 19:15:46
I am working on implementing the smilies right now. The updated control should be ready for release either tonight or tomorrow :)

Posted by: vash - Saturday, 8 November 2008 19:21:39
Cool... This will be a great feature. I will look forward on this... I have already implemented a shoutbox created by Continiezo I think... But they have not included the smilies yet. Here is where I placed the chatbox [url=http://www.itchytech.net]http://www.itchytech.net[/url]

Posted by: mdlesk - Saturday, 8 November 2008 19:25:19
The ShoutBox looks really good on your website. The latest control will also handle HTML, including links opening in new windows and not the current window.

Posted by: vash - Saturday, 8 November 2008 20:20:32
Cool.... :cheesy: I'm really excited about the new features... Thanks in advance... :cheesy:

Posted by: midwestSS - Sunday, 9 November 2008 05:00:45
when i download that zip file, im told its a corrupted file while trying to uncompress it.

Posted by: midwestSS - Sunday, 9 November 2008 05:01:49
when i download that zip file, im told its a corrupted file while trying to uncompress it.

Posted by: mdlesk - Sunday, 9 November 2008 05:25:54
I have re-attached another zip file for the initial release. Version 1.0.0.1 is the first release, while Version 1.1.0.1 contains the smilies implemented. Please note that I experienced an issue with 2 smilies not being able to be used. If you experience the same issue please let me know and I will see what I can do to fix it. If you are upgraded from 1.0.0.1 to 1.1.0.1 then you just have to overwrite the Control ASCX and ASCX.CS files. There are no changes to the database or any other classes. Let me know if you have any questions.

Posted by: ryanmedley - Sunday, 9 November 2008 14:51:55
How do i install this?

Posted by: mdlesk - Sunday, 9 November 2008 14:59:40
There are instructions provided in the zip file. It is very simple, you copy the control to the controls directory execute the sql file on the database, write 2 lines of code on forum.ascx, and copy the code into the DB class.

Posted by: ryanmedley - Sunday, 9 November 2008 15:10:45
ok i am very new to this and there are no instructions that i can see i have a site from godaddy with free hosting thats all i know i can get to the FTP threw my windows browser or do i need a certain program Thanks.

Posted by: mdlesk - Sunday, 9 November 2008 15:22:31
Did you install it from the applications section under hosting on GoDaddy? If so do you have Visual Studio on your computer?

Posted by: midwestSS - Monday, 10 November 2008 04:31:07
so, do you have to recompile this to put it into play?

Posted by: mdlesk - Monday, 10 November 2008 04:37:31
Yes, a recompile is necessary.

Posted by: midwestSS - Monday, 10 November 2008 05:21:36
ahh ok there in lies the issue im going to have. i dont know how to recompile. I have installed VS2005 on my Xp machine, downloaded the source. but it gives me errors about the YAF project not being installed.. so i gave up trying to understand how to compile a long time ago.

Posted by: mdlesk - Monday, 10 November 2008 13:04:26
Have you considered trying to use the latest version. I was experiencing issues with 1.9.1 so I decided to go to 1.9.3 and a lot of my issues were resolved.

Posted by: mdlesk - Monday, 10 November 2008 13:11:13
Would it be better if I compile all of the class code: DB functions and everything else in a DLL and you just add it as a reference? I am considering doing this for future releases. I was trying to keep all of the code together, but this is an option that would require anyone to recompile or modify any of the classes. All that would be needed to place add the control at the appropriate section. Please let me know your opinions. As always this will be a GPL and I will start a separate project for all of the DLESKTECH controls.

Posted by: mdlesk - Monday, 10 November 2008 13:56:37
I have uploaded a new version of the control. It's only a minor change in the code that points to the smiley location. If you are experiencing issue with your smilies displaying then make sure you perform this upgrade.

Posted by: midwestSS - Monday, 10 November 2008 15:09:45
adding it pre compiled would be AWESOME! personally, for the 'compiled challenged' , thats a great thing to do. I am so out of the loop on programing and it makes me feel like moron.. i have to learn how to program all over again. i downloaded vs 2008 for web apps, but i was having the same issues there

Posted by: midwestSS - Monday, 10 November 2008 19:21:45
ok.. i tried to compile again, and got this error Error 1 Member modifier 'static' must precede the member type and name C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YAF.Classes\YAF.Classes.Data\DB.cs 73 3 YAF.Classes.Data

Posted by: vash - Monday, 10 November 2008 20:05:08
Hi Bro, Thanks for the update, I will try to implement this tonight :cheesy:

Posted by: mdlesk - Monday, 10 November 2008 20:13:07
[quote=midwestSS]ok.. i tried to compile again, and got this error Error 1 Member modifier 'static' must precede the member type and name C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YAF.Classes\YAF.Classes.Data\DB.cs 73 3 YAF.Classes.Data [/quote] Can you post your CS file you are getting this error on and I will take a look at it.

Posted by: midwestSS - Monday, 10 November 2008 20:16:35
/* Yet Another Forum.NET * Copyright (C) 2003-2005 Bjørnar Henden * Copyright (C) 2006-2008 Jaben Cargman * http://www.yetanotherforum.net/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Data; using System.Data.SqlClient; using System.Web; using System.Web.Security; namespace YAF.Classes.Data { public static class DB { /// /// Gets the database size /// /// intager value for database size static public int DBSize() { using ( SqlCommand cmd = new SqlCommand( "select sum(cast(size as integer))/128 from sysfiles" ) ) { cmd.CommandType = CommandType.Text; return ( int )DBAccess.ExecuteScalar( cmd ); } } #region Forum static public DataRow pageload( object sessionID, object boardID, object userKey, object ip, object location, object browser, object platform, object categoryID, object forumID, object topicID, object messageID, object donttrack ) { int nTries = 0; while ( true ) { try { using ( SqlCommand cmd = DBAccess.GetCommand( "pageload" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "SessionID", sessionID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserKey", userKey ); cmd.Parameters.AddWithValue( "IP", ip ); cmd.Parameters.AddWithValue( "Location", location ); cmd.Parameters.AddWithValue( "Browser", browser ); cmd.Parameters.AddWithValue( "Platform", platform ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "DontTrack", donttrack ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { if ( dt.Rows.Count > 0 ) return dt.Rows [0]; else return null; } } } catch ( SqlException x ) { if ( x.Number == 1205 && nTries < 3 ) { /// Transaction (Process ID XXX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. } else throw new ApplicationException( string.Format( "Sql Exception with error number {0} (Tries={1})", x.Number, nTries ), x ); } ++nTries; } } /// /// Returns Search results /// /// /// Field to search /// Search what /// /// ID of user /// Results static public DataTable GetSearchResult( string toSearchWhat, string toSearchFromWho, SearchWhatFlags searchFromWhoMethod, SearchWhatFlags searchWhatMethod, int forumIDToStartAt, int userID, int boardId, int maxResults, bool useFullText ) { bool bFirst = true; System.Text.StringBuilder forumIds = new System.Text.StringBuilder(); if ( toSearchWhat == "*" ) { toSearchWhat = ""; } if ( forumIDToStartAt != 0 ) { DataTable dt = forum_listall_sorted( boardId, userID, null, false, forumIDToStartAt ); bFirst = true; foreach ( DataRow dr in dt.Rows ) { if ( bFirst ) bFirst = false; else forumIds.Append( "," ); forumIds.Append( Convert.ToString( Convert.ToInt32( dr ["ForumID"] ) ) ); } } // fix quotes for SQL insertion... toSearchWhat = toSearchWhat.Replace( "'", "''" ).Trim(); toSearchFromWho = toSearchFromWho.Replace( "'", "''" ).Trim(); string searchSql = ( maxResults == 0 ) ? "SELECT" : ( "SELECT TOP " + maxResults.ToString() ); searchSql += " a.ForumID, a.TopicID, a.Topic, b.UserID, IsNull(c.Username, b.Name) as Name, c.MessageID, c.Posted, c.Message, c.Flags "; searchSql += "from {databaseOwner}.{objectQualifier}topic a left join {databaseOwner}.{objectQualifier}message c on a.TopicID = c.TopicID left join {databaseOwner}.{objectQualifier}user b on c.UserID = b.UserID join {databaseOwner}.{objectQualifier}vaccess x on x.ForumID=a.ForumID "; searchSql += String.Format( "where x.ReadAccess<>0 AND x.UserID={0} AND c.IsApproved = 1 AND a.TopicMovedID IS NULL AND a.IsDeleted = 0 AND c.IsDeleted = 0 ", userID ); string [] words; if ( !String.IsNullOrEmpty( toSearchFromWho ) ) { searchSql += "AND ("; bFirst = true; // generate user search sql... switch ( searchFromWhoMethod ) { case SearchWhatFlags.AllWords: words = toSearchFromWho.Replace("\"","").Split( ' ' ); foreach ( string word in words ) { if ( !bFirst ) searchSql += " AND "; else bFirst = false; searchSql += string.Format( " ((c.Username IS NULL AND b.Name LIKE N'%{0}%') OR (c.Username LIKE N'%{0}%'))", word ); } break; case SearchWhatFlags.AnyWords: words = toSearchFromWho.Split( ' ' ); foreach ( string word in words ) { if ( !bFirst ) searchSql += " OR "; else bFirst = false; searchSql += string.Format( " ((c.Username IS NULL AND b.Name LIKE N'%{0}%') OR (c.Username LIKE N'%{0}%'))", word ); } break; case SearchWhatFlags.ExactMatch: searchSql += string.Format( " ((c.Username IS NULL AND b.Name = N'{0}') OR (c.Username = N'{0}'))", toSearchFromWho ); break; } searchSql += ") "; } if ( !String.IsNullOrEmpty( toSearchWhat ) ) { searchSql += "AND ("; bFirst = true; // generate message and topic search sql... switch ( searchWhatMethod ) { case SearchWhatFlags.AllWords: words = toSearchWhat.Replace("\"","").Split( ' ' ); if ( useFullText ) { string ftInner = ""; // make the inner FULLTEXT search foreach ( string word in words ) { if ( !bFirst ) ftInner += " AND "; else bFirst = false; ftInner += String.Format( @"""{0}""", word ); } // make final string... searchSql += string.Format( "( CONTAINS (c.Message, N' {0} ') OR CONTAINS (a.Topic, N' {0} ') )", ftInner ); } else { foreach ( string word in words ) { if ( !bFirst ) searchSql += " AND "; else bFirst = false; searchSql += String.Format( "(c.Message like N'%{0}%' OR a.Topic LIKE N'%{0}%')", word ); } } break; case SearchWhatFlags.AnyWords: words = toSearchWhat.Split( ' ' ); if ( useFullText ) { string ftInner = ""; // make the inner FULLTEXT search foreach ( string word in words ) { if ( !bFirst ) ftInner += " OR "; else bFirst = false; ftInner += String.Format( @"""{0}""", word ); } // make final string... searchSql += string.Format( "( CONTAINS (c.Message, N' {0} ') OR CONTAINS (a.Topic, N' {0} ') )", ftInner ); } else { foreach ( string word in words ) { if ( !bFirst ) searchSql += " OR "; else bFirst = false; searchSql += String.Format( "c.Message LIKE N'%{0}%' OR a.Topic LIKE N'%{0}%'", word ); } } break; case SearchWhatFlags.ExactMatch: if ( useFullText ) { searchSql += string.Format( "( CONTAINS (c.Message, N' \"{0}\" ') OR CONTAINS (a.Topic, N' \"{0}\" ') )", toSearchWhat ); } else { searchSql += string.Format( "c.Message LIKE N'%{0}%' OR a.Topic LIKE N'%{0}%' ", toSearchWhat ); } break; } searchSql += ") "; } // Ederon : 6/16/2007 - forum IDs start above 0, if forum id is 0, there is no forum filtering if ( forumIDToStartAt > 0 && forumIds.Length > 0 ) { searchSql += string.Format( "AND a.ForumID IN ({0})", forumIds.ToString() ); } searchSql += " ORDER BY c.Posted DESC"; using ( SqlCommand cmd = DBAccess.GetCommand( searchSql, true ) ) { return DBAccess.GetData( cmd ); } } #endregion #region DLESKTECH_ShoutBox public static DataTable DLESKTECH_ShoutBox_GetMessages() { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_GetMessages")) { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData(cmd); } } public static bool DLESKTECH_ShoutBox_SaveMessage(string message,string usernName,int userID, object ip) { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_SaveMessage")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("UserName", usernName); cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("IP", ip); DBAccess.ExecuteNonQuery(cmd); return true; } } Sho #endregion #region DataSets /// /// Gets a list of categories???? /// /// BoardID /// DataSet with categories static public DataSet ds_forumadmin( object boardID ) { using ( YafDBConnManager connMan = new YafDBConnManager() ) { using ( DataSet ds = new DataSet() ) { using ( SqlTransaction trans = connMan.OpenDBConnection.BeginTransaction( DBAccess.IsolationLevel ) ) { using ( SqlDataAdapter da = new SqlDataAdapter( DBAccess.GetObjectName( "category_list" ), connMan.DBConnection ) ) { da.SelectCommand.Transaction = trans; da.SelectCommand.Parameters.AddWithValue( "BoardID", boardID ); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.Fill( ds, DBAccess.GetObjectName( "Category" ) ); da.SelectCommand.CommandText = DBAccess.GetObjectName( "forum_list" ); da.Fill( ds, DBAccess.GetObjectName( "ForumUnsorted" ) ); DataTable dtForumListSorted = ds.Tables [DBAccess.GetObjectName( "ForumUnsorted" )].Clone(); dtForumListSorted.TableName = DBAccess.GetObjectName( "Forum" ); ds.Tables.Add( dtForumListSorted ); dtForumListSorted.Dispose(); forum_list_sort_basic( ds.Tables [DBAccess.GetObjectName( "ForumUnsorted" )], ds.Tables [DBAccess.GetObjectName( "Forum" )], 0, 0 ); ds.Tables.Remove( DBAccess.GetObjectName( "ForumUnsorted" ) ); ds.Relations.Add( "FK_Forum_Category", ds.Tables [DBAccess.GetObjectName( "Category" )].Columns ["CategoryID"], ds.Tables [DBAccess.GetObjectName( "Forum" )].Columns ["CategoryID"] ); trans.Commit(); } return ds; } } } } #endregion #region yaf_AccessMask /// /// Gets a list of access mask properities /// /// ID of Board /// ID of access mask /// static public DataTable accessmask_list( object boardID, object accessMaskID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "accessmask_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); return DBAccess.GetData( cmd ); } } /// /// Deletes an access mask /// /// ID of access mask /// static public bool accessmask_delete( object accessMaskID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "accessmask_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); return ( int )DBAccess.ExecuteScalar( cmd ) != 0; } } /// /// Saves changes to a access mask /// /// ID of access mask /// ID of board /// Name of access mask /// Read Access? /// Post Access? /// Reply Access? /// Priority Access? /// Poll Access? /// Vote Access? /// Moderator Access? /// Edit Access? /// Delete Access? /// Upload Access? /// Download Access? static public void accessmask_save( object accessMaskID, object boardID, object name, object readAccess, object postAccess, object replyAccess, object priorityAccess, object pollAccess, object voteAccess, object moderatorAccess, object editAccess, object deleteAccess, object uploadAccess, object downloadAccess ) { using ( SqlCommand cmd = DBAccess.GetCommand( "accessmask_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "ReadAccess", readAccess ); cmd.Parameters.AddWithValue( "PostAccess", postAccess ); cmd.Parameters.AddWithValue( "ReplyAccess", replyAccess ); cmd.Parameters.AddWithValue( "PriorityAccess", priorityAccess ); cmd.Parameters.AddWithValue( "PollAccess", pollAccess ); cmd.Parameters.AddWithValue( "VoteAccess", voteAccess ); cmd.Parameters.AddWithValue( "ModeratorAccess", moderatorAccess ); cmd.Parameters.AddWithValue( "EditAccess", editAccess ); cmd.Parameters.AddWithValue( "DeleteAccess", deleteAccess ); cmd.Parameters.AddWithValue( "UploadAccess", uploadAccess ); cmd.Parameters.AddWithValue( "DownloadAccess", downloadAccess ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Active /// /// Gets list of active users /// /// BoardID /// /// Returns a DataTable of active users static public DataTable active_list( object boardID, object Guests ) { using ( SqlCommand cmd = DBAccess.GetCommand( "active_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Guests", Guests ); return DBAccess.GetData( cmd ); } } /// /// Gets the list of active users within a certain forum /// /// forumID /// DataTable of all ative users in a forum static public DataTable active_listforum( object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "active_listforum" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } /// /// Gets the list of active users in a topic /// /// ID of topic /// DataTable of all users that are in a topic static public DataTable active_listtopic( object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "active_listtopic" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); return DBAccess.GetData( cmd ); } } /// /// Gets the activity statistics for a board /// /// boardID /// DataRow of activity stata static public DataRow active_stats( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "active_stats" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { return dt.Rows [0]; } } } #endregion #region yaf_Attachment /// /// Gets a list of attachments /// /// messageID /// attachementID /// boardID /// DataTable with attachement list static public DataTable attachment_list( object messageID, object attachmentID, object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "attachment_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "AttachmentID", attachmentID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); return DBAccess.GetData( cmd ); } } /// /// saves attachment /// /// messageID /// File Name /// number of bytes /// type of attchment /// stream of bytes static public void attachment_save( object messageID, object fileName, object bytes, object contentType, System.IO.Stream stream ) { using ( SqlCommand cmd = DBAccess.GetCommand( "attachment_save" ) ) { byte [] fileData = null; if ( stream != null ) { fileData = new byte [stream.Length]; stream.Seek( 0, System.IO.SeekOrigin.Begin ); stream.Read( fileData, 0, ( int )stream.Length ); } cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "FileName", fileName ); cmd.Parameters.AddWithValue( "Bytes", bytes ); cmd.Parameters.AddWithValue( "ContentType", contentType ); cmd.Parameters.AddWithValue( "FileData", fileData ); DBAccess.ExecuteNonQuery( cmd ); } } //ABOT CHANGE 16.04.04 /// /// Delete attachment /// /// ID of attachment to delete static public void attachment_delete( object attachmentID ) { bool UseFileTable = false; using ( DataTable dt = YAF.Classes.Data.DB.registry_list( "UseFileTable" ) ) foreach ( DataRow dr in dt.Rows ) UseFileTable = Convert.ToBoolean( Convert.ToInt32( dr ["Value"] ) ); //If the files are actually saved in the Hard Drive if ( !UseFileTable ) { using ( SqlCommand cmd = DBAccess.GetCommand( "attachment_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "AttachmentID", attachmentID ); DataTable tbAttachments = DBAccess.GetData( cmd ); string sUpDir = HttpContext.Current.Server.MapPath( YAF.Classes.Config.UploadDir ); foreach ( DataRow row in tbAttachments.Rows ) System.IO.File.Delete( String.Format( "{0}{1}.{2}", sUpDir, row ["MessageID"], row ["FileName"] ) ); } } using ( SqlCommand cmd = DBAccess.GetCommand( "attachment_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "AttachmentID", attachmentID ); DBAccess.ExecuteNonQuery( cmd ); } //End ABOT CHANGE 16.04.04 } /// /// Attachement dowload /// /// ID of attachemnt to download static public void attachment_download( object attachmentID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "attachment_download" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "AttachmentID", attachmentID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_BannedIP /// /// List of Baned IP's /// /// ID of board /// ID /// DataTable of banned IPs static public DataTable bannedip_list( object boardID, object ID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "bannedip_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "ID", ID ); return DBAccess.GetData( cmd ); } } /// /// Saves baned ip in database /// /// ID /// BoardID /// Mask static public void bannedip_save( object ID, object boardID, object Mask ) { using ( SqlCommand cmd = DBAccess.GetCommand( "bannedip_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ID", ID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Mask", Mask ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Deletes Banned IP /// /// ID of banned ip to delete static public void bannedip_delete( object ID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "bannedip_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ID", ID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Board /// /// Gets a list of information about a board /// /// board id /// DataTable static public DataTable board_list( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); return DBAccess.GetData( cmd ); } } /// /// Gets posting statistics /// /// BoardID /// DataRow of Poststats static public DataRow board_poststats( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_poststats" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { return dt.Rows [0]; } } } /// /// Recalculates topic and post numbers and updates last post for all forums in all boards /// static public void board_resync() { board_resync( null ); } /// /// Recalculates topic and post numbers and updates last post for specified board /// /// BoardID of board to do re-sync for, if null, all boards are re-synced static public void board_resync( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_resync" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Gets statistica about number of posts etc. /// /// DataRow static public DataRow board_stats() { return board_stats( null ); } static public DataRow board_stats( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_stats" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { return dt.Rows [0]; } } } /// /// Saves board information /// /// BoardID /// Name of Board /// Boolen value, allowThreaded static public void board_save( object boardID, object name, object allowThreaded ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "AllowThreaded", allowThreaded ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Creates a new board /// /// Membership Provider User Name /// Membership Provider User Key /// Name of new board /// Membership Provider Application Name for new board /// Roles Provider Application Name for new board static public void board_create( object adminUsername, object adminUserKey, object boardName, object boardMembershipName, object boardRolesName ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_create" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardName", boardName ); cmd.Parameters.AddWithValue( "MembershipAppName", boardMembershipName ); cmd.Parameters.AddWithValue( "RolesAppName", boardRolesName ); cmd.Parameters.AddWithValue( "UserName", adminUsername ); cmd.Parameters.AddWithValue( "UserKey", adminUserKey ); cmd.Parameters.AddWithValue( "IsHostAdmin", 0 ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Deletes a board /// /// ID of board to delete static public void board_delete( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "board_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Category /// /// Deletes a category /// /// ID of category to delete /// Bool value indicationg if category was deleted static public bool category_delete( object CategoryID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "category_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "CategoryID", CategoryID ); return ( int )DBAccess.ExecuteScalar( cmd ) != 0; } } /// /// Gets a list of forums in a category /// /// boardID /// categotyID /// DataTable with a list of forums in a category static public DataTable category_list( object boardID, object categoryID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "category_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); return DBAccess.GetData( cmd ); } } /// /// Gets a list of forum categories /// /// /// /// /// static public DataTable category_listread( object boardID, object userID, object categoryID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "category_listread" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); return DBAccess.GetData( cmd ); } } /// /// Lists categories very simply (for URL rewriting) /// /// /// /// static public DataTable category_simplelist( int startID, int limit ) { using ( SqlCommand cmd = DBAccess.GetCommand( "category_simplelist" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "StartID", startID ); cmd.Parameters.AddWithValue( "Limit", limit ); return DBAccess.GetData( cmd ); } } /// /// Saves changes to a category /// /// BoardID /// CategoryID so save changes to /// Name of the category /// Sort Order static public void category_save( object boardID, object categoryId, object name, object categoryImage, object sortOrder ) { using ( SqlCommand cmd = DBAccess.GetCommand( "category_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "CategoryID", categoryId ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "CategoryImage", categoryImage ); cmd.Parameters.AddWithValue( "SortOrder", sortOrder ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_CheckEmail /// /// Saves a new email into the table for verification /// /// ID of user to verify /// Hash of user /// email of user static public void checkemail_save( object userID, object hash, object email ) { using ( SqlCommand cmd = DBAccess.GetCommand( "checkemail_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Hash", hash ); cmd.Parameters.AddWithValue( "Email", email ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Updates a hash /// /// New hash /// DataTable with user information static public DataTable checkemail_update( object hash ) { using ( SqlCommand cmd = DBAccess.GetCommand( "checkemail_update" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Hash", hash ); return DBAccess.GetData( cmd ); } } /// /// Gets a check email entry based on email or all if no email supplied /// /// Associated email /// DataTable with check email information static public DataTable checkemail_list( object email ) { using ( SqlCommand cmd = DBAccess.GetCommand( "checkemail_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Email", email ); return DBAccess.GetData( cmd ); } } #endregion #region yaf_Choice /// /// Saves a vote in the database /// /// Choice of the vote static public void choice_vote( object choiceID, object userID, object remoteIP ) { using ( SqlCommand cmd = DBAccess.GetCommand( "choice_vote" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ChoiceID", choiceID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "RemoteIP", remoteIP ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_EventLog static public void eventlog_create( object userID, object source, object description, object type ) { try { if ( userID == null ) userID = DBNull.Value; using ( SqlCommand cmd = DBAccess.GetCommand( "eventlog_create" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Type", ( object )type ); cmd.Parameters.AddWithValue( "UserID", ( object )userID ); cmd.Parameters.AddWithValue( "Source", ( object )source.ToString() ); cmd.Parameters.AddWithValue( "Description", ( object )description.ToString() ); DBAccess.ExecuteNonQuery( cmd ); } } catch { // Ignore any errors in this method } } static public void eventlog_create( object userID, object source, object description ) { eventlog_create( userID, ( object )source.GetType().ToString(), description, ( object )0 ); } /// /// Deletes all event log entries for given board. /// /// ID of board. static public void eventlog_delete( int boardID ) { eventlog_delete( null, boardID ); } /// /// Deletes event log entry of given ID. /// /// ID of event log entry. static public void eventlog_delete( object eventLogID ) { eventlog_delete( eventLogID, null ); } /// /// Calls underlying stroed procedure for deletion of event log entry(ies). /// /// When not null, only given event log entry is deleted. /// Specifies board. It is ignored if eventLogID parameter is not null. static private void eventlog_delete( object eventLogID, object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "eventlog_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "EventLogID", eventLogID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable eventlog_list( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "eventlog_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); return DBAccess.GetData( cmd ); } } #endregion yaf_EventLog // Admin control of file extensions - MJ Hufford #region yaf_Extensions static public void extension_delete( object extensionId ) { try { using ( SqlCommand cmd = DBAccess.GetCommand( "extension_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ExtensionId", extensionId ); DBAccess.ExecuteNonQuery( cmd ); } } catch { // Ignore any errors in this method } } // Get Extension record by extensionId static public DataTable extension_edit( object extensionId ) { using ( SqlCommand cmd = DBAccess.GetCommand( "extension_edit" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "extensionId", extensionId ); return DBAccess.GetData( cmd ); } } // Used to validate a file before uploading static public DataTable extension_list( object boardID, object extension ) { using ( SqlCommand cmd = DBAccess.GetCommand( "extension_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Extension", extension ); return DBAccess.GetData( cmd ); } } // Returns an extension list for a given Board static public DataTable extension_list( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "extension_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Extension", "" ); return DBAccess.GetData( cmd ); } } // Saves / creates extension static public void extension_save( object extensionId, object boardID, object Extension ) { try { using ( SqlCommand cmd = DBAccess.GetCommand( "extension_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "extensionId", extensionId ); cmd.Parameters.AddWithValue( "BoardId", boardID ); cmd.Parameters.AddWithValue( "Extension", Extension ); DBAccess.ExecuteNonQuery( cmd ); } } catch { // Ignore any errors in this method } } #endregion yaf_EventLog #region yaf_PollVote /// /// Checks for a vote in the database /// /// Choice of the vote static public DataTable pollvote_check( object pollid, object userid, object remoteip ) { using ( SqlCommand cmd = DBAccess.GetCommand( "pollvote_check" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "PollID", pollid ); cmd.Parameters.AddWithValue( "UserID", userid ); cmd.Parameters.AddWithValue( "RemoteIP", remoteip ); return DBAccess.GetData( cmd ); } } #endregion #region yaf_Forum //ABOT NEW 16.04.04 /// /// Deletes attachments out of a entire forum /// /// ID of forum to delete all attachemnts out of static private void forum_deleteAttachments( object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listtopics" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { foreach ( DataRow row in dt.Rows ) { topic_delete( row ["TopicID"] ); } } } } //END ABOT NEW 16.04.04 //ABOT CHANGE 16.04.04 /// /// Deletes a forum /// /// forum to delete /// bool to indicate that forum has been deleted static public bool forum_delete( object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listSubForums" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); if ( DBAccess.ExecuteScalar( cmd ) is DBNull ) { forum_deleteAttachments( forumID ); using ( SqlCommand cmd_new = DBAccess.GetCommand( "forum_delete" ) ) { cmd_new.CommandType = CommandType.StoredProcedure; cmd_new.Parameters.AddWithValue( "ForumID", forumID ); DBAccess.ExecuteNonQuery( cmd_new ); } return true; } else return false; } } //END ABOT CHANGE 16.04.04 //ABOT NEW 16.04.04: This new function lists all moderated topic by the specified user /// /// Lists all moderated forums for a user /// /// board if of moderators /// user id /// DataTable of moderated forums static public DataTable forum_listallMyModerated( object boardID, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listallmymoderated" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } //END ABOT NEW 16.04.04 /// /// Gets a list of topics in a forum /// /// boardID /// forumID /// DataTable with list of topics from a forum static public DataTable forum_list( object boardID, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } /// /// Listes all forums accessible to a user /// /// BoardID /// ID of user /// DataTable of all accessible forums static public DataTable forum_listall( object boardID, object userID ) { return forum_listall( boardID, userID, 0 ); } /// /// Lists all forums accessible to a user /// /// BoardID /// ID of user /// startAt ID /// DataTable of all accessible forums static public DataTable forum_listall( object boardID, object userID, object startAt ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listall" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Root", startAt ); return DBAccess.GetData( cmd ); } } /// /// Lists all forums within a given subcategory /// /// BoardID /// CategoryID /// DataTable with list static public DataTable forum_listall_fromCat( object boardID, object categoryID ) { return forum_listall_fromCat( boardID, categoryID, true ); } /// /// Lists forums very simply (for URL rewriting) /// /// /// /// static public DataTable forum_simplelist( int StartID, int Limit ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_simplelist" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "StartID", StartID ); cmd.Parameters.AddWithValue( "Limit", Limit ); return DBAccess.GetData( cmd ); } } /// /// Lists all forums within a given subcategory /// /// BoardID /// CategoryID /// EmptyFirstRow /// DataTable with list static public DataTable forum_listall_fromCat( object boardID, object categoryID, bool emptyFirstRow ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listall_fromCat" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); int intCategoryID = Convert.ToInt32( categoryID.ToString() ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { return forum_sort_list( dt, 0, intCategoryID, 0, null, emptyFirstRow ); } } } /// /// Sorry no idea what this does /// /// /// static public DataTable forum_listpath( object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listpath" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } /// /// Lists read topics /// /// BoardID /// UserID /// CategoryID /// ParentID /// DataTable with list static public DataTable forum_listread( object boardID, object userID, object categoryID, object parentID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_listread" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); cmd.Parameters.AddWithValue( "ParentID", parentID ); return DBAccess.GetData( cmd ); } } /// /// Return admin view of Categories with Forums/Subforums ordered accordingly. /// /// BoardID /// UserID /// DataSet with categories static public DataSet forum_moderatelist( object userID, object boardID ) { using ( YafDBConnManager connMan = new YafDBConnManager() ) { using ( DataSet ds = new DataSet() ) { using ( SqlDataAdapter da = new SqlDataAdapter( DBAccess.GetObjectName( "category_list" ), connMan.OpenDBConnection ) ) { using ( SqlTransaction trans = da.SelectCommand.Connection.BeginTransaction( DBAccess.IsolationLevel ) ) { da.SelectCommand.Transaction = trans; da.SelectCommand.Parameters.AddWithValue( "BoardID", boardID ); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.Fill( ds, DBAccess.GetObjectName( "Category" ) ); da.SelectCommand.CommandText = DBAccess.GetObjectName( "forum_moderatelist" ); da.SelectCommand.Parameters.AddWithValue( "UserID", userID ); da.Fill( ds, DBAccess.GetObjectName( "ForumUnsorted" ) ); DataTable dtForumListSorted = ds.Tables [DBAccess.GetObjectName( "ForumUnsorted" )].Clone(); dtForumListSorted.TableName = DBAccess.GetObjectName( "Forum" ); ds.Tables.Add( dtForumListSorted ); dtForumListSorted.Dispose(); forum_list_sort_basic( ds.Tables [DBAccess.GetObjectName( "ForumUnsorted" )], ds.Tables [DBAccess.GetObjectName( "Forum" )], 0, 0 ); ds.Tables.Remove( DBAccess.GetObjectName( "ForumUnsorted" ) ); ds.Relations.Add( "FK_Forum_Category", ds.Tables [DBAccess.GetObjectName( "Category" )].Columns ["CategoryID"], ds.Tables [DBAccess.GetObjectName( "Forum" )].Columns ["CategoryID"] ); trans.Commit(); } return ds; } } } } static public DataTable forum_moderators() { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_moderators" ) ) { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData( cmd ); } } /// /// Updates topic and post count and last topic for all forums in specified board /// /// BoardID static public void forum_resync( object boardID ) { forum_resync( boardID, null ); } /// /// Updates topic and post count and last topic for specified forum /// /// BoardID /// If null, all forums in board are updated static public void forum_resync( object boardID, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_resync" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); DBAccess.ExecuteNonQuery( cmd ); } } static public long forum_save( object forumID, object categoryID, object parentID, object name, object description, object sortOrder, object locked, object hidden, object isTest, object moderated, object accessMaskID, object remoteURL, object themeURL, bool dummy ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forum_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); cmd.Parameters.AddWithValue( "ParentID", parentID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Description", description ); cmd.Parameters.AddWithValue( "SortOrder", sortOrder ); cmd.Parameters.AddWithValue( "Locked", locked ); cmd.Parameters.AddWithValue( "Hidden", hidden ); cmd.Parameters.AddWithValue( "IsTest", isTest ); cmd.Parameters.AddWithValue( "Moderated", moderated ); cmd.Parameters.AddWithValue( "RemoteURL", remoteURL ); cmd.Parameters.AddWithValue( "ThemeURL", themeURL ); cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); return long.Parse( DBAccess.ExecuteScalar( cmd ).ToString() ); } } static private void forum_list_sort_basic( DataTable listsource, DataTable list, int parentid, int currentLvl ) { for ( int i = 0; i < listsource.Rows.Count; i++ ) { DataRow row = listsource.Rows [i]; if ( ( row ["ParentID"] ) == DBNull.Value ) row ["ParentID"] = 0; if ( ( int )row ["ParentID"] == parentid ) { string sIndent = ""; int iIndent = Convert.ToInt32( currentLvl ); for ( int j = 0; j < iIndent; j++ ) sIndent += "--"; row ["Name"] = string.Format( " -{0} {1}", sIndent, row ["Name"] ); list.Rows.Add( row.ItemArray ); forum_list_sort_basic( listsource, list, ( int )row ["ForumID"], currentLvl + 1 ); } } } static private void forum_sort_list_recursive( DataTable listSource, DataTable listDestination, int parentID, int categoryID, int currentIndent ) { DataRow newRow; foreach ( DataRow row in listSource.Rows ) { // see if this is a root-forum if ( row ["ParentID"] == DBNull.Value ) row ["ParentID"] = 0; if ( ( int )row ["ParentID"] == parentID ) { if ( ( int )row ["CategoryID"] != categoryID ) { categoryID = ( int )row ["CategoryID"]; newRow = listDestination.NewRow(); newRow ["ForumID"] = -categoryID; // Ederon : 9/4/2007 newRow ["Title"] = string.Format( "{0}", row ["Category"].ToString() ); listDestination.Rows.Add( newRow ); } string sIndent = ""; for ( int j = 0; j < currentIndent; j++ ) sIndent += "--"; // import the row into the destination newRow = listDestination.NewRow(); newRow ["ForumID"] = row ["ForumID"]; newRow ["Title"] = string.Format( " -{0} {1}", sIndent, row ["Forum"] ); listDestination.Rows.Add( newRow ); // recurse through the list... forum_sort_list_recursive( listSource, listDestination, ( int )row ["ForumID"], categoryID, currentIndent + 1 ); } } } static private DataTable forum_sort_list( DataTable listSource, int parentID, int categoryID, int startingIndent, int [] forumidExclusions ) { return forum_sort_list( listSource, parentID, categoryID, startingIndent, forumidExclusions, true ); } static private DataTable forum_sort_list( DataTable listSource, int parentID, int categoryID, int startingIndent, int [] forumidExclusions, bool emptyFirstRow ) { DataTable listDestination = new DataTable(); listDestination.Columns.Add( "ForumID", typeof( String ) ); listDestination.Columns.Add( "Title", typeof( String ) ); if ( emptyFirstRow ) { DataRow blankRow = listDestination.NewRow(); blankRow ["ForumID"] = string.Empty; blankRow ["Title"] = string.Empty; listDestination.Rows.Add( blankRow ); } // filter the forum list -- not sure if this code actually works DataView dv = listSource.DefaultView; if ( forumidExclusions != null && forumidExclusions.Length > 0 ) { string strExclusions = ""; bool bFirst = true; foreach ( int forumID in forumidExclusions ) { if ( bFirst ) bFirst = false; else strExclusions += ","; strExclusions += forumID.ToString(); } dv.RowFilter = string.Format( "ForumID NOT IN ({0})", strExclusions ); dv.ApplyDefaultSort = true; } forum_sort_list_recursive( dv.ToTable(), listDestination, parentID, categoryID, startingIndent ); return listDestination; } static public DataTable forum_listall_sorted( object boardID, object userID ) { return forum_listall_sorted( boardID, userID, null, false, 0 ); } static public DataTable forum_listall_sorted( object boardID, object userID, int [] forumidExclusions ) { return forum_listall_sorted( boardID, userID, null, false, 0 ); } static public DataTable forum_listall_sorted( object boardID, object userID, int [] forumidExclusions, bool emptyFirstRow, int startAt ) { using ( DataTable dt = forum_listall( boardID, userID, startAt ) ) { return forum_sort_list( dt, 0, 0, 0, forumidExclusions, emptyFirstRow ); } } #endregion #region yaf_ForumAccess static public DataTable forumaccess_list( object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forumaccess_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } static public void forumaccess_save( object forumID, object groupID, object accessMaskID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forumaccess_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "GroupID", groupID ); cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable forumaccess_group( object groupID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "forumaccess_group" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "GroupID", groupID ); return userforumaccess_sort_list( DBAccess.GetData( cmd ), 0, 0, 0 ); } } #endregion #region yaf_Group static public DataTable group_list( object boardID, object groupID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "group_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "GroupID", groupID ); return DBAccess.GetData( cmd ); } } static public void group_delete( object groupID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "group_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "GroupID", groupID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable group_member( object boardID, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "group_member" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public long group_save( object groupID, object boardID, object name, object isAdmin, object isGuest, object isStart, object isModerator, object accessMaskID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "group_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "GroupID", groupID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "IsAdmin", isAdmin ); cmd.Parameters.AddWithValue( "IsGuest", isGuest ); cmd.Parameters.AddWithValue( "IsStart", isStart ); cmd.Parameters.AddWithValue( "IsModerator", isModerator ); cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); return long.Parse( DBAccess.ExecuteScalar( cmd ).ToString() ); } } #endregion #region yaf_Mail static public void mail_delete( object mailID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "mail_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MailID", mailID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable mail_list( object processId ) { using ( SqlCommand cmd = DBAccess.GetCommand( "mail_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ProcessID", processId ); return DBAccess.GetData( cmd ); } } static public void mail_createwatch( object topicID, object from, object fromName, object subject, object body, object bodyHtml, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "mail_createwatch" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "From", from ); cmd.Parameters.AddWithValue( "FromName", fromName ); cmd.Parameters.AddWithValue( "Subject", subject ); cmd.Parameters.AddWithValue( "Body", body ); cmd.Parameters.AddWithValue( "BodyHtml", bodyHtml ); cmd.Parameters.AddWithValue( "UserID", userID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void mail_create( object from, object fromName, object to, object toName, object subject, object body, object bodyHtml ) { using ( SqlCommand cmd = DBAccess.GetCommand( "mail_create" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "From", from ); cmd.Parameters.AddWithValue( "FromName", fromName ); cmd.Parameters.AddWithValue( "To", to ); cmd.Parameters.AddWithValue( "ToName", toName ); cmd.Parameters.AddWithValue( "Subject", subject ); cmd.Parameters.AddWithValue( "Body", body ); cmd.Parameters.AddWithValue( "BodyHtml", bodyHtml ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Message static public DataTable post_list( object topicID, object updateViewCount, bool showDeleted ) { using ( SqlCommand cmd = DBAccess.GetCommand( "post_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "UpdateViewCount", updateViewCount ); cmd.Parameters.AddWithValue( "ShowDeleted", showDeleted ); return DBAccess.GetData( cmd ); } } static public DataTable post_list_reverse10( object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "post_list_reverse10" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); return DBAccess.GetData( cmd ); } } static public DataTable post_last10user( object boardID, object userID, object pageUserID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "post_last10user" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "PageUserID", pageUserID ); return DBAccess.GetData( cmd ); } } // gets list of replies to message static public DataTable message_getRepliesList( object messageID ) { DataTable list = new DataTable(); list.Columns.Add( "Posted", typeof( DateTime ) ); list.Columns.Add( "Subject", typeof( string ) ); list.Columns.Add( "Message", typeof( string ) ); list.Columns.Add( "UserID", typeof( int ) ); list.Columns.Add( "Flags", typeof( int ) ); list.Columns.Add( "UserName", typeof( string ) ); list.Columns.Add( "Signature", typeof( string ) ); using ( SqlCommand cmd = DBAccess.GetCommand( "message_reply_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DataTable dtr = DBAccess.GetData( cmd ); for ( int i = 0; i < dtr.Rows.Count; i++ ) { DataRow newRow = list.NewRow(); DataRow row = dtr.Rows [i]; newRow = list.NewRow(); newRow ["Posted"] = row ["Posted"]; newRow ["Subject"] = row ["Subject"]; newRow ["Message"] = row ["Message"]; newRow ["UserID"] = row ["UserID"]; newRow ["Flags"] = row ["Flags"]; newRow ["UserName"] = row ["UserName"]; newRow ["Signature"] = row ["Signature"]; list.Rows.Add( newRow ); message_getRepliesList_populate( dtr, list, ( int )row ["MessageId"] ); } return list; } } // gets list of nested replies to message static private void message_getRepliesList_populate( DataTable listsource, DataTable list, int messageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_reply_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DataTable dtr = DBAccess.GetData( cmd ); for ( int i = 0; i < dtr.Rows.Count; i++ ) { DataRow newRow = list.NewRow(); DataRow row = dtr.Rows [i]; newRow = list.NewRow(); newRow ["Posted"] = row ["Posted"]; newRow ["Subject"] = row ["Subject"]; newRow ["Message"] = row ["Message"]; newRow ["UserID"] = row ["UserID"]; newRow ["Flags"] = row ["Flags"]; newRow ["UserName"] = row ["UserName"]; newRow ["Signature"] = row ["Signature"]; list.Rows.Add( newRow ); message_getRepliesList_populate( dtr, list, ( int )row ["MessageId"] ); } } } //creates new topic, using some parameters from message itself static public long topic_create_by_message( object messageID, object forumId, object newTopicSubj ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_create_by_message" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "ForumID", forumId ); cmd.Parameters.AddWithValue( "Subject", newTopicSubj ); DataTable dt = DBAccess.GetData( cmd ); return long.Parse( dt.Rows [0] ["TopicID"].ToString() ); } } static public DataTable message_list( object messageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); return DBAccess.GetData( cmd ); } } static public void message_delete( object messageID, bool isModeratorChanged, string deleteReason, int isDeleteAction, bool DeleteLinked ) { message_delete( messageID, isModeratorChanged, deleteReason, isDeleteAction, DeleteLinked, false ); } static public void message_delete( object messageID, bool isModeratorChanged, string deleteReason, int isDeleteAction, bool DeleteLinked, bool eraseMessage ) { message_deleteRecursively( messageID, isModeratorChanged, deleteReason, isDeleteAction, DeleteLinked, false, eraseMessage ); } // Retrieve all reported messages with the correct forumID argument. static public DataTable message_listreported( object messageFlag, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_listreported" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "MessageFlag", messageFlag ); return DBAccess.GetData( cmd ); } } // Save reported message back to the database. static public void message_report( object reportFlag, object messageID, object userID, object reportedDateTime ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_report" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ReportFlag", reportFlag ); cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "ReporterID", userID ); cmd.Parameters.AddWithValue( "ReportedDate", reportedDateTime ); DBAccess.ExecuteNonQuery( cmd ); } } // Copy current Message text over reported Message text. static public void message_reportcopyover( object messageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_reportcopyover" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DBAccess.ExecuteNonQuery( cmd ); } } // Copy current Message text over reported Message text. static public void message_reportresolve( object messageFlag, object messageID, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_reportresolve" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageFlag", messageFlag ); cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "UserID", userID ); DBAccess.ExecuteNonQuery( cmd ); } } //BAI ADDED 30.01.2004 // Delete message and all subsequent releated messages to that ID static private void message_deleteRecursively( object messageID, bool isModeratorChanged, string deleteReason, int isDeleteAction, bool DeleteLinked, bool isLinked ) { message_deleteRecursively( messageID, isModeratorChanged, deleteReason, isDeleteAction, DeleteLinked, isLinked, false ); } static private void message_deleteRecursively( object messageID, bool isModeratorChanged, string deleteReason, int isDeleteAction, bool DeleteLinked, bool isLinked, bool eraseMessages ) { bool UseFileTable = false; using ( DataTable dt = DB.registry_list( "UseFileTable" ) ) foreach ( DataRow dr in dt.Rows ) UseFileTable = Convert.ToBoolean( Convert.ToInt32( dr ["Value"] ) ); if ( DeleteLinked ) { //Delete replies using ( SqlCommand cmd = DBAccess.GetCommand( "message_getReplies" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DataTable tbReplies = DBAccess.GetData( cmd ); foreach ( DataRow row in tbReplies.Rows ) message_deleteRecursively( row ["MessageID"], isModeratorChanged, deleteReason, isDeleteAction, DeleteLinked, true, eraseMessages ); } } //If the files are actually saved in the Hard Drive if ( !UseFileTable ) { using ( SqlCommand cmd = DBAccess.GetCommand( "attachment_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DataTable tbAttachments = DBAccess.GetData( cmd ); string sUpDir = HttpContext.Current.Server.MapPath( Config.UploadDir ); foreach ( DataRow row in tbAttachments.Rows ) System.IO.File.Delete( String.Format( "{0}{1}.{2}", sUpDir, messageID, row ["FileName"] ) ); } } // Ederon : erase message for good if ( eraseMessages ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "EraseMessage", eraseMessages ); DBAccess.ExecuteNonQuery( cmd ); } } else { //Delete Message // undelete function added using ( SqlCommand cmd = DBAccess.GetCommand( "message_deleteundelete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "isModeratorChanged", isModeratorChanged ); cmd.Parameters.AddWithValue( "DeleteReason", deleteReason ); cmd.Parameters.AddWithValue( "isDeleteAction", isDeleteAction ); DBAccess.ExecuteNonQuery( cmd ); } } } // Set flag on message to approved and store in DB static public void message_approve( object messageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_approve" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Get message topic IDs (for URL rewriting) /// /// /// /// static public DataTable message_simplelist( int StartID, int Limit ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_simplelist" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "StartID", StartID ); cmd.Parameters.AddWithValue( "Limit", Limit ); return DBAccess.GetData( cmd ); } } // Update message to DB. static public void message_update( object messageID, object priority, object message, object subject, object flags, object reasonOfEdit, object isModeratorChanged ) { message_update( messageID, priority, message, subject, flags, reasonOfEdit, isModeratorChanged, null ); } static public void message_update( object messageID, object priority, object message, object subject, object flags, object reasonOfEdit, object isModeratorChanged, object overrideApproval ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_update" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "Priority", priority ); cmd.Parameters.AddWithValue( "Message", message ); cmd.Parameters.AddWithValue( "Subject", subject ); cmd.Parameters.AddWithValue( "Flags", flags ); cmd.Parameters.AddWithValue( "Reason", reasonOfEdit ); cmd.Parameters.AddWithValue( "IsModeratorChanged", isModeratorChanged ); cmd.Parameters.AddWithValue( "OverrideApproval", overrideApproval ); DBAccess.ExecuteNonQuery( cmd ); } } // Save message to DB. static public bool message_save( object topicID, object userID, object message, object userName, object ip, object posted, object replyTo, object flags, ref long messageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_save" ) ) { SqlParameter paramMessageID = new SqlParameter( "MessageID", messageID ); paramMessageID.Direction = ParameterDirection.Output; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Message", message ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "IP", ip ); cmd.Parameters.AddWithValue( "Posted", posted ); cmd.Parameters.AddWithValue( "ReplyTo", replyTo ); cmd.Parameters.AddWithValue( "BlogPostID", null ); // Ederon : 6/16/2007 cmd.Parameters.AddWithValue( "Flags", flags ); cmd.Parameters.Add( paramMessageID ); DBAccess.ExecuteNonQuery( cmd ); messageID = ( long )paramMessageID.Value; return true; } } static public DataTable message_unapproved( object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_unapproved" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } static public DataTable message_findunread( object topicID, object lastRead ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_findunread" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "LastRead", lastRead ); return DBAccess.GetData( cmd ); } } // message movind function static public void message_move( object messageID, object moveToTopic, bool moveAll ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_move" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); cmd.Parameters.AddWithValue( "MoveToTopic", moveToTopic ); DBAccess.ExecuteNonQuery( cmd ); } //moveAll=true anyway // it's in charge of moving answers of moved post if ( moveAll ) { using ( SqlCommand cmd = DBAccess.GetCommand( "message_getReplies" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DataTable tbReplies = DBAccess.GetData( cmd ); foreach ( DataRow row in tbReplies.Rows ) { message_moveRecursively( row ["MessageID"], moveToTopic ); } } } } //moves answers of moved post static private void message_moveRecursively( object messageID, object moveToTopic ) { bool UseFileTable = false; using ( DataTable dt = DB.registry_list( "UseFileTable" ) ) foreach ( DataRow dr in dt.Rows ) UseFileTable = Convert.ToBoolean( Convert.ToInt32( dr ["Value"] ) ); //Delete replies using ( SqlCommand cmd = DBAccess.GetCommand( "message_getReplies" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "MessageID", messageID ); DataTable tbReplies = DBAccess.GetData( cmd ); foreach ( DataRow row in tbReplies.Rows ) { message_moveRecursively( row ["messageID"], moveToTopic ); } using ( SqlCommand innercmd = DBAccess.GetCommand( "message_move" ) ) { innercmd.CommandType = CommandType.StoredProcedure; innercmd.Parameters.AddWithValue( "MessageID", messageID ); innercmd.Parameters.AddWithValue( "MoveToTopic", moveToTopic ); DBAccess.ExecuteNonQuery( innercmd ); } } } #endregion #region yaf_Medal /// /// Lists given medal. /// /// ID of medal to list. static public DataTable medal_list(object medalID) { return medal_list(null, medalID, null); } /// /// Lists given medals. /// /// ID of board of which medals to list. Required. /// Cateogry of medals to list. Can be null. In such case this parameter is ignored. static public DataTable medal_list(object boardID, object category) { return medal_list(boardID, null, category); } /// /// Lists medals. /// /// ID of board of which medals to list. Can be null if medalID parameter is specified. /// ID of medal to list. When specified, boardID and category parameters are ignored. /// Cateogry of medals to list. Must be complemented with not-null boardID parameter. static private DataTable medal_list(object boardID, object medalID, object category) { using (SqlCommand cmd = DBAccess.GetCommand("medal_list")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("BoardID", boardID); cmd.Parameters.AddWithValue("MedalID", medalID); cmd.Parameters.AddWithValue("Category", category); return DBAccess.GetData(cmd); } } /// /// List users who own this medal. /// /// Medal of which owners to get. /// List of users with their user id and usernames, who own this medal. static public DataTable medal_listusers(object medalID) { using (SqlCommand cmd = DBAccess.GetCommand("medal_listusers")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("MedalID", medalID); return DBAccess.GetData(cmd); } } /// /// Deletes given medal. /// /// ID of medal to delete. static public void medal_delete(object medalID) { medal_delete(null, medalID, null); } /// /// Deletes given medals. /// /// ID of board of which medals to delete. Required. /// Cateogry of medals to delete. Can be null. In such case this parameter is ignored. static public void medal_delete(object boardID, object category) { medal_delete(boardID, null, category); } /// /// Deletes medals. /// /// ID of board of which medals to delete. Can be null if medalID parameter is specified. /// ID of medal to delete. When specified, boardID and category parameters are ignored. /// Cateogry of medals to delete. Must be complemented with not-null boardID parameter. static private void medal_delete(object boardID, object medalID, object category) { using (SqlCommand cmd = DBAccess.GetCommand("medal_delete")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("BoardID", boardID); cmd.Parameters.AddWithValue("MedalID", medalID); cmd.Parameters.AddWithValue("Category", category); DBAccess.ExecuteNonQuery(cmd); } } /// /// Saves new medal or updates existing one. /// /// ID of a board. /// ID of medal to update. Null if new medal is being created. /// Name of medal. /// Description of medal. /// Defaukt message to display. Should briefly describe why was medal awarded to user. /// Category of medal. /// URL of medal's image. /// URL of medal's ribbon bar. Can be null. /// URL of medal's small image. This one is displayed in user box. /// URL of medal's small ribbon bar. This one is eventually displayed in user box. Can be null. /// Width of small medal's image, in pixels. /// Height of small medal's image, in pixels. /// Width of small medal's ribbon bar image, in pixels. /// Width of small medal's ribbon bar image, in pixels. /// Default order of medal as it will be displayed in user box.Medal's flags. /// True if medal was successfully created or updated. False otherwise. static public bool medal_save( object boardID, object medalID, object name, object description, object message, object category, object medalURL, object ribbonURL, object smallMedalURL, object smallRibbonURL, object smallMedalWidth, object smallMedalHeight, object smallRibbonWidth, object smallRibbonHeight, object sortOrder, object flags) { using (SqlCommand cmd = DBAccess.GetCommand("medal_save")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("BoardID", boardID); cmd.Parameters.AddWithValue("MedalID", medalID); cmd.Parameters.AddWithValue("Name", name); cmd.Parameters.AddWithValue("Description", description); cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("Category", category); cmd.Parameters.AddWithValue("MedalURL", medalURL); cmd.Parameters.AddWithValue("RibbonURL", ribbonURL); cmd.Parameters.AddWithValue("SmallMedalURL", smallMedalURL); cmd.Parameters.AddWithValue("SmallRibbonURL", smallRibbonURL); cmd.Parameters.AddWithValue("SmallMedalWidth", smallMedalWidth); cmd.Parameters.AddWithValue("SmallMedalHeight", smallMedalHeight); cmd.Parameters.AddWithValue("SmallRibbonWidth", smallRibbonWidth); cmd.Parameters.AddWithValue("SmallRibbonHeight", smallRibbonHeight); cmd.Parameters.AddWithValue("SortOrder", sortOrder); cmd.Parameters.AddWithValue("Flags", flags); // command succeeded if returned value is greater than zero (number of affected rows) return (int)DBAccess.ExecuteScalar(cmd) > 0; } } /// /// Changes medal's sort order. /// /// ID of board. /// ID of medal to re-sort. /// Change of sort. static public void medal_resort(object boardID, object medalID, int move) { using (SqlCommand cmd = DBAccess.GetCommand("medal_resort")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("BoardID", boardID); cmd.Parameters.AddWithValue("MedalID", medalID); cmd.Parameters.AddWithValue("Move", move); DBAccess.ExecuteNonQuery(cmd); } } /// /// Deletes medal allocation to a group. /// /// ID of group owning medal. /// ID of medal. static public void group_medal_delete(object groupID, object medalID) { using (SqlCommand cmd = DBAccess.GetCommand("group_medal_delete")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("GroupID", groupID); cmd.Parameters.AddWithValue("MedalID", medalID); DBAccess.ExecuteNonQuery(cmd); } } /// /// Lists medal(s) assigned to the group /// /// ID of group of which to list medals. /// ID of medal to list. static public DataTable group_medal_list(object groupID, object medalID) { using (SqlCommand cmd = DBAccess.GetCommand("group_medal_list")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("GroupID", groupID); cmd.Parameters.AddWithValue("MedalID", medalID); return DBAccess.GetData(cmd); } } /// /// Saves new or update existing group-medal allocation. /// /// ID of user group. /// ID of medal. /// Medal message, to override medal's default one. Can be null. /// Hide medal in user box. /// Show only ribbon bar in user box. /// Sort order in user box. Overrides medal's default sort order. static public void group_medal_save( object groupID, object medalID, object message, object hide, object onlyRibbon, object sortOrder) { using (SqlCommand cmd = DBAccess.GetCommand("group_medal_save")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("GroupID", groupID); cmd.Parameters.AddWithValue("MedalID", medalID); cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("Hide", hide); cmd.Parameters.AddWithValue("OnlyRibbon", onlyRibbon); cmd.Parameters.AddWithValue("SortOrder", sortOrder); DBAccess.ExecuteNonQuery(cmd); } } /// /// Deletes medal allocation to a user. /// /// ID of user owning medal. /// ID of medal. static public void user_medal_delete(object userID, object medalID) { using (SqlCommand cmd = DBAccess.GetCommand("user_medal_delete")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("MedalID", medalID); DBAccess.ExecuteNonQuery(cmd); } } /// /// Lists medal(s) assigned to the group /// /// ID of user who was given medal. /// ID of medal to list. static public DataTable user_medal_list(object userID, object medalID) { using (SqlCommand cmd = DBAccess.GetCommand("user_medal_list")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("MedalID", medalID); return DBAccess.GetData(cmd); } } /// /// Saves new or update existing user-medal allocation. /// /// ID of user. /// ID of medal. /// Medal message, to override medal's default one. Can be null. /// Hide medal in user box. /// Show only ribbon bar in user box. /// Sort order in user box. Overrides medal's default sort order. /// Date when medal was awarded to a user. Is ignored when existing user-medal allocation is edited. static public void user_medal_save( object userID, object medalID, object message, object hide, object onlyRibbon, object sortOrder, object dateAwarded) { using (SqlCommand cmd = DBAccess.GetCommand("user_medal_save")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("MedalID", medalID); cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("Hide", hide); cmd.Parameters.AddWithValue("OnlyRibbon", onlyRibbon); cmd.Parameters.AddWithValue("SortOrder", sortOrder); cmd.Parameters.AddWithValue("DateAwarded", dateAwarded); DBAccess.ExecuteNonQuery(cmd); } } /// /// Lists all medals held by user as they are to be shown in user box. /// /// ID of user. /// List of medals, ribbon bar only first. static public DataTable user_listmedals(object userID) { using (SqlCommand cmd = DBAccess.GetCommand("user_listmedals")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("UserID", userID); return DBAccess.GetData(cmd); } } #endregion #region yaf_NntpForum static public DataTable nntpforum_list( object boardID, object minutes, object nntpForumID, object active ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpforum_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Minutes", minutes ); cmd.Parameters.AddWithValue( "NntpForumID", nntpForumID ); cmd.Parameters.AddWithValue( "Active", active ); return DBAccess.GetData( cmd ); } } static public void nntpforum_update( object nntpForumID, object lastMessageNo, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpforum_update" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "NntpForumID", nntpForumID ); cmd.Parameters.AddWithValue( "LastMessageNo", lastMessageNo ); cmd.Parameters.AddWithValue( "UserID", userID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void nntpforum_save( object nntpForumID, object nntpServerID, object groupName, object forumID, object active ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpforum_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "NntpForumID", nntpForumID ); cmd.Parameters.AddWithValue( "NntpServerID", nntpServerID ); cmd.Parameters.AddWithValue( "GroupName", groupName ); cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "Active", active ); DBAccess.ExecuteNonQuery( cmd ); } } static public void nntpforum_delete( object nntpForumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpforum_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "NntpForumID", nntpForumID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_NntpServer static public DataTable nntpserver_list( object boardID, object nntpServerID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpserver_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "NntpServerID", nntpServerID ); return DBAccess.GetData( cmd ); } } static public void nntpserver_save( object nntpServerID, object boardID, object name, object address, object port, object userName, object userPass ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpserver_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "NntpServerID", nntpServerID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Address", address ); cmd.Parameters.AddWithValue( "Port", port ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "UserPass", userPass ); DBAccess.ExecuteNonQuery( cmd ); } } static public void nntpserver_delete( object nntpServerID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntpserver_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "NntpServerID", nntpServerID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_NntpTopic static public DataTable nntptopic_list( object thread ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntptopic_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Thread", thread ); return DBAccess.GetData( cmd ); } } static public void nntptopic_savemessage( object nntpForumID, object topic, object body, object userID, object userName, object ip, object posted, object thread ) { using ( SqlCommand cmd = DBAccess.GetCommand( "nntptopic_savemessage" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "NntpForumID", nntpForumID ); cmd.Parameters.AddWithValue( "Topic", topic ); cmd.Parameters.AddWithValue( "Body", body ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "IP", ip ); cmd.Parameters.AddWithValue( "Posted", posted ); cmd.Parameters.AddWithValue( "Thread", thread ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_PMessage /// /// Returns a list of private messages based on the arguments specified. /// If pMessageID != null, returns the PM of id pMessageId. /// If toUserID != null, returns the list of PMs sent to the user with the given ID. /// If fromUserID != null, returns the list of PMs sent by the user of the given ID. /// /// /// /// The id of the private message /// static public DataTable pmessage_list( object toUserID, object fromUserID, object userPMessageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "pmessage_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ToUserID", toUserID ); cmd.Parameters.AddWithValue( "FromUserID", fromUserID ); cmd.Parameters.AddWithValue( "UserPMessageID", userPMessageID ); return DBAccess.GetData( cmd ); } } /// /// Returns a list of private messages based on the arguments specified. /// If pMessageID != null, returns the PM of id pMessageId. /// If toUserID != null, returns the list of PMs sent to the user with the given ID. /// If fromUserID != null, returns the list of PMs sent by the user of the given ID. /// /// /// /// The id of the private message /// static public DataTable pmessage_list( object userPMessageID ) { return pmessage_list( null, null, userPMessageID ); } /// /// Deletes the private message from the database as per the given parameter. If is true, /// the message is only removed from the user's outbox. Otherwise, it is completely delete from the database. /// /// /// If true, removes the message from the outbox. Otherwise deletes the message completely. static public void pmessage_delete( object userPMessageID, bool fromOutbox ) { using ( SqlCommand cmd = DBAccess.GetCommand( "pmessage_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserPMessageID", userPMessageID ); cmd.Parameters.AddWithValue( "FromOutbox", fromOutbox ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Deletes the private message from the database as per the given parameter. If fromOutbox is true, /// the message is only deleted from the user's outbox. Otherwise, it is completely delete from the database. /// /// static public void pmessage_delete( object userPMessageID ) { pmessage_delete( userPMessageID, false ); } /// /// Archives the private message of the given id. Archiving moves the message from the user's inbox to his message archive. /// /// The ID of the private message public static void pmessage_archive( object userPMessageID ) { using ( SqlCommand sqlCommand = DBAccess.GetCommand( "pmessage_archive" ) ) { sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.AddWithValue( "UserPMessageID", userPMessageID ); DBAccess.ExecuteNonQuery( sqlCommand ); } } static public void pmessage_save( object fromUserID, object toUserID, object subject, object body, object Flags ) { using ( SqlCommand cmd = DBAccess.GetCommand( "pmessage_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "FromUserID", fromUserID ); cmd.Parameters.AddWithValue( "ToUserID", toUserID ); cmd.Parameters.AddWithValue( "Subject", subject ); cmd.Parameters.AddWithValue( "Body", body ); cmd.Parameters.AddWithValue( "Flags", Flags ); DBAccess.ExecuteNonQuery( cmd ); } } static public void pmessage_markread( object userPMessageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "pmessage_markread" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserPMessageID", userPMessageID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable pmessage_info() { using ( SqlCommand cmd = DBAccess.GetCommand( "pmessage_info" ) ) { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData( cmd ); } } static public void pmessage_prune( object daysRead, object daysUnread ) { using ( SqlCommand cmd = DBAccess.GetCommand( "pmessage_prune" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "DaysRead", daysRead ); cmd.Parameters.AddWithValue( "DaysUnread", daysUnread ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Poll static public DataTable poll_stats( object pollID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "poll_stats" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "PollID", pollID ); return DBAccess.GetData( cmd ); } } static public int poll_save(object question, object c1, object c2, object c3, object c4, object c5, object c6, object c7, object c8, object c9, object closes) { using ( SqlCommand cmd = DBAccess.GetCommand( "poll_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Question", question ); cmd.Parameters.AddWithValue( "Choice1", c1 ); cmd.Parameters.AddWithValue( "Choice2", c2 ); cmd.Parameters.AddWithValue( "Choice3", c3 ); cmd.Parameters.AddWithValue( "Choice4", c4 ); cmd.Parameters.AddWithValue( "Choice5", c5 ); cmd.Parameters.AddWithValue( "Choice6", c6 ); cmd.Parameters.AddWithValue( "Choice7", c7 ); cmd.Parameters.AddWithValue( "Choice8", c8 ); cmd.Parameters.AddWithValue( "Choice9", c9 ); cmd.Parameters.AddWithValue("Closes", closes); return ( int )DBAccess.ExecuteScalar( cmd ); } } static public void poll_update(object pollID, object question, object closes) { using (SqlCommand cmd = DBAccess.GetCommand("poll_update")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("PollID", pollID); cmd.Parameters.AddWithValue("Question", question); cmd.Parameters.AddWithValue("Closes", closes); DBAccess.ExecuteNonQuery(cmd); } } static public void poll_remove(object pollID) { using (SqlCommand cmd = DBAccess.GetCommand("poll_remove")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("PollID", pollID); DBAccess.ExecuteNonQuery(cmd); } } static public void choice_delete(object choiceID) { using (SqlCommand cmd = DBAccess.GetCommand("choice_delete")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("ChoiceID", choiceID); DBAccess.ExecuteNonQuery(cmd); } } static public void choice_update(object choiceID, object choice) { using (SqlCommand cmd = DBAccess.GetCommand("choice_update")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("ChoiceID", choiceID); cmd.Parameters.AddWithValue("Choice", choice); DBAccess.ExecuteNonQuery(cmd); } } static public void choice_add(object pollID, object choice) { using (SqlCommand cmd = DBAccess.GetCommand("choice_add")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("PollID", pollID); cmd.Parameters.AddWithValue("Choice", choice); DBAccess.ExecuteNonQuery(cmd); } } #endregion #region yaf_Rank static public DataTable rank_list( object boardID, object rankID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "rank_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "RankID", rankID ); return DBAccess.GetData( cmd ); } } static public void rank_save( object rankID, object boardID, object name, object isStart, object isLadder, object minPosts, object rankImage ) { using ( SqlCommand cmd = DBAccess.GetCommand( "rank_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "RankID", rankID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "IsStart", isStart ); cmd.Parameters.AddWithValue( "IsLadder", isLadder ); cmd.Parameters.AddWithValue( "MinPosts", minPosts ); cmd.Parameters.AddWithValue( "RankImage", rankImage ); DBAccess.ExecuteNonQuery( cmd ); } } static public void rank_delete( object rankID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "rank_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "RankID", rankID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Smiley static public DataTable smiley_list( object boardID, object smileyID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "smiley_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "SmileyID", smileyID ); return DBAccess.GetData( cmd ); } } static public DataTable smiley_listunique( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "smiley_listunique" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); return DBAccess.GetData( cmd ); } } static public void smiley_delete( object smileyID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "smiley_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "SmileyID", smileyID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void smiley_save( object smileyID, object boardID, object code, object icon, object emoticon, object sortOrder, object replace ) { using ( SqlCommand cmd = DBAccess.GetCommand( "smiley_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "SmileyID", smileyID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Code", code ); cmd.Parameters.AddWithValue( "Icon", icon ); cmd.Parameters.AddWithValue( "Emoticon", emoticon ); cmd.Parameters.AddWithValue( "SortOrder", sortOrder ); cmd.Parameters.AddWithValue( "Replace", replace ); DBAccess.ExecuteNonQuery( cmd ); } } static public void smiley_resort( object boardID, object smileyID, int move ) { using ( SqlCommand cmd = DBAccess.GetCommand( "smiley_resort" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "SmileyID", smileyID ); cmd.Parameters.AddWithValue( "Move", move ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_BBCode static public DataTable bbcode_list( object boardID, object bbcodeID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "bbcode_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "BBCodeID", bbcodeID ); return DBAccess.GetData( cmd ); } } static public void bbcode_delete( object bbcodeID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "bbcode_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BBCodeID", bbcodeID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void bbcode_save( object bbcodeID, object boardID, object name, object description, object onclickjs, object displayjs, object editjs, object displaycss, object searchregex, object replaceregex, object variables, object usemodule, object moduleclass, object execorder ) { using ( SqlCommand cmd = DBAccess.GetCommand( "bbcode_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BBCodeID", bbcodeID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Description", description ); cmd.Parameters.AddWithValue( "OnClickJS", onclickjs ); cmd.Parameters.AddWithValue( "DisplayJS", displayjs ); cmd.Parameters.AddWithValue( "EditJS", editjs ); cmd.Parameters.AddWithValue( "DisplayCSS", displaycss ); cmd.Parameters.AddWithValue( "SearchRegEx", searchregex ); cmd.Parameters.AddWithValue( "ReplaceRegEx", replaceregex ); cmd.Parameters.AddWithValue( "Variables", variables ); cmd.Parameters.AddWithValue( "UseModule", usemodule ); cmd.Parameters.AddWithValue( "ModuleClass", moduleclass ); cmd.Parameters.AddWithValue( "ExecOrder", execorder ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_Registry /// /// Retrieves entries in the board settings registry /// /// Use to specify return of specific entry only. Setting this to null returns all entries. /// DataTable filled will registry entries static public DataTable registry_list( object name, object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "registry_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "BoardID", boardID ); return DBAccess.GetData( cmd ); } } /// /// Retrieves entries in the board settings registry /// /// Use to specify return of specific entry only. Setting this to null returns all entries. /// DataTable filled will registry entries static public DataTable registry_list( object name ) { return registry_list( name, null ); } /// /// Retrieves all the entries in the board settings registry /// /// DataTable filled will all registry entries static public DataTable registry_list() { return registry_list( null, null ); } /// /// Saves a single registry entry pair to the database. /// /// Unique name associated with this entry /// Value associated with this entry which can be null static public void registry_save( object name, object value ) { using ( SqlCommand cmd = DBAccess.GetCommand( "registry_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Value", value ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Saves a single registry entry pair to the database. /// /// Unique name associated with this entry /// Value associated with this entry which can be null /// The BoardID for this entry static public void registry_save( object name, object value, object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "registry_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Value", value ); cmd.Parameters.AddWithValue( "BoardID", boardID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_System /// /// Not in use anymore. Only required for old database versions. /// /// static public DataTable system_list() { using ( SqlCommand cmd = DBAccess.GetCommand( "system_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData( cmd ); } } #endregion #region yaf_Topic static public void topic_poll_update(object topicID, object messageID, object pollID) { using (SqlCommand cmd = DBAccess.GetCommand("topic_poll_update")) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("TopicID", topicID); cmd.Parameters.AddWithValue("MessageID", messageID); cmd.Parameters.AddWithValue("PollID", pollID); DBAccess.ExecuteNonQuery(cmd); } } static public int topic_prune(object forumID, object days) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_prune" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "Days", days ); return ( int )DBAccess.ExecuteScalar( cmd ); } } static public DataTable topic_list( object forumID, object userId, object announcement, object date, object offset, object count ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "UserID", userId ); cmd.Parameters.AddWithValue( "Announcement", announcement ); cmd.Parameters.AddWithValue( "Date", date ); cmd.Parameters.AddWithValue( "Offset", offset ); cmd.Parameters.AddWithValue( "Count", count ); return DBAccess.GetData( cmd ); } } /// /// Lists topics very simply (for URL rewriting) /// /// /// /// static public DataTable topic_simplelist( int StartID, int Limit ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_simplelist" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "StartID", StartID ); cmd.Parameters.AddWithValue( "Limit", Limit ); return DBAccess.GetData( cmd ); } } static public void topic_move( object topicID, object forumID, object showMoved ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_move" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "ShowMoved", showMoved ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable topic_announcements( object boardID, object numOfPostsToRetrieve, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_announcements" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "NumPosts", numOfPostsToRetrieve ); cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public DataTable topic_latest( object boardID, object numOfPostsToRetrieve, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_latest" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "NumPosts", numOfPostsToRetrieve ); cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public DataTable topic_active( object boardID, object userID, object since, object categoryID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_active" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Since", since ); cmd.Parameters.AddWithValue( "CategoryID", categoryID ); return DBAccess.GetData( cmd ); } } //ABOT NEW 16.04.04:Delete all topic's messages static private void topic_deleteAttachments( object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_listmessages" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { foreach ( DataRow row in dt.Rows ) { message_deleteRecursively( row ["MessageID"], true, "", 0, true, false ); } } } } // Ederon : 12/9/2007 static public void topic_delete( object topicID ) { topic_delete( topicID, false ); } static public void topic_delete( object topicID, object eraseTopic ) { //ABOT CHANGE 16.04.04 topic_deleteAttachments( topicID ); //END ABOT CHANGE 16.04.04 using ( SqlCommand cmd = DBAccess.GetCommand( "topic_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "EraseTopic", eraseTopic ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable topic_findprev( object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_findprev" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); return DBAccess.GetData( cmd ); } } static public DataTable topic_findnext( object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_findnext" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); return DBAccess.GetData( cmd ); } } static public void topic_lock( object topicID, object locked ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_lock" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "Locked", locked ); DBAccess.ExecuteNonQuery( cmd ); } } static public long topic_save( object forumID, object subject, object message, object userID, object priority, object pollID, object userName, object ip, object posted, object blogPostID, object flags, ref long messageID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "Subject", subject ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Message", message ); cmd.Parameters.AddWithValue( "Priority", priority ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "IP", ip ); cmd.Parameters.AddWithValue( "PollID", pollID ); cmd.Parameters.AddWithValue( "Posted", posted ); cmd.Parameters.AddWithValue( "BlogPostID", blogPostID ); cmd.Parameters.AddWithValue( "Flags", flags ); DataTable dt = DBAccess.GetData( cmd ); messageID = long.Parse( dt.Rows [0] ["MessageID"].ToString() ); return long.Parse( dt.Rows [0] ["TopicID"].ToString() ); } } static public DataRow topic_info( object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "topic_info" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); using ( DataTable dt = DBAccess.GetData( cmd ) ) { if ( dt.Rows.Count > 0 ) return dt.Rows [0]; else return null; } } } #endregion #region yaf_ReplaceWords // rico : replace words / begin /// /// Gets a list of replace words /// /// DataTable with replace words static public DataTable replace_words_list( object boardId, object id ) { using ( SqlCommand cmd = DBAccess.GetCommand( "replace_words_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardId ); cmd.Parameters.AddWithValue( "ID", id ); return DBAccess.GetData( cmd ); } } /// /// Saves changs to a words /// /// ID of bad/good word /// bad word /// good word static public void replace_words_save( object boardId, object id, object badword, object goodword ) { using ( SqlCommand cmd = DBAccess.GetCommand( "replace_words_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ID", id ); cmd.Parameters.AddWithValue( "BoardID", boardId ); cmd.Parameters.AddWithValue( "badword", badword ); cmd.Parameters.AddWithValue( "goodword", goodword ); DBAccess.ExecuteNonQuery( cmd ); } } /// /// Deletes a bad/good word /// /// ID of bad/good word to delete static public void replace_words_delete( object ID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "replace_words_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ID", ID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_User static public DataTable user_list( object boardID, object userID, object approved ) { return user_list( boardID, userID, approved, null, null ); } static public DataTable user_list( object boardID, object userID, object approved, object groupID, object rankID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Approved", approved ); cmd.Parameters.AddWithValue( "GroupID", groupID ); cmd.Parameters.AddWithValue( "RankID", rankID ); return DBAccess.GetData( cmd ); } } /// /// For URL Rewriting /// /// /// /// static public DataTable user_simplelist( int StartID, int Limit ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_simplelist" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "StartID", StartID ); cmd.Parameters.AddWithValue( "Limit", Limit ); return DBAccess.GetData( cmd ); } } static public void user_delete( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_setrole( int boardID, object providerUserKey, object role ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_setrole" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "ProviderUserKey", providerUserKey ); cmd.Parameters.AddWithValue( "Role", role ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_setinfo( int boardID, System.Web.Security.MembershipUser user ) { using ( SqlCommand cmd = DBAccess.GetCommand( "update {databaseOwner}.{objectQualifier}User set Name=@UserName,Email=@Email where BoardID=@BoardID and ProviderUserKey=@ProviderUserKey", true ) ) { cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue( "UserName", user.UserName ); cmd.Parameters.AddWithValue( "Email", user.Email ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "ProviderUserKey", user.ProviderUserKey ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_migrate( object userID, object providerUserKey, object updateProvider ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_migrate" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "ProviderUserKey", providerUserKey ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "UpdateProvider", updateProvider ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_deleteold( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_deleteold" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_approve( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_approve" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_approveall( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_approveall" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_suspend( object userID, object suspend ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_suspend" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Suspend", suspend ); DBAccess.ExecuteNonQuery( cmd ); } } static public bool user_changepassword( object userID, object oldPassword, object newPassword ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_changepassword" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "OldPassword", oldPassword ); cmd.Parameters.AddWithValue( "NewPassword", newPassword ); return ( bool )DBAccess.ExecuteScalar( cmd ); } } static public int user_pmcount( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_pmcount" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return ( int )DBAccess.ExecuteScalar( cmd ); } } static public void user_save( object userID, object boardID, object userName, object email, object timeZone, object languageFile, object themeFile, object overrideDefaultThemes, object approved, object pmNotification ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "Email", email ); cmd.Parameters.AddWithValue( "TimeZone", timeZone ); cmd.Parameters.AddWithValue( "LanguageFile", languageFile ); cmd.Parameters.AddWithValue( "ThemeFile", themeFile ); cmd.Parameters.AddWithValue( "OverrideDefaultTheme", overrideDefaultThemes ); cmd.Parameters.AddWithValue( "Approved", approved ); cmd.Parameters.AddWithValue( "PMNotification", pmNotification ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_adminsave( object boardID, object userID, object name, object email, object flags, object rankID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_adminsave" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Email", email ); cmd.Parameters.AddWithValue( "Flags", flags ); cmd.Parameters.AddWithValue( "RankID", rankID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable user_emails( object boardID, object groupID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_emails" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "GroupID", groupID ); return DBAccess.GetData( cmd ); } } static public DataTable user_accessmasks( object boardID, object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_accessmasks" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserID", userID ); return userforumaccess_sort_list( DBAccess.GetData( cmd ), 0, 0, 0 ); } } //adds some convenience while editing group's access rights (indent forums) static private DataTable userforumaccess_sort_list( DataTable listSource, int parentID, int categoryID, int startingIndent ) { DataTable listDestination = new DataTable(); listDestination.Columns.Add( "ForumID", typeof( String ) ); listDestination.Columns.Add( "ForumName", typeof( String ) ); //it is uset in two different procedures with different tables, //so, we must add correct columns if ( listSource.Columns.IndexOf( "AccessMaskName" ) >= 0 ) listDestination.Columns.Add( "AccessMaskName", typeof( String ) ); else { listDestination.Columns.Add( "CategoryName", typeof( String ) ); listDestination.Columns.Add( "AccessMaskId", typeof( Int32 ) ); } DataView dv = listSource.DefaultView; userforumaccess_sort_list_recursive( dv.ToTable(), listDestination, parentID, categoryID, startingIndent ); return listDestination; } static private void userforumaccess_sort_list_recursive( DataTable listSource, DataTable listDestination, int parentID, int categoryID, int currentIndent ) { DataRow newRow; foreach ( DataRow row in listSource.Rows ) { // see if this is a root-forum if ( row ["ParentID"] == DBNull.Value ) row ["ParentID"] = 0; if ( ( int )row ["ParentID"] == parentID ) { string sIndent = ""; for ( int j = 0; j < currentIndent; j++ ) sIndent += "--"; // import the row into the destination newRow = listDestination.NewRow(); newRow ["ForumID"] = row ["ForumID"]; newRow ["ForumName"] = string.Format( "{0} {1}", sIndent, row ["ForumName"] ); if ( listDestination.Columns.IndexOf( "AccessMaskName" ) >= 0 ) newRow ["AccessMaskName"] = row ["AccessMaskName"]; else { newRow ["CategoryName"] = row ["CategoryName"]; newRow ["AccessMaskId"] = row ["AccessMaskId"]; } listDestination.Rows.Add( newRow ); // recurse through the list... userforumaccess_sort_list_recursive( listSource, listDestination, ( int )row ["ForumID"], categoryID, currentIndent + 1 ); } } } static public object user_recoverpassword( object boardID, object userName, object email ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_recoverpassword" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "Email", email ); return DBAccess.ExecuteScalar( cmd ); } } static public void user_savepassword( object userID, object password ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_savepassword" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Password", FormsAuthentication.HashPasswordForStoringInConfigFile( password.ToString(), "md5" ) ); DBAccess.ExecuteNonQuery( cmd ); } } static public object user_login( object boardID, object name, object password ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_login" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Name", name ); cmd.Parameters.AddWithValue( "Password", password ); return DBAccess.ExecuteScalar( cmd ); } } static public DataTable user_avatarimage( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_avatarimage" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public int user_get( int boardID, object providerUserKey ) { using ( SqlCommand cmd = DBAccess.GetCommand( "select UserID from {databaseOwner}.{objectQualifier}User where BoardID=@BoardID and ProviderUserKey=@ProviderUserKey", true ) ) { cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "ProviderUserKey", providerUserKey ); return ( int )DBAccess.ExecuteScalar( cmd ); } } static public DataTable user_find( object boardID, bool filter, object userName, object email ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_find" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "Filter", filter ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "Email", email ); return DBAccess.GetData( cmd ); } } static public string user_getsignature( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_getsignature" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.ExecuteScalar( cmd ).ToString(); } } static public void user_savesignature( object userID, object signature ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_savesignature" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Signature", signature ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_saveavatar( object userID, object avatar, System.IO.Stream stream, object avatarImageType ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_saveavatar" ) ) { byte [] data = null; if ( stream != null ) { data = new byte [stream.Length]; stream.Seek( 0, System.IO.SeekOrigin.Begin ); stream.Read( data, 0, ( int )stream.Length ); } cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Avatar", avatar ); cmd.Parameters.AddWithValue( "AvatarImage", data ); cmd.Parameters.AddWithValue( "AvatarImageType", avatarImageType ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_deleteavatar( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_deleteavatar" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); DBAccess.ExecuteNonQuery( cmd ); } } static public bool user_register( object boardID, object userName, object password, object hash, object email, object location, object homePage, object timeZone, bool approved ) { using ( YafDBConnManager connMan = new YafDBConnManager() ) { using ( SqlTransaction trans = connMan.OpenDBConnection.BeginTransaction( DBAccess.IsolationLevel ) ) { try { using ( SqlCommand cmd = DBAccess.GetCommand( "user_save", connMan.DBConnection ) ) { cmd.Transaction = trans; cmd.CommandType = CommandType.StoredProcedure; int UserID = 0; cmd.Parameters.AddWithValue( "UserID", UserID ); cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "Password", FormsAuthentication.HashPasswordForStoringInConfigFile( password.ToString(), "md5" ) ); cmd.Parameters.AddWithValue( "Email", email ); cmd.Parameters.AddWithValue( "Hash", hash ); cmd.Parameters.AddWithValue( "Location", location ); cmd.Parameters.AddWithValue( "HomePage", homePage ); cmd.Parameters.AddWithValue( "TimeZone", timeZone ); cmd.Parameters.AddWithValue( "Approved", approved ); cmd.Parameters.AddWithValue( "PMNotification", 1 ); cmd.ExecuteNonQuery(); } trans.Commit(); } catch ( Exception x ) { trans.Rollback(); YAF.Classes.Data.DB.eventlog_create( null, "user_register in YAF.Classes.Data.DB.cs", x, EventLogTypes.Error ); return false; } } } return true; } static public int user_aspnet( int boardID, string userName, string email, object providerUserKey, object isApproved ) { try { using ( SqlCommand cmd = DBAccess.GetCommand( "user_aspnet" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "Email", email ); cmd.Parameters.AddWithValue( "ProviderUserKey", providerUserKey ); cmd.Parameters.AddWithValue( "IsApproved", isApproved ); return ( int )DBAccess.ExecuteScalar( cmd ); } } catch ( Exception x ) { YAF.Classes.Data.DB.eventlog_create( null, "user_aspnet in YAF.Classes.Data.DB.cs", x, EventLogTypes.Error ); return 0; } } static public int user_guest( object boardID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_guest" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); return ( int )DBAccess.ExecuteScalar( cmd ); } } static public DataTable user_activity_rank( object boardID, object startDate, object displayNumber ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_activity_rank" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "StartDate", startDate ); cmd.Parameters.AddWithValue( "DisplayNumber", displayNumber ); return DBAccess.GetData( cmd ); } } static public int user_nntp( object boardID, object userName, object email ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_nntp" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "BoardID", boardID ); cmd.Parameters.AddWithValue( "UserName", userName ); cmd.Parameters.AddWithValue( "Email", email ); return ( int )DBAccess.ExecuteScalar( cmd ); } } static public void user_addpoints( object userID, object points ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_addpoints" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Points", points ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_removepointsByTopicID( object topicID, object points ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_removepointsbytopicid" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "TopicID", topicID ); cmd.Parameters.AddWithValue( "Points", points ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_removepoints( object userID, object points ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_removepoints" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Points", points ); DBAccess.ExecuteNonQuery( cmd ); } } static public void user_setpoints( object userID, object points ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_setpoints" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "Points", points ); DBAccess.ExecuteNonQuery( cmd ); } } static public int user_getpoints( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "user_getpoints" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return ( int )DBAccess.ExecuteScalar( cmd ); } } #endregion #region yaf_UserForum static public DataTable userforum_list( object userID, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "userforum_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } static public void userforum_delete( object userID, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "userforum_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void userforum_save( object userID, object forumID, object accessMaskID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "userforum_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); cmd.Parameters.AddWithValue( "AccessMaskID", accessMaskID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_UserGroup static public DataTable usergroup_list( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "usergroup_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public void usergroup_save( object userID, object groupID, object member ) { using ( SqlCommand cmd = DBAccess.GetCommand( "usergroup_save" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "GroupID", groupID ); cmd.Parameters.AddWithValue( "Member", member ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_WatchForum static public void watchforum_add( object userID, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchforum_add" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); DBAccess.ExecuteNonQuery( cmd ); } } static public DataTable watchforum_list( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchforum_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public DataTable watchforum_check( object userID, object forumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchforum_check" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "ForumID", forumID ); return DBAccess.GetData( cmd ); } } static public void watchforum_delete( object watchForumID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchforum_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "WatchForumID", watchForumID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion #region yaf_WatchTopic static public DataTable watchtopic_list( object userID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchtopic_list" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); return DBAccess.GetData( cmd ); } } static public DataTable watchtopic_check( object userID, object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchtopic_check" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "TopicID", topicID ); return DBAccess.GetData( cmd ); } } static public void watchtopic_delete( object watchTopicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchtopic_delete" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "WatchTopicID", watchTopicID ); DBAccess.ExecuteNonQuery( cmd ); } } static public void watchtopic_add( object userID, object topicID ) { using ( SqlCommand cmd = DBAccess.GetCommand( "watchtopic_add" ) ) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue( "UserID", userID ); cmd.Parameters.AddWithValue( "TopicID", topicID ); DBAccess.ExecuteNonQuery( cmd ); } } #endregion } } and for errors i get things like.... Error 1 Member modifier 'static' must precede the member type and name C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YAF.Classes\YAF.Classes.Data\DB.cs 287 3 YAF.Classes.Data Error 2 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 6 Error 3 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 11 Error 4 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 15 Error 5 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 29 Error 6 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 39 Error 7 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 49 Error 8 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumIconLegend.ascx 6 Error 9 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumIconLegend.ascx 7 Error 10 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumIconLegend.ascx 9 Error 11 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumIconLegend.ascx 10 Error 12 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumIconLegend.ascx 12 Error 13 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumIconLegend.ascx 13 Error 14 Unknown server tag 'asp:UpdatePanel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 3 Error 15 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 9 Error 16 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 16 Error 17 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 21 Error 18 Unknown server tag 'YAF:ActiveUsers'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 28 Error 19 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 33 Error 20 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 38 Error 21 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 43 Error 22 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumStatistics.ascx 49 Error 23 Unknown server tag 'asp:UpdatePanel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumActiveDiscussion.ascx 3 Error 24 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumActiveDiscussion.ascx 8 Error 25 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumActiveDiscussion.ascx 15 Error 26 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumActiveDiscussion.ascx 23 Error 27 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumActiveDiscussion.ascx 24 Error 28 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumActiveDiscussion.ascx 30 Error 29 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersSignature.ascx 10 Error 30 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersSignature.ascx 13 Error 31 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 7 Error 32 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 17 Error 33 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 22 Error 34 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 24 Error 35 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 26 Error 36 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 28 Error 37 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 30 Error 38 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 32 Error 39 Unknown server tag 'YAF:MessagePostData'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 45 Error 40 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 52 Error 41 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 59 Error 42 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 61 Error 43 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 63 Error 44 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 65 Error 45 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 67 Error 46 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 69 Error 47 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 71 Error 48 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 73 Error 49 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 75 Error 50 Unknown server tag 'YAF:PopMenu'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayPost.ascx 92 Error 51 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumLastPost.ascx 7 Error 52 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumLastPost.ascx 11 Error 53 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumLastPost.ascx 12 Error 54 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumLastPost.ascx 12 Error 55 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumLastPost.ascx 15 Error 56 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\smileys.ascx 9 Error 57 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 6 Error 58 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 12 Error 59 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 19 Error 60 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 27 Error 61 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 35 Error 62 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 43 Error 63 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 52 Error 64 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 59 Error 65 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 68 Error 66 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 75 Error 67 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 83 Error 68 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 93 Error 69 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 100 Error 70 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 108 Error 71 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 111 Error 72 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 119 Error 73 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 129 Error 74 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 136 Error 75 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 144 Error 76 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 152 Error 77 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 160 Error 78 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 168 Error 79 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 177 Error 80 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 184 Error 81 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 193 Error 82 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 200 Error 83 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 208 Error 84 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 217 Error 85 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 225 Error 86 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 234 Error 87 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersProfile.ascx 240 Error 88 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ProfileYourAccount.ascx 7 Error 89 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ProfileYourAccount.ascx 12 Error 90 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ProfileYourAccount.ascx 21 Error 91 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ProfileYourAccount.ascx 28 Error 92 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ProfileYourAccount.ascx 35 Error 93 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ProfileYourAccount.ascx 50 Error 94 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersSuspend.ascx 6 Error 95 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersSuspend.ascx 11 Error 96 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersSuspend.ascx 20 Error 97 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayAd.ascx 6 Error 98 Unknown server tag 'YAF:MessagePost'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayAd.ascx 19 Error 99 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\DisplayAd.ascx 26 Error 100 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumSubForumList.ascx 5 Error 101 Unknown server tag 'YAF:ThemeImage'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumSubForumList.ascx 8 Error 102 Unknown server tag 'asp:Timer'. controls/ShoutBox.ascx Error 103 Unknown server tag 'asp:UpdatePanel'. controls/ShoutBox.ascx Error 104 Unknown server tag 'asp:UpdatePanel'. controls/ShoutBox.ascx Error 105 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\ForumModeratorList.ascx 6 Error 106 Unknown server tag 'YAF:Pager'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\PMList.ascx 4 Error 107 Unknown server tag 'YAF:UserLink'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\PMList.ascx 25 Error 108 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\PMList.ascx 55 Error 109 Unknown server tag 'YAF:ThemeButton'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\PMList.ascx 57 Error 110 Unknown server tag 'YAF:Pager'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\PMList.ascx 65

Posted by: midwestSS - Monday, 10 November 2008 20:19:43
That was my db.cs following your directions. i hate compiling

Posted by: mdlesk - Monday, 10 November 2008 20:28:29
Remove the Sho: #region DLESKTECH_ShoutBox public static DataTable DLESKTECH_ShoutBox_GetMessages() { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_GetMessages") { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData(cmd); } } public static bool DLESKTECH_ShoutBox_SaveMessage(string message,string usernName,int userID, object ip) { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_SaveMessage") { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("UserName", usernName); cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("IP", ip); DBAccess.ExecuteNonQuery(cmd); return true; } } [b]Sho[/b] #endregion

Posted by: vash - Tuesday, 11 November 2008 04:15:15
It seems that the download file for ShoutBox v 1.1.0.2.zip is corrupted. :(

Posted by: mdlesk - Tuesday, 11 November 2008 04:27:57
Try the one attached to this post.

Posted by: midwestSS - Tuesday, 11 November 2008 04:44:48
[quote=mdlesk]Remove the Sho: #region DLESKTECH_ShoutBox public static DataTable DLESKTECH_ShoutBox_GetMessages() { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_GetMessages") { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData(cmd); } } public static bool DLESKTECH_ShoutBox_SaveMessage(string message,string usernName,int userID, object ip) { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_SaveMessage") { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("UserName", usernName); cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("IP", ip); DBAccess.ExecuteNonQuery(cmd); return true; } } [b]Sho[/b] #endregion[/quote] thanks! that did help. knocked down the number of errors from 121 down to 109. the YAF.Classes.Data.dll looks like it rebuilt, is that the only .dll file that is supposed to rebuilt for this mod?

Posted by: midwestSS - Tuesday, 11 November 2008 04:46:48
[quote=mdlesk]Remove the Sho: #region DLESKTECH_ShoutBox public static DataTable DLESKTECH_ShoutBox_GetMessages() { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_GetMessages") { cmd.CommandType = CommandType.StoredProcedure; return DBAccess.GetData(cmd); } } public static bool DLESKTECH_ShoutBox_SaveMessage(string message,string usernName,int userID, object ip) { using (SqlCommand cmd = DBAccess.GetCommand("DLESKTECH_ShoutBox_SaveMessage") { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("Message", message); cmd.Parameters.AddWithValue("UserName", usernName); cmd.Parameters.AddWithValue("UserID", userID); cmd.Parameters.AddWithValue("IP", ip); DBAccess.ExecuteNonQuery(cmd); return true; } } [b]Sho[/b] #endregion[/quote] thanks! that did help. knocked down the number of errors from 121 down to 109. the YAF.Classes.Data.dll looks like it rebuilt, is that the only .dll file that is supposed to rebuilt for this mod?

Posted by: vash - Tuesday, 11 November 2008 04:49:27
It still has the same problem :(

Posted by: midwestSS - Tuesday, 11 November 2008 17:34:58
oh well, I give up. I tried installing VS 2005 SP1, and it keeps telling me I cant open the project, the application is not installed.. yada yada yada.. blah blah blah... I installed VS 2008, i can open the project, but when i try to build it... Error 1 Unknown server tag 'YAF:LocalizedLabel'. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\controls\EditUsersAvatar.ascx 6 i get 109 errors like that.

Posted by: mdlesk - Tuesday, 11 November 2008 18:27:25
Make sure you copied one of the webconfig files from the webconfig directory to the root of the web application. Rename it to web.config and all it should build fine. Without this step, nothing will build as it contains all of the references.

Posted by: mdlesk - Tuesday, 11 November 2008 18:30:55
You can try downloading from this location: [url=http://www.dlesktech.com/dlesktech/products/]DLESKTECH ShoutBox[/url]

Posted by: midwestSS - Tuesday, 11 November 2008 18:31:19
thanks! getting closer Error 1 The file '/YetAnotherForum.NET/pages/ShoutBox.ascx.cs' does not exist. C:\Documents and Settings\me\Desktop\yaf\YAF-v1.9.3-RC2-SRC\YetAnotherForum.NET\pages\ShoutBox.ascx 1

Posted by: midwestSS - Tuesday, 11 November 2008 18:48:31
ok i tried it again, and it looks like all the dll files rebuilt. do i need to re copy all the new dll's in place, or just one, two, etc? i only got one error about it mismatching what was in my temp files, but it completed the build.

Posted by: mdlesk - Tuesday, 11 November 2008 18:56:06
Can you post what you have in your Forum.ASCX file? The reference to DLESKTECH control should not be pointing to the pages directory.

Posted by: midwestSS - Tuesday, 11 November 2008 19:04:11
sure. i thought i had it right. so i was gonna load it on the site. i went to run the sql script, which is where im usually much better, but i got these errors. im loopy this late at night right now..so.. Msg 170, Level 15, State 1, Line 11 Line 11: Incorrect syntax near '('. Msg 170, Level 15, State 1, Procedure yaf_DLESKTECH_ShoutBox_GetMessages, Line 3 Line 3: Incorrect syntax near '('. <%@ Register TagPrefix="YAF" TagName="ForumActiveDiscussion" Src="../controls/ForumActiveDiscussion.ascx" %> is what i had in that file btw

Posted by: vash - Wednesday, 12 November 2008 04:54:30
how can I make the smileys work? the hyperlink is already working :)

Posted by: mdlesk - Wednesday, 12 November 2008 05:08:39
[quote=vash]how can I make the smileys work? the hyperlink is already working :) [/quote] Can you send me a screenshot of what your shoutbox looks like. So I can see the exact issue.

Posted by: vash - Wednesday, 12 November 2008 05:29:05
Hi, I was able to display the smilies. I just changed the following code [code][/code] to this one [code] [/code] The smileys are now displayed on the upper panel. Now my problem is if I click any of the smileys, the corresponding text is not written in the text box. So I have to know by heart the equivalent text value and manually type it in the text box.

Posted by: midwestSS - Wednesday, 12 November 2008 07:09:51
ok i got it working!! yay! ok BUT.. i wanted to cut down the amount of smilies shown cuz it was hideous. made my shoutbox look SILLY. www.silveradoss.net check it out.. how can i get rid of all those extra smiley boxes??? i changed the shoutbox.ascx file to point to another location for smiley files and only put a few smilies in there.

Posted by: midwestSS - Wednesday, 12 November 2008 10:42:00
1) Thank you so much for this!! 2) can i turn off the smileys from showing on the shoutbox 3) How does one add a refresh button? each attempt i tried rendered the forum useles and i had to back out. 4) Can I apply access masks to the shoutbox so you have to be a member to READ it?

Posted by: midwestSS - Wednesday, 12 November 2008 19:10:03
i dont know if I compiled something incorrectly, or what, BUT.. with this shoutbox you can use the forum tags for things like IMG to display images in posts.. but as soon as people start doing that, you start gettting errors in the browser... out of memory at line .......... type messages. so you all tell me.. did i compile wrong? if i did, can someone upload properly compiled .dll files? one more suggestion? YAF allows you to prune messages or forums... it would be ideal to also add a control into the admin section to allow you to prune the messages in the shoutbox, instead of going into the database's table like i did to clean it out.

Posted by: mdlesk - Wednesday, 12 November 2008 19:16:33
I am currently rewriting the control to be purely compiled in a DLL. The only thing that will be necessary is to create the DB items in SQL and add the references to the page. It should equal to about 4 lines of code total. By the way the next version will have admin controls to perform advanced functionality. It might be a few days before I can get it released though.

Posted by: mdlesk - Wednesday, 12 November 2008 19:19:35
A refresh button is not necessary as it has a timer that reloads every 3 seconds. It may not look like it is reloading, but I designed it that way. Another thing is that the smilies only work in IE right now. I will be implemented some changes in the very near future to correct a lot of the issues. The smilies is a repeater control so as of right now it cannot be limited; but that functionality will be added in the next release.

Posted by: vash - Thursday, 13 November 2008 03:31:41
Hi Bro... tagging of Smilies are not working even in IE. :cry:

Posted by: midwestSS - Thursday, 13 November 2008 04:48:36
mdlesk, thanks for your hard work on this shoutbox.. i love it so far.. like i said, i THINK maybe I re compiled something wrong, OR... maybe something else is odd with me getting those out of memory issues if someone posts pics in the shoutbox.. i like that people can do that, but im wondering if that functionality causes that error, or if my compiling is in error and causing it.. i wait on baited breath for your release, sir... (also cant wait to see what you write for the gallery addin....) the smilies, why do they look at the entire YAF smiley gallery, when the code specifies a location? I had to remove about 100 smilies from my forum cuz the shoutbox put about 100 red X boxes up there and again caused out of memory issues.

Posted by: vash - Thursday, 13 November 2008 04:50:47
Hi, How can you post pictures in the shoutbox?

Posted by: mdlesk - Thursday, 13 November 2008 05:32:51
The shoutbox supports html. Just use

Posted by: midwestSS - Thursday, 13 November 2008 05:42:52
or, [ img ] [ / img ] tags like you do in the forum posts.

Posted by: vash - Thursday, 13 November 2008 06:27:08
:) tnx... I got the images working now :) the smileys are working if you manually type in the corresponding text... but if you click the smiley image, nothing happens. This is both for IE and FireFox

Posted by: mdlesk - Thursday, 13 November 2008 06:57:16
I am work right now, but I will look at this tonight. Make sure that javascript is enabled.

Posted by: vash - Thursday, 13 November 2008 07:21:47
[quote=mdlesk]I am work right now, but I will look at this tonight. Make sure that javascript is enabled.[/quote] Javascript is enabled dude :) I'll just wait for the update... I also found out that you can also embed a video but the 3 second refresh rate keeps videos on a start loop.

Posted by: midwestSS - Thursday, 13 November 2008 08:57:25
java script enabled in your own browser? mine is enabled as well, and I am having the same issue as Vash.. Vash you joined my forum, and i think im having the same issue on mine as you have on yours. i patiently wait as well. mdlesk, you really have done a nice job with this, and like every 1.0.x release.. issues are found, and dummies like me make mistakes. again, nice job so far

Posted by: mdlesk - Thursday, 13 November 2008 11:08:53
Version 2.0.0 should be complete and released tonight after I do some testing.

Posted by: vash - Thursday, 13 November 2008 14:14:43
very nice.... :-d

Posted by: mdlesk - Thursday, 13 November 2008 19:05:05
I am experiencing some issues with the timer taking some actions on the text bxo so I won't be able to release tonight. Once I get this issue resolved everything should be stable enough for a release.

Posted by: midwestSS - Thursday, 13 November 2008 19:07:43
patience is what guides us... we appreciate the work you're doing.. btw, let me know what you think of my implementation at www.silveradoss.net ok?

Posted by: mdlesk - Thursday, 13 November 2008 19:14:55
[quote=midwestSS]patience is what guides us... we appreciate the work you're doing.. btw, let me know what you think of my implementation at www.silveradoss.net ok?[/quote] Very nice...You'll especially enjoy the new attribute features that I am implementing. I love auto forums...keep up the good work.

Posted by: midwestSS - Thursday, 13 November 2008 19:16:32
oh now you're makin me drool with anticipation.. LOL

Posted by: mdlesk - Friday, 14 November 2008 19:49:39
I just wanted to provide an update on the status of the control. It's approx. 90% complete. I just need to do some checks on the smilies, such as checking escape characters. Other than that everything is functioning properly. You can expect a release tomorrow, hopefully by noon eastern time.

Posted by: midwestSS - Monday, 17 November 2008 05:25:13
Hey, how's it going? just checking in on the progress..no pressures

Posted by: mdlesk - Monday, 17 November 2008 10:13:02
Things were working locally so I decided to deploy to a godaddy server and it's not working on there so tonight I'm going to see what's going on with that.

Posted by: midwestSS - Monday, 17 November 2008 12:24:55
DOH I have a local server that I run my stuff on. i dont use a hosting company. maybe it will work for me. id be happy to be your other tester.

Posted by: vash - Sunday, 23 November 2008 03:07:07
Any News regarding this? :|

Posted by: vash - Tuesday, 25 November 2008 03:13:00
Hi, is it possible to add the shoutbox in a different page other than forum.ascx? I've tried adding it on a new page but could not get the shoutbox to display. Please see attached files Thanks...

Posted by: midwestSS - Tuesday, 25 November 2008 06:08:26
[quote=vash]Any News regarding this? :| [/quote] i know he had some issues running it on a godaddy site. i offered to test it on my local server that i have running sql express so i can test it in a local environment, removing the hosted environment issue(s). he was supposed to send me what he had last weekend, but I hadnt heard from him. I was not going to push the issue since he has done so much for us. my big issue right now is that my smilies dont work properly, and you cant set security on the shoutbox so non members cant see it.. all of which are going to be fixed on his next release.

Posted by: vash - Tuesday, 25 November 2008 23:44:34
aah... the joys of waiting. Just like a father waiting for his laboring wife to deliver their baby :cheesy:

Posted by: midwestSS - Wednesday, 3 December 2008 17:05:18
Update by chance??

Posted by: vash - Tuesday, 9 December 2008 03:02:25
any news on this? :?:

Posted by: continienzo - Friday, 12 December 2008 04:46:48
That doen't work, plus I would like let you all know that there was aready a tagboard posted by me: http://forum.yetanotherforum.net/yaf_postst5925_Tagboardshoutbox-for-yaf-forum.aspx This guys just copied my code taking copyright :evil: and added some stuffs that don't work Plus mine is working fine, and maybe I will realease soon a working version with smilies and with an ajax bugfix that cause randomly error messages alrt... Bye :wink:

Posted by: midwestSS - Friday, 12 December 2008 11:47:05
continezo, will you release yours pre compiled?

Posted by: vash - Saturday, 13 December 2008 03:53:28
[quote=continienzo]That doen't work, plus I would like let you all know that there was aready a tagboard posted by me: http://forum.yetanotherforum.net/yaf_postst5925_Tagboardshoutbox-for-yaf-forum.aspx This guys just copied my code taking copyright :evil: and added some stuffs that don't work Plus mine is working fine, and maybe I will realease soon a working version with smilies and with an ajax bugfix that cause randomly error messages alrt... Bye :wink: [/quote] Ah.. I thought you were comrades since you both presented the same chatbox. So this is the very reason why we never heard again from the other guy :cheesy: Thanks continienzo for clarifying this :wink:

Posted by: midwestSS - Saturday, 27 December 2008 05:10:06
continienzo , do you plan on a new release, pre compliled by chance?

Posted by: midwestSS - Wednesday, 21 January 2009 08:03:19
are these smileys ever going to work on this shoutbox??

Posted by: midwestSS - Tuesday, 12 May 2009 05:31:52
ive been trying to recompile this in the 1.9.3 final release.. trying to compile it and i do not think this one is 1.9.3 final compatible.. or im just an idiot.. [code]Warning 10 The variable 'x' is declared but never used C:\yaf\YAF-v1.9.3-FINAL-SRC\YAF.Classes\YAF.Classes.Utils\Context.cs 941 22 YAF.Classes.Utils Warning 9 The variable 'ex' is declared but never used C:\yaf\YAF-v1.9.3-FINAL-SRC\YAF.Classes\YAF.Classes.Utils\StaticData.cs 51 30 YAF.Classes.Utils Error 8 'YAF.Classes.Data.DB' does not contain a definition for 'DLESKTECH_ShoutBox_GetMessages' C:\yaf\YAF-v1.9.3-FINAL-SRC\YetAnotherForum.NET\controls\ShoutBox.ascx.cs 95 Error 1 Member modifier 'static' must precede the member type and name C:\yaf\YAF-v1.9.3-FINAL-SRC\YAF.Classes\YAF.Classes.Data\DB.cs 172 3 YAF.Classes.Data [/code]

Posted by: EP - Tuesday, 12 May 2009 14:06:01
The DLESKTECH_ShoutBox_GetMessages function needs to be added to the DB.cs file located here: C:\yaf\YAF-v1.9.3-FINAL-SRC\YAF.Classes\YAF.Classes.Data\DB.cs

Posted by: midwestSS - Tuesday, 12 May 2009 17:28:59
i got that part working.. of course the smileys dont work

Posted by: JoeOuts - Wednesday, 17 June 2009 06:44:29
Got it working on my YAF 1.9.3 site. Works Great, Thanks for all the hard work. [url=http://www.clanrampancy.net]Clan Rampancy[/url]

Posted by: midwestSS - Wednesday, 17 June 2009 08:05:22
[quote=JoeOuts]Got it working on my YAF 1.9.3 site. Works Great, Thanks for all the hard work. [url=http://www.clanrampancy.net]Clan Rampancy[/url][/quote] do u have the smileys working in it?

Posted by: JoeOuts - Wednesday, 17 June 2009 09:14:30
I just got it working... :)

Posted by: JoeOuts - Wednesday, 17 June 2009 09:18:49
I had to make a change to: [quote]InsertStringAtCurrentCursorPositionOrOverwriteSelectedText(document.getElementById('forum$ctl01$ctl00$messageTextBox'),code)[/quote] since I am using a MasterPage it looks like this: [quote]InsertStringAtCurrentCursorPositionOrOverwriteSelectedText(document.getElementById('ctl00_ContentPlaceHolder1_forum_ctl01_ShoutBox1_messageTextBox'), code)[/quote] It was also using the Textbox controls Name attribute instead of the ID attribute. notice the underscores instead of the dollar signs. The Name attribute works in IE7 but not IE8 or Firefox Make sure that you have smilies imported into your board from the admin section

Posted by: midwestSS - Wednesday, 17 June 2009 11:33:07
Joe kicks all forms of azz!! thanks so much!! it works in my IE8 btw

Posted by: AsULikeIt - Thursday, 18 June 2009 00:54:48
[quote=JoeOuts]I had to make a change to: [quote]InsertStringAtCurrentCursorPositionOrOverwriteSelectedText(document.getElementById('forum$ctl01$ctl00$messageTextBox'),code)[/quote] since I am using a MasterPage it looks like this: [quote]InsertStringAtCurrentCursorPositionOrOverwriteSelectedText(document.getElementById('ctl00_ContentPlaceHolder1_forum_ctl01_ShoutBox1_messageTextBox'), code)[/quote] It was also using the Textbox controls Name attribute instead of the ID attribute. notice the underscores instead of the dollar signs. The Name attribute works in IE7 but not IE8 or Firefox Make sure that you have smilies imported into your board from the admin section[/quote] I am not able to get the Smilies working.... it gives null is null error... I have applied the final DLESKTECH ShoutBox v 1[1].1.0.2 shoutbox .. Please meed help...

Posted by: JoeOuts - Thursday, 18 June 2009 07:08:23
Ok, I'll make it easy for everyone I hope. I included the dll for people who can't compile the code. //***************************************************************************************************** // Original code by: DLESKTECH at http://www.dlesktech.com/support.aspx // Modifications by: KASL Technologies at www.kasltechnologies.com // Mod date: 6/18/2009 // Mods: working smileys, moved smilies to bottom, added clear button for admin, new stored procedure // Mods: fixed the time to show the viewers time not the server time // Note: clear button removes message more than 24hrs old from db //*****************************************************************************************************

Posted by: linhmuc - Wednesday, 15 July 2009 01:18:28
to enable smiles, login with Admin right, then goto ADMIN --> SMILES -->Add smile (this will add emotion icons to the DB). Import pak file does not insert to DB

Posted by: Zero2Cool - Monday, 5 August 2013 03:17:39
[quote=vash;29527]Hi, is it possible to add the shoutbox in a different page other than forum.ascx? I've tried adding it on a new page but could not get the shoutbox to display. Please see attached files Thanks...[/quote] I have a ASP.NET page with YAF and would like to have the ShoutBox also display in an additional page of my own design. The purpose of this new page would be for users to chat. I'm playing around with the source code trying to figure out how implement the ShoutBox control into an ASPX page on its own. Any help would be appreciated.

Posted by: shachris - Thursday, 11 September 2014 10:59:58
[quote=mdlesk;29072]Yes, a recompile is necessary.[/quote] [color=darkblue][h]Nice[/h][/color]. :cheesy: