November 8, 201214 yr Hi guys, Just had a request from a client. They have 2 sites, one uses wordpress, the other uses an ecommerce system. They want to be able to make small css and file changes through the admin panel of the ecommerce system the same way they do with wordpress. Does anybody know how this could be acheived? They already have ftp but would prefer to be part of the system itself. Ecommerce system is in php. I can give them read/write access to the files. Cheers
November 8, 201214 yr Has the shopping cart got a templating system that can be access via the admin?
November 8, 201214 yr Hi, this may get you started. <?php $test = "test.css"; $fh = fopen($test, 'r'); $newcss = fgets($fh); fclose($fh); ?> that opens the file put $newcss inside an editor <textarea><?php echo $newcss; ?></textarea> so they can edit the css file When they submit call the below php that will overwrite the css file <?php $test = "test.css"; $fh = fopen($test, 'w') or die("can't open file"); $css = "$newcss"; fwrite($fh, $css); fclose($fh); ?> not tested but not far off Edited November 8, 201214 yr by ELITE
November 8, 201214 yr Author Bluedreamer : no it doesn't unfortunately. Elit: cheers for that, will give it a bash in a bit.
November 9, 201214 yr Bluedreamer : no it doesn't unfortunately. Elit: cheers for that, will give it a bash in a bit. or you can use file_get_contents and file_put_contents
November 9, 201214 yr or you can use file_get_contents and file_put_contents yes i never thought of that Edited November 9, 201214 yr by ELITE
November 9, 201214 yr Author cheers webdesigner93, file_get_contents and file_put_contents did the trick, just had to change some file permissions.
Create an account or sign in to comment