Jump to content
surfalot

[Contribution] Define Content 1.x Support

Recommended Posts

Hi again.

 

I found the solution thanks to Todd's link, it's a great forum there by the way. I will post my solution on "how to make tiny_mce to use utf-8", and to show utf-8 up in both, page itself and page source. Thats very importand for not stuffing google with some α stuff, no listing with this. Also if you use "header tags SEO" and want to use the "fill tags" option, you need normal text to be placed here. It will not happen if you don't change the tiny_mce settings

 

Maybe somebody else has the same problems.

 

1) You need to modify 2 files:

 

admin/includes/javascript/tiny_mce/tiny_mce.js

admin/includes/javascript/tiny_mce/tiny_mce_src.js

 

2) In each file search for the word "entity"

 

3) the default setting for this is 'named' Change it to 'raw'

 

4) Upload the files. Thats it ! You need to resubmit all content that you had written in tiny_mce and it will appear correctly

Share this post


Link to post
Share on other sites

Thanks for working that out and contributing the solution!

 

You shouldn't need to edit those files. This should work by added this "override" in the files I mentioned above in the initialization function.

 

entity_encoding : "raw",

 

Those files should be there if you have version 1.4 of Define Content.

Edited by surfalot

Share this post


Link to post
Share on other sites
I have version 1.3b. I'll update by chance

 

in that version you would add it to the initialization function in this folder:

catalog/admin/includes/javascript/tiny_mce/initconfig.js

there are several initconfig.js files there. it depends on which config you are using.

 

the 1.4 version requires the 3.x.x version of tinyMCE.

 

the 1.3 version of Define Content shouldn't work with the new version of tinyMCE

Edited by surfalot

Share this post


Link to post
Share on other sites

Hi George,

 

Thanks for your help.

I ran the 2 tests and got these results:

 

 

/catalog/test.php

setting $lng now

languages from object:

en Array ( [id] => 1 [name] => English [image] => icon.gif [directory] => english )

hu Array ( [id] => 4 [name] => Hungarian [image] => icon.gif [directory] => hungarian )

 

When I ran the /catalog/admin/test.php I get to the address:

 

http://eva4art.com/catalog/admin/FILENAME_LOGIN

 

But on the page I have a 404 error message.

Share this post


Link to post
Share on other sites
are you having a problem of some sort?

 

Hi Surfalot,

 

George started to help me yesterday.

I have a store (eva4art.com) set up (downloads only) in English and Hungarian.

If you signed up in the Hungarian language, you didn't get welcome email or order confirmation email. Now I got the order confirmation email to go out but the welcoming still doesn't go out.

 

I also would like to ask you a question. I am home with my 2 year old son trying to make some extra income as other hundreds of moms. I do not know anything about data base management and coding. I am reading the forums, and using the help what all these great people can offer. But still it looks like I am going to struggle for months to get it together when I can open and not to expect any major problem.

 

Is there any place where I can find someone here who could clean up my database and troubleshoot my site? I can not pay thousands of dollars but I understand that it takes time and knowledge to do this work and willing to compensate for it.

 

Thank you for your attention.

 

Eva

Edited by eva4art

Share this post


Link to post
Share on other sites
Hi Surfalot,

George started to help me yesterday.

I have a store (eva4art.com) set up (downloads only) in English and Hungarian.

If you signed up in the Hungarian language, you didn't get welcome email or order confirmation email. Now I got the order confirmation email to go out but the welcoming still doesn't go out.

Eva

This doesn't appear to be related to Define Content contribution.

Share this post


Link to post
Share on other sites
couple ideas for you...

 

first try this change, same change in both of these files:

catalog/admin/external/tiny_mce/tinyMCEinit.js

catalog/admin/external/tiny_mce/tinyMCEinit_strict.js

 

find the line:

		document_base_url : osc_baseurl + "index.php",

 

change to:

		document_base_url : osc_baseurl,

 

if that doesn't work, try this. In file:

catalog/admin/tinymce_images.js.php

 

find the line:

	  $output .= '["'.$name.'", "'.$file.'"]'.(($sz==$c)?'':','."\n" );

 

change to:

	  $output .= '["'.$name.'", "'.DIR_WS_CATALOG.$file.'"]'.(($sz==$c)?'':','."\n" );

 

I am having this problem with both links and images. I applied both modifications, and my problem with the images was solved, but still, when I try to create a link, it strips the url, and adds index.php. Every time I modify the page, it adds another 'index.php' so I end up with a url that looks like this: <a href="index.php/index.php/index.php/index.php/conditions.php">Terms and Conditions</a>

 

Any help would be greatly appreciated. Thanks!

 

Scott

Share this post


Link to post
Share on other sites
I am having this problem with both links and images. I applied both modifications, and my problem with the images was solved, but still, when I try to create a link, it strips the url, and adds index.php. Every time I modify the page, it adds another 'index.php' so I end up with a url that looks like this: <a href="index.php/index.php/index.php/index.php/conditions.php">Terms and Conditions</a>

 

Any help would be greatly appreciated. Thanks!

 

Scott

 

it still adds the index.php even after that first change? did you change both files?

 

if you make this change in the same file, it should stop changing the urls all together.

		relative_urls : true,

 

to

 

		relative_urls : false,

 

both files

Share this post


Link to post
Share on other sites

Thanks so much for the help. The first fix did do the trick. I'm not sure why it didn't work the first time I tried.

 

- Scott

Share this post


Link to post
Share on other sites

not sure if this was brought up already, but i'm getting an error with the installation example of using the tinymce editor on the admin/categories.php page. The error that displays itself says on top of that categories.php page says....

 

Warning: Variable passed to each() is not an array or object in C:\site\catalog\admin\categories.php on line 348

Warning: reset() [function.reset]: Passed variable is not an array or object in C:\site\catalog\admin\categories.php on line 351

 

 

This is the code its looking at....

 

<?php // get language code for TinyMCE
 $lang_code = 'en';
 while (list($key, $lang) = each($lng->catalog_languages)) {
  if ($lang['directory']==$language) { $lang_code = $key; break; }
 }
 reset($lng->catalog_languages); ?>

 

 

I'm using osc rc2a, any advice?

 

thanks

Edited by kenz

Share this post


Link to post
Share on other sites
not sure if this was brought up already, but i'm getting an error with the installation example of using the tinymce editor on the admin/categories.php page. The error that displays itself says on top of that categories.php page says....

 

Warning: Variable passed to each() is not an array or object in C:\site\catalog\admin\categories.php on line 348

Warning: reset() [function.reset]: Passed variable is not an array or object in C:\site\catalog\admin\categories.php on line 351

 

 

This is the code its looking at....

 

<?php // get language code for TinyMCE
  $lang_code = 'en';
  while (list($key, $lang) = each($lng->catalog_languages)) {
   if ($lang['directory']==$language) { $lang_code = $key; break; }
  }
  reset($lng->catalog_languages); ?>

 

 

I'm using osc rc2a, any advice?

 

thanks

 

strange. do you only have one language installed maybe? I can't figure why the languages class would not be initialized.

 

try closing your browser, clearing the cache, and try again?

 

does it work fine in the define content page? see tinyMCE there?

Share this post


Link to post
Share on other sites
strange. do you only have one language installed maybe? I can't figure why the languages class would not be initialized.

 

try closing your browser, clearing the cache, and try again?

 

does it work fine in the define content page? see tinyMCE there?

 

Yes I'm only using one language. perhaps the reason cause I deleted the other default languages from osc. When I remove that php code, the error goes away.

Edited by kenz

Share this post


Link to post
Share on other sites
Yes I'm only using one language. perhaps the reason cause I deleted the other default languages from osc. When I remove that php code, the error goes away.

 

Thanks again for the response surfalot. I ran into another issue now. I have the tinymce editor installed but a lot of text wording for buttons within tinymce are showing up like...

 

{#advanced_dlg.code_wordwrap}

 

or my cancel button says...

{#cancel}

 

instead of just "cancel". Same thing with my update button and various buttons on my image popup window.

 

I downloaded the latest version of tinymce - 3.2.5

 

 

Also how do we turn on spellcheck, i have it installed in my folder directory according to the instructions.

 

 

Thank you so much!

Edited by kenz

Share this post


Link to post
Share on other sites
Thanks again for the response surfalot. I ran into another issue now. I have the tinymce editor installed but a lot of text wording for buttons within tinymce are showing up like...

 

{#advanced_dlg.code_wordwrap}

 

or my cancel button says...

{#cancel}

 

instead of just "cancel". Same thing with my update button and various buttons on my image popup window.

 

I downloaded the latest version of tinymce - 3.2.5

 

 

Also how do we turn on spellcheck, i have it installed in my folder directory according to the instructions.

 

 

Thank you so much!

 

The funny thing is that the buttons look great when you actually work in the define content pages - but looks off on other parts of the admin.

Share this post


Link to post
Share on other sites
The funny thing is that the buttons look great when you actually work in the define content pages - but looks off on other parts of the admin.

 

thats because of the code you took out. it handles the language settings without it, you'll get what you got.

 

What language are you using?

 

go back to post 17 and give me the results.

 

do you have any other contributions installed in categories.php?

Share this post


Link to post
Share on other sites
thats because of the code you took out. it handles the language settings without it, you'll get what you got.

 

What language are you using?

 

go back to post 17 and give me the results.

 

do you have any other contributions installed in categories.php?

 

I only have english installed. I deleted all other languages befdore installing this contribution.

 

I have more pics v6 and quick edit products installed on my rc2a.

 

In all seriousness, how do i got to any particular post? I'm working with firefox 3 and post page #'s found on the right side of every comment seem confusing to follow, they change up depending on the conversation...

 

 

thanks!

Edited by kenz

Share this post


Link to post
Share on other sites

post number is in the upper right of each post. post 17 is on page 1.

Share this post


Link to post
Share on other sites
post number is in the upper right of each post. post 17 is on page 1.

 

i'm not seeing it..? Would you happen to have a link for it?

 

thanks

Share this post


Link to post
Share on other sites

in the list of pages (left side, top and bottom), go to page 1. 3/4 of the way down the page, post 17

Share this post


Link to post
Share on other sites
in the list of pages (left side, top and bottom), go to page 1. 3/4 of the way down the page, post 17

 

Hello todd - I found the problem. I had to place...

 

  if (!$lng) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language();
 }

 

In my head tag for my categories.php page before the tinymce editor was called. for some reason my catagories.php page could not find the language class without this little piece of code.

Everything works like a charm now.

Edited by kenz

Share this post


Link to post
Share on other sites

Want to add category descriptions on the fly with Define Content? Simply open up your catalog/index.php page and look for

 

<tr>
 <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);?></td> 
</tr>

 

and replace it with

 

 

 $category_query = tep_db_query("select cd.categories_name from " .TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" .(int)$current_category_id . "' and cd.language_id = '" .(int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

if ($category['categories_name']) {
 echo tep_get_defined_content($category['categories_name']);
}

 

Finally define your content in the admin of your site with the exact name of your category. That's it. This is considering that you have "Define Content" already working for you on your index.php Credit goes to Unique Category Descriptions - http://addons.oscommerce.com/info/4053.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×