[03-Dec-2017 12:54:39 UTC] PHP Notice: Trying to get property of non-object in
[03-Dec-2017 12:54Happywide9 UTC] PHP Notice:  Trying to get property of non-object in /home/proximity/public_html/proximity.gq/postcount.php on line 77
[03-Dec-2017 12:54Happywide9 UTC] PHP Notice:  Trying to get property of non-object in /home/proximity/public_html/proximity.gq/postcount.php on line 84

I don't know why i'm getting this problem.
Can someone help me resolve this?

PHP Code:
include 'simple_html_dom.php';

$nopointsforums = array(
       'SPAM/Testing' => true,
       'Introductions' => true,
 * Writes the given text with a border into the image using TrueType fonts.
 * @author John Ciacia
 * @param image An image resource
 * @param size The font size
 * @param angle The angle in degrees to rotate the text
 * @param x Upper left corner of the text
 * @param y Lower left corner of the text
 * @param textcolor This is the color of the main text
 * @param strokecolor This is the color of the text border
 * @param fontfile The path to the TrueType font you wish to use
 * @param text The text string in UTF-8 encoding
 * @param px Number of pixels the text border will be
 * @see http://us.php.net/manual/en/function.imagettftext.php
function imagettfstroketext(&$image$size$angle$x$y, &$textcolor, &$strokecolor$fontfile$text$px) {

   for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++)
       for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++)
           $bg imagettftext($image$size$angle$c1$c2$strokecolor$fontfile$text);

  return imagettftext($image$size$angle$x$y$textcolor$fontfile$text);

$userpage file_get_html('http://forum.proximity.host/user-'.$_GET["userid"].'.html');
$username $userpage->find('span[class="largetext"]'0)->plaintext// find the username from the user profile page.
//refer to http://simplehtmldom.sourceforge.net/manual.htm

$ch curl_init();
curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue); // Must be set to true so that PHP follows any "Location:" header

$a curl_exec($ch); // $a will contain all headers

$url curl_getinfo($chCURLINFO_EFFECTIVE_URL); // This is what you need, it will return you the last effective URL

// Uncomment to see all headers
echo "<pre>";
echo "</pre>";

//echo $url; // Voila
/* the above code was taken from http://stackoverflow.com/questions/20233115/how-to-get-destination-url-from-redirection-url-in-php
when clicking on "Find more posts" it appears the resulting search page that only returns the user's posts is dynamically generated*/

$numberofpoststhismonth 0;
$uncountedposts 0;
$numberofpostsnotmadeinthismonth 0;
$pagenumber 1;
$firstrun True;
while ((
$numberofpostsnotmadeinthismonth === and $numberofpoststhismonth != 0) or $firstrun === True) {
       if ($pagenumber === 1) {
               $firstrun False;
       $html file_get_html($url.'&sortby=dateline&order=desc&uid=&page='.$pagenumber);
       $rows 0;
       foreach($html->find('table[class="tborder"] tr') as $element)

// Ignore first two rows.
               if ($rows++ < 2)
               $post $element->find('*[style="white-space: nowrap; text-align: center;"]',0);
               $forum $element->find('a'3)->innertext;
// Forum doesn't give points.
if (isset($nopointsforums[$forum])) {
                if (!
is_string($post->plaintext)) {
if (substr($post->plaintext03) === 'Yes' or substr($post->plaintext03) === 'Tod' or substr($post->plaintext03) === date("m-")) {

/* http://transfusion.cf/tf-content/uploads/2013/12/screenshot_134.png We are crawling the webpage for the timestamps of the posts - if they begin with YESterday or TODay or the current month.- 
If all the posts on the first search page are made this month, $pagenumber++ */
                else {
$totalposts $uncountedposts+$numberofpoststhismonth;
    if ((
$totalposts %= 20) != 0) {

header('Pragma: public');
header('Cache-Control: max-age=240');
header('Expires: 'gmdate('D, d M Y H:i:s \G\M\T'time() + 240));
 // if the browser has a cached version of this image, send 304 
 header('Last-Modified: '.$_SERVER['HTTP_IF_MODIFIED_SINCE'],true,304); 

// Force the browser to cache the image for 4 minutes. Crawling webpages like that is not exactly good etiquette.

header("Content-Type: image/png");
$img imagecreatefrompng("./freevpsbg.png"); // the background image.
$font_color imagecolorallocate($img255255255);
$stroke_color imagecolorallocate($img000);
$posts_color imagecolorallocate($img2212550);
imagettfstroketext($img805013$font_color$stroke_color"./visitor1.ttf"$username."'s posts: "1);
if (
$numberofpoststhismonth >= 40) {
       $message="posessed poster!";
       $message_color imagecolorallocate($img1112550);
} elseif (
$numberofpoststhismonth >= 30) {
       $message="Sociable Seal!";
       $message_color imagecolorallocate($img0255222);
} elseif (
$numberofpoststhismonth >= 20) {
       $message="Completed! Chewsum5gum";
       $message_color imagecolorallocate($img02550);
} elseif (
$numberofpoststhismonth >= 17) {
       $message="OH! LIVIN ON A PRAYER";
       $message_color imagecolorallocate($img2551000);
} elseif (
$numberofpoststhismonth >=15) {
       $message="WOAH, HALFWAY THERE";
       $message_color imagecolorallocate($img2552550);
} elseif (
$numberofpoststhismonth >= 0) {
       $message="Dry your tears n Post";
       $message_color imagecolorallocate($img25500);
// http://www.johnciacia.com/2010/01/04/using-php-and-gd-to-add-border-to-text/
// free memory associated with this image - delete it from the PHP cache
//echo $numberofpoststhismonth;
//echo date("m-d");
       My Post Count:
[Image: img.php?userid=20087&vps2]

$forum = $element->find('a', 3)->innertext;

The error leads to the fact that $element->find('a', 3) isn't an object, therefore it cannot have any properties.

Same thing on line 84. $post isn't an object either.

I suggest you check over the parts where you create the objects. At the moment, I can't debug and solve this for you, unless you're willing to wait for another 24 hours where I'll have the chance to fix it for you.

@Abdul Sami

Honestly, couldn't seem to find the underlying issue.
Since you own the forum, why don't you just find post counts using the database? It should be quicker.
I'm not going to be that person who throws up another signature which displays my posts for the month. My goal is to be active enough to reach the post requirements without staring at a counter thinking, "Great! I'm done my posts, I can log off until next month."

-- FlamesRunner

My website } { GitHub } { Contact me: andrew@andrew-hong.me }

Actually, I tried debugging at my own, First it was giving error of File_get_content, I changed php version and that seems to fixed it. But this error came, Which i cannot actually seem to fix it.

I can post user post by using MyBB Post counter but i was thinking for the user that they could get images in their signature and make easy for them. When you have free time do let me know.
       My Post Count:
[Image: img.php?userid=20087&vps2]

curl -vvv http://forum.proximity.host/search.php?action=finduser&uid=1 > c
response : <p>The document has been temporarily moved.</p>
i had the same problem one time with my site while trying to use file_get_contents, nothing changed in my code just webserver, after a day i found that problem was SSL.
D❤ᴘᴇ.ᴀʟ Oᴡɴᴇʀ.

Users browsing this thread: 1 Guest(s)