Loaded Commerce Community

Banner


Board index » Web Design and Development » Contribution Garage

All times are UTC - 5 hours




Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Newsletters and Non-Customer Subscribers Contribution
PostPosted: Fri Dec 02, 2005 2:24 am 
Offline
CRE Freak
User avatar

Joined: Sat Aug 23, 2003 12:00 am
Posts: 122
Hi all,

I have added a new info box with a text box and add button using frontpage server ext's however post via frontpage server ext's dont working within an info box. I need to collect email addresses enter in the text box and stored in a text file.

Can anybody help?

Thanks


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Sat Dec 03, 2005 12:34 pm 
Offline
CRE Freak
User avatar

Joined: Sat Aug 23, 2003 12:00 am
Posts: 122
anybody?


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Tue Dec 06, 2005 11:22 am 
Offline
CRE Freak
User avatar

Joined: Sat Aug 23, 2003 12:00 am
Posts: 122
anybody please?


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Tue Dec 06, 2005 3:11 pm 
Offline
CRE Legend

Joined: Sun Nov 09, 2003 1:00 am
Posts: 7301
Location: Baconton, GA USA
Kevin,

I've never used frontpage extensions. I think what you are looking for may be in a newsletter signup contribution on the osCommerce forums. There is also a "report" which will allow saving your newsletter subscribers to a file.

David

_________________
My CRE Loaded FAQ List
CRE Loaded Hosting


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Thu Dec 08, 2005 12:06 pm 
Offline
CRE Freak
User avatar

Joined: Sat Aug 23, 2003 12:00 am
Posts: 122
Hi David,

Thanks for the info. I have downloaded http://www.oscommerce.com/community/con ... Newsletter

I have installed all the files and it works! :) with and exception to the following file : newsletters_subscribe_success.php

you get to that file after you enter your email address and name.

This is the error


Parse error: parse error, unexpected T_STRING in /home/perkala/public_html/includes/header.php on line 12


and this is the contents of the file:

<?php
/*
$Id: privacy.php,v 1.17 2002/01/12 19:19:38 dgw_ Exp $
The Exchange Project - Community Made Shopping!
http://www.theexchangeproject.org
Copyright (c) 2000,2001 The Exchange Project
Released under the GNU General Public License
*/
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSLETTERS);
$location = ' &raquo;<a href="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBE_SUCCESS, '', 'NONSSL') . '" class="headerNavigation">' . NAVBAR_TITLE . '</a>';
?>
<!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 (getenv('HTTPS') == 'on' ? 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 width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td 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><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo TEXT_INFORMATION; ?></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></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>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Thu Jan 05, 2006 9:56 pm 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
To remove the header.php parse error do the following.

Replace

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


With

Code:
<?php require(DIR_WS_TEMPLATES . TEMPLATE_NAME .'/header.php'); ?>



The file newsletter_subscribe_success.php contains the .tpl.php structure for OSCommerce MS2. I am working on fixing this file to work with my specific store template, you may have to modify the file to work properly. I will post my file contents once I get the file working properly.

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Thu Jan 05, 2006 11:10 pm 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
Alright I fixed this little bug in this contribution.

Here are the changes you need to make, this "should" work for any template not just mine. This is adding the Newsletters Success page into the CRE 6.15 environment, which is very different from OSCommerce MS2.

Here it goes.

[hr]

Replace the code inside the file catalog/newsletters_subscribe_success.php with this code:

Code:
<?php
/*
  $Id: newsletters_subscribe_success.php,v 1.0 2006/01/05 23:00:38 tjlawjx Exp $

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

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
  require('includes/application_top.php');

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


  // newsletterss breadcrumb
  $breadcrumb->add(NAVBAR_TITLE_1, FILENAME_NEWSLETTERS);
  $breadcrumb->add(NAVBAR_TITLE_2);

  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();
  } else {
    $origin_href = tep_href_link(FILENAME_DEFAULT);
  }

  $content = newsletters_subscribe_success;


  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

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


[hr]

catalog/includes/filenames.php

add this code

Code:
  define('CONTENT_NEWSLETTERS_SUBSCRIBE_SUCCESS', 'newsletters_subscribe_success.php')   ;   


Right below this line

Code:
  define('FILENAME_NEWSLETTERS_SUBSCRIBE_SUCCESS', 'newsletters_subscribe_success')   ;   



[hr]


Create a new file using your favorite text editor and paste this code in it:

Code:
<table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="pageHeading" align="center"><?php echo HEADING_TITLE; ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo TEXT_INFORMATION; ?></td>
              </tr>
            </table></td>
          </tr>
        </table></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="' . $origin_href . '">' . 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> 


Then name it newsletters_subscribe_success.tpl.php (case sensitive rename it exactly as shown here) and then place it at catalog/templates/content/

[hr]

That should do it. Now on to test the rest of the contribution. I'll post if I find more problems. Let me know if this helps.

If this thing works completely this needs to be added to the creloaded contributions library. I know I have been wanting this functionality for a very long time. Awesome!

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 12:29 am 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
I found another bug and fixed it.

Problem: the infobox added does not have the box footer graphic loaded.

[hr]

catalog/includes/boxes/newsletter.php

add this code:

Code:
$info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
                              );
  new infoboxFooter($info_box_contents, true, true);


just below this line (line 94):

Code:
new $infobox_template($info_box_contents);

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 12:40 am 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
There is one thing I don't like, and I'm getting too tired to figure it out. If someone has a chance to help out. I do not like the idea of hard coding the Newsletter Subscription infobox into catalog/includes/column_left.php or catalog/includes/column_right.php.

Can someone who is familiar with creating infoboxes knock this out real quick?

The code that is being added to catalog/includes/column_left.php or catalog/includes/column_right.php to create the contents of the new infobox is:

Code:
if (!tep_session_is_registered('customer_id')) {
  require(DIR_WS_BOXES . 'newsletter.php');
}


I tried, but failed miserably when trying to add newsletter.php to the "File Name" drop-down list in the infobox admin page. I guess a SQL edit is needed to add newsletter.php as an available file for use as an infobox.

The code used inside catalog/includes/boxes/newsletter.php is:

Code:
<?php
/*
  $Id: information.php,v 1.5 2002/01/11 22:04:06 dgw_ Exp $
  osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
  Copyright (c) 2001 osCommerce
  Released under the GNU General Public License
*/
?>
<!-- subscribers //-->
          <tr>
            <td>

<?php
  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                               'text'  => BOX_HEADING_SUBSCRIBERS
                              );
  new infoBoxHeading($info_box_contents,'');

  ?>

<script language="JavaScript1.2" type="text/javascript">
        function verify(form)
        {
           var passed = false;
        var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;
        if (form.Email){
                       intAtSign=form.Email.value.indexOf("@");
                        intDot=form.Email.value.indexOf(".",intAtSign);
                        intComma=form.Email.value.indexOf(",");
                        intSpace=form.Email.value.indexOf(" ");
                        intLastDot=form.Email.value.lastIndexOf(".");
                        intDomain=intDot-intAtSign;
                        intStrLen=form.Email.value.length;
                // *** CHECK FOR BLANK EMAIL VALUE
                   if (form.Email.value == "" )
                   {
                alert("You have not entered an email address.");
                form.Email.focus();
                passed = false;
                }
                // **** CHECK FOR THE  @ SIGN?
                else if (intAtSign == -1)
                {

                alert("Your email address is missing the \"@\".");
                        form.Email.focus();
                passed = false;

                }
                // **** Check for commas ****

                else if (intComma != -1)
                {
                alert("Email address cannot contain a comma.");
                form.Email.focus();
                passed = false;
                }

                // **** Check for a space ****

                else if (intSpace != -1)
                {
                alert("Email address cannot contain spaces.");
                form.Email.focus();
                passed = false;
                }

                // **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****

                else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1)< 2))
                {
                alert("Please enter a valid Email address.\n" + form.Email.value + " is invalid.");
                form.Email.focus();
                passed = false;
                }
                else {
                        passed = true;
                }
        }
        else    {
                passed = true;
        }
        return passed;
  }
        //-->
</script>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                               'text'  =>  '<span class="smallText"><b>Note:</b> Registered customers go to: <a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'NONSSL') . '"><u>Your Account</u></a> to subscribe.</span><br><br><form name="newsletter" action="' . tep_href_link(FILENAME_NEWSLETTERS_SUBSCRIBE, '', 'NONSSL') . '" method="post" onSubmit="return verify(this);">' . TEXT_EMAIL . '<br><input type="text" name="Email" value="" checked size="15" maxlength="35"><br>' . TEXT_NAME . '<br><input type="text" name="lastname" value="" checked size="15" maxlength="35">' . '<input type="submit" name="Submit" value="Subscribe">' . '<a href="' . tep_href_link(FILENAME_NEWSLETTERS, '', 'NONSSL') . '"></form>');

new $infobox_template($info_box_contents);


$info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
                              );
  new infoboxFooter($info_box_contents, true, true);

?>
            </td>
          </tr>
<!-- subscribers_eof //-->

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 2:19 pm 
Offline
CRE Legend

Joined: Sun Nov 09, 2003 1:00 am
Posts: 7301
Location: Baconton, GA USA
Some nice work being done here. Moving to Contribution Garage to make locating this type of information easier.

David

_________________
My CRE Loaded FAQ List
CRE Loaded Hosting


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 2:50 pm 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
More Bugs Found:

Problem 1:

Newsletter Manager is still listed under Tools in the Admin's Left Column.


Problem 2:


Clicking Send after creating a newsletter and locking it inside the Newsletter Manager to send a newsletter generates this error:

Warning: Missing argument 3 for newsletter() in catalog/admin/includes/modules/newsletters/newsletter.php on line 17

Warning: Missing argument 4 for newsletter() in catalog/admin/includes/modules/newsletters/newsletter.php on line 17

Warning: Missing argument 5 for newsletter() in catalog/admin/includes/modules/newsletters/newsletter.php on line 17

Warning: Missing argument 6 for newsletter() in catalog/admin/includes/modules/newsletters/newsletter.php on line 17

Warning: Missing argument 7 for newsletter() in catalog/admin/includes/modules/newsletters/newsletter.php on line 17


Problem 3:

The Newsletter Manager is calculating the number of receiving newsletter subscribers incorrectly. Those subscribers who have subscribed through the new infobox are not being factored in. thus will not receive the newsletter once sent.


Problem 4:

The Newsletter Sent using the Newsletter Manager, does not contain the contents of the newsletter created inside the manager.

Problem 5:

The unsubscribe links that are emailed to the customer once subscribed via the infobox, are getting the parse error unexpected T_STRING for header.php on Line 12.

Problem 7:

The email being sent at newsletter subscription contains a link to the privacy policy which is not CRE 6.15's link. It is pointing a catalog/privacy.php which does not exist.

Note:

I do not believe this contribution will work with the newsletter Manager that comes with CRE 6.15. However I am not able to locate a method for actually sending a newsletter with the new Newsletter links inside Admin.
I will gather this contribution and post a .zip file so others can help out. This thing is close but not quite there.

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 3:40 pm 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
Sending Email to All Subscribers via the mails.php that comes with this contribution will send out the email that you create to all subscribers, however it does not attach the correct headers and footers created by the contribution. This leads me to believe that this contribution would most likely work perfectly in OSCommerce MS2 using the Newsletter Manager, however it will not work with CRE since CRE 6.15 has its own Newsletter manager in which this contribution was not designed for. This is where we will need to do a lot of work. The Newsletter Manager will need to be reworked to use the new database calls properly.

The mails.php file will need to replace the mail.php that comes with CRE 6.15.

The Newsletter Manager link needs to be moved from the "Tools" category in Admin to the new "Newsletter" category

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 3:58 pm 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
Correction on the admin/newsletters.php

The OSCommerce orginal link for this contribution had an updated admin/newsletters.php available.

This one does not generate the long list of errors, but it is also not using the header and footer pieces created in the contribution, nor is it calculating the correct amount of subscribers. Again the subscribers who signed up via new infobox who are not "customers" are not being included in the sent newsletter.


OK now I am working to get this thing in one .zip file so others can play with it. Sorry for spamming the thread, I kept having more ideas on it.

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 4:37 pm 
Offline
CRE Legend

Joined: Sun Nov 09, 2003 1:00 am
Posts: 7301
Location: Baconton, GA USA
I don't think this is "spamming". Does make me excited about the pending opening of CRE forge for developers who want to work together...

David

_________________
My CRE Loaded FAQ List
CRE Loaded Hosting


Top
 Profile  
 
 Post subject: Re: mailing list
PostPosted: Fri Jan 06, 2006 5:02 pm 
Offline
CRE Freak
User avatar

Joined: Tue Aug 16, 2005 12:00 am
Posts: 98
Location: Orlando, FL
OK my file upload control panel doesn't work in the My Account area on this site, so I uploaded it to my domain.

Please read further to download what has been developing. [edited to remove dead link]

If you make any drastic changes, please update the version history in the INSTALL.txt re-package it and post it back up in the thread.

Once again I apologize for flooding this thread, realizing now, I am most certain many of you received a bunch of emails due to my excitement.

_________________
TJ Lawrence<br>
<a href="http://www.islandgirlscrapwear.com">IslandGirlScrapwear.com</a><br>  - Running CRE Loaded 6.15


Last edited by TJLawJX on Fri Jan 13, 2006 5:17 pm, edited 3 times in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next

Board index » Web Design and Development » Contribution Garage

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 24, 2012 5:51 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy