Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help: Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION


DerekSerianni

Recommended Posts

Whoops... sorry... here is the code:

 

<?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
*/
 require('includes/application_top.php');
 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();
 $orders_statuses = array();
 $orders_status_array = array();
 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
   $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
						   'text' => $orders_status['orders_status_name']);
   $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
 }
 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
 if (tep_not_null($action)) {
   switch ($action) {
  case 'update_order':
    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
    $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
 $cp_tracking = tep_db_prepare_input($HTTP_POST_VARS['cp_tracking']);
    $order_updated = false;
    $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased, cp_tracking from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
    $check_status = tep_db_fetch_array($check_status_query);
    if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {
	  tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
	  $customer_notified = '0';
	  if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
	    $notify_comments = '';
	    if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
	    }
	    $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
	    tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
	    $customer_notified = '1';
	  }
	  tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");
	  $order_updated = true;
    }
 if ($cp_tracking != $check_status['cp_tracking']) {
  tep_db_query("update " . TABLE_ORDERS . " set cp_tracking = '" . tep_db_input($cp_tracking) . "' where orders_id = '" . tep_db_input($oID) . "'");
  $order_updated = true;
 }
 if ($order_updated == true) {
	 $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
    } else {
	  $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
    }
    tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
    break;
  case 'deleteconfirm':
    $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
    tep_remove_order($oID, $HTTP_POST_VARS['restock']);
    tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));
    break;
   }
 }
 if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
   $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
   $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
   $order_exists = true;
   if (!tep_db_num_rows($orders_query)) {
  $order_exists = false;
  $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
   }
 }
 include(DIR_WS_CLASSES . 'order.php');
 require(DIR_WS_INCLUDES . 'template_top.php');
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (($action == 'edit') && ($order_exists == true)) {
   $order = new order($oID);
?>
  <tr>
    <td width="100%"><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_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
  <td class="smallText" align="right"><?php echo tep_draw_button(IMAGE_SHIP_CANADAPOST, 'document', tep_href_link(FILENAME_SHIP_CANADAPOST, 'oID=' . $HTTP_GET_VARS['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_ORDERS_INVOICE, 'document', tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_ORDERS_PACKINGSLIP, 'document', tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')))); ?></td>
   </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
	    <td colspan="3"><?php echo tep_draw_separator(); ?></td>
	  </tr>
	  <tr>
	    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
		  <tr>
		    <td class="main" valign="top"><strong><?php echo ENTRY_CUSTOMER; ?></strong></td>
		    <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'); ?></td>
		  </tr>
		  <tr>
		    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
		  </tr>
		  <tr>
		    <td class="main"><strong><?php echo ENTRY_TELEPHONE_NUMBER; ?></strong></td>
		    <td class="main"><?php echo $order->customer['telephone']; ?></td>
		  </tr>
		  <tr>
		    <td class="main"><strong><?php echo ENTRY_EMAIL_ADDRESS; ?></strong></td>
		    <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
		  </tr>
	    </table></td>
	    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
		  <tr>
		    <td class="main" valign="top"><strong><?php echo ENTRY_SHIPPING_ADDRESS; ?></strong></td>
		    <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'); ?></td>
		  </tr>
	    </table></td>
	    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
		  <tr>
		    <td class="main" valign="top"><strong><?php echo ENTRY_BILLING_ADDRESS; ?></strong></td>
		    <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'); ?></td>
		  </tr>
	    </table></td>
	  </tr>
    </table></td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
	    <td class="main"><strong><?php echo ENTRY_PAYMENT_METHOD; ?></strong></td>
	    <td class="main"><?php echo $order->info['payment_method']; ?></td>
	  </tr>
<?php
   if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {
?>
	  <tr>
	    <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>
	  <tr>
	    <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
	    <td class="main"><?php echo $order->info['cc_type']; ?></td>
	  </tr>
	  <tr>
	    <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
	    <td class="main"><?php echo $order->info['cc_owner']; ?></td>
	  </tr>
	  <tr>
	    <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
	    <td class="main"><?php echo $order->info['cc_number']; ?></td>
	  </tr>
	  <tr>
	    <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
	    <td class="main"><?php echo $order->info['cc_expires']; ?></td>
	  </tr>
<?php
   }
?>
    </table></td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr class="dataTableHeadingRow">
	    <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
	    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
	    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
	    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
	    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
	    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
	    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
	  </tr>
<?php
   for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
  echo '		  <tr class="dataTableRow">' . "\n" .
	   '		    <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	   '		    <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
  if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
    for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
	  echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
	  if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
	  echo '</i></small></nobr>';
    }
  }
  echo '		    </td>' . "\n" .
	   '		    <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
	   '		    <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
	   '		    <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
	   '		    <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
	   '		    <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
	   '		    <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n";
  echo '		  </tr>' . "\n";
   }
?>
	  <tr>
	    <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php
   for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
  echo '			  <tr>' . "\n" .
	   '			    <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
	   '			    <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
	   '			  </tr>' . "\n";
   }
?>
	    </table></td>
	  </tr>
    </table></td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td class="main"><table border="1" cellspacing="0" cellpadding="5">
	  <tr>
	    <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_DATE_ADDED; ?></strong></td>
	    <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></strong></td>
	    <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_STATUS; ?></strong></td>
	    <td class="smallText" align="center"><strong><?php echo TABLE_HEADING_COMMENTS; ?></strong></td>
	  </tr>
<?php
   $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
   if (tep_db_num_rows($orders_history_query)) {
  while ($orders_history = tep_db_fetch_array($orders_history_query)) {
    echo '		  <tr>' . "\n" .
		 '		    <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
		 '		    <td class="smallText" align="center">';
    if ($orders_history['customer_notified'] == '1') {
	  echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
    } else {
	  echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
    }
    echo '		    <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .
		 '		    <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .
		 '		  </tr>' . "\n";
  }
   } else {
    echo '		  <tr>' . "\n" .
		 '		    <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
		 '		  </tr>' . "\n";
   }
?>
    </table></td>
  </tr>
  <tr>
    <td class="main"><br /><strong><?php echo TABLE_HEADING_COMMENTS; ?></strong></td>
  </tr>
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
  </tr>
  <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>
    <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
  </tr>
  <tr>
  <td class="main"><b><?php echo TABLE_HEADING_CP_TRACKING; ?></b>  <?php echo tep_draw_input_field('cp_tracking', $order->info['cp_tracking'], 'size="20" maxlength="18"'); ?>
   <a href="https://em.canadapost.ca/emo/basicPin.do?trackingCode=PIN&action=query&language=en&scloc=segment&trackingId=<?php echo $order->info['cp_tracking']; ?>" target="_blank"><b>Track</b></a>
  <?php
  $label_file = DIR_WS_IMAGES . 'canadapost/' . $oID . '.pdf';
  if (file_exists($label_file)) {
  echo ' <a href="' . $label_file . '" target="_blank"><b>Label</b></a>';
  }
  ?>
  </td>
  </tr>
  <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>  
  <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  </tr>
  <tr>
    <td><table border="0" cellspacing="0" cellpadding="2">
	  <tr>
	    <td><table border="0" cellspacing="0" cellpadding="2">
		  <tr>
		    <td class="main"><strong><?php echo ENTRY_STATUS; ?></strong> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
		  </tr>
		  <tr>
		    <td class="main"><strong><?php echo ENTRY_NOTIFY_CUSTOMER; ?></strong> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
		    <td class="main"><strong><?php echo ENTRY_NOTIFY_COMMENTS; ?></strong> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>
		  </tr>
	    </table></td>
	    <td class="smallText" valign="top"><?php echo tep_draw_button(IMAGE_UPDATE, 'disk', null, 'primary'); ?></td>
	  </tr>
    </table></td>
  </form></tr>
<?php
 } else {
?>
  <tr>
    <td width="100%"><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_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
	    <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>
		    <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
		  <?php echo tep_hide_session_id(); ?></form></tr>
		  <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>
		    <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onchange="this.form.submit();"'); ?></td>
		  <?php echo tep_hide_session_id(); ?></form></tr>
	    </table></td>
	  </tr>
    </table></td>
  </tr>
  <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
	    <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr class="dataTableHeadingRow">
		    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
		    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
		    <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
		    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
		    <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
		  </tr>
<?php
   if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
   } elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
   } else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
   }
   $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
   $orders_query = tep_db_query($orders_query_raw);
   while ($orders = tep_db_fetch_array($orders_query)) {
   if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
    $oInfo = new objectInfo($orders);
  }
  if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
    echo '			  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
  } else {
    echo '			  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
  }
?>
		    <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td>
		    <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>
		    <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
		    <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
		    <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
		  </tr>
<?php
   }
?>
		  <tr>
		    <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
			    <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
			    <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
			  </tr>
		    </table></td>
		  </tr>
	    </table></td>
<?php
 $heading = array();
 $contents = array();
 switch ($action) {
   case 'delete':
  $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_DELETE_ORDER . '</strong>');
  $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));
  $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br /><br /><strong>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</strong>');
  $contents[] = array('text' => '<br />' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
  $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id)));
  break;
   default:
  if (isset($oInfo) && is_object($oInfo)) {
    $heading[] = array('text' => '<strong>[' . $oInfo->orders_id . ']  ' . tep_datetime_short($oInfo->date_purchased) . '</strong>');
    $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete')));
    $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_ORDERS_INVOICE, 'document', tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id), null, array('newwindow' => true)) . tep_draw_button(IMAGE_ORDERS_PACKINGSLIP, 'document', tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id), null, array('newwindow' => true)));
    $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHIP_CANADAPOST, 'oID=' .$oInfo->orders_id . '&action=new&status=3') . '">' . tep_image_button('button_ship_canadapost.gif', IMAGE_ORDERS_SHIP) . '</a>');
 $contents[] = array('text' => '<br />' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
    if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
    $contents[] = array('text' => '<br />' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
  }
  break;
 }
 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '		    <td width="25%" valign="top">' . "\n";
   $box = new box;
   echo $box->infoBox($heading, $contents);
   echo '		    </td>' . "\n";
 }
?>
	  </tr>
    </table></td>
  </tr>
<?php
 }
?>
   </table>
<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

My Bad.... (It's been a long day of trying to figure this out)

 

<?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/
 class order {
   var $info, $totals, $products, $customer, $delivery;
   function order($order_id) {
  $this->info = array();
  $this->totals = array();
  $this->products = array();
  $this->customer = array();
  $this->delivery = array();
  $this->query($order_id);
   }
   function query($order_id) {
  $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, cp_tracking from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
  $order = tep_db_fetch_array($order_query);

  // Canada Post OST start
  $totals_query = tep_db_query("select title, text, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  $shipping_method = '';
  while ($totals = tep_db_fetch_array($totals_query)) {
  $this->totals[] = array('title' => $totals['title'],
  'text' => $totals['text'],
  'class' => $totals['class']);
  if ($totals['class'] == 'ot_shipping') $shipping_method = $totals['title'];
  }
  // Canada Post OST End.  




  }
  $this->info = array('currency' => $order['currency'],
					  'currency_value' => $order['currency_value'],
					  'payment_method' => $order['payment_method'],
					  'cc_type' => $order['cc_type'],
					  'cc_owner' => $order['cc_owner'],
					  'cc_number' => $order['cc_number'],
					  'cc_expires' => $order['cc_expires'],
					  'date_purchased' => $order['date_purchased'],
					  'orders_status' => $order['orders_status'],
    // Canada Post OST Start
    'cp_tracking' => $order['cp_tracking'],
    // Canada Post OST end	  
    'last_modified' => $order['last_modified']);
  $this->customer = array('name' => $order['customers_name'],
						  'company' => $order['customers_company'],
						  'street_address' => $order['customers_street_address'],
						  'suburb' => $order['customers_suburb'],
						  'city' => $order['customers_city'],
						  'postcode' => $order['customers_postcode'],
						  'state' => $order['customers_state'],
						  'country' => $order['customers_country'],
						  'format_id' => $order['customers_address_format_id'],
						  'telephone' => $order['customers_telephone'],
						  'email_address' => $order['customers_email_address']);
  $this->delivery = array('name' => $order['delivery_name'],
						  'company' => $order['delivery_company'],
						  'street_address' => $order['delivery_street_address'],
						  'suburb' => $order['delivery_suburb'],
						  'city' => $order['delivery_city'],
						  'postcode' => $order['delivery_postcode'],
						  'state' => $order['delivery_state'],
						  'country' => $order['delivery_country'],
						  'format_id' => $order['delivery_address_format_id']);
  $this->billing = array('name' => $order['billing_name'],
						 'company' => $order['billing_company'],
						 'street_address' => $order['billing_street_address'],
						 'suburb' => $order['billing_suburb'],
						 'city' => $order['billing_city'],
						 'postcode' => $order['billing_postcode'],
						 'state' => $order['billing_state'],
						 'country' => $order['billing_country'],
						 'format_id' => $order['billing_address_format_id']);
  $index = 0;
  $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
  while ($orders_products = tep_db_fetch_array($orders_products_query)) {
    $this->products[$index] = array('qty' => $orders_products['products_quantity'],
								    'name' => $orders_products['products_name'],
								    'model' => $orders_products['products_model'],
								    'tax' => $orders_products['products_tax'],
								    'price' => $orders_products['products_price'],
								    'final_price' => $orders_products['final_price']);
    $subindex = 0;
    $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
    if (tep_db_num_rows($attributes_query)) {
	  while ($attributes = tep_db_fetch_array($attributes_query)) {
	    $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
																 'value' => $attributes['products_options_values'],
																 'prefix' => $attributes['price_prefix'],
																 'price' => $attributes['options_values_price']);
	    $subindex++;
	  }
    }
    $index++;
  }
   }
 }
?>

Link to comment
Share on other sites

Was there a segment of code you were supposed to remove when you put in the Canada Post code? This?

  $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  while ($totals = tep_db_fetch_array($totals_query)) {
	$this->totals[] = array('title' => $totals['title'],
							'text' => $totals['text']);
  }

If so, you left in the final } that should have been removed. It's after the comment

// Canada Post OST End.

Link to comment
Share on other sites

  • 5 months later...

hi can anybody help please its been days trying to figure this out.. get this error

Parse error: syntax error, unexpected T_ARRAY, expecting ')' in /hermes/bosweb/web193/b1931/ipw.babycareplus/public_html/OSCommerce/admin/includes/boxes/customers.php on line 28

 

This is my customer.php

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

$cl_box_groups[] = array(

'heading' => BOX_HEADING_CUSTOMERS,

'apps' => array(

array(

'code' => FILENAME_CUSTOMERS,

'title' => BOX_CUSTOMERS_CUSTOMERS,

'link' => tep_href_link(FILENAME_CUSTOMERS)

),

array(

'code' => FILENAME_ORDERS,

'title' => BOX_CUSTOMERS_ORDERS,

'link' => tep_href_link(FILENAME_ORDERS)

)

 

 

array(

 

'code' => 'batchprint_noPDF.php',

 

'title' => 'Batch Print',

 

'link' => tep_href_link('batchprint_noPDF.php')'

 

)

)

);

?>

Link to comment
Share on other sites

You messed up the new code insertion.

 $cl_box_groups[] = array(
'heading' => BOX_HEADING_CUSTOMERS,
'apps' => array(
  array(
	'code' => FILENAME_CUSTOMERS,
	'title' => BOX_CUSTOMERS_CUSTOMERS,
	'link' => tep_href_link(FILENAME_CUSTOMERS)
  ),
  array(
	'code' => FILENAME_ORDERS,
	'title' => BOX_CUSTOMERS_ORDERS,
	'link' => tep_href_link(FILENAME_ORDERS)
  )


array(

	'code' => 'batchprint_noPDF.php',

	'title' => 'Batch Print',

	'link' => tep_href_link('batchprint_noPDF.php')'

  )
)
 );

should be

 $cl_box_groups[] = array(
'heading' => BOX_HEADING_CUSTOMERS,
'apps' => array(
  array(
	'code' => FILENAME_CUSTOMERS,
	'title' => BOX_CUSTOMERS_CUSTOMERS,
	'link' => tep_href_link(FILENAME_CUSTOMERS)
  ),
  array(
	'code' => FILENAME_ORDERS,
	'title' => BOX_CUSTOMERS_ORDERS,
	'link' => tep_href_link(FILENAME_ORDERS)
  ),
  array(
	'code' => 'batchprint_noPDF.php',
	'title' => 'Batch Print',
	'link' => tep_href_link('batchprint_noPDF.php')'
  )
)
 );

You're missing a comma before the new lines.

 

And please use [ code ] tags when posting code!

Link to comment
Share on other sites

  • 5 months later...

Thank you for solving the above issue Mr. Phil, I have a codecanyon wordpress plugin and having the same issue, please help me in resolving this matter. After installing plugin when i was trying to re-activate the plugin i can see the following message: Plugin could not be activated because it triggered a fatal error. and Parse error: syntax error, unexpected T_INCLUDE, expecting T_FUNCTION in /home/content/78/9378278/html/example/wp-content/plugins/maplist/MapListPro.php on line 57

 

The coded is added here for your kind reference, waiting for your kind response, thanks

<?php
/*
Plugin Name: Map List Pro
Version: 1.5
Description: Map List Pro lets you add interactive maps and location list to pages and posts quickly and easily.
Author:SmartRedFox & Eiretek limited
Author URI: http://www.eiretek.net
*/
$prefix = 'maplist_';
$mapLocationFields = array(
array(
'name' => 'Description',
'desc' => 'Description',
'id' => $prefix . 'description',
'type' => 'text',
'std' => 'Description'),
array(
'name' => 'Address',
'desc' => 'Enter address',
'id' => $prefix . 'address',
'type' => 'text',
'std' => 'Address'),
//	    array(
// 'name' => 'MapIcon',
// 'desc' => 'Choose map icon',
// 'id' => $prefix . 'mapicon',
// 'type' => 'text',
// 'std' => 'Map icon'),
array(
'name' => 'Latitude',
'desc' => 'Enter latitude',
'id' => $prefix . 'latitude',
'type' => 'text',
'std' => 'Latitude'),
array(
'name' => 'Longitude',
'desc' => 'Enter longitude',
'id' => $prefix . 'longitude',
'type' => 'text',
'std' => 'Longitude')
);   


class MapList_Class{

   /**
 * Class Constructor
 */
   function __construct() {
    $this->plugin_defines();
    $this->setup_actions();
   }[/size]
[size=3]    /**
 * Defines To Be Used Anywhere In Wordpress After The Plugin Has Been Initiated.
 */
   include'includes/Map_location_post.php';
   function plugin_defines(){
define( 'MAP_LIST_PLUGIN_PATH', trailingslashit( WP_PLUGIN_DIR.'/'.str_replace(basename( __FILE__ ),"",plugin_basename( __FILE__ ) ) ) );
    define( 'MAP_LIST_PLUGIN_URL' , trailingslashit( WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__ ),"",plugin_basename( __FILE__ ) ) ) );
   }[/size]
[size=3]    /**
 * Setup The Actions To Hook The Plugin Into WordPress At The Appropriate Places
 */
   function setup_actions(){

    //Needed for both front and back
    add_action( 'init', array($this,'register_taxonomy_map_location_categories' ));			  

    if(is_admin())
    {				  
	    //Admin only		   
	    add_action('init', array( $this , 'maplist_register' ));
	    add_action('admin_init', array($this,'admin_init'));
	    add_action('admin_print_styles', array($this,'load_admin_scripts_styles'));
	    //Save map locations
	    add_action('save_post', array($this,'save_custom_meta'));
	    //Attach the settings menu
	    add_action('admin_menu', array($this,'srf_prettylist_admin_menu'));
	    //Attach save event for Settings page
	    add_filter( 'attachment_fields_to_save', array($this,'attachment_field_maplist_save'), 10, 2 );
	    //Add shortcode button
	    add_action('init', array($this,'add_button'));
	    //Ajax calls from shortcode creator
	    add_action('wp_ajax_get_all_maplocations', array($this,'get_all_maplocations_ajax'));
	    add_action('wp_ajax_get_all_mapcategories', array($this,'get_all_mapcategories_ajax'));
    }
    else
    {
	    //Front end only
	    add_action( 'template_redirect' , array( $this , 'frontend_hookup' ) );
	    add_shortcode('maplist', array($this, 'maplist_shortcode'));

	    //Set domain for translations
	    load_plugin_textdomain( 'maplistpro', false, dirname( plugin_basename( __FILE__ ) ) );		   
    }
   }[/size]
[size=3]    /******************************
   ADMIN Start
   *******************************/
   function maplist_register() {[/size]
[size=3]	    //register custom post type
    $args = array(
		    'labels' => array(
			    'name' => _x('Map locations', 'post type general name'),
			    'singular_name' => _x('Map', 'post type singular name'),
			    'add_new' => _x('Add new', 'maplist item'),
			    'add_new_item' => __('Add new map location','maplistpro'),
			    'edit_item' => __('Edit map location','maplistpro'),
			    'new_item' => __('New map location','maplistpro'),
			    'view_item' => __('View map location','maplistpro'),
			    'search_items' => __('Search maps','maplistpro'),
			    'not_found' =>  __('Nothing found','maplistpro'),
			    'not_found_in_trash' => __('Nothing found in Trash','maplistpro'),
			    'parent_item_colon' => ''
		    ),
		    'public' => true,
		    'publicly_queryable' => true,
		    'show_ui' => true,
		    'query_var' => true,
		    'menu_icon' => MAP_LIST_PLUGIN_URL . 'images/MapIcon16px.png',
		    'rewrite' => true,
		    'capability_type' => 'post',
		    'hierarchical' => false,
		    'menu_position' => null,
		    'supports' => array('title','editor','thumbnail')
	    );				 [/size]
[size=3]		    register_post_type('maplist' , $args );[/size]

[size=3]		    //remove the wysiswyg editor for map locations edit/add
	    remove_post_type_support('maplist', 'editor');
   }

    function register_taxonomy_map_location_categories()
    {
	    //register custom taxonomy
	    $labels = array(
		    'name' => _x( 'Location Categories', 'map_location categories' ),
		    'singular_name' => _x( 'Location Category', 'map_location categories' ),
		    'search_items' => _x( 'Search Location Categories', 'map_location categories' ),
		    'popular_items' => _x( 'Popular Location Categories', 'map_location categories' ),
		    'all_items' => _x( 'All Location Categories', 'map_location categories' ),
		    'parent_item' => _x( 'Parent Map Location Category', 'map_location categories' ),
		    'parent_item_colon' => _x( 'Parent Map Location Category:', 'map_location categories' ),
		    'edit_item' => _x( 'Edit Map Location Category', 'map_location categories' ),
		    'update_item' => _x( 'Update Map Location Category', 'map_location categories' ),
		    'add_new_item' => _x( 'Add New Map Location Category', 'map_location categories' ),
		    'new_item_name' => _x( 'New Map Location Category', 'map_location categories' ),
		    'separate_items_with_commas' => _x( 'Separate map location categories with commas', 'map_location categories' ),
		    'add_or_remove_items' => _x( 'Add or remove map location categories', 'map_location categories' ),
		    'choose_from_most_used' => _x( 'Choose from the most used map location categories', 'map_location categories' ),
		    'menu_name' => _x( 'Location Categories', 'map_location categories' ),
	    );[/size]
[size=3]		    $args = array(
		    'labels' => $labels,
		    'public' => true,
		    'show_in_nav_menus' => true,
		    'show_ui' => true,
		    'show_tagcloud' => false,
		    'hierarchical' => true,[/size]
[size=3]			    'rewrite' => true,
		    'query_var' => true
	    );[/size]
[size=3]		    register_taxonomy( 'map_location_categories', array('maplist'), $args );
    }

function admin_init(){
	    //setup column headings on map locations list page
	    add_filter('manage_edit-maplist_columns', array($this,'add_new_maplist_columns'));[/size]
[size=3]		    //setup column data for the map locations list page
	    add_action('manage_maplist_posts_custom_column',  array($this,'manage_maplist_columns'), 10, 2);[/size]
[size=3]		    //setup edit/add map location
	    add_meta_box("map_location_extra_details", "Details", array($this,'maplocation_edit_box'), "maplist", "normal", "low");
}

    //Define column heading for Map location list page
function add_new_maplist_columns() {
 global $post,$mapLocationFields;
 $new_columns['cb'] = '<input type="checkbox" />';
 $new_columns['id'] = __('Id', 'maplistpro');
 $new_columns['title'] = _x('Title', 'maplistpro');
 $new_columns['maplocationcategories'] = __('Categories', 'maplistpro');

 //add custom fields
 foreach ($mapLocationFields as $field)
 {
			    if($field['name'] != 'Latitude' && $field['name'] != 'Longitude'){
				    $new_columns[$field['id']] = _x($field['name'], 'maplistpro');
			    }
 }
		    $new_columns['mapimage'] = _x('', 'column name');

 return $new_columns;
}

    //Get column data for Map location list page
function manage_maplist_columns($column_name, $id) {
	    global $post;
	    if($column_name == "id"){
		    echo $post->ID;
	    }
	    else if($column_name == "maplocationcategories")
	    {
		    //get map location categories for this post (custom taxonmy: map-location-categories)
		    $categories = wp_get_object_terms($post->ID, 'map_location_categories', array('orderby' => 'parent', 'order' => 'ASC'));
		    ?>
		    <ul>   
		    <?php
		    if ( !empty( $categories ) ) {
			    foreach ( $categories as $cat ) {?>
				    <li><?php
					    if($cat->parent != 0) {
						    echo '>> ';
					    }
					    ?>
					    <a href='edit.php?map-location-categories=<?php echo $cat->slug;?>&post_type=maplist'><?php echo $cat->name;?></a>
				    </li>   
			    <?php
			    }
			    ?>
			    </ul>   
		    <?php
		    }
		    else{
			    _e('Uncategorized','maplistpro');
		    }
	    }
	    else if($column_name == "mapimage"){
		    $lat = get_post_meta($post->ID, 'maplist_latitude', true);
		    $lng = get_post_meta($post->ID, 'maplist_longitude', true);
		    ?>
		    <img border="0" alt="<?php the_title($post->ID); ?>" src="//maps.googleapis.com/maps/api/staticmap?center=<?php echo $lat; ?>,<?php echo $lng; ?>&zoom=14&size=100x100&sensor=false&markers=color:blue|<?php echo $lat; ?>,<?php echo $lng; ?>" title="Latitude: <?php echo $lat; ?> Longitude: <?php echo $lng; ?>" alt="Latitude: <?php echo $lat; ?> Longitude: <?php echo $lng; ?>">   
		    <?php
	    }
	    else{
		    echo get_post_meta($id, $column_name, true);
	    }

}

//setup edit/add map location
function maplocation_edit_box()
    {
	    //Get the edit page
	    include(MAP_LIST_PLUGIN_PATH . 'includes/Map_Location_edit_box.php');
}[/size]
[size=3]	    // Save the Data
function save_custom_meta($post_id) {
 global $mapLocationFields;

 //Check if post variables are set first
 if(isset($_POST['custom_meta_box_nonce'])){
  // Verify nonce
  if (!wp_verify_nonce($_POST['custom_meta_box_nonce'], MAP_LIST_PLUGIN_PATH)){
   return $post_id;
  }
 }
 else{
  //Or quit out (not saving)
  return;				   
		    }

 //If autosave return
 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){ return; }

//  // check permissions
//  if (isset($_POST['post_type']) && 'page' == $_POST['post_type']) {
//				    if (!current_user_can('edit_page', $post_id) || !current_user_can('edit_post', $post_id)){
//					    return $post_id;
//				    }
//  }

 //Check to see if new post or edit
 //get_post_meta($post_id, 'maplist_description', true);

 // save taxonomies
 //$post = get_post($post_id);
 //$category = $_POST['category'];
 //wp_set_object_terms( $post_id, $category, 'category' );

 // loop through fields and save the data
 foreach ($mapLocationFields as $field) {
  if($field['type'] == 'tax_select') continue;
  $old = get_post_meta($post_id, $field['id'], true);
  $new = $_POST[$field['id']];
  if ($new && $new != $old) {
   update_post_meta($post_id, $field['id'], $new);
  } elseif ('' == $new && $old) {
   delete_post_meta($post_id, $field['id'], $old);
  }
 } // end foreach 
}

/**********************
QUEUE ADMIN MENU		
    **********************/
public function srf_prettylist_admin_menu()
{ 
	    // this is where we add our plugin to the admin menu 
	    $page = add_options_page('maplist', 'Map List Pro', 'manage_options', dirname(__FILE__), array($this,'maplistpro_admin_options')); 
	    //Add admin preview script only to our pages
	    add_action( 'admin_print_styles-' . $page, array($this,'maplistpro_admin_scripts'));
}	  

    //Get the options page from an include file
function maplistpro_admin_options()
{
	    include(MAP_LIST_PLUGIN_PATH . 'includes/Map_admin_settings.php');			   
} 

    /**********************
LOAD ADMIN SETTINGS SCRIPTS
**********************/
function maplistpro_admin_scripts()
{					   
	    $params = array('pluginUrl' => MAP_LIST_PLUGIN_URL,'altPluginUrl' => get_bloginfo('template_directory') . '/prettymapstyles/');
	    wp_register_script('maplistpreviewer', MAP_LIST_PLUGIN_URL . 'js/style_previewer.js');
	    wp_localize_script('maplistpreviewer', 'maplistScriptParams', $params );
	    wp_enqueue_script('maplistpreviewer' );
}

    /**********************
SAVE ADMIN MENU SETTINGS
**********************/[/size]
[size=3]/*Save value of "srf_prettylist" selection in media uploader */
 function attachment_field_maplist_save( $post, $attachment ) {
  //if( isset( $attachment['srf_prettylist-include'] ) )
  //update_post_meta( $post['ID'], 'srf_prettylist-include', $attachment['srf_prettylist-include'] ); 
  return $post;
}

function load_admin_scripts_styles(){
	    //Only load if needed
	    global $post_type;
	    if( 'maplist' == $post_type ){
		    wp_enqueue_style( 'plugin_style', MAP_LIST_PLUGIN_URL . 'css/pluginstyles.css' );[/size]
[size=3]			    wp_enqueue_script( 'jquery' );
		    wp_enqueue_script( 'map_list-google-api', 'http://maps.google.com/maps/api/js?sensor=false&region=GB');
		    wp_enqueue_script( 'map_list-google-local', 'http://www.google.com/uds/api?file=uds.js&v=1.0');
		    wp_enqueue_script( 'jquery-ui-core');
		    wp_enqueue_style( 'jquery-ui_css', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css' );[/size]
[size=3]			    $params = array('pluginUrl' => MAP_LIST_PLUGIN_URL);
		    wp_register_script('plugin_init', MAP_LIST_PLUGIN_URL . 'js/admin.js');
		    wp_localize_script('plugin_init', 'plugin_initScriptParams', $params );
		    wp_enqueue_script('plugin_init' );			   
	    }
    }


/*********************
ADD SHORTCODE BUTTON
**********************/

function add_button() { 
	    if ( current_user_can('edit_posts') &&  current_user_can('edit_pages') ) 
	    { 
			    add_filter('mce_external_plugins', array($this,'add_plugin'));
			    add_filter('mce_buttons', array($this,'register_button'));
	    } 
}  [/size]
[size=3]function register_button($buttons) { 
 array_push($buttons, "maplist"); 
 return $buttons; 
}  [/size]
[size=3]function add_plugin($plugin_array) { 
 $plugin_array['maplist'] = MAP_LIST_PLUGIN_URL.'js/ModalCreate.js'; 
 return $plugin_array; 
}

    //Ajax call for add shortcode modal
    function get_all_maplocations_ajax() {
	    global $wpdb; // this is how you get access to the database[/size]
[size=3]		    $args = array( 'post_type' => 'maplist','orderby' => 'title','order' => 'ASC', 'numberposts' => -1, 'post_status' => null);
	    $attachments = get_children($args);
	    $html = '<ul>';//Start the list[/size]
[size=3]		    foreach ( $attachments as $attachment ) {			   
		    $html .= '<li><label><input type="checkbox" class="file" id="file_' . $attachment->ID . '" name="file_' . $attachment->ID .'" value="' . $attachment->ID . '">' . $attachment->post_title . '</label></li>';
	    }
	    $html .= '</ul>';//End the list
	    echo $html;[/size]
[size=3]		    die(); // this is required to return a proper result
    }

    //Ajax call for add shortcode modal
    function get_all_mapcategories_ajax() {  

	    $args = array('taxonomy' => 'map_location_categories');

	    $categories = get_categories( $args );

	    $html = '<ul>';//Start the list
	    foreach ( $categories as $category ) {
		    $html .= '<li><label><input type="checkbox" class="file" id="file_' . $category->term_id . '" name="file_' . $category->term_id .'" value="' . $category->term_id . '">' . $category->cat_name . '</label></li>';
	    }
	    $html .= '</ul>';//End the list
	    echo $html;[/size]
[size=3]		    die(); // this is required to return a proper result
    }		  


/******************************
ADMIN End
*******************************/	   

/******************************
FRONTEND Start
*******************************/
function frontend_hookup(){
 $this->frontend_include_scripts();

    }

function frontend_include_scripts(){					  
	    //Get user selected stylesheet if any
	    $options['maplist_stylesheet_to_use'] = get_option('maplist_stylesheet_to_use'); [/size]
[size=3]		    $stylesheet_url = MAP_LIST_PLUGIN_URL . 'styles/Grey_light_default.css';[/size]
[size=3]		    if($options['maplist_stylesheet_to_use'] != ""){
			    //Add our prettylist stylesheet
			    $stylesheet_url = MAP_LIST_PLUGIN_URL . 'styles/' . $options['maplist_stylesheet_to_use'];
	    }

	    //Core styles
	    wp_register_style('maplistCoreStyleSheets', MAP_LIST_PLUGIN_URL . 'css/MapListProCore.css');
	    wp_enqueue_style( 'maplistCoreStyleSheets');						

	    //Colour Styles
	    wp_register_style('maplistStyleSheets', $stylesheet_url);
	    wp_enqueue_style( 'maplistStyleSheets');			

	    //Add jQuery
	    wp_enqueue_script( 'jquery' );

	    //Add Google maps
	    wp_enqueue_script( 'map_list-google-api', 'http://maps.google.com/maps/api/js?sensor=false&region=GB');
	    wp_enqueue_script( 'map_list-google-local', 'http://www.google.com/uds/api?file=uds.js&v=1.0');[/size]
[size=3]		    //Pass params to js
	    //TODO: Add translatable strings throughout
	    $params = array('pluginUrl' => MAP_LIST_PLUGIN_URL);
	    wp_register_script('plugin_init', MAP_LIST_PLUGIN_URL . 'js/maplist.js');
	    wp_localize_script('plugin_init', 'maplistpro_params', $params );
	    wp_enqueue_script('plugin_init' );
    }

    //Output shortcode
public function maplist_shortcode($atts, $content = null){
	    //Get the shortcode output page
	    include(MAP_LIST_PLUGIN_PATH . 'includes/Map_location_shortcode_output.php');
	    return $html;
}		 
}[/size]
[size=3]$MapList_Class = new MapList_Class();[/size]
[size=3]?>

Thanks

Link to comment
Share on other sites

I'll assume that all those /size and size=3 BBCode tags appeared when you cut and pasted in the code. Please try to clean them up next time. The error message seems to be complaining about the include statement for includes/Map_location_post.php. Did you add that line, or has it been there all along? You may have to move it up to before the "class" line, or at least, before the first "function" line in the class. I think PHP is a bit picky about what is allowed within a class definition, at least after you have started defining functions.

 

/**
	 * Defines To Be Used Anywhere In Wordpress After The Plugin Has Been Initiated.
	 */
include'includes/Map_location_post.php';
function plugin_defines(){
define( '...

 

By the way, your problem is quite different than the original question. You should have started a new thread for this.

Link to comment
Share on other sites

  • 8 months later...

hello all.

 

this is my very first post anywhere

 

I keep getting this error Parse error: syntax error, unexpected T_VAR in /home/u279178715/public_html/login.php on line 115

 

 

===========================================================

 

login.php

 

<?php

/*

$Id: login.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// anti-hacker account

require('includes/functions/account_secure.php');

$password = tep_to_hex($_POST['password']);

unset($_POST['password']);

if (!isset($_POST['email_address'])) {

$_POST['email_address'] = $_GET['email_address']; unset($_GET['email_address']);

}

$email_address = '';

clean_post ();

// EOF anti-hacker account

 

require('includes/application_top.php');

 

require(DIR_WS_FUNCTIONS . 'recaptchalib.php'); // reCAPTCHA

 

 

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)

if ($session_started == false) {

tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

}

 

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

 

$error = false;

// reCAPTCHA - start

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {

$resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, $HTTP_SERVER_VARS['REMOTE_ADDR'], $HTTP_POST_VARS['recaptcha_challenge_field'], $HTTP_POST_VARS['recaptcha_response_field']);

if ($resp->is_valid) {

 

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);

$password = tep_db_prepare_input($HTTP_POST_VARS['password']);

 

// Check if email exists

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

if (!tep_db_num_rows($check_customer_query)) {

$error = true;

} else {

$check_customer = tep_db_fetch_array($check_customer_query);

// Check that password is good

if (!tep_validate_password($password, $check_customer['customers_password'])) {

$error = true;

} else {

if (SESSION_RECREATE == 'True') {

tep_session_recreate();

}

 

$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");

$check_country = tep_db_fetch_array($check_country_query);

 

$customer_id = $check_customer['customers_id'];

$customer_default_address_id = $check_customer['customers_default_address_id'];

$customer_first_name = $check_customer['customers_firstname'];

$customer_country_id = $check_country['entry_country_id'];

$customer_zone_id = $check_country['entry_zone_id'];

tep_session_register('customer_id');

tep_session_register('customer_default_address_id');

tep_session_register('customer_first_name');

tep_session_register('customer_country_id');

tep_session_register('customer_zone_id');

 

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

 

// restore cart contents

$cart->restore_contents();

 

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

$navigation->clear_snapshot();

tep_redirect($origin_href);

} else {

tep_redirect(tep_href_link(FILENAME_DEFAULT));

}

}

}

 

} else {

$error = true;

}

}

 

if ($error == true) {

if ($resp->is_valid) {

$messageStack->add('login', TEXT_LOGIN_ERROR);

} else {

$messageStack->add('login', RECAPTCHA_ERROR);

}

}

 

if (!is_object($lng)) {

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

}

foreach ($lng->catalog_languages as $code => $languages) {

if ($languages['id'] == $languages_id) break;

}

// reCAPTCHA - end

 

 

function session_win() {

window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();

}

 

var RecaptchaOptions = { theme : '<?php echo RECAPTCHA_THEME ?>', lang : '<?php echo in_array($code, array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr')) ? $code : 'en' ?>' }; // reCAPTCHA

 

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOGIN, '', 'SSL'));

?>

<!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="css/constants.css">

<link rel="stylesheet" type="text/css" href="css/stylesheet.css">

<link rel="stylesheet" type="text/css" href="css/stylesheet_boxes.css">

<link rel="stylesheet" type="text/css" href="css/stylesheet_content.css">

<script language="javascript">

function session_win() {

window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=559,width=465,toolbar=no,statusbar=no,scrollbars=yes").focus();

}

</script>

</head>

<body>

<!-- header //-->

<?php $tab_sel = 6; ?>

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" class="<?php echo MAIN_TABLE; ?>" cellspacing="0" cellpadding="0">

<tr>

<td class="<?php echo BOX_WIDTH_TD_LEFT; ?>"><table border="0" class="<?php echo BOX_WIDTH_LEFT; ?>" cellspacing="0" cellpadding="0">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td class="<?php echo CONTENT_WIDTH_TD; ?>"><?php /* include(DIR_WS_BOXES . 'panel_top.php'); */?><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?>

 

<?php echo tep_draw_top();?>

 

<?php echo tep_draw_title_top();?>

 

<?php echo HEADING_TITLE; ?>

 

<?php echo tep_draw_title_bottom();?>

 

<?php echo tep_draw1_top();?>

 

<?php

if ($messageStack->size('login') > 0) {

?>

<table cellpadding="0" cellspacing="0" border="0">

<tr>

<td><?php echo $messageStack->output('login'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

</table>

<?php

}

 

if ($cart->count_contents() > 0) {

?>

<table cellpadding="0" cellspacing="0" border="0">

<tr><td style="padding:0px 10px 0px 10px;" class="smallText"><?php echo TEXT_VISITORS_CART; ?></td></tr>

</table>

 

<?php echo tep_pixel_trans();?>

 

<?php

}

?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="main indent_2" width="50%"><b><?php echo HEADING_NEW_CUSTOMER; ?></b></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main indent_2" width="50%"><b><?php echo HEADING_RETURNING_CUSTOMER; ?></b></td>

</tr>

<tr>

<td width="50%" height="100%">

 

<?php echo tep_draw_infoBox_top();?>

 

<table border="0" width="100%" height="100%" cellspacing="5" cellpadding="0" style="height:240px;">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main" style="height:100%;"><?php echo TEXT_NEW_CUSTOMER . '<br><br>' . TEXT_NEW_CUSTOMER_INTRODUCTION; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<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_CREATE_ACCOUNT, '', 'SSL') . '">' . 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>

 

<?php echo tep_draw_infoBox_bottom();?>

 

</td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '1'); ?></td>

<td width="50%" height="100%">

 

<?php echo tep_draw_infoBox_top();?>

 

<table border="0" width="100%" height="100%" cellspacing="5" cellpadding="0" style="height:240px;">

<tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>

<tr> <td class="main" colspan="2"><?php echo TEXT_RETURNING_CUSTOMER; ?></td></tr>

<tr><td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>

<tr><td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td></tr>

<tr><td class="main width3_100"><?php echo tep_draw_input_field('email_address'); ?></td></tr>

<tr><td class="main"><b><?php echo ENTRY_PASSWORD; ?></b></td></tr>

 

<!-- reCAPTCHA - start -->

<tr>

<td class="main" colspan="2"><?php echo RECAPTCHA_INTRO . '<br>' . recaptcha_get_html(RECAPTCHA_PUBLIC_KEY); ?></td>

</tr>

<!-- reCAPTCHA - end -->

 

 

<td class="main width3_100"><?php echo tep_draw_password_field('password'); ?></td></tr>

<tr><td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>

<tr><td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></td></tr>

<tr><td height="100%"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td></tr>

<tr><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 tep_image_submit('button_login1.gif', IMAGE_BUTTON_LOGIN); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table>

</td></tr>

</table>

 

<?php echo tep_draw_infoBox_bottom();?>

 

</td>

</tr>

</table>

 

<?php echo tep_draw1_bottom();?>

 

<?php echo tep_draw_bottom();?>

 

</form></td>

<!-- body_text_eof //-->

<td class="<?php echo BOX_WIDTH_TD_RIGHT; ?>"><table border="0" class="<?php echo BOX_WIDTH_RIGHT; ?>" cellspacing="0" cellpadding="0">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

</body>

<?php include'js/connect_js.php';?>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

 

=======================================

 

 

 

please help

Link to comment
Share on other sites

This section of the file looks highly suspicious:

 // reCAPTCHA - end


function session_win() {
 window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
}

var RecaptchaOptions = { theme : '<?php echo RECAPTCHA_THEME ?>', lang : '<?php echo in_array($code, array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr')) ? $code : 'en' ?>' }; // reCAPTCHA


 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

You've got PHP code (up through // reCAPTCHA - end). Then you have some Javascript code dumped into the PHP (define function session_win() and a global variable RecaptchaOptions) with some PHP inclusions, and then back to PHP and then HTML.

 

The Javascript code needs to be moved into the HTML <head> section, and put within <script> tags. I think it will be OK to leave the PHP snippets within the JS -- they should be processed by the server.

 

So, what were you trying to do?

Link to comment
Share on other sites

thank u for such a quick response. I thought i was passed being a newbie, now im totally confused.

 

 

i dont see the jscript code so i dont know exactly what im placing in the <head> section. i dont know how to put within <script> tags

 

 

can u separate for me jscript code and put within <script> tag and ill place in the HTML head section

 

thanks alot i appreciate you.

Link to comment
Share on other sites

Looking in the <head> section of the code, it appears that you already have a session_win() defined. How did you manage to get a second one? I would try moving the var RecaptchaOptions line to right before the </script> line. Get rid of the first session_win() function definition and leave the one down in the <head> section.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...