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

Containing Comments in DIV

First of all, this is a pretty nifty product you've developed.  If I can solve this one issue then I will be sending you a donation for sure. Smile

I've just integrated the script into my site, but I am having a small formatting issue.

I've plugged the script in so it should display in a DIV contained under the car image and six nav buttons, but it shows up at the top of the page instead.

My site doesn't write the HTML until the very end of processing, then all of the HTML is dumped at once... instead of writing a bit, then processing, then writing, etc.

Is there a way that I could have the output of your script saved into a variable and inserted into my developing output instead of outputting the moment that the script is called?


Can you provide some code so I can replicate the issue on my own system and then I'll be able to see if there's a solution?

Have you completed the interview?

Hmmm... that's a tough one. My site is basically one single PHP script with 27k+ lines. I was learning PHP when I started it over a decade ago and it has just grown over time. There isn't "some code" that I can provide.

Let me see if I can elaborate.

Depending on the URL my PHP script processes the output through a number of different routines. Each routine saves a small chunk of the HTML code into a single variable. By the 5th routine that single variable contains all of the HTML for the page. Then, at the end of the script, the variable is printed and the page is displayed.

The Commentics script outputs to the page as soon as it is called. This means that my HTML is partially formed and temporarily saved in a variable, then Commentics get's called and it immediately spits out it's own HTML code, then the rest of my PHP finishes forming the page and finally spits out the page. This means that if you view source for my comment page, you will see all of the Commentics code first, then as soon as it ends you will see the first HTML tag.

I'm not capable enough to know if there is a way to save the Commentics output into a variable so I can "release" it in the right part of the page instead of immediately.

$variable = require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');

I tried that, hoping that it would allow me to "catch and release" the Commentics code, but it didn't work.


I've been banging my head against this for hours now... just got it figured out!

    require($_SERVER['DOCUMENT_ROOT'] . $cmtx_folder . 'frontend/index.php');
    $content .= ob_get_contents();

Gonna get this all integrated nicely and you'll hear from me again soon!

Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
29-Jul-2020, 08:34 AM
Last Post by MattyP
13-Apr-2020, 08:33 PM
Last Post by Steven
03-May-2016, 08:36 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)