Ina Code Blog

bunch of code in one place
Nov
11

osCommerce: IE ne prikaže slik

Posted by admin in osCommerce, tips

Na strežniku so bile opravljene neke posodobitve in vse spletne trgovine postavljene z osCommerce sistemom so se ‘pokvarile’ v Internet Explorerju. V Mozilli je delalo vse vredu. Problem je bil v tem, da se ni prikazala nobena slika več.

To je rešilo moj problem:

  1. Odpri datoteko: /catalog/includes/aplication_top.php
  2. Najdi vrstico:

    $request_type = (getenv(’HTTPS’) == ‘on’) ? ‘SSL’ : ‘NONSSL’;

  3. In jo zamenjaj z:

    $request_type = (getenv(’HTTPS’) == ‘off’) ? ‘SSL’ : ‘NONSSL’;

To je to, meni je rešilo problem …

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Aug
27

Euroskills 18 - 20 september 2008 - Rotterdam

Posted by admin in uncategorized

Euroskills 2008Oddajte svoj glas podpore in pomagajte slovenski ekipi na Nizozemskem, ki se bo potegovala za prestižen naslov v kategoriji informatika v Rotterdamu.

Oddajte svoj glas podpore (Support Valentina!)

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Jun
4

Fatal error: Cannot re-assign $this in /home/…../admin/includes/classes/upload.php on line 31

Posted by admin in osCommerce, tips

I logged in to osCommerce shop administration and I got this error:

Fatal error: Cannot re-assign $this in /home/…../admin/includes/classes/upload.php on line 31

Few days ago the shop was transferet to a server with PHP5 installed. So the problem needs to be fiksed and here is how:

Open file /admin/includes/classes/upload.php and obviously go to line 31 or find:

$this = null;

And replace it with:

unset($this);

The administration should work perfectly now.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

May
21

Joomla: DB function failed with error number 1054

Posted by admin in joomla, tips

Spletni portal narejen s sistemom Joomla je bil prenešen s starega strežnika, ki je podpiral MySql 4.1.x na nov strežnik, ki pa podpira MySql 5.

Ko sem hotela urejati vsebino spletnega portala v administraciji Joomle sem naletela na sledeče opozorilo o napaki:

DB function failed with error number 1054
Unknown column ‘c.access’ in ‘on clause’ SQL=SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author FROM jos_content AS c, jos_categories AS cc, jos_sections AS s LEFT JOIN jos_groups AS g ON g.id = c.access LEFT JOIN jos_users AS u ON u.id = c.checked_out LEFT JOIN jos_users AS v ON v.id = c.created_by LEFT JOIN jos_content_frontpage AS f ON f.content_id = c.id WHERE c.state >= 0 AND c.catid = cc.id AND cc.section = s.id AND s.scope = ‘content’ ORDER BY s.title, c.catid, cc.ordering, cc.title, c.ordering LIMIT 0, 10

Ta napaka se lahko popravi s popravkom v datoteki: /administrator/components/com_content/admin.content.php

Najdi del kode:

$query = “SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author”
. “\n FROM #__content AS c, #__categories AS cc, #__sections AS s”
. “\n LEFT JOIN #__groups AS g ON g.id = c.access”
. “\n LEFT JOIN #__users AS u ON u.id = c.checked_out”
. “\n LEFT JOIN #__users AS v ON v.id = c.created_by”
. “\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id”
. ( count( $where ) ? “\nWHERE ” . implode( ‘ AND ‘, $where ) : ” )
. $order
. “\n LIMIT $pageNav->limitstart,$pageNav->limit”
;

In ga zamenjaj z:

$query = “SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author”
. “\n FROM #__content AS c” //, #__categories AS cc, #__sections AS s”
. “\n LEFT JOIN #__groups AS g ON g.id = c.access”
. “\n LEFT JOIN #__users AS u ON u.id = c.checked_out”
. “\n LEFT JOIN #__users AS v ON v.id = c.created_by”
. “\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id”
. “\n LEFT OUTER JOIN #__categories AS cc ON c.catid=cc.id”
. “\n LEFT OUTER JOIN #__sections AS s ON cc.section=s.id”
. ( count( $where ) ? “\nWHERE ” . implode( ‘ AND ‘, $where ) : ” )
. $order
. “\n LIMIT $pageNav->limitstart,$pageNav->limit”
;

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Mar
18

osCommerce: Add category and product name in title tag

Posted by admin in osCommerce, tips

I’m doing search engine optimization for a shop powered by osCommerce. Title tags are very important for that, so I wanted it to look like this: Shop name :: Category name :: Product name.

If you are using STS (Simple Template System) use:

  1. Open file /catalog/includes/modules/sts_inc/general.php
  2. Find line:

    $sts->template[’headertags’]= “<title>” . TITLE .”</title>”;

    and replace it with:

    // BOF add category and product name in title tag
    $product_title_query = tep_db_query(”select pd.products_name, pd.products_description from ” . TABLE_PRODUCTS . ” p, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd where p.products_id = ‘” . (int)$HTTP_GET_VARS[’products_id’] . “‘ and pd.products_id = p.products_id and pd.language_id = ‘” . (int)$languages_id . “‘”);
    $product_title = tep_db_fetch_array($product_title_query); // get product name

    $category_query = tep_db_query(”select cd.categories_name, c.categories_image from ” . TABLE_CATEGORIES . ” c, ” . TABLE_CATEGORIES_DESCRIPTION . ” cd where c.categories_id = ‘” . (int)$current_category_id . “‘ and cd.categories_id = ‘” . (int)$current_category_id . “‘ and cd.language_id = ‘” . (int)$languages_id . “‘”);
    $category = tep_db_fetch_array($category_query); // get category name

    $sts->template[’headertags’]= “<title>” . TITLE . ” :: ” . $category[’categories_name’] . ” :: ” . $product_title[’products_name’] . “</title>”;
    // EOF add category and product name in title tag

  3. Upload the file and you’re done!

If you are using basic osCommerce use:

  1. Open file /catalog/index.php
  2. Find line:

    <title><?php echo TITLE; ?></title>

    and replace it with:

    <?php // BOF add category and product name in title tag
    $product_title_query = tep_db_query(”select pd.products_name, pd.products_description from ” . TABLE_PRODUCTS . ” p, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd where p.products_id = ‘” . (int)$HTTP_GET_VARS[’products_id’] . “‘ and pd.products_id = p.products_id and pd.language_id = ‘” . (int)$languages_id . “‘”);
    $product_title = tep_db_fetch_array($product_title_query); // get product name

    $category_query = tep_db_query(”select cd.categories_name, c.categories_image from ” . TABLE_CATEGORIES . ” c, ” . TABLE_CATEGORIES_DESCRIPTION . ” cd where c.categories_id = ‘” . (int)$current_category_id . “‘ and cd.categories_id = ‘” . (int)$current_category_id . “‘ and cd.language_id = ‘” . (int)$languages_id . “‘”);
    $category = tep_db_fetch_array($category_query); // get category name
    ?>
    <title><?php echo TITLE . ” :: ” . $category[’categories_name’] . ” :: ” . $product_title[’products_name’]; ?></title>

  3. Do the same for file /catalog/product_info.php
  4. Upload files and that’s it!

Note: Page title (TITLE) is found in your language file (for example: /catalog/includes/language/english.php)

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Mar
13

Kako najem absolutno pot na strežniku

Posted by admin in tips
  1. Kreiraj novo php datoteko (recimo, da jo poimenuješ abspath.php).
  2. Vstavi spodnjo kodo v datoteko:

    <?php
    $abspath = getcwd();
    echo $abspath;
    ?>

  3. Naloži datoteko s FTP-jem na root direktorij domene.
  4. Odpri http://www.your-domain.com/abspath.php v brskalniku in izpisala se bo tvoja absolutna pot strežnika.
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]