• ?the “each”?function?is not available anymore in PHP 8

    WordPress error message:
    Call to undefined function each() in wp-content/plugins/internal-link-building-plugin/internal_link_building.php:454

    After going back to 7.4 – no problem

    Update necessary

Viewing 2 replies - 1 through 2 (of 2 total)
  • Still doesn’t work in PHP 8.0. Can something be done about it? If you type the word dog, it also links to the word dogs. Can this also be changed?

    POS2012

    (@pos2012)

    @markos33 and @admsite:

    You have to edit the file: internal_link_building.php

    /wp-content/plugins/internal-link-building-plugin/internal_link_building.php

    Line 454 find this:

    while (list($name, $ops) = each($keywords)) {
    
    				if($name == 'keywords_time')
    					continue;
    
    				$case = '';
    				if($ops['case'] == 1)
    					$case = ' checked="checked" ';
    				$nofollow = '';
    				if($ops['nofollow'] == 1)
    					$nofollow = ' checked="checked" ';
    				$newwindow = '';
    				if($ops['newwindow'] == 1)
    					$newwindow = ' checked="checked" ';
    
    				$name = str_replace("'","'",stripslashes($name));
    
    				echo "
    					<tr>
    						<td><input type='text' style='width:90%;' value='$name' name='internal_link_building[$x][name]' /></td>
    						<td><input type='text' style='width:90%;' value='$ops[url]' name='internal_link_building[$x][url]' /></td>
    						<td><input type='text' value='$ops[times]' name='internal_link_building[$x][times]' size='4' /></td>
    						<td><input type='text' value='$ops[between]' name='internal_link_building[$x][between]' size='4' /></td>
    						<td><input type='text' value='$ops[before]' name='internal_link_building[$x][before]' size='4' /></td>
    						<td><input type='text' value='$ops[after]' name='internal_link_building[$x][after]' size='4' /></td>
    						<td><input type='checkbox' $case value='1' name='internal_link_building[$x][case]' /></td>
    						<td><input type='checkbox' $nofollow value='1' name='internal_link_building[$x][nofollow]' /></td>
    						<td><input type='checkbox' $newwindow value='1' name='internal_link_building[$x][newwindow]' /></td>
    					</tr>
    					";
    				$x++;
    			}

    and then remove it, and add this in stead:

    foreach ($keywords as $name => $ops) {
    
        if($name == 'keywords_time')
            continue;
    
        $case = '';
        if($ops['case'] == 1)
            $case = ' checked="checked" ';
        $nofollow = '';
        if($ops['nofollow'] == 1)
            $nofollow = ' checked="checked" ';
        $newwindow = '';
        if($ops['newwindow'] == 1)
            $newwindow = ' checked="checked" ';
    
        $name = str_replace("'","'",stripslashes($name));
    
        echo "
            <tr>
                <td><input type='text' style='width:90%;' value='$name' name='internal_link_building[$x][name]' /></td>
                <td><input type='text' style='width:90%;' value='{$ops['url']}' name='internal_link_building[$x][url]' /></td>
                <td><input type='text' value='{$ops['times']}' name='internal_link_building[$x][times]' size='4' /></td>
                <td><input type='text' value='{$ops['between']}' name='internal_link_building[$x][between]' size='4' /></td>
                <td><input type='text' value='{$ops['before']}' name='internal_link_building[$x][before]' size='4' /></td>
                <td><input type='text' value='{$ops['after']}' name='internal_link_building[$x][after]' size='4' /></td>
                <td><input type='checkbox' $case value='1' name='internal_link_building[$x][case]' /></td>
                <td><input type='checkbox' $nofollow value='1' name='internal_link_building[$x][nofollow]' /></td>
                <td><input type='checkbox' $newwindow value='1' name='internal_link_building[$x][newwindow]' /></td>
            </tr>
            ";
        $x++;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not working with PHP8’ is closed to new replies.