Thread: CSS and Forums
View Single Post
  #2 (permalink)  
Old October 8th, 2007, 04:20 PM
Maxxim Maxxim is offline
Friend of Wrox
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts

Now you are talking...
In past I eared you saying that it is easy implement some things into TBH forums... Like parent-child category... treeviews etc! I gave you same time to fall in reality! :)
I know because I made an all new forum for 1.1!
It all can be done but... it take some time!

quote:Also, I've been looking into forums. My users are used to vBulletin, and compared to that, TBH forums stink. I've pondered just coding a lot myself, but frankly I'd rather spend my time on other parts of the site. Heck, if users would pick too big a picture as avatar (my users will want their own pictures), the completely forum layout is messed up as it is :(
Don't worry...
for the avatar image, use something like this:

<%# checkImage(Eval("AvatarUrl")) %>

// write some CheckImage(urlString) function that will check if the image with is bigger than 110px (for example) if it is... then resize to 110px
For the other images in forums you can do one of two things:
by css like:

<div class="postContent">
<%# Eval("Message") %>

width:445px; /* td width */
word-wrap: break-word;
//this css lines are very usefull! Because if some user post an url with 100 characters without spaces, your design will be corrupted!
//overflow:auto;word-wrap: break-word; avoid that making an horizontal scroll just for that div!
The second choice (my choice is a little javascript):
You can use css together, just for avoid bigwords/urlLinks without spaces
  function resize_images()
    for (i = 1; i < document.images.length; i++)
      while ( !document.images[i].complete )
      if ( document.images[i].width > 445 )
        document.images[i].width = 445;
<body onload="resize_images()">
But now we have a problem... with masterpage we can't acess to the body in order to write:
<body onload="resize_images()">
But the javascript function is very usefull and works in my forum!
If you have a method to run this function with masterpages please tell me

I hope it helped!