Location: PHPKode > scripts > WH Social > wh_social/framework/functions/comments.php
<?php

    if($_SERVER['REQUEST_METHOD'] != 'POST') {

    echo '<form action="" method="post" name="comment">
    <p>' . $lang['post_a_comment'] . '<br>
    <textarea name="comment" class="textareas"></textarea></p>
    <p><input type="submit" class="buttons" value="' . $lang['add_comment'] . '" name="' . $lang['add_comment'] . '"></p>
    </form>';

        }else{

        $errors = array();

        if(isset($_POST['comment'])) {
        if(trim($_POST['comment']) == "") {
        $errors[] = $lang['enter_a_comment'];
        }

        	}else{
        	$errors[] = $lang['enter_a_comment'];
        	}

        if(!empty($errors)) {

        echo '<p class="false">' . $lang['not_filled_in_all_fields'] . ' - <a href="javascript:history.back();" class="false_link">' . $lang['back'] . '</a></p>';
        echo '<ul>';

        foreach($errors as $key => $value) {
		echo '<li>&#8226; ' . $value . '</li>';
		}
		echo '</ul>';

        	}else{

    $sql = "INSERT INTO
                comments(id2, author, comment, date)
            VALUES ('" . $id . "',
                '" . (int)$_SESSION['id'] . "',
                '" . mysql_real_escape_string($_POST["comment"]) . "',
                NOW()
                )";

    $result = mysql_query($sql) OR die(mysql_error());

    if(!$result) {

    echo '<p class="false">' . $lang['couldnot_comment'] . ' - <a href="javascript:history.back();" class="false_link">' . $lang['back'] . '</a></p>';

        }else{

        $autoforward = 3;

        echo '<p class="success">' . $lang['success_comment'] . ' - <a href="myphoto.php?id=' . $id . '" class="success_link">' . $lang['go_on'] . '</a></p>
        <meta http-equiv="refresh" content="' . $autoforward . '; URL=myphoto.php?id=' . $id . '">
        <p><em>(' . $lang['redirected_in'] . ' ' . $autoforward . ' ' . $lang['seconds'] . '...)</em><p>';
        }
    }
    }

?>
Return current item: WH Social