Two Questions (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


DarkLogan -> Two Questions (5/23/2005 18:01:33)

First One:

On my website I'd like to be able to post a question and then have the users be able to hit the comment button and be able to leave a comment. How can I achive this is it a form or something else ?? Please dont say its php.

Secound:

Can you add forums to your page using Frontpage or is that something totally different ?? And how can I achive this




Taz -> RE: Two Questions (5/23/2005 18:39:29)

I'll take the second one.

Yes, you can create a forum with Frontpage (Discussion web), however they are very limited, not that good or really worth the effort. I would say go with some proper forum software like phpBB or some of the other popular forum software available either free or a pay for a license jobbies.




Kitka -> RE: Two Questions (5/23/2005 22:22:13)

Hi,

And Welcome to OutFront Forums


For the first one, sounds like a Shoutbox is what you are looking for.

Here's a couple of free ones:
http://shoutbox.sourceforge.net/
http://www.myshoutbox.com/




Tailslide -> RE: Two Questions (5/24/2005 3:27:38)

I'm using exactly that (shoutbox) on one of my sites - it is php I'm afraid but it's fairly easy to configure.

There are loads to look at on Hotscripts.com but here are two:

http://design.definitelymaybe.org/guestbook/

http://xhawk.net/projects/simplemb/ This is the one I've used

Don't be worried about the php bit - the scripts will have instructions in them and the only things to change will be the paths to your document in the php file or possibly your choice of background colours/text colours etc.

Couple of points to remember with php -
You won't be able to see anything "locally" unless you're running a local web server - so you'll have to upload it to the web to check it.
Always upload it using the ASCII option otherwise it won't work.
You'll have to use a long path to the php doc in your include in your HTML - I usually get this wrong first time but, helpfully, PHP error message on this will tell you the full path so you just copy it in.

Have a go - if you get stuck then let us know and we'll work it out. It may take a while but it's great fun!




DarkLogan -> RE: Two Questions (5/24/2005 7:03:21)

I understand what you guys are saying but it may help if you take a look at my site to see what I'm trying to do. www.darklogan.com
When I or someone else posts on my site I would like others to be able to hit where it says Comments and have it right to a text file somehow but be able to be seen without having to rewrite the entire website. Is this possible ?? I'm no good at php and when I look at php I instantly get lost. PhP forums are a joke (atleast the ones I've been to) they dont want to help newbies. I'd just like to somehow get this to work. I thought maybe it could be done using Frontpage where it would write to a form of some sorts.




Tailslide -> RE: Two Questions (5/24/2005 11:04:11)

I understand exactly the type of thing you're after - have a look at a version on one of my sites (it's a "play site" where I try to figure code out and amuse myself and my friends rather than something meant for wider public consumption)

http://www.sideslip.me.uk/bsg.html

Click on the Enter Caption bit and you'll see what I mean.

It is PHP - it sounds scary but it honestly isn't.  It just means working through  it slowly.  Some other forums can be a bit.... intimidating - which is why I hang around here, 'cos they're nice - so don't worry about asking for help if you get stuck.

Writing PHP scripts from scratch is one thing, adapting existing ones is usually fairly straightforward as long as they were written with that in mind.




DarkLogan -> RE: Two Questions (5/24/2005 13:12:14)

Yeah thats exaclty what I'd like to have something simple like you have there. But how/where would I put php code in my index to make it work on my site in the exact spot where my comment button will be ???




Tailslide -> RE: Two Questions (5/24/2005 13:56:41)

Ok - to replicate exactly what I've got, which is a slightly altered version of Paul Gareau's simple shoutbox script  (with things you need to change highlighted by //change this to the right of a line) for your site you'd do the following:

In your HTML page you'd have the following added at the point where you want your comments to appear:

 <?php include("simplemb.inc.php");        
     do_board(); ?>   


You also need a .txt file which you call board.txt - this is the file that will contain the comments that your users leave.

Finally you need a PHP file as follows:
 <?php
 
 /*
     Paul Gareau - paul@xhawk.net
     Copyright (C) 2001 - Paul Gareau
 
     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
 */
 
 
 ###################################################
 # simplemb v.1.1.0
 #
 # to use put the following lines in your code:    #
 #
 #   include("simplemb.inc.php");                
 #   do_board();                                 
 #
 #                                                #
 # make sure your data file can be written to      #
 # by yourserver!                                #
 #                                                #
 # you can customize the look and feel of the      #
 # script by changing the following variables      #
 ###################################################
 
 
 ########################
 # EDIT THESE VARIABLES #
 ########################
 
 $filename = 'board.txt';;
 $dark_background = '#DDDDDD';
 $light_background = '#EEEEEE'; // These colour options don't work in my version so ignore them
 $sfont = $font2;
 
 #################
 # MAIN FUNCTION #
 #################
 
 function do_board($num=20)
 {
     global $show,
     $mb_submit,
     $name,
     $message,
     $PHP_SELF;
 
     global $filename,
     $dark_background,
     $light_background,
     $lfont,
     $sfont;
 
     if($mb_submit && $name && $message)     //add post to data file
     {
         $name = stripslashes(strip_tags($name));
         $message = stripslashes(strip_tags($message));
         $message = ereg_replace("[[:space:]]+", ' ', $message);
         $message = str_replace("|", '', $message);
 
         $ary_date = getdate(time());
         $date = $ary_date['mday'].'.'.$ary_date['mon'].'.'.$ary_date['year'];
         $new = $name.'|'.$date.'|'.$message;
 
         $fp = fopen($filename, "a");
         fwrite($fp, $new."\n");
         fclose($fp);
 
         echo
         "$sfont\n".
         "Your Caption wasentered.\n". // change to whatever you want - maybe "Your Comment wasentered"
          "<br />\n".
          "<br />\n".
         "<ahref='$PHP_SELF'><strong> » Return to CaptionCompetition</strong></a>.\n". // change to Back to CommentPage
           "<br />\n".
           "<br />\n".
         "[ Opera users please refreshyour page <strong>after</strong> returning to the CaptionList to see your caption ]\n" //I added this line because I was gettingproblems with Opera
         ;
     }
     elseif($show=="form")     //show post form
     {
         echo
         "$sfont\n".
         "Enter your name andCaption, then press 'Enter' to post.\n". //Change this to Enter nameand Comment...
         "<br />\n".
          "<br />\n".
         "<ahref='$PHP_SELF'>Return to Caption Competition</a>\n". //change this to return to Comment Page etc
         "<form action='$PHP_SELF' method='post'>\n".
         "<table cellpadding='0' cellspacing='0'><tr><td>\n".
         "$sfont\n".
         "Name: \n".
         "<br />\n".
         "<input type='text' name='name' size='20'>\n".
          "<br />\n".
         "Message:\n".
         "<br />\n".
         "<textarea rows='2'cols='50' name='message' wrap='virtual'></textarea>\n".
         "</tr></td><tr><td>\n".
         "$sfont\n".
         "<input type='submit' value='Enter' name='mb_submit'>\n".
         "<input type='reset' value='clear'>\n".
         "</td></tr></table>\n".
         "</form>\n";
     }
  else     //show posts
     {
         $ary_board = file($filename);
         $num_lines = count($ary_board);
         echo "<table cellpadding='5' cellspacing='0' width='80%'>\n";
        for($line_num=($num_lines>$num)?$num_lines-$num:0; $line_num <$num_lines; $line_num++)
         {
             if(! ereg("^[[:space:]]+$", $ary_board[$line_num]))
             {
                $ary_fields = explode("|", $ary_board[$line_num]);
                 $name = $ary_fields[0];
                 $date = $ary_fields[1];
                 $message = $ary_fields[2];
 
                if(++$line % 2) $color = $dark_background;
                 else $color = $light_background;
 
                 echo
                 "<tr><td>\n".
                 "$sfont\n".
                 "<b>$name - $date</b>\n".
                 "<br />\n".
                 "$message\n".
                 "</td></tr>\n";
             }
         }
         echo
         "</table><br />\n".
         "$sfont <h5><ahref='$PHP_SELF?show=form'>» Enter aCaption</a></h5>\n"; //change this to Enter a Comment orwhatever
     }
 } //end function
 
 ?>


This is my fiddled with version to get it to validate - for the original version with alternate colour stripes etc then download the original from http://xhawk.net/projects/simplemb/

I've added comments where I think you should change stuff. 

Copy and Paste this code to a new totally blank notepad  page and save it as simplemb.inc.php then upload it to your web server - make sure you do this in ASCII mode or it won't work. To keep things simple upload it to the same directory as your comments page.

Upload the other files too.  You'll need to edit the chmod (permissions) on the board.txt file so that people can add their comments.  In a FTP programme usually you can right-click on the file on your web server and choose properties then their may be a list of boxes you can tick - tick 'em all.  There may also be a 3 figure number - it should read 777.  Change this and now people can add stuff to the file. If you can't do the right-click thing then have a look at the options on your programme - you're looking for Permissions of CHMOD.

Have a look and see if it works.

If when you open the page there's no "Enter Comments" link then add the following to your .htaccess file:
AddType application/x-httpd-php .php .html


Your .htaccess file is in your root directory of your web server.

Have a go with a test page and see how you go. The good thing about PHP is that if you've got something wrong it usually throws up useful error messages - so it's easier to work out what's wrong.








DarkLogan -> RE: Two Questions (5/24/2005 23:30:56)

WOW I'll give it a try but as I sit and read this tonight at about 11:30 pm it looks nuts lol. But you took the time to write it so I'll take the time and patience to try and get it to work. I'll keep ya posted. Thanx for your help




DarkLogan -> RE: Two Questions (5/25/2005 13:12:35)

You'll need to edit the chmod (permissions) on the board.txt file so that people can add their comments.  In a FTP programme usually you can right-click on the file on your web server and choose properties then their may be a list of boxes you can tick - tick 'em all.  There may also be a 3 figure number - it should read 777.  Change this and now people can add stuff to the file.


Ok you got me lost here. Do you want me to put check marks in every box I see cause when I do that number 777 goes into the box automatically and if I change that number some of the boxes un-check themselfs. I'm lost here




Tailslide -> RE: Two Questions (5/25/2005 14:27:25)

If it gives you boxes - check 'em all - 777 should automatically go into the box - just wasn't sure that everybody's FTP gave the same options!





DarkLogan -> RE: Two Questions (5/25/2005 17:16:41)

ok I got what I want on there but didnt use php. Thing is its not working right. If you dont mind go to my site www.darklogan.com and you will see where I wrote that I'm working on the site and next to that it says Comment click it. It will take you to my comments page. Thing is it should say what you saw on the first where it says That I'm working on the site but yet it says Test and so on. If you type something and hit enter you will see what happens [:@]. Maybe you could take a look at the code and see if you know what it is that is wrong. I'm not that good at html but I'm learning. If it cant be fixed I'm going to try your way but I would like to keep it working the way you will see it now as far as going to another page. Thanx




Tailslide -> RE: Two Questions (5/26/2005 2:59:48)

Morning DarkLogan

I've had a look at darklogan.com and at home.comcast.net/~dark_logan/main.html which is the target for the frame (btw - you seem to be using frames but have exactly the same stuff on each page - is there a reason for that?) But I can't see any method such as a form for entering a comment - I had a look at the code and I can't see anything just a HTML list of blank comments - am I on the right page?  All the links except the home page are blank so far.

It is early, and I haven't had my cornflakes and morning cuppa yet - which might well explain it! [;)]




DarkLogan -> RE: Two Questions (5/26/2005 8:15:33)

Not using frames lol just a straight forward page with a bunch of split cells. Ok go to the main.html you will see where I wrote (I'm currently working on the site and getting content together. Keep checking back for additions and updates. Thanks) Under that on the right  hand side you will see where it says (Comments) click that and you will be taken to the comments.html page. That is the page that I want you to look at. Have a look at the html and see what it is that I may be missing. Cause the box to type your name and comment in are there but when you hit submit it just takes you to a cant find page. Not sure whats going on. Thanx




Tailslide -> RE: Two Questions (5/26/2005 8:45:18)

Looks like a frame to me - on the page with the updates and link to the comments and the comments page itself is:

<html><head>

<title></title></head>
<!-- Redirection Services Redirector3C-DC H1 -->
<frameset rows='100%, *' frameborder=no framespacing=0 border=0>
<frame src="http://home.comcast.net/~dark_logan" name=mainwindow frameborder=no framespacing=0 marginheight=0 marginwidth=0></frame>
/frameset>
<noframes>
<h2>Your browser does not support frames.  We recommend upgrading your browser.</h2><br><br>
<center>Click <a href="http://home.comcast.net/~dark_logan">here</a> to enter the site.</center>
</noframes></html>


If it's not traditional frames and just a redirection - is there a reason why you don't just have the content on the .com page?  Reason I ask is that Search Engines are supposed to dislike frames and redirections so you might have problems getting ranking.  Of course that might not be an issue.

Anyhoo - when I went through to the actual comments page and looked at the code there didn't appear to be an action connected to your form.

Unless this is a FP or DW special feature - as I don't know either well - you'll need an action as well as a name and a method.





DarkLogan -> RE: Two Questions (5/26/2005 12:31:10)

I've changed my mind on having a comment page. I'm just going to have a forum. Do you know of any good free forums out there that dont take a rocket scientist to figure out ??




Tailslide -> RE: Two Questions (5/26/2005 12:40:07)

Not off hand I'm afraid - I've never had to set one up.

I could be wrong about this - but my understanding is that forums can be a lot of trouble.

Have a look on Hotscripts.com, they'll have ratings attached, should give you some idea of how good/easy to implement they are.






dpf -> RE: Two Questions (5/26/2005 13:22:37)

http://forum.snitz.com/ is a very easy asp forum - free




DarkLogan -> RE: Two Questions (5/26/2005 16:21:44)

Thanx guys




adhgh -> RE: Two Questions (7/1/2005 6:21:03)

ok its pretty late to add a reply in this discussion.. anyway..
i did all the above regarding the shoutbox [8|] but for some reason i cant find my .htaccess file in the root directory, so i dont know what shall i do regarding this issue..
any help please!!

Adham




Tailslide -> RE: Two Questions (7/1/2005 6:30:08)

If you're absolutely sure it's not there (and sometimes you can't find it via FTP just by the clunky control panel file management thing) then it's possible you don't have one.

You can create one in Notepad - just make sure that you're careful when you save it as Notepad just loves adding on a .txt suffix to everything!




Kitka -> RE: Two Questions (7/1/2005 6:45:39)

FrontPage will not usually allow you to see your .htaccess file (this is to protect the code FP uses for publishing - modify it and FP will refuse to publish).

To view it, you'll need to use a FTP client such as Filezilla (free open-source) or WS_FTP lite (free).

When you do, you might need to use -la or -al to see the .htaccess file.
.. see tutorial here: http://www.outfront.net/tutorials_02/adv_tech/htaccess_magic1.htm

If you are not using FrontPage, you might need to create an .htaccess file from scratch.

Also - if you have access to your Control Panel, you can create an .htaccess file from within the File Manager.




caz -> RE: Two Questions (7/1/2005 7:57:57)

Unless you are on a Linux/Unix server, the article above is no good to you..

From: http://www.dnswiz.com/
www.darklogan.com
Server Software: Microsoft-IIS/6.0
FrontPage Extensions: NO




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.125