Thursday, 28 May 2015

http://www.agenziazelaschi.it | php 5.3 win32 - denial of service and buffer overflow



path: C:\JRun4\servers\multi_01\hp6022\
.\blog\
.\blog2\
....

php path: C:\Program Files (x86)\PHP\v5.3\php-cgi.exe

Wednesday, 27 May 2015

FIX - smaller search box not working properly on my custom opencart theme

search not working properly on my custom opencart theme


Probably you have moved your <?php echo $search; ?> outside the <header> tag.

so .... we are going to use the #search id

<div id="search" class="input-group">
  <input type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php echo $text_search; ?>" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i></button>
  </span>
</div>


Solution

edit catalog/view/javascript/common.js

and after
var a=$("header input[name='search']").val();

add
if(!a){a=$("#search input[name='search']").val();}

or just replace
var a=$("header input[name='search']").val(); it s
with
var a=$("#search input[name='search']").val();

 I've just added the if statement so that I can ignore in the future WHY it doesn't work at all and I can move the "small search" in and out the header.

It's the fastest way and I don't want to invest extra time understanding why it works this way.

Saturday, 23 May 2015

solution for the message No -tsa or -tsacert is provided and this jar is not timestamped

Solution for the message

No -tsa or -tsacert is provided and this jar is not timestamped. Without a times
tamp, users may not be able to validate this jar after the signer certificate's
expiration date (2015-08-21) or after any future revocation date.

When you are (trying to sign) signing a jar this notice can be shown if the file is not timestamped.

To solve this thing the faster way is to add this part to your signing command line

-tsa http://timestamp.digicert.com


for example

jarsigner -storepass mypass -keypass mypass2 myjar.jar storek

Wednesday, 20 May 2015

sql replace text in a update



Check live the Example http://sqlfiddle.com/#!9/9d3c4

We are basing the example on a table with varchar records
CREATE TABLE uno
(
str varchar(255)
);

insert into uno VALUES ( 'anteprima/image/descriptions/555b2343cb43a-555b2343c94f3-wink_smile.gif');
insert into uno VALUES ( 'anteprima/image/descriptions/555b2343cb43a-dd3b2343c94f3-wink_smile.gif');
insert into uno VALUES ( 'anteprima/image/descriptions/555b2343cb43a-555b2343c94f3-wink_smiles.gif');
insert into uno VALUES ( 'anteprima/image/descriptions/555b2343cb43a-555b2343c94f3d-wink_smile.gif');
insert into uno VALUES ( 'anteprima/image/descriptions/555b2343cb43a-555b2343c9qdq4f3-wink_smile.gif');
___


We want to REPLACE 'anteprima/image/descriptions/' with 'image/catalog/descriptions/'
 within each record.
UPDATE uno set str = replace(str, 'anteprima/image/descriptions/', 'image/catalog/descriptions/');

It's useful, for example, to move image paths of your products in magento, opencart, prestashop and so on.

sample (used for real) query that I used in opencart due to the missing images after a migration.

UPDATE oc_product_description SET
oc_product_description.description = replace(oc_product_description.description, 'anteprima/image/descriptions/', 'image/catalog/descriptions/');

Tuesday, 5 May 2015

FIX Fatal error: Call to a member function toOptionArray() on a non-object

Fix Fatal error: Call to a member function toOptionArray() on a non-object



replace

$optionArray = $sourceModel->toOptionArray($fieldType == ‘multiselect’);

with

 if ( is_object($sourceModel) ) {
                $field->setValues($sourceModel->toOptionArray($fieldType == 'multiselect') );
}