Post Reply 
commentics in php function
22-Nov-2011, 06:27 AM
Post: #1
commentics in php function
Hi,
my website uses php functions, and I would like to put comments in them. Unfortunately when I try, it says comments have been disabled. If I don't put the code in a php function it works fine.
Can anyone help me?
Thanks,
rolz

Code:
<?php
session_start();
ob_start();
?>

<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="comments/css/stylesheet.css"/>
</head>

<body>
    <?php
    f();
    ?>
</body>

</html>

<?php
function f()
{
    global $page_id, $reference, $path_to_comments_folder;
    $page_id = "1";
    $reference = "Page One";
    $path_to_comments_folder = "comments/";
    define ('IN_COMMENTICS', 'true'); //no need to edit this line
    require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line

}

?>
Find all posts by this user
Quote this message in a reply
04-Mar-2012, 03:43 AM
Post: #2
RE: commentics in php function
it worked for me when I change the function to:
Code:
function f($id,$title)
{
    global $page_id, $reference, $path_to_comments_folder, $default_name, $default_email, $default_website, $default_town, $default_country, $mysql_table_prefix, $page_id, $settings, $default_rating, $default_comment, $default_notify, $default_privacy, $default_terms;
    $page_id = $id;
    $reference = $title;
    $path_to_comments_folder = "comments/";
    define ('IN_COMMENTICS', 'true'); //no need to edit this line
    require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line

}
Find all posts by this user
Quote this message in a reply
04-Mar-2012, 11:22 AM
Post: #3
RE: commentics in php function
My bad the above code it doesn't work correct.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Binding Commentics to specific page on site johndoe694 2 138 12-Apr-2013 02:11 PM
Last Post: johndoe694
  Keeping SEO URLs with Commentics pier 11 882 31-Mar-2013 02:44 PM
Last Post: CaptainAlex
Star How to integrate Commentics to a subdomain page? page 1 343 04-Jan-2013 07:26 AM
Last Post: page
  commentics and subdomain problem ludo 0 244 13-Dec-2012 09:11 PM
Last Post: ludo
  Commentics in Smarty TPL file? saeed319 2 731 09-Oct-2012 04:11 PM
Last Post: jonoweb
  Commentics sometimes shows up/sometimes doesn't mdniaz 1 449 19-Dec-2011 12:38 PM
Last Post: Steven
  Wordpress + Commentics bcb 2 855 28-Sep-2011 10:30 AM
Last Post: utaka
  Webcalender + Commentics,And Example Change of Character Code utaka 0 1,964 28-Sep-2011 09:59 AM
Last Post: utaka
  PhpMyFAQ + Commentics utaka 3 6,416 14-Sep-2011 07:16 AM
Last Post: utaka
  Adding commentics to a template based website bgc79vc 2 863 13-Sep-2011 06:52 AM
Last Post: utaka

Forum Jump:


User(s) browsing this thread: 1 Guest(s)