Facebook Comments

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 17, 2011   (RSS)

Re: [design9] Facebook Comments

By Jason - May 16, 2011

Hi,

What's happening is here:
list($blogpageRecords, $blogpageMetaData) = getRecords(array(
'tableName' => 'blogpage',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));


The function whereRecordNumberInUrl() is getting the last number in the URL and attempting to use this as a record number. In this case, it's using the variable fb_comment_id.
What we can do, is temporarily strip this variable out just long enough to do our query, then put it back in.

Try this:

$fb_comment_id = @$_REQUEST['fb_comment_id'];
$_REQUEST['fb_comment_id'] = "";


list($blogpageRecords, $blogpageMetaData) = getRecords(array(
'tableName' => 'blogpage',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));

$blogpageRecord = @$blogpageRecords[0]; // get first record
$_REQUEST['fb_comment_id'] = $fb_comment_id;


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Facebook Comments

By design9 - May 16, 2011

Jason, I tried this and it doesn't seem to work. Can you look at my page and see if I am missing anything? Also, it was my blogsrecord that is pulling the blog data so I updated that.

Thanks!

April
Attachments:

details_001.php 46K

Re: [design9] Facebook Comments

By Jason - May 17, 2011

Hi April,

I took a closer look into this, and it turns out that the function whereRecordNumberInUrl() function gets data from $_SERVER['QUERY_STRING'], and not the $_REQUEST array. But we can still use a similar technique, try this:


$tmpQueryString = $_SERVER['QUERY_STRING'];
$queryArray = explode("&", $_SERVER['QUERY_STRING']);
$_SERVER['QUERY_STRING'] = $queryArray[0];

list($blogsRecords, $blogsMetaData) = getRecords(array(
'tableName' => 'blogs',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));

$blogsRecord = @$blogsRecords[0]; // get first record

$_SERVER['QUERY_STRING'] = $tmpQueryString;


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/