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

Trouble with identifier
#1

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.
Reply
#2

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?
Reply
#3

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

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

if (isset(
$_GET['id']))
{
$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'] ?>">
<?php
$datetime
= new DateTime($article[0]['published_at']);
echo
$datetime->format("j F, Y");
?>
</time>

<?php if ($article[0]['category_name']): ?>
<p>Categories:
<?php foreach ($article as $a): ?>
<?= htmlspecialchars($a['category_name']); ?>
<?php endforeach; ?>
</p>
<?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>
<?php
$cmtx_logged_in
= false;
$cmtx_identifier = $_GET["id"];
$cmtx_reference  = $article['title'];
$cmtx_folder    = '/mycommentics/';
require(
$_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
?>



</article>

<?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.
Reply
#4

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

Have you completed the interview?
Reply
#5

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

Have you completed the interview?
Reply
#6

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
Reply
#7

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

Have you completed the interview?
Reply
#8

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


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)