// ====================================================================== // // Tell A Friend - Enhancement to ShopZone Online Store // // Copyright (c) 2000 by William Atchison. All Rights Reserved // // Atchison Consulting // http://www.atchison.net // // ====================================================================== DEFAULT_COMMENTS="I saw this item and thought you might be interested."; MAX_TELL_FRIEND=5; // set this value to the maximum emails that any user can send from one session // keeping a low number less than 20 can stop potential serious abuse of this // feature CC_WEBMASTER=1; // Set to 1 to CC the webmaster on all TellFriend emails // Set to 0 to disable CC'ing copies to the webmaster main() { configread("config.ini"); l_found=0; if( s_tellfriend_count >= MAX_TELL_FRIEND ) { printtag("HEADER"); printtag( "EXCEED_MAX" ); printtag("TOOLBAR"); printtag("FOOTER"); exit(); } l_found=FindProduct(); if ( (stateget("s_sys_userlogon") == "True") || (stateget("VALIDLOGON") == "True") ) { if( YOUR_NAME=="" ) YOUR_NAME = s_sys_firstname & " " & s_sys_lastname; if( YOUR_EMAIL=="" ) YOUR_EMAIL = s_sys_email; } printtag("HEADER"); if( (parmcount()>1) && (parm("p_prodid")=="") ) { printtag("NO_PROD"); printtag("TOOLBAR"); printtag("FOOTER"); exit(); } if( toupper(func)=="SUBMIT" ) { send_err=TellFriend(l_found); if( send_err==1 ) { printtag("BODY"); if( l_found ) printtag("PRODUCT"); printtag("COMMENTS"); } else { if( send_err!=2 ) { printtag("SUBMIT_CONFIRM" ); if( l_found ) printtag("SUBMIT_CONFIRM_PRODUCT" ); printtag("SUBMIT_CONFIRM_FOOTER" ); } } } else { if( COMMENTS=="" ) COMMENTS=DEFAULT_COMMENTS; printtag("BODY"); if( l_found ) printtag("PRODUCT"); printtag("COMMENTS"); } printtag("TOOLBAR"); printtag("FOOTER"); } TellFriend( l_found ) { // If a session Cookie isn't detected enable the // ShopZone 3 style URL session tracking if( checksession()=="False" ) { enablesession(); } if( s_tellfriend_count == "" ) stateset("s_tellfriend_count",0 ); if( s_tellfriend_count >= MAX_TELL_FRIEND ) { printtag( "EXCEED_MAX" ); return(2); } stateset("s_tellfriend_count", s_tellfriend_count+1 ); l_req_fields = ""; // all fields required if ( strip(COMMENTS)=="" ) { l_req_fields = l_req_fields & "Comments"; comma = ", "; } if ( strip(YOUR_NAME)=="" ) { l_req_fields = l_req_fields & comma & "Your Name"; comma = ", "; } if ( strip(YOUR_EMAIL)=="" ) { l_req_fields = l_req_fields & comma & "Your Email Address"; comma = ", "; } if ( strip(SEND_TO_EM)=="" ) { l_req_fields = l_req_fields & comma & "Your Friend's Email Address"; comma = ", "; } if (l_req_fields != "") { print("