Exemplo n.º 1
0
                                        echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="20" width="20" alt="X" />' . "\n";
                                    }
                                    ?>
											</a>
											<?php 
                                }
                                break;
                            }
                        }
                        if ($missing) {
                            recordMissing($table, $row, $image);
                        }
                        $cache_file = '{*WEBPATH*}/' . CACHEFOLDER . getImageCacheFilename(dirname($image), basename($image), $args);
                        if ($match != $cache_file) {
                            //need to update the record.
                            $row[$field] = updateCacheName($row[$field], $match, $cache_file);
                            $updated = true;
                        }
                    }
                }
                if ($updated) {
                    $sql = 'UPDATE ' . prefix($table) . ' SET `' . $field . '`=' . db_quote($row[$field]) . ' WHERE `id`=' . $row['id'];
                    query($sql);
                }
            }
        }
    }
}
if (!empty($missingImages)) {
    ?>
			<div class="errorbox">
Exemplo n.º 2
0
/**
 * Updates the path to the cache folder
 * @param mixed $text
 * @param string $target
 * @param string $update
 * @return mixed
 */
function updateCacheName($text, $target, $update)
{
    if (is_string($text) && preg_match('/^a:[0-9]+:{/', $text)) {
        //	serialized array
        $text = getSerializedArray($text);
        $serial = true;
    } else {
        $serial = false;
    }
    if (is_array($text)) {
        foreach ($text as $key => $textelement) {
            $text[$key] = updateCacheName($textelement, $target, $update);
        }
        if ($serial) {
            $text = serialize($text);
        }
    } else {
        $text = str_replace($target, $update, $text);
    }
    return $text;
}