Posts: 11
Threads: 2
Joined: Oct 2010
Could anyone give me some pointers about installing / using the replacer plugin? I installed it but when clicking on replacer in the menu it says there is no folder GSDATAOTHERPATH/replacer. I create such a folder and make it writeable but to no avail. I have tried a few locations. Help appreciated!
Thanks
Posts: 290
Threads: 26
Joined: Oct 2010
GSDATAOTHERPATH is /data/other/
so create /data/other/replacer/ and make it writeable.
-Rob A>
Posts: 11
Threads: 2
Joined: Oct 2010
Thanks Rob
Perhaps I missed some notes somewhere ...
The plugin could also do with explanations along the lines of :
"Do not include PHP opening and closing tags as this will caus your code to be ignored."
"Replace any single quotes in your code with double quotes".
Does not quite work for what I was trying to do as it happens - I was hoping to run a 'random image' script and tried the 'automatic image rotator' but this just returns some odd characters that may be an incorrect rendering of a JPG. (Automatic labs website seems to not exist any more BTW)
Perhaps I need to try converting the script directly into a plugin...
Posts: 1
Threads: 0
Joined: Mar 2012
Hi, I had some problems today with the RePlacer plugin. Basically it just replaced the text with empty strings. It's probably my PHP environment, but it worked after I changed 4 lines of code. The diff between the original code and my version is below. I think it's also cleaner. Any change the original coder could look at this "patch" and release a newer version?
Code:
$ diff replacer.php replacer.php.original
168c168
< $found_replace[] = (string) $data[$match[1]]->code;
---
> $found_replace[] = $data[$match[1]]->code;
175,178c175,178
< # ob_start();
< # eval($found_replace[$counter]);
< # $found_replace[$counter] = ob_get_contents();
< # ob_end_clean();
---
> ob_start();
> eval($found_replace[$counter]);
> $found_replace[$counter] = ob_get_contents();
> ob_end_clean();