Note that there are some explanatory texts on larger screens.

plurals
  1. POecho htmlentities image title
    primarykey
    data
    text
    <p>Apologies if this seems like a re-post, but earlier today I posted this question: <a href="https://stackoverflow.com/questions/18719657/php-for-an-image-gallery-pulled-from-facebook-only-grabs-the-first-25-images">PHP for an image gallery pulled from facebook, only grabs the first 25 images</a></p> <p>And I forgot to ask what I assume is a small issue. On the echo htmlentities tag displayed here: </p> <pre><code> echo htmlentities ('&lt;li class="imgcomments"&gt; &lt;a href="http://www.facebook.com/people/@/'.$Cdata-&gt;from-&gt;id.'" target="_blank"&gt; &lt;img src="https://graph.facebook.com/'.$Cdata-&gt;from-&gt;id.'/picture" align=left border=0 /&gt; &lt;/a&gt;&amp;nbsp; &lt;a href="http://www.facebook.com/people/@/'.$Cdata-&gt;from-&gt;id.'" target="_blank"&gt; &lt;b&gt;'.$Cdata-&gt;from-&gt;name.'&lt;/a&gt;: &lt;/b&gt;'.$Cdata-&gt;message.'&lt;br /&gt; &lt;div align="left" style="padding-bottom:10px;"&gt; &lt;small&gt;&amp;nbsp;Posted '.timeSince(strtotime($Cdata-&gt;created_time)).' ago&lt;/small&gt;&lt;/div&gt; &lt;/li&gt;'); </code></pre> <p>Whenever I hover over an image with no comments, there is no issue because after this code there's an else displaying "there are no comments". But when I hover over one that does have comments I get the same as an img title attribute but it displays the entire html code linked here. I already gave htmlspecialchars a try and also wrapping all the html code with a span with a title=" ".</p> <p><strong><em>Edit:</em></strong> I found the error, now I am seeing about ways to fix it. the problem was way before on the code: </p> <pre><code> echo '&lt;li&gt;&lt;a href="'.$data-&gt;source.'" rel="lightbox" title="'; if (property_exists($data, "comments")) { foreach ( $data-&gt;comments-&gt;data as $Cdata ) { echo htmlentities ('&lt;li class="imgcomments"&gt; &lt;a href="http://www.facebook.com/people/@/'.$Cdata-&gt;from-&gt;id.'" target="_blank"&gt; </code></pre> <p>On the first line, the title attribute is making it display the entire html code, I am assuming that I'll have to resort to an if/else statement, but if anyone else has a better idea...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload