Profile Comments Mo...
 
Notifications
Clear all

Profile Comments Mod Development

4 Posts
3 Users
0 Reactions
1,576 Views
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

Short of a bridge, of course.

The code I am looking at is http://www.zimmertech.com/tutorials/php/25/comment-form-script-tutorial.php

I figured out how

include ("header.php");

works, but its not working when placed in the two key php files. I took out

//Please set the following variables for your mysql database:
$db_hostname = "localhost";  //usually "localhost be default"
$db_username = "";  //your user name
$db_pass = "";  //the password for your user
$db_name = "";  //the name of the database


/*MYSQL DATABASE CONNECTION/ TRACKING FUNCTIONS
--------------------------------------*/
// connect to database
$dbh = mysql_connect ($db_hostname, $db_username, $db_pass) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($db_name);

which is fairly insecure as is.

So in adding the header.php code. Result:


Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/******/itanshi/fanforge.net/inc_rate.php on line 233
*
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/***/itanshi/fanforge.net/inc_rate.php on line 233
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

So, I thought to include 

include("includes/pagesetup.php");

Fatal error: Call to a member function assignInclude() on a non-object in /home/***/itanshi/fanforge.net/includes/pagesetup.php on line 63

What I'd love to do is place {comments} or something similar in a .tpl.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 17/04/2009 4:00 am
 Elle
(@jenny)
Posts: 594
Honorable Member
 

The code you're looking at is pretty insecure itself (and five years old :O)... Like this:

$tuturl = $_POST["tuturl"];
$tutid2 = $_POST["tutid2"];
$name = $_POST["name"];
$url = $_POST["url"];
$email = $_POST["email"];
$message = $_POST["message"];

$sendcomment = mysql_query("INSERT INTO comments SET tutorialid='$tutid2', name='$name', url='$url', email='$email', comment='$message', date=now()");

See: http://xkcd.com/327/ πŸ˜€

As a starting point for error 1: eFiction uses dbquery() instead of mysql_query(). I'm not sure how that will affect error 2 though! I'm not entirely sure how you're going about doing this.


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 17/04/2009 11:10 am
(@tammy)
Posts: 2577
Member Moderator
 

Another route would be to create a new type of review and just use the reviews.php file.  You can probably use the reviews in the recommendation module as an example.


 
Posted : 17/04/2009 12:21 pm
(@itanshi)
Posts: 381
Reputable Member
Topic starter
 

I saw that when I was fussing with it, that would work better. Thanks.


I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 17/04/2009 2:46 pm
Share: