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

Multiple pages
#1

Is there a way to load more than one set of comments?

I have a site where the content changes on a daily basis, and today's page content is pulled from a file with a numerical day identifier. In other words, if today is day 2134, there is a php variable "$day" with a value of 2134, and $cmtx_idenfier = "$day". You could load the same page with a URL GET value ?day=2134 (and prior days are available using GET, e.g. you can see yesterday's page by putting ?day=2133 at the end of the URL.

What I would like to do is include yesterday's comments as well as today's in my commentics section. I hate to start mucking about in the code, even though this seems like something one might be able to do by just adding an "OR `id` = '$id+1'" to the correct query.

Commentics has been a big hit. If you want to see it, here is today:
http://dailyprayer.us/daily_devotion_page2.php?day=1587
Reply
#2

(03-Jan-2014, 04:59 PM)masonbarge Wrote:  Is there a way to load more than one set of comments?

I have a site where the content changes on a daily basis, and today's page content is pulled from a file with a numerical day identifier.
In other words, if today is day 2134, there is a php variable "$day" with a value of 2134, and $cmtx_idenfier = "$day".
(snip)

Okay, I didn't get any ideas from anyone, so I managed to do this but there has to be a better way - my solution is rather primitive and I don't like messing with the Commentics code.

I changed comments/includes/template/comments.php line 606 from this:
PHP Code:
<?php 
$cmtx_comments_query
= mysql_query("SELECT `id` FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `reply_to` = '0' AND `is_approved` = '1'
AND `page_id` = '
$cmtx_page_id' ORDER BY $cmtx_sort;"); //get comments from database

to this:
PHP Code:
<?php 
$cmtx_page_id2
= $cmtx_page_id-1;
$cmtx_comments_query = mysql_query("SELECT `id` FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `reply_to` = '0' AND `is_approved` = '1'
AND (`page_id` = '
$cmtx_page_id' OR `page_id` = '$cmtx_page_id2') ORDER BY $cmtx_sort;"); //get comments from database

Any comments on this? Is there something somewhere else that is going to get messed up?
Reply
#3

Hi,

You'll need to make a similar change to the cmtx_validate_reply function in /comments/includes/functions/processor.php

That's all I can think of at the moment. Probably easiest just to test all of the comment-related features on a comment that is loaded from yesterday.

Have you completed the interview?
Reply
#4

Thanks!
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
16-Dec-2011, 01:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)