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

2nd include bloc
#1

First of all complements on this script, really. Doddle to css customise, uses text boilerplates, great admin control - seriously excellent work. Really excellent, and a lot better than a commercial script doing much the same thing that gave me no end of grief.

So I have a question which may not have been posed before and maybe a tad pedantic. Say I want to pull in a 2nd include which only has the following and nothing else (this is the 2nd include, in effect the 1st on page order): cmtx_comments/cmtx_comments_count and the bloc of cmtx_social_images (but without &title=Page%20One), how would I go about it and is this a pig to do?

To explain - this I think is a nice start but I'd like to be able to do this. See how at the top below the author and date it has just the count and the socials. Then I'd make the comments and count (#) bit also be a local anchor to jump further down the page to the comments bit. Nicer if it scrolled like the 'reply' function in the form but that's also beyond me js knowledge area. Doable? A hint?

Another thought, maybe this is for further down the road (this site not expected to be ready until at least xmas anyway), when someone has posted something and they get the message "Thank you. Your comment has been added.", a line underneath saying something like "now tell everyone about it!" with again a link to all the socials, that'd be neat too. But thinking about it I might be able to figure that one out by some simple futzing with processor(?).

Thanks again -- good work here

Thank you!
Reply
#2

Thank you for the compliments.

I think the easiest way to get the comments number is to use the following code.

Hopefully you're not using any integration keywords as they won't be converted.

PHP Code:
<?php
$cmtx_identifier
= 'test';

define('IN_COMMENTICS', true);
require
'comments/includes/db/connect.php';

//sanitize
$cmtx_identifier = htmlspecialchars($cmtx_identifier, ENT_QUOTES, 'UTF-8');
$cmtx_identifier = mysql_real_escape_string($cmtx_identifier);

$query = mysql_query("SELECT `id` FROM `" . $cmtx_mysql_table_prefix . "pages` WHERE `identifier` = '$cmtx_identifier'");
$result = mysql_fetch_assoc($query);
$id = $result['id'];

$query = mysql_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `is_approved` = '1' AND `page_id` = '$id'");
$total = mysql_num_rows($query);

echo
$total;
?>

Have you completed the interview?
Reply
#3

Regarding the social links it would be better to build it yourself, as the features of Commentics aren't really designed to be taken out and used elsewhere. You could use the same images and all you would need to do is to supply the URL of the page which you can easily get with PHP.

Have you completed the interview?
Reply
#4

That rocks, thank you Steven. Been years since I once looked briefly at SQL, and I was rubbish at it then. Time for some refreshing methinks.
Reply
#5

Works beautifully! Thanks again
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by fnord12
06-May-2018, 07:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)