This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Trouble with identifier

I'm having trouble figuring out the cmtx_identifier for a blog I'm trying to integrate the comments module to. The blog db for the articles has the following fields: id, title, content, published_at. I have tried using id, and title with no success. Can anyone point me in the right direction?

Any help will be appreciated.

Can you post the code of the file you're trying to integrate Commentics into.

And also the integration code that you've tried with no success.

Have you completed the interview?

PHP Code:
require 'include/init.php';

// PDO check PDO comments and look back earlier codes in project
$conn = require 'include/db.php';

if (isset(
$article Article::getWithCategories($conn$_GET['id'], true);    // PDO (function calling from Article class)
} else {
$article null;

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../mycommentics/frontend/view/default/stylesheet/stylesheet.css" rel="stylesheet" type="text/css">
<!--<link href="style.css" rel="stylesheet" type="text/css">
<link href="../davidcomments/style.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="comments.css" rel="stylesheet" type="text/css">-->
<?php require 'include/header.php'?>
            <?php if ($article): ?>

                <article class="">
                    <h2><?= htmlspecialchars($article[0]['title']); ?></h2>

                    <time datetime="<?= $article[0]['published_at'?>">
= new DateTime($article[0]['published_at']);
$datetime->format("j F, Y");

                    <?php if ($article[0]['category_name']): ?>
                            <?php foreach ($article as $a): ?>
                                <?= htmlspecialchars($a['category_name']); ?>
                            <?php endforeach; ?>
                    <?php endif; ?>

                    <?php if ($article[0]['image_file']): ?>
                        <img src="/uploads/<?= $article[0]['image_file']; ?>" alt="Content Image" height="240" width="360">
                    <?php endif; ?>
                    <p><?= htmlspecialchars($article[0]['content']); ?></p>
$cmtx_identifier $_GET["id"];
$cmtx_reference  $article['title'];
$cmtx_folder     '/mycommentics/';
$_SERVER['DOCUMENT_ROOT'] . $cmtx_folder 'frontend/index.php');


            <?php else: ?>
                <p>No Article found.</p>
            <?php endif; ?>
<?php require 'include/footer.php'?>

Here is the code where I'm trying to include the comments in. It also includes the code I am using that is not working. What you see is just one iteration of it...

Thanks for your help.

Looks okay to me. Why do you say it's not working?

Have you completed the interview?

When you say "one iteration", are you trying to load Commentics multiple times on the same page?

Have you completed the interview?

When I use this iteration, I get the following error message. When I say iteration I mean using different options for the identifier.

An error occured

Uncaught Exception: 'ErrorException'

Undefined variable: results

Stack trace:

#0 C:\usbwebserver862\root\simpleblog\article.php(50): errorHandler(8, 'Undefined varia...', 'C:\\usbwebserver...', 50, Array)
#1 {main}

In File'C:\usbwebserver862\root\simpleblog\article.php'on line50

Okay I'm not sure because that error doesn't make sense given the code you've provided.

Have you completed the interview?

I'll keep at it and see if I can figure it out.

Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:

Users browsing this thread: 1 Guest(s)