Post by Theodore » Thu Dec 10, 2009 12:52 am

i want to do this:
banner.JPG

banner.JPG (64.82 KiB) Viewed 2001 times

i'll find in admin/controler/settings config_icon and config_logo and added this behind icon and logo:

Code: Select all

			if (is_uploaded_file($this->request->files['config_banner']['tmp_name']) && is_writable(DIR_IMAGE) && is_writable(DIR_IMAGE . 'cache/')) {
				move_uploaded_file($this->request->files['config_banner']['tmp_name'], DIR_IMAGE . $this->request->files['config_banner']['name']);

				if (file_exists(DIR_IMAGE . $this->request->files['config_banner']['name'])) {
					$data['config_banner'] = $this->request->files['config_banner']['name'];
				}
			}
and this:

Code: Select all

		$this->data['config_banner'] = $this->config->get('config_banner');

		if ($this->config->get('config_banner') && file_exists(DIR_IMAGE . $this->config->get('config_banner'))) {
			if ((isset($this->request->server['HTTPS'])) && ($this->request->server['HTTPS'] == 'on')) {
				$this->data['preview_banner'] = HTTPS_IMAGE . $this->config->get('config_banner');
			} else {
				$this->data['preview_banner'] = HTTP_IMAGE . $this->config->get('config_banner');
			}
		} else {
			$this->data['preview_banner'] = image_resize('no_image.jpg', 100, 100);
		}
and this:

Code: Select all

  		if ($this->request->files['config_banner']['name']) {
	  		if ((strlen(utf8_decode($this->request->files['config_banner']['name'])) < 3) || (strlen(utf8_decode($this->request->files['config_banner']['name'])) > 255)) {
        		$this->error['warning'] = $this->language->get('error_filename');
	  		}

		    $allowed = array(
		    	'image/jpeg',
		    	'image/pjpeg',
				'image/png',
				'image/x-png',
				'image/gif'
		    );

			if (!in_array($this->request->files['config_banner']['type'], $allowed)) {
				$this->error['warning'] = $this->language->get('error_filetype');
			}

			if (!is_writable(DIR_IMAGE)) {
				$this->error['warning'] = $this->language->get('error_writable_image');
			}

			if (!is_writable(DIR_IMAGE . 'cache/')) {
				$this->error['warning'] = $this->language->get('error_writable_image_cache');
			}

			if ($this->request->files['config_banner']['error'] != UPLOAD_ERR_OK) {
				$this->error['warning'] = $this->language->get('error_upload_' . $this->request->files['config_banner']['error']);
			}
		}

after this i do refresh in my admin panel in images and do not see news((((
i search in admin folder someword like config_logo and config_ico but do not find((

how i can add this? >:(

Thank You!
========================
Best regards,
Theodore.

Newbie

Posts

Joined
Thu Oct 22, 2009 7:44 am

Post by Xsecrets » Thu Dec 10, 2009 12:56 am

you really can't control the display from the controller file. You will also need to edit the view file that is where you change things that display on the screen. Also if you are planning on putting anything to do with the changes in to the database you will need to modify the model file.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Theodore » Thu Dec 10, 2009 3:12 pm

thank you man, i finds in view/settings $entry_logo and $entry_icon and added this:

Code: Select all

            <tr>
        <td width="25%"><?php echo $entry_banner; ?></td>
        <td><input type="file" name="config_banner" />
          <input type="hidden" name="config_banner" value="<?php echo $config_banner; ?>" /></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><img src="<?php echo $preview_banner; ?>" alt="" style="margin: 4px 0px; border: 1px solid #EEEEEE;" /></td>
      </tr>
but in model i don't find anything about icon and logo((( in my admin panel in images i see new textbox where i can upload mew picture that have error

Code: Select all

Notice: Undefined variable: entry_banner in /home/vhosts/localhost/public_html/admin/view/template/setting/setting.tpl on line 422
this is mayby bc i do not added this in language pack.. but how i can add options for what is this image?

Tank you!

Newbie

Posts

Joined
Thu Oct 22, 2009 7:44 am

Post by fido-x » Thu Dec 10, 2009 5:24 pm

While the "logo" is self-explanatory, the "icon" is the "favicon" that appears in the address line of your browser. I think the "icon" you've chosen is a bit on the big side to be used for this purpose.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Theodore » Thu Dec 10, 2009 5:40 pm

hmmm.. sorry fido-x but i do not understand u :(

i find in common header

Code: Select all

<?php if ($icon) { ?>
<link href="image/<?php echo $icon; ?>" rel="icon" />
<?php } ?>
      
and

Code: Select all

  <div class="div2"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $store; ?>" alt="<?php echo $store; ?>" /></a></div>
     

i can add here banner:

Code: Select all

<div align = "center">
  <a href="<?php echo $this->url->http('product/special'); ?>"><img src="/image/under_construction.gif" alt="" /></a>
  </div>
but where i can add new div class and $banner tag to can do this if upload banner image in admin panel images?
i search search.. but cant find $logo tag :(
untitled.JPG

untitled.JPG (59.26 KiB) Viewed 1980 times


Newbie

Posts

Joined
Thu Oct 22, 2009 7:44 am

Post by fido-x » Thu Dec 10, 2009 5:56 pm

Theodore wrote:...i find in common header

Code: Select all

<?php if ($icon) { ?>
<link href="image/<?php echo $icon; ?>" rel="icon" />
<?php } ?>
This is your icon (or favicon - as it is also known). It appears in the address line of your browser, eg. "iconhttp://www.yourdomain.com".

Code: Select all

<div class="div2"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $store; ?>" alt="<?php echo $store; ?>" /></a></div>
You should look a bit closer at that one. You'll see "<?php echo $logo; ?>" in the image tag.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Theodore » Thu Dec 10, 2009 6:02 pm

yes fido-x i know what is this))) u don't understund my question)))
how i can do like $logo and $icon my new tag $banner?

Newbie

Posts

Joined
Thu Oct 22, 2009 7:44 am

Post by fido-x » Thu Dec 10, 2009 6:18 pm

What you need to do is, in "admin/controller/setting/setting.php", insert the following:-

Code: Select all

$this->data['entry_banner'] = $this->language->get('entry_banner');
In "admin/language/english/setting/setting.php", insert the following:-

Code: Select all

$_['entry_banner'] = 'Banner:';
Since it's an "Under Construction" banner, I would suggest you get Qphoria's "Maintenance Mode" (http://forum.opencart.com/viewtopic.php?f=23&t=7471).

You'll then need to edit "catalog/controller/common/maintenance.php" and insert:

Code: Select all

$this->data['under_construction'] = $this->config->get('config_banner');
Then, in the template file ("catalog/view/theme/default/template/common/maintenance.tpl"), insert:

Code: Select all

<img src="<?php echo $under_construction; ?>" />
where you want it.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by fido-x » Fri Dec 11, 2009 7:12 pm

This bit from the last post was wrong:
You'll then need to edit "catalog/controller/common/maintenance.php" and insert:

Code: Select all

$this->data['under_construction'] = $this->config->get('config_banner');
You'll need to use the following:-

Code: Select all

if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on')) {
	$this->data['under_construction'] = HTTPS_IMAGE . $this->config->get('config_banner');
} else {
	$this->data['under_construction'] = HTTP_IMAGE . $this->config->get('config_banner');
}
Keep what you've already done in the admin, add what I've suggested, and you'll get an "Under Construction" banner on the front-end of your site. I know it will work, I've been doing a bit of testing. ;D

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 3 guests