PDA

View Full Version : Total image replacement


Shiekron
08-14-2003, 01:27 PM
I've been looking all over for the code to do this, but I just can't find it. What I'm looking for is a way to change every image on my forum to one certain picture for a user/group. Any ideas on how to do this?

NTLDR
08-14-2003, 04:02 PM
In admin/functions.php find:

global $PHP_SELF, $DB_site, $replacementsetid, $gzipoutput, $gziplevel, $newpmmsg;

Replace with:

global $PHP_SELF, $DB_site, $replacementsetid, $gzipoutput, $gziplevel, $newpmmsg, $bbuserinfo;

Find:

unset($replacement);

Add before:


if ($bbuserinfo['usergroupid'] == X) {
$vars['{FINDME}'] = '{REPLACEWITH}';
}


Untest but should work, replace X with the usergroupid, {FINDME} with the text your searching for and {REPLACEWITH} with the replacement.

I assume this is what you want to do, but maybe you wanted to change all <img> tags to show the same image, in which case, ignore the second edit above and do this instead:

Find:

return $newtext;

Add before:

if ($bbuserinfo['usergroupid'] == X) {
$newtext = preg_replace('#<img (.*)/?>#siU', '<img src="imagename" alt="" />', $newtext);
}

Again untested but should work, replace imagename with the filename/path to the image.

Shiekron
08-14-2003, 10:15 PM
Kickin' rad. I'll check it out. Thanks.