Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

As the others have said, the code above has many problems. If you just want a good working bulletin board, you should probably look for one of the many that others have already written. If you are doing it for a learning experience, try to post smaller portions of code and ask about a specific problem instead of posting the entire code and asking for "any problems."

In general, writing a good bulletin board is a tricky thing, and can be much harder than it looks. I've written my own and it's now at 4000 lines (and growing), and I tend to write small, efficient code. :) Here are some things to keep in mind when rolling your own:

  • Use a database if possible. It saves a lot of trouble.
  • If you can't use a database, keep the data separate from the html files that are displayed. Keep the html out of your code as much as possible. Break up the data into multiple files, and create your own indexes (subsets of your data) to allow quick accessing of the data.
  • Check and double-check your file locking. This part will really get you in trouble: since multiple processes are writing to the same file, a simple mistake can cause your files to be erased.
  • Some sort of login/authentication will be needed eventually. Design it that way from the beginning.
  • Abstract everything as much as possible. Adding or removing an entire table, for example, should involve changing a configuration file and NOT the code. Things such as the error messages, the names of the boards/threads, the "improper language" words, etc. should not be inside the main code itself.
  • Perlmonks is a great resource, especially for specific problems in large projects. :)

In reply to Re: bulletin board by turnstep
in thread bulletin board by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found