Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Proper Code writing


DVBHardware

Recommended Posts

Posted

I need to know if there is a setting in Dreamweaver or Golve to keeping the code of table on a single line. Every time I edit a table from a template I need to delete the tabs & cr from 40 lines.

 

if I am explaining this correctly.

 

I have the newsdesk installed and when adding a table to the content the code must not have any tabs or cr to display correctly.

 

The table must be writen in a straight line

I'm not a coder just a splicer.

Posted

You could try replacing them when posting the newsdesk form.

 

Around line 279 in newsdesk.php

'newsdesk_article_description' => tep_db_prepare_input(preg_replace('/[\r|\n|\t]/','',$HTTP_POST_VARS['newsdesk_article_description'][$language_id])),

Posted
You could try replacing them when posting the newsdesk form.

 

Around line 279 in newsdesk.php

'newsdesk_article_description' => tep_db_prepare_input(preg_replace('/[\r|\n|\t]/','',$HTTP_POST_VARS['newsdesk_article_description'][$language_id])),

 

 

That did the trick partialy.

 

This is what I need to to make it work with your fix.

 

1. Past the code in the content

2. Preview then update

3. Preview then update again , and also remove the first "/" to the link of the stylsheet link referance..

 

To not have to worry about the stylsheet link I used ex. http://www.????.com/includes/sts_style.css. But I still have to do step 1 & 2 for the table to show at the top where the content begins if I do not the table is way down the end of the page like sombody added a bunch of empty paragraphs at the beginning.

 

Could you explain what the '/[\r|\n|\t]/' did ?

 

I know this problem had to do withe the newsdesk only because I have no trouble pasting my product templates into the product database side.

 

Thanks

Jimmy

I'm not a coder just a splicer.

Posted

After looking at it again you need to remove the nl2br() function around line 964.

Then you would always need to put <br> instead of return to format the text.

 

$newsdesk_article_shorttext[1] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_1']);
$newsdesk_article_shorttext[2] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_2']);
$newsdesk_article_shorttext[3] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_3']);
$newsdesk_article_shorttext[4] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_4']);
$newsdesk_article_shorttext[5] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_5']);
$newsdesk_article_shorttext[6] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_6']);
$newsdesk_article_shorttext[7] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_7']);
$newsdesk_article_shorttext[8] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_8']);
$newsdesk_article_shorttext[9] = nl2br($HTTP_POST_VARS['newsdesk_article_shorttext_9']);


$newsdesk_article_description[1] = nl2br($HTTP_POST_VARS['newsdesk_article_description_1']);
$newsdesk_article_description[2] = nl2br($HTTP_POST_VARS['newsdesk_article_description_2']);
$newsdesk_article_description[3] = nl2br($HTTP_POST_VARS['newsdesk_article_description_3']);
$newsdesk_article_description[4] = nl2br($HTTP_POST_VARS['newsdesk_article_description_4']);
$newsdesk_article_description[5] = nl2br($HTTP_POST_VARS['newsdesk_article_description_5']);
$newsdesk_article_description[6] = nl2br($HTTP_POST_VARS['newsdesk_article_description_6']);
$newsdesk_article_description[7] = nl2br($HTTP_POST_VARS['newsdesk_article_description_7']);
$newsdesk_article_description[8] = nl2br($HTTP_POST_VARS['newsdesk_article_description_8']);
$newsdesk_article_description[9] = nl2br($HTTP_POST_VARS['newsdesk_article_description_9']);

$newsdesk_article_shorttext[1] = $HTTP_POST_VARS['newsdesk_article_shorttext_1'];
$newsdesk_article_shorttext[2] = $HTTP_POST_VARS['newsdesk_article_shorttext_2'];
$newsdesk_article_shorttext[3] = $HTTP_POST_VARS['newsdesk_article_shorttext_3'];
$newsdesk_article_shorttext[4] = $HTTP_POST_VARS['newsdesk_article_shorttext_4'];
$newsdesk_article_shorttext[5] = $HTTP_POST_VARS['newsdesk_article_shorttext_5'];
$newsdesk_article_shorttext[6] = $HTTP_POST_VARS['newsdesk_article_shorttext_6'];
$newsdesk_article_shorttext[7] = $HTTP_POST_VARS['newsdesk_article_shorttext_7'];
$newsdesk_article_shorttext[8] = $HTTP_POST_VARS['newsdesk_article_shorttext_8'];
$newsdesk_article_shorttext[9] = $HTTP_POST_VARS['newsdesk_article_shorttext_9'];


$newsdesk_article_description[1] = $HTTP_POST_VARS['newsdesk_article_description_1'];
$newsdesk_article_description[2] = $HTTP_POST_VARS['newsdesk_article_description_2'];
$newsdesk_article_description[3] = $HTTP_POST_VARS['newsdesk_article_description_3'];
$newsdesk_article_description[4] = $HTTP_POST_VARS['newsdesk_article_description_4'];
$newsdesk_article_description[5] = $HTTP_POST_VARS['newsdesk_article_description_5'];
$newsdesk_article_description[6] = $HTTP_POST_VARS['newsdesk_article_description_6'];
$newsdesk_article_description[7] = $HTTP_POST_VARS['newsdesk_article_description_7'];
$newsdesk_article_description[8] = $HTTP_POST_VARS['newsdesk_article_description_8'];
$newsdesk_article_description[9] = $HTTP_POST_VARS['newsdesk_article_description_9'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...