Ver Mensaje Individual
  #20 (permalink)  
Antiguo 27/12/2006, 18:22
luchozero
 
Fecha de Ingreso: diciembre-2006
Mensajes: 384
Antigüedad: 17 años, 4 meses
Puntos: 5
Re: Ayuda para instalar este script en mi web

Cita:
Iniciado por causita Ver Mensaje
Luchozero, en el foro de Perl y CGI t podrian orientar mejor.

algún moderador podria mover este tema al foro de Perl y CGI x favor?

gracias
Hola!!

Muchas gracias por los script que me has facilitado, pero ayer encontre uno que parece basntante sencillo de instalar, pero claro, mi bajo nivel de ingles, y mi torpeza a la hora de instalar, pues no me deja hacerlo

Asi que si puedes tu, o cualquier persona que pueda ayudarme, pues le seria muy agradecido.


La explicacion de la instalacion es esta (en ingles):

STEP 1:
Open the settings.php file with notepad. And edit the settings just the way instructed in that file with comments.

STEP 2:
OK now upload the 3 php files named "settings.php", "post.php" and "view.php" into your server. Better if you put them into a folder like "comments_manager"

STEP 3:
Now create a folder named "data" or upload the blank "data" folder inside the sane folder where you uploaded other three php files. Please not that you should make the folder name exactly "data" not something like "DaTa"

STEP 4:
Change the CHMOD settings of your data folder to 777. It is required so that php script can write inside data folder.

That completes the installation. Now the thing that you need to include form.php and view.php into each of your pages. Just add the script below into each of your pages.

The code:

<?php
$page_id ="demo";
include('http://yourwebsite.com/comments_manager/form.php');
include('http://yourwebsite.com/comments_manager/view.php');
?>

Change the include url of (marked red) form.php and view.php to your current url. After that change the page_id (marked_red, bold) to your choice. Please make sure that while inserting this script into each of your pages, the page_id should be unique to every single pages.

How the id would be?
This is an important matter. Please note that you should not use any space or special character to make id.
Use only A-Z, a-z, 0-9 and _ (underscore)

Wait! My Host supports PHP but not SSI:
Then I shall say, your host is really bogus!! In such case, you shall need to insert all the code of both form.php and view.php to all of your pages maually. And also should need to copy and paste codes from settings.php to both post.php and view.php


Admin Panel:
Well, flat file databases are usually tough to make an admin panel. But that doesn't mean that you can't admin the entries. I recommend to use .html or .htm files to store data not .txt file. Whenever you need to edit or delete entries just go to the data folder using ftp. Download the file you need to edit. If it is a html file you can easily edit the entries with any kind of html editor like Dream weaver or FrontPage.

Troubleshoot:
Please while installing this script please check these matters below to avoid failures

You should make the folder names exactly to "data" not "dAtA"

You should change CHMOD of the data folder to 777

Don't forget to give unique ID for each pages when your are inserting the code.

You should name your page ids with only characters with A-Z, a-z, 0-9 and _ (Underscore)

If you followed the steps mentioned above the script should run fine

-----------------------------------------------------------------------


El problema, es que en el paso 1, pues no se que es lo que tengo que cambiar, y lo que aparece en el archivo settings.php es esto:

<?php

$name = $_POST["name"];
$email = $_POST["email"];
$comment = $_POST["comment"];

$name = ereg_replace("[^A-Za-z ]", "", $name);
$email = ereg_replace("[^A-Za-z0-9 ._@]", "", $email);
$comment = ereg_replace("[^A-Za-z0-9 ,.?;:!@&*-_/[]{}\]", "", $comment);

$name = stripslashes($name);
$email = stripslashes($email);
$comment = stripslashes($comment);


// Change the url to your directory where you uploaded the script. Don't forget to add a forward slash at the end.

$dir_url = 'http://dscripts.awardspace.com/comments_manager/';
$dir = 'data/'; // Name of the directory where comments data will be stored. Don't forget to add a forward slash at the end.
$ext = '.html'; // The type of file to be used as database. Recomended use html that help you in case of editing/ deleting entries.

$file = "$dir$id$ext";
$view_file = "$dir_url$dir$page_id$ext";

$page = $_SERVER['HTTP_REFERER'];
$ip = $_SERVER['REMOTE_ADDR'];

// Change the url to your style sheet to have more control on showing errors or thanks message.
$style = 'style.css';
$date = (date ("l, d F Y [ h:i A]",time())); // This is date format to be shown. Ignore it if you don't know php.
$spilter ='<!-- -->'; // This is pattern with which php scripts divides data file into entries. Important to count number of entries.

// This is the format of every comments to be written and to be shown
$format = "<b><a title=\"Posted on: $date from $ip\" href=\"mailto:$email\">$name</a></b><br>$comment<hr>";


// Next lines sets different messages for different cases.

$no_name = "You did not enter your name!"; // When Name is not entered.
$no_email = "You did not enter your email address!"; // When Email is not entered.
$inv_email = "You have entered an invalid email address!"; // When Email id is invalid
$no_cmn = "You should enter your comments!"; // No no comments entered.
$thanks = "Thank you <b>$name</b> for posting your valuable comments!"; // Thanks message when a comments is posted
$no_id_post = "Sorry! No page id mentioned. Comments can't be posted!"; // Error message to notify you incase you forget to add a page id to post comments.
$no_id_view = "Sorry! No page id mentioned. Comments can't be viewed!";// Error message to notify you incase you forget to add a page id to view comments.
$no_post = "No comments posted here yet!"; // When no comments is available for a page.
$error_time = "3"; // Seconds to show error or thanks page
$title_error = "Error Occured!"; // Ttitle of page when error occurs
$title_ok = "Thank You!"; // Ttitle of page when error occurs
$send_back = "You shall be send back to the previous page automatically within $error_time seconds.<br><a href='$page'>If it does not work click here to go back.</a>"; // This line shows a send back line so that visiors can go back to previous page from error or thanks page.



// Next Lines sets the advance format of error or thank you pages. Ignore if you dot understand.

$format_no_name = "<head><meta http-equiv='refresh' content='$error_time;URL=$page'><title>$title_erro r</title><link rel='stylesheet' type='text/css' href='$style'></head><span class='error'>$no_name</span><br><br><hr><br>$send_back";
$format_no_email = "<head><meta http-equiv='refresh' content='$error_time;URL=$page'><title>$title_erro r</title><link rel='stylesheet' type='text/css' href='$style'></head><span class='error'>$no_email</span><br><br><hr><br>$send_back";
$format_inv_email = "<head><meta http-equiv='refresh' content='$error_time;URL=$page'><title>$title_erro r</title><link rel='stylesheet' type='text/css' href='$style'></head><span class='error'>$inv_email</span><br><br><hr><br>$send_back";
$format_no_cmn = "<head><meta http-equiv='refresh' content='$error_time;URL=$page'><title>$title_erro r</title><link rel='stylesheet' type='text/css' href='$style'></head><span class='error'>$no_cmn</span><br><br><hr><br>$send_back";
$format_thanks = "<head><meta http-equiv='refresh' content='$error_time;URL=$page'><title>$title_ok</title><link rel='stylesheet' type='text/css' href='$style'></head><p><span class='thanks'>$thanks</span><br><br><hr><br>$send_back";
$format_no_id_post= "<head><meta http-equiv='refresh' content='$error_time;URL=$page'><title>$title_erro r</title><link rel='stylesheet' type='text/css' href='$style'></head><p><span class='error'>$no_id_post</span><br><br><br><hr><br>$send_back";
$format_no_id_view= "<font color='#ff0000'><b>$no_id_view</b></font>";


?>

--------------------------------------------------------------------------

Muchas gracias a todos, y si no entienden algo pues avisenme, porque no se ni explicarlo jeje

saludos y felices fiesta

Última edición por luchozero; 27/12/2006 a las 18:58 Razón: equivocacion