Jump to content

php 5.2 - 5.4 (to use ioncube).


Nik Grey

Recommended Posts

Starting a new thread as I was hijacking >This one previously.

 

So, having a couple of tools made for my new cubecart - the original developer who is making my 'Lettering Tool' managed to get the tool working on their server Here.

 

And was saying that my php version was the problem - in an attempt to rectify this I have been moved to a different server so I can use php 5.4 and ioncube.

 

Things arent going well now (moved over 48 hours ago) - many pages are not displaying etc, and there is no difference to the tool on my test store Here.

 

I checked my global.inc.php file to make sure the correct encoder was selected:

 

$glob['encoder'] = 'ioncube';

 

so am wondering what else I need do to get this working again on the new php version. I have left it so long before posting here as it might have been a progagation issue but I'm sure it cant be now :(

 

I want to make a fresh install but I have a version of my new tool on there and I have no way of getting that back as I dont have anything from the developer of that yet as its not finished.

 

Any idea's ?

 

Not sure if this is any help: http://test-store.greyprint.co.uk/phpinfo.php

Link to comment
Share on other sites

In this new conversation, can you refresh our memory by summarizing what you believe how the lettering tool is malfunctioning?

 

Also, looking at the HTML source as seen by my browser, the code is not exactly the same between the two sites (as this is being written).

 

There is the issue where a couple of color codes are not preceded by # in your custom code -- their custom code has the #.

 

CubeCart already calls jQuery 1.7, the highest version CubeCart is coded for. The custom code on their site calls jQuery 1.8.2, and the custom code on your site calls jQuery 1.10.2. (There are a couple of locations where a drop-down selector auto-submits the form, and jQuery 1.8+ causes this to not happen. I do not know what behaviors will manifest with two versions of jQuery loaded.)

Link to comment
Share on other sites

Thanks Brian.

 

There were issues with the drop down menu not showing the colours, and the 'Available' colours page was not showing any colours either but that was becayse the # was missing. thats fixed now.

 

The main problem, and it might seem like a small one but its important to me - the '£' doesnt work, all I get is a square.

Link to comment
Share on other sites

"the '£' doesn't work" where? Next to the calculated price text field? The HTML code has the entity (£) to show this character.

 

If you are referring to the Enter Text text field, and when you enter '£' as the text to get lettered, then, yes, I see a square. A square is the symbol returned by the font driver to indicate that there is no glyph in this font for that character. That is, "I do not know how to draw that character." (When CC525 added the Hebrew language pack, my programmer's text editor showed all squares. I have an editor setting to use a font that I did not know did not have glyphs for the Hebrew letters.)

 

On your site, the only font listed is Times (which is weird, as I would think £ would be in the font). The data is: fontid=1&text=Smither%C2%A3&size=30&colorid=2 (where %C2%A3 are the html entities for the UTF-8 byte code of £).

 

On their site, there are several fonts (not Times). The data is: fontid=5&text=U21pdGhlcsKj&size=20&colorid=1 (where U21pdGhlcsKj is the text that has been base64 encoded).

 

Considering the sample shown is in fact an image generated on the fly, and that the character being requested is properly formed (in my opinion), the fault then lies with the code that generates the image. Or, perhaps more on point, the source of the fonts need to be looked into.

 

Also, it is apparent that your site still has a version of this package different than the developer's site.

Link to comment
Share on other sites

Sorry, yes - I meant in the 'Enter Text' box, the £ doesnt work. I did just upload another font as my thought was the font was missing that symbol.

 

This is important for me as I know people will want to use this £ symbol.

 

You said it:

"Also, it is apparent that your site still has a version of this package different than the developer's site."

 

This is exactly what is worrying me.. will get back onto him now - I'm sure he wants to finish this as much as I need to start using it.

 

Also I notice a lot of pages arent working in the admin area:

 

http://test-store.greyprint.co.uk/admin.php?_g=settings&node=currency

 

for example.

 

The site seems to be slower also, takes a while to load the updated text when you update it :(

 

I'm not sure if I can do anything else to help that - I did optimise the tables :(

Link to comment
Share on other sites

Well, I have solved the missing pages issue - the original chap put an .htaccess file in (I renamed it and things are working now):

 

Still no £ sign, but at least Admin is working :)

 

## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *

#### Rewrite rules for SEO functionality ####

<IfModule mod_rewrite.c>
  RewriteEngine On
 
   ######## START v4 SEO URL BACKWARD COMPATIBILITY ########
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$    index.php?_a=category&cat_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$        index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(.[a-z]{3,4})?$        index.php?_a=document&doc_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$        index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(.[a-z]+)?(?.*)?$        index.php?_a=saleitems&%1 [NC,L]
  ######## END v4 SEO URL BACKWARD COMPATIBILITY ########

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>

Link to comment
Share on other sites

ok, I have another version of this tool - it is claimed to be the same version as HERE

 

So, does the html match THIS one.

 

If so, why does the £ still not work.. :(

 

Could this all be down to some setting I have control over? I stopped banging my head against the wall for a while and found this:

 

 

This works in all chrome, IE, Firefox.

In Database > table > field type .for example set the symbol column TO varchar(2) utf8_bin php code:

$symbol = '£';
echo mb_convert_encoding($symbol, 'UTF-8', 'HTML-ENTITIES');
or
html_entity_decode($symbol, ENT_NOQUOTES, 'UTF-8');

And also make sure set the HTML OR XML encoding to encoding="UTF-8"

Note: You should make sure that database, document type and php code all have a same encoding

Link to comment
Share on other sites

I have only set the 30mm prices so-far as I am sure if I set and enter everything I will have to do it again, I know it is all stored in the database but I am not trusting much at the moment with this :(

 

Everything else seems to work apart from that £ symbol.

Link to comment
Share on other sites

The HTML is the same (except for the site URL).

 

This character, ¿, also makes a square on your site. So, your installation of PHP (probably) might not be set to use UTF-8 in the proper way.

 

Later today, I will compare the PHPINFO between the two sites to see if there is a difference.

Link to comment
Share on other sites

Using a programmer's text editor (NotePad++ is good and free), make your edits. To get the file downloaded to your computer, your hosting control panel should have an FTP utility.

 

As well as, your hosting control panel may have a text editor as part of its toolset.

Link to comment
Share on other sites

Thanks for checking Brian,

 

I'm in the js/common.html and 2 jqueries are listed:

 

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.min.js"></script>

 

I will change the top one to 1.7 now but could this be the cause of my problems?

Link to comment
Share on other sites

SUCCESS !!!

 

I just happened to mention about the £ sign not showing problem to Jonathan (Toucan) in passing as he has built another tool for me.

 

I didn't expect him to do anything but he just replied saying he had fixed it - and he has ! it's working - look:

 

http://test-store.greyprint.co.uk/index.php?_a=letter

 

To say I am chuffed is an under statement.. now I wonder if I pass on the information if my original developer can make some changes to his code so I dont have to have someone else make further changes ?

 

I feel like the weight of the world has just been lifted from my shoulders.

 

happy :)

 

This is all Jonathan said - means nothing to me but it will do some of you:

 

Had a play around with it, managed to get it sorted, it needs to use html entity numbers apparently, php doesn't have a function to directly convert to those though, utf8_encode does not seem to do the trick

Right, should be sorted now, had to add in a translation to that
.

Link to comment
Share on other sites

It's a very good question really, but maybe it's some quirk of either the charset being different on the test site so that the symbols were getting sent differently, or maybe a minor php version change was allowing the imagettftext function to just accept the £ or &pound;.

 

The php spec itself just references utf8, there's no reason I could see that it should only work on html entity numbers rather than bog standard entities or such

Link to comment
Share on other sites

For imagettftext(), if a character is used in the string which is not supported by the font, a hollow rectangle will replace the character. Empty rectangles is a standard way to show that there is no glyph for this code point. I think it is the font driver of the operating system that does this, not PHP nor the function.

 

But, seriously, a modern operating system not having an up-to-date font driver, and not having up-to-date fonts??? And the GBP and Spanish UQM not being in the font???

 

So you were able to experiment with the tool? On your dev server? What was it's behavior?

 

Nik Grey's point of view aside, I won't be satisfied until the true culprit is found.

Link to comment
Share on other sites

Did they provide the fonts you're using Nik, or did you find those yourself? Just to check whether that's the same

 

I'd been doing another plugin so had access to Nik's test site, so just went on and had a look into it, figured it was something due to the charset and just had an experiment around with it, utf8_encode just made it bring up 3 squares rather than the one, as it clearly couldn't read the format it'd gone into, &pound; just got rendered as such in the font, with no conversion to £, the only one it took in the end was &#163;

Link to comment
Share on other sites

  • 4 weeks later...

From what Jonathan said above does anybody know what he did - I have just spent the entire day trying to update my Test Store and I just keep hitting a wall.

 

The Lettering Tool is not showing characters again, there no way I can even think about updating my main store at the moment, too many things are against me.

 

I may be stuck on 5.2.5 forever :(

 

I tried deleting everything and uploading 5.2.8 (in an attempt to solve another problem) - no lettering tool characters, then 5.2.7 again which should have worked as Brian made me a special revision of the Lettering Tool which WAS working before today.

I am sure I have got rid of what ever Jonathan did and as I have no clue what it might have been I am well and truly stuck.

 

I tried Two windows of FireFTP but that does my head in, doesn't seem to make any sense - everything gets written to the root and I have to spend ages deleting all of that one by one.

 

I want to copy the Live Store to the Test Store again, I may have to install FlashFXP onto a windows machine and do it that way.

 

.. fxp installed on a windoze machine but thats taking forever - losing the will to live, its been 5 months since I started this project and I still cant open to the public. help !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...