# Add a forum to your site



## ferrarif50 (Feb 7, 2006)

When youâ€™re setting up a site using CSS, itâ€™s a good idea to do a little planning ahead and think how youâ€™ll be using your styles, otherwise you could end up spending much more time later.

 As a case in point â€“ for a site Iâ€™ve recently built, a basic style sheet was put together, with entries for matters like headlines, section headings, item headings and so on. When it came to forms on the site that needed headings next to the data entry boxes, the logical choice was the item headings style. It helped maintain a consistent look across the site, but it came back to bite me later. The reason? After some feedback from the beta testers, a left margin was added, so that text didnâ€™t butt up against the left-side of a browser window. You might think that is fairly straightforward. And it would be, but for the fact that simply adding a margin to all the CSS styles would do the same wherever a style was used, making the headings on some of the forms look a little odd. 

So, the solution was to duplicate the appropriate style â€“ before adding the margin to it â€“ and call the new duplicate something useful like â€˜formItemHeadingâ€™. Then, amend the original item heading style to add the margin and, finally, go through the entire site changing headings in forms to the new style. Itâ€™s tedious work and something that could have been avoided had I done the thing that Iâ€™m always urging other people to do â€“ plan, plan and plan. Even if you first imagine that two types of element on your page â€“ in my case item headings, and form box headings â€“ will look the same, remember that they are separate items and, though it might feel tedious at the time, create a separate CSS style for each type of item. It will save you a lot of time if you need Building a community Add a forum to your site and planning ahead with CSS to make changes to the style sheet later . Youâ€™ll just need to alter the style sheet â€“ which is best saved as a separate file, rather than included in each document, for large sites â€“ instead of having to manually edit every page and reassign styles later. Itâ€™s far better to end up with a few extra styles in your style sheet than to have too few. The amount of data in a style sheet is trivial, so itâ€™s really not going to make any difference to the download time of your site. 

Attracting visitors One of the things that most web designers would like is for their site to be visited by lots of people. You can promote it â€“ but not by using junk mail â€“ and mention it elsewhere on the Internet, put it in your email signature and arrange reciprocal links with similar sites. But none of that is much use unless thereâ€™s a compelling reason for people to keep coming back. So, how do you tackle that sort of thing? It was one of the issues facing the site on which I had my style sheet tribulations. Itâ€™s a site thatâ€™s intended to be a resource for users of a digital video recorder, which can be enhanced via software downloads. 

But a site that simply lists things you can download isnâ€™t terribly exciting, so we needed something to try and draw people back. The obvious answer to that is forums. 

Discussion forums can help provide a community and draw people back to your site to see the answers to questions theyâ€™ve posed. Obviously, theyâ€™re not relevant to every site, but for the site in question, it seemed a logical idea. And one that immediately raises the question â€“ how do I add a forum? There are several packages that you can use to provide forums. In some cases, the type of forum that you can install will depend on your web host. Two of the most popular and well known are phpBB and YaBB. The former is actually a component of the PHP Nuke (www.phpnuke.org) open source portal system, though you can install it separately, if you donâ€™t want all the other portal functions.

As you can guess from the name, you need PHP on your web server to run phpBB. Youâ€™ll also need the MySQL database, which is used as the back-end of the system â€“ donâ€™t worry if you donâ€™t have the two on the main part of your site. If you have a site like www.nigelwhitfield.com, it wonâ€™t look odd if you use a separate site like forum.nigelwhitfield.com to host your discussions, but obviously youâ€™ll also need to be able to manage the DNS entries to set that up. YaBB is written in Perl, which is also a very popular scripting language and available on many web servers. Rather than use a database, it stores its information in text files, so all you need is the ability to run Perl scripts on your web host, rather than PHP scripting, MySQL and full access to a database. On the downside, the file structure might store up problems for the future if youâ€™re running a very busy site.

In the end, though, we went with YaBB (www.yabbforum.com), which is very easy to set up. Itâ€™s a simple matter of downloading a zip file, unpacking it and then uploading the files to your web server. You need to edit the Settings.pl file to tell the scripts where your files are stored, both in terms of the URL and of the directory on the server, and then make sure the script is set so that it can be executed. Then log in to the web page with the default admin user name and password, and fill in a few simple web forms to set up your forums. It really is extremely easy to do. If you want to tweak the design a little, for instance, to match the colour scheme of your website, itâ€™s easy â€“ just click on the Admin link, and you can alter the template file, with its CSS definitions from within your browser. That really is just about all it took â€“ certainly less than half an hour. Even if youâ€™re not familiar with Perl, itâ€™s not exactly difficult to edit the settings file and get up and running. If you want a forum on your site, itâ€™s well worth taking a look at. A forum isnâ€™t necessarily the only thing that youâ€™ll need. 

On the site I was setting up, we decided that it would be a good idea to have a function that allowed users to build up a personal page with information and quick links to the things they want to download. Itâ€™s a handy tool that might help bring people back â€“ especially since you can then email people when a new version of a product in their list appears, providing you seek their consent. And to help tie it in with the forums, and give an incentive to register, the functions restricted only to those who have signed up for the forums. That might sound complicated, but itâ€™s a lot simpler to do than you might imagine. All you do is check for the cookie thatâ€™s set when a user logs in to the forums, and only allow the personalisation scripts to run when thatâ€™s set. In the case of YaBB, the default cookie is called YaBBusername, though you can change it if you like. You can check for the presence of the cookie with some PHP code like this, which, if before the HTML section of a document, will redirect to the forum home page if the cookie is not there. 

<?php if ( ! isset($HTTP_COOKIEd _VARS[â€˜YaBBusernameâ€™]) )

 { header(â€˜Location: d www.mysite.com/cgi-d bin/yabb/YaBB.cgiâ€™) ; exit ; }

 (Key: d code string continues) 



You may want to redirect to a different page, explaining why people need to sign into the forums. Linking functions of the site like this can help to encourage people to sign up, since thereâ€™s a tangible benefit to doing so. But donâ€™t do it just for the sake of it â€“ think of how people might want to use your site and work around that. Pointlessly restricting functions or sections of your site is likely to turn people away, rather than encourage them. Reader queries David Boswell asks: â€˜is it possible to reduce the size of an Excel spreadsheet saved as a web page, other than by printing out, scanning and reducing it as an object? Printing out in Excel does not reproduce the macro buttons and I also need the very best definition I can get. Using the zoom factor on the spreadsheet before saving it as a web page does not seem to work.â€™ The answer is, sort of. When you save a web page as Excel, either on a Mac or PC, whatâ€™s created â€“ unless you use embedded objects inWindows â€“ is simply an HTML table, with formulas changed to the results they use. (Actually, strictly speaking, the formulas are still there, in XML, so the spreadsheet could be recreated from the HTML file). At the top of the file, youâ€™ll find an embedded stylesheet. You can edit that â€“ you could set up a global search and replace if you do this often â€“ to alter the options, including font sizes, so that you end up with the desired effect. If you have the last twoWeb Development columns, you can now marvel at the forethought of including a crash course on CSS in them. Alternatively, depending on the browser youâ€™re using, you have a few different options. In Internet Explorer, the View/Text Size menu options wonâ€™t work because there are sizes specified in the document. But if you choose Accessibility from the Internet Options, you can override text sizes and styles in the document, which will then allow the menu options to increase or decrease text size to work. You could even create your own style sheet to apply, though that would only be worth the effort if you used an almost identical spreadsheet template a lot. If youâ€™re using Opera, you can zoom in and out of a page, regardless of the style sheet thatâ€™s been applied, so you can easily fit more of a spreadsheet into theWindows. And you can also click the drop-down view mode menu at the right to switch to User mode, which will use your own default styles, instead of the ones specified in the file.

Source: www.techslash.com


----------



## coolendra (Feb 11, 2006)

knew that already dude ......

but great work...
very informative..


----------



## paul_007 (Mar 2, 2006)

thnx man, this is what i was lookin 4


----------



## steelwin (May 6, 2006)

why are you going for such a noisy forum , i have all versions of V--bulletin if u need them i can give yo for free


----------



## Drizzling Blur (May 6, 2006)

Well, didnt really go through all of it, i made my own forums for music, Its the phpBB free thing, i want to change a lot things in the forums can some one help me with that please ???

Check my forums - *s3.phpbbforfree.com/forums/blix.html

Things needed to be changed are 

1) Background
2) Overall Look of the Forums
3) Mailing System

In future if i have my own domain, can i move these forums to my site ????

Kindly help, thanks in advance.


----------



## rajkumar_personal (May 6, 2006)

I found out sometime ago that there are some sites which let you make your own forum and then u can link to them from your site as your Forum !

But nevertheles.....this tut was quite a nice one !

Someone posted a tut for creating your own forum right from scratch in this forum. I found that to be a better one than this !

No hard feelings though mate !
I just let ppl know of my opinion !


----------

