Jump to content



Photo
- - - - -

Discussion about Hard Coded Database Tables


  • Please log in to reply
43 replies to this topic

#1   Kolingua

Kolingua
  • Members
  • 40 posts
  • Real Name:Juan Antonio Postigo
  • Gender:Male

Posted 24 February 2015 - 11:31

Database tables' names are hardcoded in line 36 of catalog/includes/modules/boxes/bm_specials.php, it should be changed to

      if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {

Edited by figuera, 24 February 2015 - 11:33.


#2   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 24 February 2015 - 11:37

@figuera - database names and filenames should be hardcoded.  

 

/includes/filenames.php and /includes/database_tables.php are deprecated.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#3   Kolingua

Kolingua
  • Members
  • 40 posts
  • Real Name:Juan Antonio Postigo
  • Gender:Male

Posted 24 February 2015 - 14:11

@figuera - database names and filenames should be hardcoded.  

 

/includes/filenames.php and /includes/database_tables.php are deprecated.

 

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?


Edited by figuera, 24 February 2015 - 14:14.


#4   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,770 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 24 February 2015 - 16:25

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

yes, that is apparently the current line of thinking, personally I don't like it either as I rely on some level of abstraction for the database.
I personally don't have issues with the filenames being hardcoded - maybe we should organize a community poll ?
KEEP CALM AND CARRY ON
FYI Just upgraded from PHP 5.3 to PHP 5.5  and saw big performance improvement.
But be aware php 5.5 is more strict about things.
UTF8-without BOM, no extra spaces allowed at the beginning or end of your php file, or your redirects wont work.
No double declarations of functions allowed - used to slip through the cracks ...

#5   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 24 February 2015 - 16:48

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

 

Yes.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#6   Kolingua

Kolingua
  • Members
  • 40 posts
  • Real Name:Juan Antonio Postigo
  • Gender:Male

Posted 25 February 2015 - 07:55

yes, that is apparently the current line of thinking, personally I don't like it either as I rely on some level of abstraction for the database.
I personally don't have issues with the filenames being hardcoded - maybe we should organize a community poll ?

Changing the file names may make sense for a store whose default language is other than English, and unique table names may provide a little extra protection against SQL injection attacks. A poll seems a good idea.



#7   wHiTeHaT

wHiTeHaT
  • Community Team
  • 1,135 posts
  • Real Name:Henry
  • Gender:Male
  • Location:Netherlands

Posted 25 February 2015 - 08:40

@bruyndoncx

@figuera

 

Imagine for your account_edit.php you never need to touch :

<?php
	/*
		$Id$
		
		osCommerce, Open Source E-Commerce Solutions
		http://www.oscommerce.com
		
		Copyright (c) 2015 osCommerce
		
		Released under the GNU General Public License
	*/
	
	require('includes/application_top.php');
	
	echo $oscTemplate->getPageContent('account_edit');  
	
	require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Then for the pageContent being called pg_account_edit.php you wil never need to touch (if we get more classes to get rid of the globals) :

<?php
	/*
		$Id$
		
		osCommerce, Open Source E-Commerce Solutions
		http://www.oscommerce.com
		
		Copyright (c) 2015 osCommerce
		
		Released under the GNU General Public License
	*/
	
	class pg_account_edit {
		var $group = 'account_edit';
		
		function prepare() {
			global $navigation, $breadcrumb, $oscTemplate;
			
			if (!tep_session_is_registered('customer_id')) {
				$navigation->set_snapshot();
				tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
			}
			
			$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
			$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link($this->group . '.php', '', 'SSL'));			
		}
		
		function buildtop() {
			global $messageStack, $oscTemplate;
			
			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/template_top.php') && file_exists('includes/templates/' . TEMPLATE . '/template_bottom.php')) {
				require('includes/templates/' . TEMPLATE . '/template_top.php');
				} else {
				require(DIR_WS_INCLUDES . 'template_top.php');
			}
			require('includes/form_check.js.php');			
			$data = ob_get_clean();                 
			
			$oscTemplate->addPageContent($data, $this->group);		
		}
		
		function build() {
			global $HTTP_POST_VARS, $customer_id, $customer_default_address_id, $messageStack, $sessiontoken, $oscTemplate;
			
			require('includes/modules/pages/pg_actions/' . $this->group . '.php');			
			
			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php')) {
				include('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php');
				} else {
				include(DIR_WS_MODULES . 'pages/templates/tpl_' . $this->group . '.php');
			}
			$data = ob_get_clean();                 
			
			$oscTemplate->addPageContent($data, $this->group);
		}
		
		function buildbottom() {
			global $oscTemplate;
			
			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/template_bottom.php') && file_exists('includes/templates/' . TEMPLATE . '/template_top.php')) {
				require('includes/templates/' . TEMPLATE . '/template_bottom.php');
				} else {
				require(DIR_WS_INCLUDES . 'template_bottom.php');
			}
			$data = ob_get_clean();                 
			
			$oscTemplate->addPageContent($data, $this->group);			
		}		
	}
?>

Because this is a CRUD based page (Create-Read-Update-Delete) we require an action file called in function build() :

require('includes/modules/pages/pg_actions/' . $this->group . '.php');

So inside that file named now as account_edit.php ($this->group == account_edit) we have:

<?php
	
	global $HTTP_POST_VARS, $customer_id, $customer_default_address_id, $messageStack, $sessiontoken, $oscTemplate;
	
	if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
		if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
		$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
		$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
		if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
		$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
		$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
		$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
		
		$error = false;
		
		if (ACCOUNT_GENDER == 'true') {
			if ( ($gender != 'm') && ($gender != 'f') ) {
				$error = true;
				
				$messageStack->add('account_edit', ENTRY_GENDER_ERROR);
			}
		}
		
		if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
		}
		
		if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
		}
		
		if (ACCOUNT_DOB == 'true') {
			if ((strlen($dob) < ENTRY_DOB_MIN_LENGTH) || (!empty($dob) && (!is_numeric(tep_date_raw($dob)) || !@checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))))) {
				$error = true;
				
				$messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR);
			}
		}
		
		if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
		}
		
		if (!tep_validate_email($email_address)) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
		}
		
		$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'");
		$check_email = tep_db_fetch_array($check_email_query);
		if ($check_email['total'] > 0) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
		}
		
		if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
			$error = true;
			
			$messageStack->add('account_edit', ENTRY_TELEPHONE_NUMBER_ERROR);
		}
		
		if ($error == false) {
			$sql_data_array = array('customers_firstname' => $firstname,
			'customers_lastname' => $lastname,
			'customers_email_address' => $email_address,
			'customers_telephone' => $telephone,
			'customers_fax' => $fax);
			
			if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
			if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
			
			tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
			
			tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'");
			
			$sql_data_array = array('entry_firstname' => $firstname,
			'entry_lastname' => $lastname);
			
			tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'");
			
			// reset the session variables
			$customer_first_name = $firstname;
			
			$messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');
			
			tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
		}
	}
	
	$account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
	$account = tep_db_fetch_array($account_query);
	
?>

As can see in above file it is the code what is in your default account_edit.php running BEFORE template_top.php

 

And then comes the final html output previously called as well in function build() as:

			ob_start();
			if (file_exists('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php')) {
				include('includes/templates/' . TEMPLATE . '/modules/pages/tpl_' . $this->group . '.php');
				} else {
				include(DIR_WS_MODULES . 'pages/templates/tpl_' . $this->group . '.php');
			}
			$data = ob_get_clean(); 

And then the template file what can be styled by your needs in what ever template :

<div class="page-header">
  <h1><?php echo HEADING_TITLE; ?></h1>
</div>

<?php
  if ($messageStack->size('account_edit') > 0) {
    echo $messageStack->output('account_edit');
  }
?>

<?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'class="form-horizontal" onsubmit="return check_form(account_edit);"', true) . tep_draw_hidden_field('action', 'process'); ?>

<div class="contentContainer">
  <div class="inputRequirement text-right"><?php echo FORM_REQUIRED_INFORMATION; ?></div>

  <?php
  if (ACCOUNT_GENDER == 'true') {
    if (isset($gender)) {
      $male = ($gender == 'm') ? true : false;
    } else {
      $male = ($account['customers_gender'] == 'm') ? true : false;
    }
    $female = !$male;
  ?>
  <div class="form-group has-feedback">
    <label class="control-label col-sm-3"><?php echo ENTRY_GENDER; ?></label>
    <div class="col-sm-9">
      <label class="radio-inline">
        <?php echo tep_draw_radio_field('gender', 'm', $male, 'required aria-required="true"') . ' ' . MALE; ?>
      </label>
      <label class="radio-inline">
        <?php echo tep_draw_radio_field('gender', 'f', $female) . ' ' . FEMALE; ?>
      </label>
      <?php echo FORM_REQUIRED_INPUT; ?>
      <?php if (tep_not_null(ENTRY_GENDER_TEXT)) echo '<span class="help-block">' . ENTRY_GENDER_TEXT . '</span>'; ?>
    </div>
  </div>
  <?php
  }
  ?>
  <div class="form-group has-feedback">
    <label for="inputFirstName" class="control-label col-sm-3"><?php echo ENTRY_FIRST_NAME; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('firstname', $account['customers_firstname'], 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME . '"'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
  <div class="form-group has-feedback">
    <label for="inputLastName" class="control-label col-sm-3"><?php echo ENTRY_LAST_NAME; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('lastname', $account['customers_lastname'], 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME . '"'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>

  <?php
  if (ACCOUNT_DOB == 'true') {
?>
  <div class="form-group has-feedback">
    <label for="inputName" class="control-label col-sm-3"><?php echo ENTRY_DATE_OF_BIRTH; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('dob', tep_date_short($account['customers_dob']), 'required aria-required="true" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"'); ?>
      <?php if (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT)) echo '<span class="help-block">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>'; ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
<?php
  }
?>

  <div class="form-group has-feedback">
    <label for="inputEmail" class="control-label col-sm-3"><?php echo ENTRY_EMAIL_ADDRESS; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('email_address', $account['customers_email_address'], 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS . '"', 'email'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
  <div class="form-group has-feedback">
    <label for="inputTelephone" class="control-label col-sm-3"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('telephone', $account['customers_telephone'], 'required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER . '"', 'tel'); ?>
      <?php echo FORM_REQUIRED_INPUT; ?>
    </div>
  </div>
  <div class="form-group">
    <label for="inputFax" class="control-label col-sm-3"><?php echo ENTRY_FAX_NUMBER; ?></label>
    <div class="col-sm-9">
      <?php echo tep_draw_input_field('fax', $account['customers_fax'], 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER . '"'); ?>
    </div>
  </div>

  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'glyphicon glyphicon-chevron-left', tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'glyphicon glyphicon-chevron-right', null, 'primary', null, 'btn-success'); ?></div>
  </div>
</div>

</form>

So looks quite allot, but consider that the last code tpl_account_edit.php is the only file you will ever need to edit.


Do you need an osCommerce website? Do you want to have an Responsive osCommerce CONTACT ME as i am for HIRE

#8   wHiTeHaT

wHiTeHaT
  • Community Team
  • 1,135 posts
  • Real Name:Henry
  • Gender:Male
  • Location:Netherlands

Posted 25 February 2015 - 09:10

So looks quite allot but consider that the last code tpl_account_edit.php is the only file you will ever need to edit.

 
 
ofcourse inside tpl_account_edit.php you will be able to load the cm_ modules.


Do you need an osCommerce website? Do you want to have an Responsive osCommerce CONTACT ME as i am for HIRE

#9   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 25 February 2015 - 09:23

Changing the file names may make sense for a store whose default language is other than English, and unique table names may provide a little extra protection against SQL injection attacks. A poll seems a good idea.

 

There will be no poll and no further discussion about it.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#10   Gergely

Gergely

    Json Juggler

  • Community Team
  • 2,112 posts
  • Real Name:Gergely Tóth
  • Gender:Male
  • Location:Budapest

Posted 25 February 2015 - 18:02

Deprecated as a general osC policy? Do you mean that these files will be suppressed in next versions of osC and file and table names will be hardcoded everywhere and thus not changeable?

 

The reason is index.php based core where no other files to use in catalog. No reason for file names. Files will become module classes. No admin files no catalog files. No file names.


You will be able do more effective URL SEO than before by languges.


Edited by Gergely, 25 February 2015 - 18:09.
SEO notes

Next PHP changes will kill the current codes on the following years. We should do programing for the future and never stick in the present.

My addons: Conversion Tools::Hungarian Translation::Email Templates::URL redirection
 
Development Works: Setup Languages::Email Templates::Languages from ini files::Parcel Shops::Facebook App
 
What core codes have been complained?

In orders table payment_methods value would be better if payment class name used than payment's language name.
In the orders class we found order status does not contains $order->info['orders_status'] but instead there is $order->info['orders_status_name'], and that property is language dependant.
We can not identify in order the customer language.


#11   Kolingua

Kolingua
  • Members
  • 40 posts
  • Real Name:Juan Antonio Postigo
  • Gender:Male

Posted 26 February 2015 - 12:00

@Gergely, that makes a lot of sense, but table names is a different issue. I agree that this thread is not the place to discuss it, but maybe you can give a good reason in short as you did for filenames, or link to somewhere else it's dealt with.



#12   14steve14

14steve14
  • Members
  • 4,361 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 26 February 2015 - 15:20

There will be no poll and no further discussion about it.

 

I bet there will and this thread will continue to grow.


REMEMBER BACKUP, BACKUP AND BACKUP

 

Find information about the bootstrap community version here

 

Success is the ability to go from one failure to the next without any loss of enthusiasm


#13   MrPhil

MrPhil
  • Members
  • 6,972 posts
  • Real Name:Phil
  • Gender:Male

Posted 26 February 2015 - 15:32

Some pros and cons of putting file names and table names into macros (defines)

 

+  provides some flexibility that file names and table names could be changed if desired for some reason

+  provides a level of abstraction that makes such names stand out in code

+  by having all names in one place, it makes it easier to avoid accidentally repeating a name for a different purpose (PHP can catch duplicate define names)

+  name could be changed more easily if you need to integrate with other code (e.g., different table names for a sitewide common sign-on)

 

-  very few store owners would bother to change "admin" for security reasons, so I doubt they'll change other files or table names

-  is there any real point to localizing names (non-English languages), since the code is still English (keywords, variable names, comments, and even the define names themselves)?

-  slight performance hit, as the defined name has to be looked up and substituted during compile, in addition to extra string concatenation operations

 

Any others?



#14   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,637 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 27 February 2015 - 04:29

The issue of table names has been discussed before. I tried to get Harald to give a reason for making this change. He kept dodging the question. I suspect that there is no reason other than "I want to". Unfortunately that seems to be the way osCommerce is being run.

 

I guess the moral is: "Stop asking. You won't get an answer, and nothing is going to change."

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#15   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 27 February 2015 - 08:56

Looks like there is further discussion, greeeatttttttttttt  :rolleyes:

 

The reason for deprecating the two files is so that shopowners do not have to amend that core file when they add in addons.  Simple really.  

You want to rename a file or a database table?  It takes less time to do that sitewide, than it will for me to write this post. 

 

If I did not just go ahead and do things - there would have been no progress so far - no-one else stepped up to the plate a year ago and said "let's do this".

 

I ask for peoples input, I get little in return, save for a couple of guys who "get it".  

I ask for peoples help to code, I get nothing in return, save for a couple of guys who "get it".    

I ask for people to test things, I get nothing in return, save for a couple of guys who "get it".    

 

What is so hard to understand;

 

If you give nothing, you get what you're given, when it's given.  

Alternatively you can keep on posting random crap about how osCommerce is so bad and how osCommerce doesn't listen and how osCommerce developers are useless and blah blah blah.  

Alternatively, you can start having positive input and help to bring osCommerce out of the Dark Age.


Edited by burt, 27 February 2015 - 09:11.

This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#16   bruyndoncx

bruyndoncx

    osCommerce Teenager

  • Members
  • 3,770 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 27 February 2015 - 09:08

It finally dawned on me this morning- it is to facilitate extensions to oscommerce without having to touch the core code, otherwise any silly addition would still require a core code change - exactly what we do not want ...
KEEP CALM AND CARRY ON
FYI Just upgraded from PHP 5.3 to PHP 5.5  and saw big performance improvement.
But be aware php 5.5 is more strict about things.
UTF8-without BOM, no extra spaces allowed at the beginning or end of your php file, or your redirects wont work.
No double declarations of functions allowed - used to slip through the cracks ...

#17   Kolingua

Kolingua
  • Members
  • 40 posts
  • Real Name:Juan Antonio Postigo
  • Gender:Male

Posted 27 February 2015 - 10:00

I agree that this thread is not the place to discuss it.

 

Now this thread IS the place to discuss it. I said that in another thread and then it was moved here. Thanks and sorry @burt



#18   Kolingua

Kolingua
  • Members
  • 40 posts
  • Real Name:Juan Antonio Postigo
  • Gender:Male

Posted 27 February 2015 - 10:33

I mean, the first 11 posts of this thread were first published in http://forums.oscomm...234-responsive/ and later @burt moved them here.

@burt, I understand you feel disappointed and uncredited for your effort, and I'm sorry for having contributed to that, in part due to my lack of experience here.

Anyway, I want to say that I still consider the hardcoding I mentioned as a "bug" in the sense that you claim to mirror osC 2.3.4 and you're not doing so in this point. If I know that in conventional 2.3.4 I can change table names and reflect the new names in /includes/database_tables.php, I expect that I'm able to the same in the bootstrap version. That's how I found the issue: because it didn't work. That this will work differently in future versions of osC is a different issue.



#19   Moxamint

Moxamint
  • Members
  • 83 posts
  • Real Name:Ai-Teh Eddy Lin
  • Gender:Male
  • Location:Taiwan (a country, NOT part of China)

Posted 27 February 2015 - 13:11

@figuera - database names and filenames should be hardcoded.  

 

/includes/filenames.php and /includes/database_tables.php are deprecated.

 

Related readings:


#20   frankl

frankl

    One of the originals...

  • Community Sponsor
  • 468 posts
  • Real Name:Frank
  • Gender:Male
  • Location:Sydney, Australia

Posted 28 February 2015 - 00:18

What is needed is for osCommerce to become more popular. That way, it will attract more coders, who will provide more add ons and themes, which will make osCommerce more functional, which will lead to more sales for shop owners.

 

The only way to make osCommerce more popular is to make it easy to use for the average non technical webmaster.

 

In the past, and even up till now, the base code has been relatively easy to install but hard to alter - which has come at a cost. Haphazard add on development, with changes to the core code that causes conflicts, and great difficulty in theming. This results in headaches if people want to alter their osC store (and most osCommerce stores that basically all look the same).

 

What is the motivation for people to create and maintain add ons and themes? To make money, or contribute back to the community. For the former, it is a complete headache to provide support because if a shop owner (or developer) installs add on Y, it interferes with add on X resulting in extra coding work (plus the time it takes to find the problem!). For the latter, the amount of work involved helping out less experienced shop owners makes the whole exercise of "giving back" a tiring and thankless exercise.

 

Look at a program like Wordpress - easy to install, easy to maintain, easy to skin, easy to install add ons - and people are happy to code for it because they know it will just work if they adhere to the standards. osCommerce can be like that. Old time osC users need to change their thinking in this transitional process.

 

Where some us find it a great (and satisfying) challenge to hack the core code to get it to do what we want, we need to look at things differently. How can we add functionality without touching the core code? How can we use hooks, modules and themes to make an exciting and functional shop? We want to get to the stage where the average shop owner won't even need to know what FTP is used for! They should be able to download and install add ons and themes from an osC app store - some may be free and some may be paid. We aren't even half way there yet.

 

We have to let the developers get osC to that "easy" stage. We can make suggestions, test, and in general help wherever we can. The result will be a robust, easy to use eCommerce suite with many more users and stores that have a unique look and feel that will result in what we are looking for - more sales and conversions. Plus developers, add on writers and theme creators should be able to make money, adding even more creativity to the osCommerce ecosystem. 

 

Time to move forward!


Let's make things easier for new osCommerce users http://forums.oscomm...bles/?p=1718900  Getting there with osCommerce 2.4! :thumbsup: