• 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?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter RuntOfTheLitter3

    (@runtofthelitter3)

    Thread Starter RuntOfTheLitter3

    (@runtofthelitter3)

    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.

    Thread Starter RuntOfTheLitter3

    (@runtofthelitter3)

    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…

    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;
    		}
    	}

    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.

    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.

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

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Profile Pic] Headers already sent – fix didn't fix.’ is closed to new replies.