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

Integration to more than 500k page
#1

Hello, i have 500.000 url in my site with 300 mb in the database. With automatic link creation, my database size reached to 600 mb. How can i add only commented pages . Any help will be appreciated...
Reply
#2

Hi,

Sorry for the late reply. I'm going to look into this either today or tomorrow. I will provide a solution here.

Have you completed the interview?
Reply
#3

Thanks for your interest Steven...
Reply
#4

Hi,

I've done a few tests and I think this will work.

1. What you need to do first is to create a new Commentics page which you know won't ever have any comments submitted to it. To do this you could change the $page_id in one of your existing pages to something unique like "cmtx80934853", view the page in your web browser, and then change the $page_id back to what it was.

2. In Manage -> Pages, find the page that you just created. If necessary do a search for "cmtx80934853" to find it. Make a note of the ID of the page. This will be in the left column. For example it may be "156".

3. Now in comments/includes/functions/page.php, find this bit of code (starts at line 178):

PHP Code:
<?php 
} else { //create page

mysql_query("INSERT INTO `".$mysql_table_prefix."pages` (custom_id, reference, url, is_form_enabled, dated) VALUES ('$page_id', '$reference', '$url', 1, NOW())");

return
mysql_insert_id();

}

And replace it with this:

PHP Code:
<?php 
} else { //create page

if (isset($_POST['cmtx_submit']) || isset($_POST['cmtx_sub']) || isset($_POST['cmtx_preview']) || isset($_POST['cmtx_prev'])) { //if data submitted

mysql_query("INSERT INTO `".$cmtx_mysql_table_prefix."pages` (custom_id, reference, url, is_form_enabled, dated) VALUES ('$page_id', '$reference', '$url', 1, NOW())");

return
mysql_insert_id();

} else {

return
"156";

}

}

(Make sure to change "156" to the actual ID.)

What happens now is when a user views a page, if it doesn't exist then instead of creating it, it loads page 156 which has no comments. If the user either previews or submits a comment then it will create the page and it will load the correct ID from then on.

Have you completed the interview?
Reply
#5

Hello Steven, i tested and working perfectly. You are a good man. Thank you very much....
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by DuO-VB
21-Mar-2014, 04:26 PM
Last Post by Steven
01-Feb-2013, 03:48 PM
Last Post by webdev67
21-Nov-2012, 03:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)