WordPress.org

Ready to get started?Download WordPress

Forums

Profile Pic
Headers already sent - fix didn't fix. (10 posts)

  1. RuntOfTheLitter3
    Member
    Posted 3 years ago #

    I've seen the link explaining about removing <?php and ?> whitespace in the associated files for the errors given, that didn't work for me.

    My particular profile-pic.php appears to be broken somewhere from line 841 to the end, due to the discoloration of my editor - code is supposed to be blue, and from line 844 on the text is mostly black, even the remarked text which should be green.

    Warning: Invalid argument supplied for foreach() in /home/literat/public_html/ccsnowrunners/wp-content/plugins/profile-pic/profile-pic.php on line 422

    Warning: Cannot modify header information - headers already sent by (output started at /home/literat/public_html/ccsnowrunners/wp-content/plugins/profile-pic/profile-pic.php:422) in /home/literat/public_html/ccsnowrunners/wp-includes/pluggable.php on line 890

    I then saw a post that said to put a line of code in front of the foreach on line 422, and I did that - I no longer get the error but the profile picture still doesn't show up on the front end.

    Now what?

  2. RuntOfTheLitter3
    Member
    Posted 3 years ago #


  3. RuntOfTheLitter3
    Member
    Posted 3 years ago #


  4. spherical
    Member
    Posted 3 years ago #

    I finally gave up on that plugin. If you aren't using the plugin for multiple user sites, only yours, just call the avatar file location that it uses:

    <img src="/wp-content/profile-pic/[whatever].jpg" style="height:NNpx;width:NNpx;margin:Npx;">

    followed by whatever text you might like to have, in a text widget and save all of the plugin code overhead.

  5. RuntOfTheLitter3
    Member
    Posted 3 years ago #

    it will be multiple users, it's a snowmobiling club in minnesota.

    is there another plugin? i looked but nothing seemed "right." everyone likes a profile picture...

  6. mauricio.camayo
    Member
    Posted 3 years ago #

    I solved by doing this, around line 422 on /home/[YOUR_HOME]/public_html/wp-content/plugins/profile-pic/profile-pic.php

    if($raw_data){
    		foreach ($raw_data as $key => $val) {
    			$reversed_data[$val] = $key;
    		}
    	}
  7. jproducer
    Member
    Posted 3 years ago #

    Mauricio, I'm not sure if you just added this line after this?

    // store form data
    	$raw_data = $_POST['profilepic_displayoptions'];
    	$reversed_data = array();
    	foreach ($raw_data as $key => $val) {
    		$reversed_data[$val] = $key;
    	}

    Can you be more specific? I tried adding what you said and it was actually more problematic.

  8. mauricio.camayo
    Member
    Posted 3 years ago #

    Hi, it's from line 419 to 426, this is the actual code i have there:

    // store form data
    	$raw_data = $_POST['profilepic_displayoptions'];
    	$reversed_data = array();
    	if($raw_data){
    		foreach ($raw_data as $key => $val) {
    			$reversed_data[$val] = $key;
    		}
    	}

    If it didn't work for you, it may be another think failing.

  9. jproducer
    Member
    Posted 3 years ago #

    FANTASTIC Mauricio! This worked perfectly. No more errors. You are truly amazing. Thank you.

  10. jproducer
    Member
    Posted 3 years ago #

    So just to be clear for others, you just replace the existing code from line 419 to 426. Perfect.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic