Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

copy appearing outside site content


martinstan

Recommended Posts

Posted

Hi

I've installed a nice little contribution but something very weird is happening. The contribution is called edit_pagesinfo and what it does is allows simple editing of a new page from within the admin area. The instructions were quite poor but I thought I'd figured out how to install it What is happening is that when I add page content via the editor a copy of the content is appearing outside the page at the top of the browser. I think the best thing would be to look

http://www.essential-housewares.co.uk/product_tables.php

and you'll see what I mean.

 

I'd just appreciate it if anyone can give me a pointer as to where to start looking for an answer to this.

Thanks

Posted
Hi

I've installed a nice little contribution but something very weird is happening. The contribution is called edit_pagesinfo and what it does is allows simple editing of a new page from within the admin area. The instructions were quite poor but I thought I'd figured out how to install it What is happening is that when I add page content via the editor a copy of the content is appearing outside the page at the top of the browser. I think the best thing would be to look

http://www.essential-housewares.co.uk/product_tables.php

and you'll see what I mean.

 

I'd just appreciate it if anyone can give me a pointer as to where to start looking for an answer to this.

Thanks

You mean the addon is called edit pages info.

 

Since the add on is quite old, you should be mindful of this.

 

It may also depend on what template you are using.

Posted

Hi

I'm not using a template and although it's an old contribution I don't think this will be a problem. I'm not great at programming unfortunately but there must a fairly obvious reason why the content is duplicating.

Thanks

Posted

So, what does your /includes/languages/english/product_tables.php look like?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Hi and thanks for getting involved. Here is catalog/product_tables.php:

<?php


 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_TABLES);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(PRODUCT_TABLES));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<!--<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>-->
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><?php require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EDIT_PRODUCT_TABLES); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
<!-- body_text_eof //-->
<!--<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">-->
<!-- right_navigation //-->
<?php /*require(DIR_WS_INCLUDES . 'column_right.php'); */?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

and here is /includes/languages/english/product_tables.php

<?php
/*
 $Id: conditions.php 6137 2005-05-10 12:59:09Z jim $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Products List');
define('HEADING_TITLE', 'Products List');

define('TEXT_INFORMATION', 'Products List');
?>

Posted

Nice, but I wanted the language file...

:blush:

 

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_TABLES);

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Isn't this code:

 

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(PRODUCT_TABLES));

Supposed to be:

 

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_TABLES));

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

While we're at it, post the contents of:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_EDIT_PRODUCT_TABLES);

Pwease...

:)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

And how about the new additions you made to /includes/filenames.php

 

I think you have things switched around there.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

;) Was just in the process of:

Here it is. It's a bit odd actually as it's just text i think:

 

<P align=left><FONT class=productsNotifications>Informações sobre a empresa</FONT><FONT class=infoBoxNotice>,  se você é o administrador deste site, vá no seu administrador e escolha "editar informações" altere este texto e clique em "gravar"<BR>qualquer dúvida, entre em contato<BR></FONT><A href="mailto:[email protected]"><EM><FONT color=#0000ff>[email protected]</FONT></EM></A><BR><A href="http://www.sualojavirtual.com/" target=_blank><STRONG><FONT color=#ff0000>www.sualojavirtual.com</FONT></STRONG></A></P>

 

and here is admin/edit_product_tables.php

<?php
/*
 $Id: define_header.php,v 1.0 2005/04/06 00:00:00 mattice Exp $
  osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
  Copyright (c) 2002 osCommerce
Released under the GNU General Public License
Modificado por Belchior
[email protected]
www.sualojavirtual.com
*/

 require('includes/application_top.php');

// This will cause it to look for 'edit_header.php'

 $HTTP_GET_VARS['filename'] = 'edit_product_tables.php';

 switch ($HTTP_GET_VARS['action']) {
case 'save':
  if ( ($HTTP_GET_VARS['lngdir']) && ($HTTP_GET_VARS['filename']) ) {
	if ($HTTP_GET_VARS['filename'] == $language . '.php') {
	  $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
	} else {
	  $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
	}
	if (file_exists($file)) {
	  if (file_exists('bak' . $file)) {
		@unlink('bak' . $file);
	  }
	  @rename($file, 'bak' . $file);
	  $new_file = fopen($file, 'w');
	  $file_contents = stripslashes($HTTP_POST_VARS['file_contents']);
	  fwrite($new_file, $file_contents, strlen($file_contents));
	  fclose($new_file);
	}
	tep_redirect(tep_href_link(FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir']));
  }
  break;
 }

 if (!$HTTP_GET_VARS['lngdir']) $HTTP_GET_VARS['lngdir'] = $language;

 $languages_array = array();
 $languages = tep_get_languages();
 $lng_exists = false;
 for ($i=0; $i<sizeof($languages); $i++) {
if ($languages[$i]['directory'] == $HTTP_GET_VARS['lngdir']) $lng_exists = true;

$languages_array[] = array('id' => $languages[$i]['directory'],
						   'text' => $languages[$i]['name']);
 }
 if (!$lng_exists) $HTTP_GET_VARS['lngdir'] = $language;
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">


 <script language="Javascript1.2"><!-- // load htmlarea
 //MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.6.5 Products Description HTML - Head
	_editor_url = "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN; ?>htmlarea/";  // URL to htmlarea files
	  var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
	   if (navigator.userAgent.indexOf('Mac')		>= 0) { win_ie_ver = 0; }
		if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
		 if (navigator.userAgent.indexOf('Opera')	  >= 0) { win_ie_ver = 0; }
	 <?php if (HTML_AREA_WYSIWYG_BASIC_DEFINE == 'Basic'){ ?>  if (win_ie_ver >= 5.5) {
	 document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_basic.js"');
	 document.write(' language="Javascript1.2"></scr' + 'ipt>');
		} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
	 <?php } else{ ?> if (win_ie_ver >= 5.5) {
	 document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_advanced.js"');
	 document.write(' language="Javascript1.2"></scr' + 'ipt>');
		} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
	 <?php }?>
 // --></script>


</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr><?php echo tep_draw_form('lng', FILENAME_DEFINE_PRODUCT_TABLES, '', 'get'); ?>
		<td class="pageHeading"><?php echo BOX_CATALOG_DEFINE_PRODUCT_TABLES; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '1', HEADING_IMAGE_HEIGHT); ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_pull_down_menu('lngdir', $languages_array, '', 'onChange="this.form.submit();"'); ?></td>
	  </form></tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if ( ($HTTP_GET_VARS['lngdir']) && ($HTTP_GET_VARS['filename']) ) {
if ($HTTP_GET_VARS['filename'] == $language . '.php') {
  $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
} else {
  $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' . $HTTP_GET_VARS['filename'];
}
if (file_exists($file)) {
  $file_array = @file($file);
  $file_contents = @implode('', $file_array);

  $file_writeable = true;
  if (!is_writeable($file)) {
	$file_writeable = false;
	$messageStack->reset();
	$messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $file), 'error');
	echo $messageStack->output();
  }

?>
	  <tr><?php echo tep_draw_form('language', FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $HTTP_GET_VARS['filename'] . '&action=save'); ?>
		<td><table border="0" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main"><b><?php echo $HTTP_GET_VARS['filename']; ?></b></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_draw_textarea_field('file_contents', 'soft', '80', '20', $file_contents, (($file_writeable) ? '' : 'readonly')); ?></td>
		  </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		  </tr>
		  <tr>
			<td align="right"><?php if ($file_writeable) { echo tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; } ?></td>
		  </tr>
		</table></td>
	  </form></tr>

 <?php if (HTML_AREA_WYSIWYG_DISABLE_DEFINE == 'Disable') {} else { ?>
  <script language="JavaScript1.2" defer>
	  // MaxiDVD Added WYSIWYG HTML Area Box + Admin Function v1.6.5 Products Description HTML - Body
		 var config = new Object();  // create new config object
		config.width = "<?php echo DEFINE_MAINPAGE_WYSIWYG_WIDTH; ?>px";
		 config.height = "<?php echo DEFINE_MAINPAGE_WYSIWYG_HEIGHT; ?>px";
		 config.bodyStyle = 'background-color: <?php echo HTML_AREA_WYSIWYG_BG_COLOUR; ?>; font-family: "<?php echo HTML_AREA_WYSIWYG_FONT_TYPE; ?>"; color: <?php echo HTML_AREA_WYSIWYG_FONT_COLOUR; ?>; font-size: <?php echo HTML_AREA_WYSIWYG_FONT_SIZE; ?>pt;';
		 config.debug = <?php echo HTML_AREA_WYSIWYG_DEBUG; ?>;
		 // More Configs can added here:
		 // Dreamscape added Dynamic Language Function
	  editor_generate('file_contents',config);
   <?php } ?>
 </script>

<?php
} else {
?>
	  <tr>
		<td class="main"><b><?php echo TEXT_FILE_DOES_NOT_EXIST; ?></b></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php echo '<a href="' . tep_href_link(FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
	  </tr>
<?php
}
 } else {
$filename = $HTTP_GET_VARS['lngdir'] . '.php';
?>
	  <tr>
		<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td class="smallText"><a href="<?php echo tep_href_link(FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $filename); ?>"><b><?php echo $filename; ?></b></a></td>
<?php
$dir = dir(DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir']);
$left = false;
if ($dir) {
  $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  while ($file = $dir->read()) {
	if (substr($file, strrpos($file, '.')) == $file_extension) {
	  echo '				<td class="smallText"><a href="' . tep_href_link(FILENAME_DEFINE_PRODUCT_TABLES, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $file) . '">' . $file . '</a></td>' . "\n";
	  if (!$left) {
		echo '			  </tr>' . "\n" .
			 '			  <tr>' . "\n";
	  }
	  $left = !$left;
	}
  }
  $dir->close();
}
?>



		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
		<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'current_path=' . DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir']) . '">' . tep_image_button('button_file_manager.gif', IMAGE_FILE_MANAGER) . '</a>'; ?></td>
	  </tr>
<?php
 }
?>
	</table></td>
  </tr>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Posted

Hi Germ. I have to go now but really appreciate your help. I will hopefully pick up with you again tomorrow.

Thanks again.

Posted

I can't help track this down unless you give me what I asked for.

<_<

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Sorry if I'm not supplying the correct files. Here is the amendment to includes/filenames.php

//edit page
define('FILENAME_EDIT_PRODUCT_TABLES', 'edit_product_tables.php');
define('FILENAME_PRODUCT_TABLES', 'edit_product_tables.php');

and to admin/includes/filenames.php

//edit page
define('FILENAME_DEFINE_PRODUCT_TABLES', 'edit_product_tables.php');

Thanks

Archived

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

×
×
  • Create New...