Jump to content
surfalot

[Contribution] Define Content 1.x Support

Recommended Posts

Abstract:

 

Define Content is a basic language aware Content Management System (CMS)

designed for osCommerce. Its intended to make content management easier

for the non-technical shop owner. It allows you to define content areas

and then modify them with or without a WYSIWYG HTML editor from the

osCommerce admin.

 

Site designers can use this contrib to setup areas the store owner

can easily modify with tinyMCE WYSIWYG HTML editor.

 

Define Content is completely language aware in both catalog side and

admin side. This means it can be used, for example, to make the header

(top banner) change with the language choice of the customer. It can

also be used to make an image or any other content change with the

language choice of the customer.

 

The contribution allows you to include PHP code in the content so that

elements such as the STORE_NAME or STORE_NAME_ADDRESS can be

added via PHP. For security, and by default, php code is stripped from the

Define Content editor page when submitted. The extra step is included to

enable PHP code inclusion from the editor.

 

The contribution includes easy file copy directions to integrate tinyMCE

cross-browser WYSIWYG editor. tinyMCE is compatible with browsers like

Mozilla, MSIE, FireFox, Opera and (partially) Safari. tinyMCE has lots

of features. It cleans and verifies your HTML and I've even included

a mod to support including PHP code if you wish to optionally enable it.

If you already have a preferred WYSIWYG editor integrated into your admin,

you can use that, or follow the few included additional steps to setup tinyMCE.

 

Once installed, you can use the tinyMCE cross-browser WYSIWYG editor

for any textarea field in your osC admin.

 

This contribution comes with several examples of areas to use it such as:

Page Header

Page Footer

Catalog Main Page content and Greeting areas

Contact US Message

 

Get it here

Edited by surfalot

Share this post


Link to post
Share on other sites

hi pal , could you provide a screenshot to show us how it appears for the header and contact us in the admin ?


MS2

Share this post


Link to post
Share on other sites

Interesting question. This contrib is designed to allow you to make any defined area anything you want.

 

Directions are included that will allow you to install this contribution, and setup just what you want defined. You do not have to use the content areas I setup for the novice user. just make sure you read the directions carefully since sections are marked as Mandatory Install and Content Install. Ignore the Content setup instructions and you can start defining your content from scratch. Help is built in for setting-up content areas from scratch.

 

So, if you are asking about how it looks just after installing the contribution, it would look just like the default store would. I clipped out the default store header and created a content area for the header and pasted the code I clipped from the default store. So the result is exactly what I had to begin with, the default store.

 

There is only one exception to the pre-setup content. The Contact Page I have added this next sentence and the STORE_NAME_ADDRESS below that: "Welcome and thank you for visiting. Please use this information to contact us with any needs, questions or comments. Please use the form to contact us electronically."

Share this post


Link to post
Share on other sites

that seems to fit my need and the need of all the developper that setup a shop ...

i will try to setup it with fck editor, while maybe tinymce is better i didnt check the difference..

for the screenshot , that was more an admin screnneshot showing a footer or header content while entering the information


MS2

Share this post


Link to post
Share on other sites

I will include screenshots in the first update. You can go to tinymce dot moxiecode dot com and click on examples for how it looks and see available options. The benefits built into this integration boils down to 2 nice features. You can choose whether to use the editor (with a checkbox) each time you edit content. A feature is also available to turn the editor on or off while editing the code.

 

I have integrated both the standard osCommerce's stylesheet.css and the default images directory. It allows you to preview the images and directions are included on how to add more directories. (no upload though).

 

The WYSIWYG editor has an optional powerful code checking/cleanup engine. The WYSIWYG is also integrated with allowing and not allowing PHP code at edit time.

Share this post


Link to post
Share on other sites

after installation of this contrbution I receive the following:

 

064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

UPDATE define_content_description set define_content_description_text=' test', define_content_date_added='2005-11-11 00:00:00', define_content_last_modified=now() WHERE define_content_description_id=5 AND language_id=

 

[TEP STOP]

 

I checked the installation several times, I installed the contrib by editing the files by hand as explained in the readme files.

 

Server Host: Databank Host: localhost (127.0.0.1)

Server OS: Databank: MySQL 5.0.18-nt

Server Datum: 16.03.2006 16:27:00 Databank Datum: 16.03.2006 16:27:00

Server Up Time:

HTTP Server: Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/4.4.1-pl1

PHP Version: 4.4.1-pl1 (Zend: 1.3.0)

 

mysql 5.0.18 op windows

 

I tried this on my xammp test environment with the mysql version above and a mysql 4 server. The same error occures.

 

What is causing the error?

 

thanx in advance.

Share this post


Link to post
Share on other sites
064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Awesome detail! I wish everyone thought ahead enough to provide that. Were you just changing one of the pre-setup content blocks in the admin?

Share this post


Link to post
Share on other sites
Awesome detail! I wish everyone thought ahead enough to provide that. Were you just changing one of the pre-setup content blocks in the admin?

 

I tried to install this contrib by editing my files as pointed out in the readme. Did I make some kind of error in editing my files?

Share this post


Link to post
Share on other sites
Did I make some kind of error in editing my files?

You gave me lots of details about your system and the error, but what I need is what you did to get this error. What you posted doesn't tell me what page this ocurred on, what you clicked on or changed, etc.

Share this post


Link to post
Share on other sites
You gave me lots of details about your system and the error, but what I need is what you did to get this error. What you posted doesn't tell me what page this ocurred on, what you clicked on or changed, etc.

 

I installed the contribution as pointed outin the readme and the error occured, this is all the detail i can provide

Share this post


Link to post
Share on other sites
I installed the contribution as pointed outin the readme and the error occured, this is all the detail i can provide

yes, I got that. What page did the error occur on? What did you click on before this error appeared (if anything)? The MOST important item to report, beside the error itself, it what you were doing, what you clicked on, and what page the error occurred on. If you can't tell me where or what page this error occurred on, I can't help you track down the problem.

Share this post


Link to post
Share on other sites
yes, I got that. What page did the error occur on? What did you click on before this error appeared (if anything)? The MOST important item to report, beside the error itself, it what you were doing, what you clicked on, and what page the error occurred on. If you can't tell me where or what page this error occurred on, I can't help you track down the problem.

When I submit the change of content of a page, at this moment I'm reinstalling the contrib to see what happens

Share this post


Link to post
Share on other sites

I reinstalled the contribution on my test server this time I used a more compatible setup with mysql 4.1.18-nt.

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

UPDATE define_content_description set define_content_description_text='

test

 

', define_content_date_added='2005-11-11 00:00:00', define_content_last_modified=now() WHERE define_content_description_id=6 AND language_id=

 

[TEP STOP]

 

it happens when I try to add content in de admin/define content/catalog main en click the update button

Share this post


Link to post
Share on other sites

Is this a standard osCommerce install, CRE, heavy modified, what? How many languages are active?

Share this post


Link to post
Share on other sites
Is this a standard osCommerce install, CRE, heavy modified, what? How many languages are active?

 

oscommerce install not heavy modified. I used contribs for shipping en payment and Categories. only dutch is active.

 

My Shop

Share this post


Link to post
Share on other sites
oscommerce install not heavy modified. I used contribs for shipping en payment and Categories. only dutch is active.

 

please create a new file: /catalog/admin/test.php

 

with the following in it, and run it from your server in the /admin/ folder as indicated above. Post me the results please. I hope I don't have any code errors, it was written on-the-fly.

 

<?php
 require('includes/application_top.php');
 if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
echo 'setting $lng now'.'<br>'."\n";
 } else {
echo '$lng is set'.'<br>'."\n";
 }
 echo 'languages from object:'.'<br>'."\n";
 while (list($key, $value) = each($lng->catalog_languages)) {
echo $key.' '.$value.'<br>'."\n";
 }
 echo '<br>'."\n";
 echo 'languages from tep_get_languages:'.'<br>'."\n";
 $languages = tep_get_languages();
 print_r($languages);
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Share this post


Link to post
Share on other sites

Hello,

 

I am following your instructions, but I think you misspelled a directory:

 

OPEN: admin/.php ????.php

 

which file needs to be updated with this :

 

OPEN: admin/.php

 

## Find:

 

tep_db_query("drop table if exists address_book, address_format, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, languages, manufacturers, manufacturers_info, orders, orders_products, orders_status, orders_status_history, orders_products_attributes, orders_products_download, products, products_attributes, products_attributes_download, prodcts_description, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sessions, specials, tax_class, tax_rates, geo_zones, whos_online, zones, zones_to_geo_zones");

 

 

## change to

 

// BOF: Define Content: Added: define_content, define_content_description,

tep_db_query("drop table if exists define_content, define_content_description, address_book, address_format, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, languages, manufacturers, manufacturers_info, orders, orders_products, orders_status, orders_status_history, orders_products_attributes, orders_products_download, products, products_attributes, products_attributes_download, prodcts_description, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sessions, specials, tax_class, tax_rates, geo_zones, whos_online, zones, zones_to_geo_zones");

// EOF: Define Content

 

 

Thanks.

Share this post


Link to post
Share on other sites
OPEN: admin/.php ????.php

Wow, that was a brain-fart. :blush: That should be:

 

OPEN: admin/backup.php

Share this post


Link to post
Share on other sites
Wow, that was a brain-fart. :blush: That should be:

 

OPEN: admin/backup.php

 

 

Hehehe no problem man !! I think your script sounds very interesting. Let me see if I can get it working :)

 

Cheers !

Share this post


Link to post
Share on other sites

Hi !

 

well I got it installed, but got a few probs. I think mainly related to the language I have selected.

 

First off , just to let you know, I modified my spanish file rather than the english file.

 

First problem:

 

I do not see a link in the admin for Define Content (I just went directly to define_content.php)

 

Second: When saving the info on Catalog Main, I get this error:

 

URL : http://www.centroaudio.es/admin/define_con...d=6&action=save

 

Error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

UPDATE define_content_description set define_content_description_text='hola', define_content_date_added='2005-11-11 00:00:00', define_content_last_modified=now() WHERE define_content_description_id=6 AND language_id=

 

[TEP STOP]

 

 

Looks like the query is not getting the current language value perhaps? Just a guess.

Share this post


Link to post
Share on other sites

Hey!

 

this instruction from the install.txt file should have given you the link in the admin:

 

OPEN: admin/includes/column_left.php

 

 

## Find:

 

require(DIR_WS_BOXES . 'catalog.php');

 

 

## Add after:

 

// BOF: Define Content

require(DIR_WS_BOXES . 'define_content.php');

// EOF: Define Content

 

 

did you create a new entry for your language, or did you just try to edit and save one of the preset english examples? If you did create a new content area for your language, please see post #17 and run that discovery script for me so I can figure out what your language class is loading.

 

If you didn't create a new content area for your language, click the little help link next to the Define Content title and follow those instruction to setup a new content area for your language.

Edited by surfalot

Share this post


Link to post
Share on other sites
Hey!

 

this instruction from the install.txt file should have given you the link in the admin:

did you create a new entry for your language, or did you just try to edit and save one of the preset english examples? If you did create a new content area for your language, please see post #17 and run that discovery script for me so I can figure out what your language class is loading.

 

If you didn't create a new content area for your language, click the little help link next to the Define Content title and follow those instruction to setup a new content area for your language.

 

Hi SurfAlot,

 

No I have used the default english setting. How do I set it to spanish ? Sorry about my ignorance.

Share this post


Link to post
Share on other sites
Hi SurfAlot,

 

No I have used the default english setting. How do I set it to spanish ? Sorry about my ignorance.

 

If you setup the complete English example and the english SQL, you have to add content for your language.

 

1) click Insert under the main content list.

2) Select the content area.

3) enter the content.

4) select your langauge.

5) click Insert.

 

Do this for each content area.

 

NOTE: you can first edit an existing english content area, copy what is there, then follow the instructions above. Just paste the english content in the content field in step #3 and do your translation.

 

The only language I know I English. I'm looking for anyone that can contribute translations for the language files and the SQL to be inlcuded in a future release. :)

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

×