Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse Error


Beezer2005

Recommended Posts

Posted

I keep getting the following error, I've tried everything. I've installed the latest version twice and an earlier version twice also, and still keep getting the same darn error.

 

Parse error: parse error, unexpected $ in /****/*****/public_html/shop/admin/includes/modules/newsletters/newsletter.php on line 120

 

If anybody can help I'd really appreciate it...I've read so much in the forums today I think I'm going blind. There is definately something wrong with this code because in other installs I got the mentioned error and a couple others all with this page.

 

Here is my code:

 

 

<?php

/*

$Id: newsletter.php,v 1.1 2002/03/08 18:38:18 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

// ################# Contribution Newsletter v050 ##############

class newsletter {

var $show_choose_audience, $newsletters_id, $module_subscribers, $title, $header, $content, $unsubscribea, $unsubscribeb;

 

function newsletter($newsletters_id, $module_subscribers, $title, $header, $content, $unsubscribea, $unsubscribeb) {

$this->show_choose_audience = false;

$this->newsletters_id = $newsletters_id;

$this->module_subscribers = $module_subscribers;

$this->title = $title;

$this->header = $header;

$this->content = $content;

$this->unsubscribea = $unsubscribea;

$this->unsubscribeb = $unsubscribeb;

 

// ################# END - Contribution Newsletter v050 #############

 

function choose_audience() {

return false;

}

 

function confirm() {

global $HTTP_GET_VARS;

 

$mail_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

$mail = tep_db_fetch_array($mail_query);

 

// ################# Contribution Newsletter v050 ##############

$confirm_string = '<table border="0" cellspacing="0" cellpadding="2">' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main"><font color="#ff0000"><b>' . tep_draw_separator('pixel_trans.gif', '20', '1') . TEXT_TITRE_INFO . '</b></font></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main">' . sprintf(TEXT_COUNT_CUSTOMERS, $mail['count']) . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main">' . TEXT_BULLETIN_NUMB . "?" . '<font color="#0000ff">' . $this->newsletters_id . '</font></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main">' . TEXT_MODULE . "?" . '<font color="#0000ff">' . $this->module_subscribers . '</font></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main">' . TEXT_TITRE_MAIL . "?" . '<font color="#0000ff">' . $this->title . '</font></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main"><font color="#ff0000"><b>' . tep_draw_separator('pixel_trans.gif', '20', '1') . TEXT_TITRE_VIEW . '</b></font></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main"><tt>' . $this->header . '</tt></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main"><tt>' . $this->content . '</tt></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main"><tt>' . $this->unsubscribea . '</tt></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td class="main"><tt>' . $this->unsubscribeb . '</tt></td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .

' </tr>' . "\n" .

' <tr>' . "\n" .

' <td align="right"><a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . '">' . tep_image_button('button_send.gif', IMAGE_SEND) . '</a> <a href="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>' . "\n" .

' </tr>' . "\n" .

'</table>';

 

// ################# END - Contribution Newsletter v050 ##############

 

// ################# Contribution Newsletter v050 ##############

function send($newsletter_id) {

$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

 

while ($mail = tep_db_fetch_array($mail_query)) {

$mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));

// Pr?paration de l'envoie du mail en HTML

$mimemessage->add_html_newsletter($this->header . "\n" . $this->content . "\n" . $this->unsubscribea . " " . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '">' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_UNSUBSCRIBE . "?email=" . $mail['customers_email_address'] . '</a>' . "\n" . $this->unsubscribeb);

 

$mimemessage->build_message();

// ################# END - Contribution Newsletter v050 #############

$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);

}

 

$newsletter_id = tep_db_prepare_input($newsletter_id);

tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");

}

}

?> :thumbsup: :thumbsup:

Posted

Add another closing curly bracket } just before the last closing tag ?> :)

 

Matti

Posted
Add another closing curly bracket } just before the last closing tag ?> :)

 

Matti

 

 

I tried this and get another error..This error has popped up with every install of this contrib I've used and get find anything in the thread to help. PLEASE HELP I'm close to insane(LOL)

 

Error Code:

 

Parse error: parse error, unexpected ';', expecting T_FUNCTION in /home/rubarts4/public_html/shop/admin/includes/modules/newsletters/newsletter.php on line 121

Archived

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

×
×
  • Create New...