Jump to content

WANNA CHANGE "HOME PICTURE"


Recommended Posts

Modules -> Tools area -> Home text editor and put your flash into the editor. This will get the flash up.

You have to remove the picture manually by going to modules on your server -> editorial and delete the homepage_logo in there (not the logo.gif).

I have a feature request in for the store owner to be able to delete this picture if you want to add to it.
http://www.prestashop.com/bug_tracker/view/3683/

Link to comment
Share on other sites

Rocky could you look at this file for the checkbox to delet the home page logo?

I compared the editorial.php file from your link to mine and it is 1.2.4 and mine is 1.2.5 or actually using the svn version1861.

I only changed 2 parts and when I did the homepage logo was deleted in the admin and in the FO but I got this error message in the admin only on deletion and only after deleting and refreshing the browser page:

Warning: unlink(/home/designus/public_html/betaTest/modules/editorial/homepage_logo.jpg) [function.unlink]: No such file or directory in /home/designus/public_html/betaTest/modules/editorial/editorial.php  on line 92



I added this code from the 1.2.4 file:

/* If clear was checked, delete the image */

           if(isset($_POST['clear_homepage_logo'])) {
               unlink(dirname(__FILE__).'/homepage_logo.jpg');
           }            

           /* upload the image */
elseif (isset($_FILES['body_homepage_logo']) AND isset($_FILES['body_homepage_logo']['tmp_name']) AND !empty($_FILES['body_homepage_logo']['tmp_name']))



and this code:

<input type="file" name="body_homepage_logo" /> - or - Clear Image? 
    <input type="checkbox" name="clear_homepage_logo" value="clear" />




There are not any errors when uploading an image and refreshing the browser page.

How could that unlink line be changed to remove the admin error? I tried a couple of things but could not make it work.

Thanks!

editorial.php

Link to comment
Share on other sites

The error occurs because the module tries to delete the homepage logo even if it has already been deleted. To fix this, change the line before the unlink from:

if(isset($_POST['clear_homepage_logo'])) {



to:

if(isset($_POST['clear_homepage_logo']) AND file_exists(dirname(__FILE__).'/homepage_logo.jpg')) {



Another thing I noticed is that the module still tries to display the homepage logo on the configuration page after it has been deleted. To fix this, change lines 218-219 from:



to:

'.(file_exists($this->_path.'homepage_logo.jpg') ? '
   <img src="'.$this->_path.'homepage_logo.jpg" alt="" title="" style="" />
' : '').'

   <img src="'.$this->_path.'homepage_logo.jpg" alt="" title="" style="" />

Link to comment
Share on other sites

I don't get an error now but the image doesn't show up in the admin when you upload it. The image does show up on the FO when you upload it but not the admin.

On this part I kept the original code on lines 218-219 and the image disappears for me on the configuration page when I deleted it with no errors. I am using firefox.

_path.'homepage_logo.jpg" alt="" title="" style="" />
Link to comment
Share on other sites

×
×
  • Create New...