Tag Archives: admin

Warning: no file uploaded – how to fix this error

Although this fix is for out-of-date oscommerce 2.2 and 4 years overdue, it may be of use for those yet to upgrade.

By default a warning will be shown at the top of the admin when a preview of a product is shown, when the product has not had an image attached or reedited.

The reason for this is the code doesn’t allow for a product not to have an image added at time of editing – ie, if it already has the correct image added to it, no other image would be attached to it, right?

The file to edit is /admin/includes/classes/upload.php

Find:

 } else {
        if ($this->message_location == 'direct') {
          $messageStack->add(WARNING_NO_FILE_UPLOADED, 'warning');
        } else {
          $messageStack->add_session(WARNING_NO_FILE_UPLOADED, 'warning');
        }

Change to:

 } else {
      if (!empty($file['tmp_name'])){
        if ($this->message_location == 'direct') {
          $messageStack->add('search', WARNING_NO_FILE_UPLOADED, 'warning');
        } else {
          $messageStack->add_session('search', WARNING_NO_FILE_UPLOADED, 'warning');
        }
      }

There are several solutions given to this problem – here’s one that is just plain wrong:
http://www.pageonewd.com/local-search-seo/helpful-findings/oscommerce-warning-no-file-uploaded/

how to change admin session lifetime, avoid getting logged out

There’s nothing worse than editing a product description, clicking save and finding that you’ve been timed out by the server. This can be caused by having an admin session set too low. If you’re running a cart that saves sessions to a directory rather than to the mysql database, this may be a problem too. Here’s an easy way to fix this:

Go to /admin/includes/functions/sessions.php, simply add at the top after the copyright info:
ini_set('session.gc_maxlifetime', 3660); // 3660 seconds = 1 hour

Note – the session lifetime is entered as seconds.

Hope this helps!

(PS If you’re using database storage of sessions you might have an admin configuration setting for this already. Check Admin >> Configuration >> Sessions to see and change the figure there.)

check for missing unused images on your server

IMAGE CHECK
(aka osCommerce contribution remove_unused_images)

Written for:
any version of cre loaded series 6 cart, but easy to convert for all osCommerce-based carts (including oscMax, zencart)

screenshot of image check
screenshot of image check

What it does:
Scans and lists all your image files, compares the ones requested by the database products and products_description tables with all of the image files on the server in the /images directory and subdirectories of /images (one level deep.) Then shows a list of any unused images (ie on the server but not being called by the database) with the option of shifting
these into /images/UNUSED.

Ease of use:
Moderate skill needed – you do need to manually set the configuration options in the /admin/image_check.php file. Instructions are included as comments in this file.

Risk from use:
None – no files are actually deleted, only shifted. Low chance of conflict with other store files.

Limitations:
1. When searching product_descriptions, it will only report on images already on the server NOT on the ones called by the database and missing from the server.
2. Will only search one subdirectory deep in the /images folder, so /images/flowers/pic1.jpg will be scanned; /images/flowers/red/pic1.jpg will not be scanned.

Don’t want to try installing it yourself?

No problem – drop me an email and I can install it for you for a minimal amount.

 

can’t see link to new box added in admin (cre loaded)

Cre Loaded 6.4.x versions have a sort of useful feature that enables specific admin access to specific files. Eg if you don’t want your employees being able to access anything in the Admin >> Reports area, you simply remove the tick from the folder (or file) from their admin group by going through Administrator >> Admin Group >> Set Menu and File Access area.

However this can be a gotcha too when you go to add a new mod and wonder why you and no-one else can see the link in the left column (I’m referring to non-Configuration panel links here which are dragged out of the database.)

So to add a file to the menu, you need obviously to login as a Top Administrator or to have access to the database via phpmyadmin.

If you’re a Top Administrator:
Login and click Administrator >> Menu File Access as shown.
cre loaded menu file access

Choose the admin area that your new link is going into by clicking on it:
cre loaded choose the admin area for adding the link

The using the dropdown on the right, find your new file and click Save (ignore the all yellow look … a beta version obviously):
cre loaded choose new file from dropdown

New file should appear with list of others in this Admin panel and importantly, the link to it will appear in the relevant box in the left column:
cre loaded new file appears in list accessible by admin

If you’re NOT a Top Administrator:
You’re going to need access to the database via something like phpmyadmin, because the first thing you’ll need to do is change your admin_groups_id in the table admin to whatever the Top Administrator group id is (usually 1.) Once this is done, login to the Admin as this new administrator and go through the steps above. Remember to change your admin_group_id back to avoid an issue later on.

But wait, there’s more… give permission to others
So now the file appears in the link … but should you want to give access to other non-Administrator account people (possibly including yourself) you need to be logged in as a member of that Top Administrator group again and go to Admininstrator >> Admin Groups and select the group you want to give access to (1), then click File Permissions (2):
admin access and permissions cre loaded

A simple system of tick/no tick comes into play here – folders (read “entire box in the left column”) are in bold; files are not. If ticked – you have access, if not ticked – you don’t have access:
folder and file access in admin panel cre loaded

Make sure you click ‘Insert’ at the bottom of the page when done.

cre loaded adserver authsecure annoyance

I was working on a client’s site today and found the admin panel was slow to load. The url it was getting stuck on was one of the adserver.authsecure.com links, one of the Cre direct ‘feeds’ into the admin panel.

Taking a closer look at a some files in the admin revealed a possible solution for Cre Loaded 6.4.x users:

The file is admin/messages.php
Find (around line 27):

case 'upgrade': //index
  $n = 'a6bb2567';
  $zone = '50';
  echo cre_iframe($n,$zone);
  break;

Replace with:

case 'upgrade': //index
  $n = 'a7d7b7d2';
  $zone = '49';
  echo cre_iframe($n,$zone);
  break;

Find and delete this block (around line 45):

case 'login': //std admin login nag
  $n = 'ac49906f';
  $zone = '103';
  echo cre_iframe($n,$zone);
  break;