Subject: Forum Extensions
Posted By: plb Post Date: 3/10/2007 11:41:38 AM
I have begun making some improvements(?) to TBH forum and comments features. At least some of these changes will be put into production next week. In the meantime I have written an article and posted it on my site under technical. It is a little too long to post here. Also I want to amend it as I go along.

Pat

http://weboperahouse.com
Reply By: englere Reply Date: 3/11/2007 2:26:45 AM
I see you're using the Telerik controls in some places. They are outstanding and highly recommended for anyone who's considering third party controls. They also have a good forum to ask questions when you can't figure something out.

Eric

Reply By: plb Reply Date: 3/11/2007 2:51:02 PM
Yes. When I first started with telerik they were pretty obscure. I have been gratified to see that they are now considered one of the two or three top .NET tool makers.



http://weboperahouse.com
Reply By: plb Reply Date: 3/11/2007 3:31:50 PM
Eric

Do you think spending time on TBH forum is time well spent? If the site is just an illustration of programming techniques that are only good enough to make a teaching point then elaborating the forum is pointless. If however TBH sites are intended to grow and prosper, the forum needs to be more full featured.

If one expected to use TBH code base as a Starter Kit for some web development contracts, paying customers are likely to expect something more than TBH forum. One could make up a site with a Community Server or an ASPPlayground license for only about $1K in license fees. That would only be a part of the total fee for a custom web site project. Maybe that makes more economic sense.

Right now I'm just doing some cosmetic work on TBH forum to make it actually look like a forum. I also have added some thread IDs to the article, poll, video, and singer tables. I have begun writing the PROCs and DAL too. I think I want users to post remarks into a forum thread rather than a comments table. This should yield better seachability.

IMHO the articles orientation of TBH is blog-like with approved authors making formal pronouncements to which the readers only  comment. A portal or a participatory site should be more egalitarian with reader/members writing informal articles without prior approval. This requires a forum orientation.
 
Advice, reactions?

Pat

http://weboperahouse.com
Reply By: iPagan Reply Date: 3/12/2007 4:59:17 AM
I have been looking myself at doing something similar, and also adding sticky topics and the likes, so I will be watching with interest

--

404 real life user not found
Reply By: plb Reply Date: 3/12/2007 3:41:30 PM
I did the first minor update of the forum on my site. I substituted a Data Grid for the stock TBH forum Data List. Obviously this isn't hard to do but I think its worthwhile because the forum now looks more like a forum. The stock TBH forum also requires a custom or semi-custom graphic for each forum topic. Most successful forums have dozens or hundreds of topics.



http://weboperahouse.com
Reply By: englere Reply Date: 3/15/2007 9:44:28 PM
Pat,

It's hard for me to respond to you. I don't want to minimize the value in TBH, but I also have to point out that there are other options, also.

I've just recently had a similar conversation with someone about forums in particular. If you're very serious, and I can see from your site that you are, you should at least consider the Community Server project. That has the best forums of any ASP.NET solution going now, and it can be used for free if you mention their name at the bottom of the pages.

You can also check out YetAnotherForum software. This is much simpler than the Community Server, but still pretty cool.

The TBH forums are basic and they illustrate a lot of good points. I stop short of calling them full-featured, however. Is is worth your time to add dozens of new features, or is it better to start with a more complete forum solution? That's your call.

The Articles are indeed a form of blog. The main disadvantages in a blog that allows responses are that it's a pain to stop the spam robots, and you have to filter inappropriate comments. I prefer making people log in before they reply because that fixes most of the problems with an open blog system.

But the Articles module is probably intended more for publishing than for blogging, so there again it's not a good fit. The Community Server also has a good blog module worth considering.

Eric

Reply By: plb Reply Date: 3/16/2007 12:06:12 PM
Thanks Eric. In fact I had implemented a Community Server forum site a couple months ago. As you know the Community Server software evolved from the ASP Forums that was open source a few years ago. At that time I integrated a forum based on that code into a larger site I was developing. A lot of that site was based on the IBuySpy architecture.

The advantage of writing your own forum is you get a single security/login subsystem. The Community Server forum site I made required a separate login, identity, and password. I know that Community Server sells a module for $600 that integrates logins. Maybe that's the way to go for heavy duty forum sites.

I was intially attracted to The Beer House because it seemed like a very flexible code base with a lot of modules that would allow me to make up a wide variety of sites including "think tank" sites. I am interested in The Beer House as a model for portal web sites on abitrary subjects.

Most of the logic in most forum products resides in the set of stored procedures that inserts counts and totals into thread or forum tables with each post. Therefore it seems easy to enhance a basic forum like that in TBH to something like the behavior of an advanced forum product like Community Server. That's what I'm doing. I'm using my five year old open source ASP Forum based PROCs and database design not the current Community Server design although they are remarkably similar.  

I will document these enhancements. I only ask that no one ridicule my somewhat primitive coding style - I'm not Marco.

http://weboperahouse.com
Reply By: jimibt Reply Date: 3/20/2007 10:41:37 AM
hi all,

i've created a couple of very basic stored procedures that allow for quite a flexible Articles and Posts search facility. it doesn't use full text search (some hosts don't provide this) but is none the less pretty quick. i've posted the .sql files up onto one of my sites and perhaps someone can have a crack at creating the visual interfaces to display the results. I've also amended the tbh_Forums_GetForums sp to return the number of Topics, Posts and lastposter etc, etc. From this, i've modified the visual interface and quite a few parts of the ForumDetails.cs so that i now display the forum listing similarly to the forum layout here at wrox. altho i'm not 100% finished with the listing view that i've created, i've put up a zip file of the changed code for all to access.


jim

http://www.eventdriventhing.com/sql/spSearchArticles.sql
http://www.eventdriventhing.com/sql/spSearchPosts.sql

and here's an image of how i've now got my forums listing:

http://www.eventdriventhing.com/sql/forum.JPG

and here's the amended files to get you to that point

http://www.eventdriventhing.com/sql/ForumsUpdate.zip
Reply By: jimibt Reply Date: 3/20/2007 11:53:20 AM
TIP!!
========

quick tip (this may have been covered before but it bugged me for a few hours). to get the breadcrumbs to 'follow' from forum to threads, you have to do 2 things:

1. amend the web.sitemap as follows:

      <siteMapNode title="$Resources: SiteMap, Forum" url="~/ShowForums.aspx">
        <siteMapNode title="$Resources: SiteMap, Browse_Threads" url="~/BrowseThreads.aspx" />
        <siteMapNode title="$Resources: SiteMap, Thread" url="~/ShowThread.aspx" />
      </siteMapNode>

2. open the App_GlobalResources\SiteMap.resx and add a new entry:

name: Browse_Threads
Value: Browse Threads

thats it - rebake and your breadcrumbs should now be complete!! :)

Reply By: plb Reply Date: 3/20/2007 1:49:56 PM
This is a little ironic. I'm rushing to get out of thr house to go to Reno to teach a couple classes on SQL. In my opening lecture I will say that SQL is a set processing language in which you normally don't need looping.

I look in the .sql scripts jimibt provides and I see a lot of temp tables and loops. I have been tying to resurect a five year old forum I wrote. As I remember all the PROCs were set based.

Sorry gotta go. More later. I will study the PROCs that jimibt provided - maybe that's the way to go.

http://weboperahouse.com
Reply By: jimibt Reply Date: 3/20/2007 2:10:18 PM
quote:
Originally posted by plb

This is a little ironic. I'm rushing to get out of thr house to go to Reno to teach a couple classes on SQL. In my opening lecture I will say that SQL is a set processing language in which you normally don't need looping.

I look in the .sql scripts jimibt provides and I see a lot of temp tables and loops. I have been tying to resurect a five year old forum I wrote. As I remember all the PROCs were set based.

Sorry gotta go. More later. I will study the PROCs that jimibt provided - maybe that's the way to go.

http://weboperahouse.com



plb - i'd say that it's 'a way' to go, not sure if it's 'the way' to go mind you. likewise, this is prolly the only time that i've used loops in my t-sql 'ever' but can't think of another way to achieve the same result easily. of course, here's hoping that you dig in a bit and optimise it further :)

all the best

jimi

[edit] - i'd also be interested to see any approach that you'd take to promote those sp's up thro' the DAL etc to the UI. that's the end game really...

Reply By: jimibt Reply Date: 3/22/2007 6:09:52 AM
ok - updated my ForumsUpdate.zip with additional code in the Post.cs class to purge the forums cache on any post action (i.e BizObject.PurgeCacheItems("forums_forums");). [this was to resolve an issue where the posts count and last post values weren't being updated when new posts were added]

all works as expected now and ready to be tweaked by someone else to the next level.

jim

http://www.eventdriventhing.com/sql/ForumsUpdate.zip

Reply By: 99mary Reply Date: 3/23/2007 1:45:45 PM

Hello!
Could not find stored procedure 'tbh_Forums_UnCloseThread'.
jimibt please add code of the stored procedure

And one mistake
It is impossible add new forum on page ManageForums.aspx
even added
      <InsertParameters>
           <asp:Parameter Name="title" Type="String" />
           <asp:Parameter Name="moderated" Type="Boolean" />
           <asp:Parameter Name="importance" Type="Int32" />
           <asp:Parameter Name="description" Type="String" />
           <asp:Parameter Name="imageUrl" Type="String" />
           <asp:Parameter Name="lastpostby" Type="String" />
           <asp:Parameter Name="lastpostdate" Type="DateTime" />
           <asp:Parameter Name="posts" Type="Int32" />
           <asp:Parameter Name="topics" Type="Int32" />
       </InsertParameters>

in base record is added, but on page ManageForums.aspx, ShowForums.aspx no.
And at accompaniment of the new forum is required nonzero field description, earlier so was not
possible, there was add and without description

Sorry for bad english.

Reply By: jimibt Reply Date: 3/23/2007 2:10:49 PM
quote:
Originally posted by 99mary


Hello!
Could not find stored procedure 'tbh_Forums_UnCloseThread'.
jimibt please add code of the stored procedure

And one mistake
It is impossible add new forum on page ManageForums.aspx
even added
      <InsertParameters>
           <asp:Parameter Name="title" Type="String" />
           <asp:Parameter Name="moderated" Type="Boolean" />
           <asp:Parameter Name="importance" Type="Int32" />
           <asp:Parameter Name="description" Type="String" />
           <asp:Parameter Name="imageUrl" Type="String" />
           <asp:Parameter Name="lastpostby" Type="String" />
           <asp:Parameter Name="lastpostdate" Type="DateTime" />
           <asp:Parameter Name="posts" Type="Int32" />
           <asp:Parameter Name="topics" Type="Int32" />
       </InsertParameters>

in base record is added, but on page ManageForums.aspx, ShowForums.aspx no.
And at accompaniment of the new forum is required nonzero field description, earlier so was not
possible, there was add and without description

Sorry for bad english.





99mary,

no problems with your english - understand perfectly!! :)

ok, i've updated the UpdateForums.zip file, so if you pick it up, the stored proc 'tbh_Forums_UnCloseThread' is there, as are the updated sp's for getforums etc..

the problem that you had was probably due to the initial tbh_Forums_GetForums sp not doing an outer join test on post, therefore, it wasn't showing any rows for forums that contained no posts. i've sorted this now and you'll need to update tbh_Forums_GetForums again and all should work fine.

let me know how you get on. (also, any errors that you fix and/or optimisations, be sure to pass those on too ;)

jim

http://www.eventdriventhing.com/sql/ForumsUpdate.zip
Reply By: 99mary Reply Date: 3/24/2007 11:22:19 AM
Hi,
Regrettably in archive no the stored proc 'tbh_Forums_UnCloseThread'.
So can not check possible open subjects anew.

New forum now adds, but requires nonzero field description, url, that not comfortable.

And one error on page ShowForums.aspx:
since I use Russian
field LastPostBy is displayed in wrong coding.
I do not know why. On other page is displayed orderly.


I have added on forum on pages ShowThread.aspx navigation
            <pagersettings mode="NumericFirstLast"
            firstpagetext="first"
            lastpagetext="last"
            pagebuttoncount="3"  
            position="TopAndBottom"/>  

and on pages BrowseThreads.aspx.cs
            Forum forum = Forum.GetForumByID(int.Parse(forumID));
            this.Title = string.Format(this.Title, forum.Title);
            ddlForums.SelectedValue = forumID;
in lieu thereof
            Forum forum = Forum.GetForumByID(int.Parse(forumID));



Respectfully yours, Mary

Reply By: jimibt Reply Date: 3/24/2007 1:28:28 PM
quote:
Originally posted by 99mary

Hi,
Regrettably in archive no the stored proc 'tbh_Forums_UnCloseThread'.
So can not check possible open subjects anew.

New forum now adds, but requires nonzero field description, url, that not comfortable.

And one error on page ShowForums.aspx:
since I use Russian
field LastPostBy is displayed in wrong coding.
I do not know why. On other page is displayed orderly.


I have added on forum on pages ShowThread.aspx navigation
            <pagersettings mode="NumericFirstLast"
            firstpagetext="first"
            lastpagetext="last"
            pagebuttoncount="3"  
            position="TopAndBottom"/>  

and on pages BrowseThreads.aspx.cs
            Forum forum = Forum.GetForumByID(int.Parse(forumID));
            this.Title = string.Format(this.Title, forum.Title);
            ddlForums.SelectedValue = forumID;
in lieu thereof
            Forum forum = Forum.GetForumByID(int.Parse(forumID));



Respectfully yours, Mary





hi again mary,

the proc 'tbh_Forums_UnCloseThread' is actually in the archive. i think you may have to clear your browser cache and then click the download link again. otherwise if you're having issues getting the latest version, i'll rename it and then you may have more success.

let me know how you get on, and i'll try your additions too ;)

cheers

jmi

Reply By: plb Reply Date: 3/25/2007 2:58:52 PM
Bug in Forum ?

I can't really tell because I've made so many changes to the forum that it may be a bug that only exists in my implimentation.

In TBH forum's data design a thread is identified as a post with ParentPostID of 0. If you are logged on as the administrator and you try to delete a regular posting you get a warning message asking you to verify the deletion of post. The deletion of a single post works fine as far as can tell. However if from the ShowThread page you delete a thread (parentID = 0) you get a nasty error message.

Deleting a thread from the BrowseThreads page works OK. I think I see what's happening with the deletion bug but I won't bother to fix it myself if its part of the Starter Kit code.


http://weboperahouse.com
Reply By: plb Reply Date: 3/25/2007 3:10:07 PM
My forum extentions so far have been reserved for cosmetics not functionality. In an effort to make my forum look more like the popular PHP forum software vBulletin, I have emulated their UI. Instead of text links I have substituted graphic buttons. I'm only at down to the BrowseThread level but I will work my way down through all the pages.



http://weboperahouse.com
Reply By: 99mary Reply Date: 3/26/2007 9:18:21 AM
When viewing the page ShowThread.aspx is changed number of the users in network - time their last activity, possible somehow this avoid, so in network from users only I?

Reply By: jimibt Reply Date: 3/26/2007 9:36:29 AM
quote:
Originally posted by 99mary

When viewing the page ShowThread.aspx is changed number of the users in network - time their last activity, possible somehow this avoid, so in network from users only I?





Mary,

Are you referring to the admin funtion when looking at users?? I know that if i change an entry (as admin) for another poster, then it shows as that user having been active at the time as well. i think this is due to roles.impersonation. i'm not sure how you bypass this (if this is what you want), without breaking the security model.

jim

btw - i presume you got the other bits working okay?? i'm currently working on an implementation for the Priority flag i.e Announcement, Sticky, Normal etc... it's nearly there and i have a version running on www.jamestollan.com . i'll post the updated zip file when i've tested it properly.

Reply By: plb Reply Date: 3/26/2007 4:41:35 PM
Jim -
I see that you too have revised the look of the forum so as to differentiate it from the UI presentation of the Articles. I will study your implimentation. I like your new ShowForums page better than my own. Does your forum have new functionality yet? You wanted to add Stickies I think.

You should work on the About section soon. I'd like to see who you are.

Pat



http://weboperahouse.com
Reply By: plb Reply Date: 3/26/2007 4:42:32 PM
I am continuing to rework the stock forum cosmetically. Today I revised the ShowThreads page. I reworked the Literal that shows the Forum Threads so that it mirrors the style of the site Bread Crumbs. I also changed the layout of the identity block to make it smaller and more compact.

I have made up a set of custom buttons for posting, locking, and quoting but these are a little hard to just substitute. It takes some coding to make image button equivalents.

Its starting to look like a real forum. A couple more days of formatting and then I will add some new functions. Then I think I can use this nice little forum in the new site I'm going to try to build next week.

Pat


http://weboperahouse.com
Reply By: jimibt Reply Date: 3/27/2007 2:21:19 AM
quote:
Originally posted by plb

I am continuing to rework the stock forum cosmetically. Today I revised the ShowThreads page. I reworked the Literal that shows the Forum Threads so that it mirrors the style of the site Bread Crumbs. I also changed the layout of the identity block to make it smaller and more compact.

I have made up a set of custom buttons for posting, locking, and quoting but these are a little hard to just substitute. It takes some coding to make image button equivalents.

Its starting to look like a real forum. A couple more days of formatting and then I will add some new functions. Then I think I can use this nice little forum in the new site I'm going to try to build next week.

Pat


http://weboperahouse.com



hi pat,

i've now completed my Priority functionality and tested it out thoughroughly. all works great and now my stickies/announcemnts are working great.  i'll include it in an updated zip with everything i've done to date. should make for a nice leap in useability and funtionality.

once i'm out of this little loop and before leaving forum/posts for a bit,  i'm going to create a couple of little webparts to display most active poster etc, etc... bascially, dashboard info to give a quick overview on the user's'homepage'

anyway

jim

Reply By: jimibt Reply Date: 3/27/2007 6:48:39 AM
OK,

Finally, the latest version of this forums/posts thing. this release includes both the new layout for the Forum listing as per previous messages, toghether with the much vaunted Priority flag for top level posts (can only be applied by admin/editors of course!!).

ok, grab yourself the code here:

http://www.originaltalent.com/downloads/ForumsUpdateV1.3.zip

Good luck, jim

see it all in action at:

http://www.originaltalent.com/Default.aspx

[edit] updated broken link 22-may-2008

Reply By: 99mary Reply Date: 3/27/2007 8:26:30 AM
I have in view of if usual user views the page ShowThread.aspx, that amount of the users in network on page ManageUsers.aspx increases, profiles of the users herewith do not change beside user of no rights. I simply wanted to do how much users in network.

Reply By: plb Reply Date: 3/27/2007 4:44:25 PM
I have started upgrading the look of my ShowForums page on the model Jim's Forum:
http://www.jamestollan.com/ShowForums.aspx

I'm not through but I've done a few little upgrades to include Topics, Posts, and Last Post columns. Right now these are simple Bound Columns. Later I will template them and add other values, links and multiple lines.

What is remarkable about these added features is that there was essentially NO PROGRAMMING much less any looping. I'm too simple minded to create a complex solution so I did it is a very simple fashion.

I just dropped the forums table on the form and auto generated a SqlDataSource control. I then created three super simple Views. One each for Threads, Posts, and Last Post Date. I created them graphically in SQL Server (I teach students how to write SQL in Query Analyzer but I seldom do so myself). They are:

vw_Forum_NumPosts

SELECT 
   ForumID, 
   COUNT(PostID) AS NumPosts
FROM 
   dbo.tbh_Posts
GROUP BY 
   ForumID


vw_Forum_NumThreads
SELECT 
   ForumID, 
   COUNT(PostID) AS NumThreads
FROM 
   dbo.tbh_Posts
GROUP BY 
   ForumID, 
   ParentPostID
HAVING
   (ParentPostID = 0)


  
vw_Forum_LastForumPost
SELECT     
   ForumID, 
   MAX(LastPostDate) AS LastForumPostDate
FROM         
   dbo.tbh_Posts
GROUP BY 
   ForumID


Then I made one more View called vw_Forums that simply joined these three views to the Forums table (graphically). The effect of which is to add three new columns to the Forums table. Lastly I replaced the table Forums with the view Forums in the SELECT statemnt in the SqlDataSource.

I know I should have probably done this in the DAL. Some would object that I should do this sort of thing completely in code not in the database at all. But I hate to type (and/or think) and its so easy in SQL.

Pat

http://weboperahouse.com
Reply By: jimibt Reply Date: 3/27/2007 5:19:25 PM
Pat,

you naughty boy, ignoring the DAL :). I went down to the levels that marco did purely as an excercise to 'learn' asp.net (i come from a vb6/php/c background and had had very little asp.net experience until 4-5 weeks ago). i do agree that it involves a lot more typing (i might even create an addin to automate new classes once i've figured it all out, to save all the repetition [of sorts] across the various layers), however, i think the advantage being that as you scale up, then you have a logical heirarchy to follow that is consistant throughout.

of course, once i've been doing this asp.net malarkie for a few more months, i might be tempted to take the shortest/quickest path to achieve the end result.

i do feel that you may be missing out on an opportunity with the above approach insofar as the BizObject caching. i might be wrong in my assumption, but if you're linking the sql directly to your SqlDataSource, then you'll be querying the database with every hit on the page. using the full abstraction across the layers gives you the benefit of all the cacheing and reduced database activity. just something you should be aware of if you're going to be generating volume users. i feel that it's crucial to keep that kind of info in ones mind with every enhancement, especially ones that step outside the model.

i hope this doesn't come across as preachie in any way, i'm really just trying to explain the reasons why i'll probably continue with the longhanded approach with any enhancements that i undertake - of course, i might never deliver doing it that way :D

all the best for now - looking fwd to seeing your finished version soon

jimi

Reply By: plb Reply Date: 3/27/2007 6:09:02 PM
I'm not really skipping the DAL in the long run. I'm just prototyping now. I'll redo it later. All my new video stuff has a DAL - but not a BLL. I have an architectural mish mash. But I'm not trying to sell a book.

At the present I have so few visitors caching hardly seems to matter. I have a few people wander through but no one uses the wizard or submits an article. I want to generate some traffic with what appears to be a conventional forum. That's why I've been so concerned about appearances. Forum afficionatos want something that looks like the other forums they habituate.

As for the classes and the DAL CRUD code. I intended to use Olymers but the MS LINC approach seems to be coming soon so I may just wait and continue to write my DAL classes by hand (actually cut, paste, search, replace).

I'm trying to understand Marco's approach better but in the meantime I wanted to get something up and running. I use my site as a demo when I apply for teaching or consulting jobs. I don't tell anyone that I cut some corners.

BTW the Forum joins have to be LEFT OUTER JOINs or else the new forum records will not show in the forum.

Pat

http://weboperahouse.com
Reply By: 99mary Reply Date: 3/31/2007 3:46:23 AM
Good work jimi.
The Forum now simply excellent!
There was quite well add else voting, as well as searching for on forum.
But anyone have done the choice Avatars (in existing versions this uncomfortably). Necessary to provide possibility of the loading on server and choice with server already.

Reply By: jimibt Reply Date: 3/31/2007 6:56:37 AM
quote:
Originally posted by 99mary

Good work jimi.
The Forum now simply excellent!
There was quite well add else voting, as well as searching for on forum.
But anyone have done the choice Avatars (in existing versions this uncomfortably). Necessary to provide possibility of the loading on server and choice with server already.



Mary,

I've actually now added searching (top right) onto my version and am 90% of the way there with it functionally. just tweaking the sql and the cacheing methods but you can try it out in action at my test location (the search box accepts multiple entries with a space between each) :

http://www.jamestollan.com/Default.aspx

i'm just going to add a further webpart under the search to report top searches/last 10 searches etc...)

glad you're happy with the mods so far..

jimi



Reply By: plb Reply Date: 3/31/2007 3:32:31 PM
Mary

I have indeed added some new and quite simple functionality to the avatar choosing fields in the profile page. I haven't uploaded it yet however. You're right the stock avatar functionality is essentially worthless as it requires the user to intuit somehow the file structure of the site.

Pat

http://weboperahouse.com
Reply By: 99mary Reply Date: 4/2/2007 1:35:51 AM
jimi
wish on page BrowseThreads.aspx.cs
at opening closing the Threads add
gvwThreads.DataBind();

Reply By: plb Reply Date: 4/2/2007 8:08:56 PM
I added a Drop Down Menu with the images of about twenty five Avatars. The user clicks on their choice and pushs the button.

If they want their own picture file I have a way for them to upload a file and semi-auto fill in the Avatar Url text box.

I could do more with this but its enough for me now. Considering how simple all this is it took more time than I intended.

Take a look. Make up a member.

Pat

BTW
Yesterday I posted on a favorite blog. I looked this morning to see if anyone replied. Indeed one of the scientists said I was - and I quote - "Ugly and your feet stink".

This kicked off a raging controversy. With dozens of posts.

See I told you that people are nicer here

http://weboperahouse.com
Reply By: vantoko Reply Date: 4/3/2007 9:14:27 AM
Hi Jimi,

I really like what you did with the forum. Can we use your code freely ?
How did you do your search ?
I implemented a full text search box on my site, but it's not the best way to go.

One suggestion for the forum : add an alt to your images (so when you hover the announcement, sticky or hot item, you can see what it means.

grtz

koen


Reply By: jimibt Reply Date: 4/3/2007 2:28:42 PM
koen,

yes, use the code as you please. i really got stuck into that part (forums)
 to get a mixture of familiarity and experience with tbh. i'll probably make further tweaks along the way and if they're of a nature that can be easily separated, then will post those as and when i can.

re the search funtionality - that was actually quite simple (tho' a bit convoluted) in the end. i'll have a look at what i did and detail the steps. i could of course attempt to post it here as a 2nd phase of post/forum extension. i'll have a think as i'm actually now working 'for real' on the site that i'm building, so a lot of other core logic is now involved and it's not so easy to rip out as it was last week (may have a backup from end of last week when search was implemented on vanila tbh).

anyway

jimi

Reply By: plb Reply Date: 4/4/2007 10:28:50 AM
Jimi,

Thanks for the code. I implemented your forum priority functions so that now I too have Stickys and Announcements.

I must be a genius. I started this thread with the idea of upgrading the Beer House forum to make it more competitive with vBulletin and/or Community Server. I have succeeded beyond my expectations. The basic Marco functionality plus the brilliant Jimi additions and my own few modest cosmetic improvements have yielded an excellent "little" forum.   

The Marco/Jimi forum now should be good enough for most web sites except those that are truly forum sites.

Yes I'm clearly a genius. I'm pondering my next trick.

TBH forum differs from most others in that it doesn't have much of a separate administrative dash board. The big commercial forum software advertise that their products have a very comprehensive dashboard. That's how one did it five years ago. Indeed that's how I did with my own forum variant back then. Today however with .NET 2.0 we have role based security built in. This allows TBH forum to have only one set of pages with a couple different sets of of controls whose visibility is role dependent. At first I found this approach odd, but now I've come to appreciate it.

TBH forum in the book is ugly. The forum follows few of the design conventions used throughout the web. Forum devotees will hardly even recognize the stock forum as a forum at all. Fortunately that's an easy modification. Drop the pictures and just have a forum page that looks like a grid.

Jimi's addition of priorities to the Post table are real improvements. Virtually every other forum on the web (including this one from WROX) has Stickys. This is an upgrade without tradeoffs. I'm less comfortable with Jimi's addition of new fields to the Forum table. He adds a couple new fields that hold summary counts from the Post table. These values can be retrieved from the Post table dynamically. This may or may not impose a performance penalty. I think the simpler approach may be more appropriate for a design aimed at "little" forums.

TBH forum has no thread table. It has only a Forum table and a Post table. A thread is defined implicitly by the ParentPostID field with a value of zero. This structure is more like the database structure of a blog than a threaded forum. That's good because blog-like forums (flat unthreaded) are now the most popular kind. Indeed the ShowThread page has a Quote button. Quoting is a feature of blogs and unthreaded forums. It is not needed very much with a threaded forum where every response is to a previous posting.

TBH forum also supports avatars but rather crudely. The user is asked for a URL. The stock Beer House file structure has a folder for avatars and a folder for a user's uploads but the stock EditProfile page doesn't explain that. For some forum topics this is easy to remedy with a collection of stock images. For example, on my opera themed site I have a couple dozen opera cartoons and opera singer photos. Its easy then to add a drop down so the user can add a picture as his avatar. This wouldn't work very well with more general topics. TBH also has a nice little user control that uploads files to a known location. This can be included in the EditProfile acsx with some explanatory text. Then anyone can have any avatar they want.

In summary I think that with the addition of Stickys and some other improvements the Beer House forum is sufficient. The only serious omission now is search and that isn't very hard. If I were developing a pure forum site I would use Community Server. If I were developing a general site that needed a supplementary forum, I would just plug in the Beer House (enhanced) forum.


Pat

http://weboperahouse.com
Reply By: jimibt Reply Date: 4/4/2007 12:04:53 PM
Pat,

Glad you liked the improvements. I agree with the 'useage' of the tbh forum. i.e. if in use on a site where the forum is a component addition but not the main driver of the site, then this is the way to go. only other modification that i'd like to make (but may not have to do) would be to add a forums 'grouping' page that allowed forums to be grouped by category/interest. as i said, for another time.

i have indeed more or less finalised my search routines against the forum (and will create a similar metaphor against articles at some point soo). however, i'm not sure if i'll be able to extract them in isolation of the other changes to the forum that was made, so any update to the forum zip would be inclusive of everything else that's been done to date, together with the search stuff. of course, it wouldn't be too difficult to get a fresh install and just put the seacrch functions against that (removing any references to the new Priority filed in posts). i'd obviously like to see how others have done this too mind you as my method (which is full-text search) is not the optimum solution. however, it's coded as such to allow for full-text index searching should the database permit it.

anyway - looking fwd to seeing further enhancements on top of mine in due course.


jimi

http://www.jamestollan.com
Reply By: kherrerab Reply Date: 4/9/2007 3:59:56 PM
i really like the chages to the forum. Thanks for this contribution.

I will keep the images though but on 30x30 size under the RSS hyperlink.

It would be great if you could see the forum with categories ex:

Cars
- VW
- BMW

Choppers
- x
- y

and in the latest topics you coud see the lates topic and the last message that was left in that topic.

Reply By: jimibt Reply Date: 4/10/2007 4:04:33 AM
kherrerab - yes, my main bugbear left is the grouping issue as well on the forum page. might have a go at that at some point (just adding another table above tbh_Forums). perhaps the 2nd suggestion you had might be a good one too with a little abstract of the 1st 50 words of the latest message being shown for example.

i'm all up for anyone implementing any of the above enhancements and posting the zip back to me to integrate into the original ForumsUpdate1.3.zip for everyone to access.


jimi

http://www.jamestollan.com
Reply By: kherrerab Reply Date: 4/10/2007 5:56:11 PM
i forgot to mention the suscribe to this topic option.

Reply By: kherrerab Reply Date: 4/11/2007 10:32:21 AM
i just made all the mods of this forum on www.clubvwnica.com but with images.

check it www.clubvwnica.com

Reply By: 99mary Reply Date: 4/16/2007 7:49:43 AM
Choice avatar with loading on server if to whom will be necessary

UserProfile.ascx

<asp:FileUpload ID="filUpload" runat="server" />&nbsp;
<asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Add" CausesValidation="false" />

UserProfile.ascx.cs

       protected void btnUpload_Click(object sender, EventArgs e)
       {
           lblFeedbackKO.Visible = false;
           lblFeedbackOK.Visible = false;
           if (filUpload.PostedFile != null && filUpload.PostedFile.ContentLength > 0 && filUpload.PostedFile.FileName != string.Empty)
           {
               try
               {
                   // if not already present, create a directory named /Uploads/<CurrentUserName>
                   string dirUrl = (this.Page as MB.TheBeerHouse.UI.BasePage).BaseUrl +
                      "Uploads/" + this.Page.User.Identity.Name;
                   string dirPath = Server.MapPath(dirUrl);
                   if (!Directory.Exists(dirPath))
                       Directory.CreateDirectory(dirPath);
                   // save the file under the user's personal folder
                   string fileUrl = dirUrl + "/" + Path.GetFileName(filUpload.PostedFile.FileName);
                   string _inputFile = fileUrl;
                   string contentType = filUpload.PostedFile.ContentType;
                   int contentLength = filUpload.PostedFile.ContentLength;
                   
                   if (contentType != "image/pjpeg" && contentType != "image/gif" && contentType != "image/jpeg" && contentType != "image/x-png")
                      {
                          lblFeedbackKO.Visible = true;
                          lblFeedbackKO.Text =   "Only GIF, JPEG and PNG image types are supported.";
                          
                      }
                   else

                          if (contentLength > 25000)
                          {
                              lblFeedbackKO.Visible = true;
                              lblFeedbackKO.Text = "Avatar images must be less than 25K in size.";

                          }
                          else
                          {
                              System.Drawing.Image image = System.Drawing.Image.FromStream(filUpload.PostedFile.InputStream);
                              if (!((image.Width > 0 && image.Width <= 100) && (image.Height > 0 && image.Height <= 100)))
                              {
                                  lblFeedbackKO.Visible = true;
                                  lblFeedbackKO.Text = "Avatar images must be no larger than 150 by 150 pixels.";

                              }
                              else
                              {
                                  filUpload.PostedFile.SaveAs(Server.MapPath(fileUrl));
                                  txtAvatarUrl.Text = fileUrl;
                                  lblFeedbackOK.Visible = true;
                                  lblFeedbackOK.Text = "File is successfully added.<br /> For change necessary to save profile.";
                              }
                          }
                          
                  }
               
               catch (Exception ex)
               {
                   lblFeedbackKO.Visible = true;
                   lblFeedbackKO.Text = ex.Message;
               }
           }
       }


Reply By: kherrerab Reply Date: 4/16/2007 11:08:14 AM
it would be also great to limit the size of the avatar in the forum to a maximun height and with at run time when the user types the link of an avatar from someplace else.

Reply By: vantoko Reply Date: 5/2/2007 3:02:22 PM
Hi Jimi,

can you add in your readme that you should update the posts table in the priority list (set it to 0 ? (if not you get a cast error).
I also saw on your site that you added categories to the forum. did you put that code online?

koen

Reply By: jimibt Reply Date: 5/3/2007 2:36:56 AM
quote:
Originally posted by vantoko

Hi Jimi,

can you add in your readme that you should update the posts table in the priority list (set it to 0 ? (if not you get a cast error).
I also saw on your site that you added categories to the forum. did you put that code online?

koen





vantoko,

i'll update the readme.txt file as you suggest.

the categories stuff on my site is actually related to some enhanced functionality that i'm doing for a site (which will be called the gifted geezer) - i'm afraid that that code to integrate categories into the forums is quite a departure from what had been done on the previous simple cut that i put into the archive. i'm not sure how easy it'd be to extract the logic at this point (i'm actually actively working on the site now). i'll take a look but of the top of my head feel that it may be something that would divert me from the task that i've got to complete (plan to go live 4th june).

as they say, never say never!!

jimi

http://www.jamestollan.com
Reply By: vantoko Reply Date: 5/3/2007 2:06:40 PM
no problem. good luck with the gifted geezer :)

Reply By: jimibt Reply Date: 5/3/2007 3:45:57 PM
quote:
Originally posted by vantoko

no problem. good luck with the gifted geezer :)





yes, it'll be interesting. a site comprised of mega-ego individuals all vying for some sort of etherial #1 position... yep, room for a bit of manipulation for fun there methinks!! :)

oh, btw - i found an issue on your site when clicking on the dropdown on this page:

http://www.skistyle.be/BrowseThreads.aspx?ForumID=1

basically, the initial click on the dropdown errors out - trying to think if it's a double postback going on, not sure. anyway, just thought i'd mention in case you hadn't seen it. likewise, i'd appreciate any debug/error reports on the site at www.jamestollan.com (my testbed site for new stuff) in the coming weeks. i'll announce when it's in beta (at that stage, there won't be any testing of styling etc, just the functionality).

jimi

btw - i did attempt to switch to your search routines last week (they are devlishly simple but effective and tight). however, even tho' i switched full text search on, i kept getting darned issues. i'll let you know when it's resolved. but needless to say, i think your search pattern is far supperior to mine, which focusses on each componenet part (posts/articles/homepages/have your says). i like the idea of a generic search page that returns urls to disparate functions and will emulate it once i've got the full text b*llocks working correctly.

anyway - must get on

jimi



jimi

http://www.jamestollan.com
Reply By: vantoko Reply Date: 5/4/2007 12:32:11 AM
thanks for the feedback. I'll have a look at it.

regarding the search : if you implement my routine, make sure you create a job which executes a full text search every 10 minutes.
for some kind of reason SQL removes the queries from the cache which makes it perform very !!! slowly. Creating the job solves the issue (not the nicest solution, but it works :)

Reply By: vantoko Reply Date: 5/9/2007 4:59:48 AM
Hi,

I implemented the forum on my beta site and locally on my vista machine and it works fine.
However, I forgot to add ss_Posts.Priority, in my getthreads method in SQLForumsprovider.
This caused my homepage to show no threads (I have a latest threads implemented)

It caused no error locally (didn't show any threads), except on the hosting maching where CPU went up to 100% .
The event viewer showed this info (I stripped some):

An unhandled exception has occurred.

Exception information:

    Exception type: IndexOutOfRangeException

    Exception message: Priority

    Request URL: http://mybetasite/GetThreadsRss.aspx?SortExpr=LastPostDate DESC&AspxAutoDetectCookieSupport=1

    Request path: /GetThreadsRss.aspx

It seems normal to me that this exception is thrown when the SQL statement is wrong, but I cannot understand why locally the application skips the error and continues to run and on the server my CPU goes up to 100%
Is this something with this forum extension, is this an error in the TBH code, ..... ??

all tips welcome

Koen


Reply By: plb Reply Date: 5/15/2007 2:04:00 PM
Ignore all that avatar code I posted before. It creates a serious bug. If you have an UploadFile ascx control in your user profiles you can't register. Th UploadFiles control throws a security exception for unregistered users.

I ripped all of it out of my current project. I will think about this again.

Pat

http://weboperahouse.com
Reply By: Maxxim Reply Date: 6/28/2007 1:02:39 PM
Any of you worked in these issues ? :

- private messages between users.
- show users that are online in the forum
- statistics
- diferent topicimages for topics written more recent than last visit
- polls
- search engine
- different moderators for different forums. They can edit all topics, but only on the forum that they are moderate.

?

I made all this in thePhille v1...
I need to implement this stuff in beerhouse. If any of you made this, please tell me

Reply By: kherrerab Reply Date: 6/29/2007 12:01:46 AM
quote:
Originally posted by plb

Ignore all that avatar code I posted before. It creates a serious bug. If you have an UploadFile ascx control in your user profiles you can't register. Th UploadFiles control throws a security exception for unregistered users.

I ripped all of it out of my current project. I will think about this again.

Pat

http://weboperahouse.com



how can it be... works fine in my site.

Reply By: plb Reply Date: 7/2/2007 12:44:49 PM
I havn't gotten around to fixing this. If it works for you it gives me hope.

http://weboperahouse.com
Reply By: kherrerab Reply Date: 7/23/2007 11:40:57 AM
this topic should be sticky

Reply By: krainov Reply Date: 8/24/2007 6:32:48 PM
Hi there!
Can anyone post the "tbh_Forums_UnCloseThread" procedure? The link to the archive where it supose to be is dead...

Thanx!

Reply By: krainov Reply Date: 8/24/2007 6:40:26 PM
quote:
Originally posted by 99mary

Choice avatar with loading on server if to whom will be necessary

UserProfile.ascx

<asp:FileUpload ID="filUpload" runat="server" />&nbsp;
<asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Add" CausesValidation="false" />

UserProfile.ascx.cs

       protected void btnUpload_Click(object sender, EventArgs e)
       {
           lblFeedbackKO.Visible = false;
           lblFeedbackOK.Visible = false;
           if (filUpload.PostedFile != null && filUpload.PostedFile.ContentLength > 0 && filUpload.PostedFile.FileName != string.Empty)
           {
               try
               {
                   // if not already present, create a directory named /Uploads/<CurrentUserName>
                   string dirUrl = (this.Page as MB.TheBeerHouse.UI.BasePage).BaseUrl +
                      "Uploads/" + this.Page.User.Identity.Name;
                   string dirPath = Server.MapPath(dirUrl);
                   if (!Directory.Exists(dirPath))
                       Directory.CreateDirectory(dirPath);
                   // save the file under the user's personal folder
                   string fileUrl = dirUrl + "/" + Path.GetFileName(filUpload.PostedFile.FileName);
                   string _inputFile = fileUrl;
                   string contentType = filUpload.PostedFile.ContentType;
                   int contentLength = filUpload.PostedFile.ContentLength;
                   
                   if (contentType != "image/pjpeg" && contentType != "image/gif" && contentType != "image/jpeg" && contentType != "image/x-png")
                      {
                          lblFeedbackKO.Visible = true;
                          lblFeedbackKO.Text =   "Only GIF, JPEG and PNG image types are supported.";
                          
                      }
                   else

                          if (contentLength > 25000)
                          {
                              lblFeedbackKO.Visible = true;
                              lblFeedbackKO.Text = "Avatar images must be less than 25K in size.";

                          }
                          else
                          {
                              System.Drawing.Image image = System.Drawing.Image.FromStream(filUpload.PostedFile.InputStream);
                              if (!((image.Width > 0 && image.Width <= 100) && (image.Height > 0 && image.Height <= 100)))
                              {
                                  lblFeedbackKO.Visible = true;
                                  lblFeedbackKO.Text = "Avatar images must be no larger than 150 by 150 pixels.";

                              }
                              else
                              {
                                  filUpload.PostedFile.SaveAs(Server.MapPath(fileUrl));
                                  txtAvatarUrl.Text = fileUrl;
                                  lblFeedbackOK.Visible = true;
                                  lblFeedbackOK.Text = "File is successfully added.<br /> For change necessary to save profile.";
                              }
                          }
                          
                  }
               
               catch (Exception ex)
               {
                   lblFeedbackKO.Visible = true;
                   lblFeedbackKO.Text = ex.Message;
               }
           }
       }








I have following in my window: The name 'Directory' does not exist in the current context.
Also You did not said that it is necessary to locate the two <asp:Label> named OK & KO. Please, post the whole code-behind file for this feature.


Reply By: Maxxim Reply Date: 9/14/2007 7:22:36 AM
quote:
Originally posted by jimibt

OK,

Finally, the latest version of this forums/posts thing. this release includes both the new layout for the Forum listing as per previous messages, toghether with the much vaunted Priority flag for top level posts (can only be applied by admin/editors of course!!).

ok, grab yourself the code here:

http://www.worldindependentnews.com/files/ForumsUpdateV1.3.zip




Jimi, I saw that you have foruns and subforuns, right?
But who do you manage them into your admin pages?

I entered on your site with sampleeditor account but I only see, for example, 5 or 7 "GENERAL FORUMS" etc...



Reply By: jimibt Reply Date: 9/14/2007 9:03:20 AM
quote:
Originally posted by Maxxim

quote:
Originally posted by jimibt

OK,

Finally, the latest version of this forums/posts thing. this release includes both the new layout for the Forum listing as per previous messages, toghether with the much vaunted Priority flag for top level posts (can only be applied by admin/editors of course!!).

ok, grab yourself the code here:

http://www.worldindependentnews.com/files/ForumsUpdateV1.3.zip




Jimi, I saw that you have foruns and subforuns, right?
But who do you manage them into your admin pages?

I entered on your site with sampleeditor account but I only see, for example, 5 or 7 "GENERAL FORUMS" etc...




max,

at the moment, i