'mobimb_demo.exe', 'icon'=>'icon_51.gif' ), $demo_products=array( 51=>array( 'name'=>'MobiMB Mobile Media Browser V1.2', 'trial'=>'http://download.com.com/3001-2641-10212872.html', // 'coded'=>'mobimb_demo.exe', 'icon'=>'icon_51.gif', 'size'=>385952, 'email'=>true), 52=>array( 'name'=>'Polyphonix Studio V1.0', 'trial'=>'http://download.com.com/3001-2641-10217376.html', // 'trial'=>'http://logomanager.shedz.co.uk/lm/pstudio_demo.exe', // 'coded'=>'pstudio_demo.exe', 'icon'=>'icon_52.gif', 'size'=>852976, 'email'=>true), 10=>array( 'name'=>'LogoManager for Nokia Phones V1.3', 'trial'=>'http://logomanager.shedz.co.uk/lm/lm130.exe', 'icon'=>'icon_10.gif', 'size'=>563760, 'email'=>false), // 50=>array( 'name'=>'Polyphonic Ringtone Uploader V1.0.1', // 'trial'=>'', // 'icon'=>'icon_50.gif' ) ); $descriptions=array( 10=>'Design logos, mono ringtones, send SMS and manage your phonebook from your PC. Supports a wide range of Nokia phones. Details...', 50=>'Upload polyphonic ringtones to the Nokia 3510 and 3590. Details...', 51=>'Manage colour wallpaper, operator logos, polyphonic ringtones and games with this easy to use tool. Browse your gallery folders and drag & drop into your phone! Supports a wide range of colour phones. Details...', 52=>'Design and edit your own Polyphonic ringtones with this professional MIDI editor. Connects to a wide range of phones in Nokia\'s polyphonic range. Details...' ); function IsCodedDownload($productid) { global $demo_products; $p=$demo_products[$productid]; if(!is_array($p)) return false; if(empty($p['coded'])) return false; return true; } function IsEmailDownload($productid) { global $demo_products; $p=$demo_products[$productid]; if(!is_array($p)) return false; if(!$p['email']) return false; return true; } function MailDemoLicence($productid,$name,$email,$dl_url=0) { global $demo_products; $p=$demo_products[$productid]; if(!is_array($p)) return false; if(empty($p['trial'])) return false; $product_name=$p['name']; $smtp=new smtp_client(); $subject="Your trial licence for $product_name"; $data="Dear $name,\n\nThank you for your interest in $product_name.\n\n"; if(!empty($dl_url)) { $data .= "You may download the trial version of this software from:\n\n $dl_url\n\n"; } else { $pwd=MakeDemoPassword($productid, $name, $email); $data .= "Please install the file you downloaded from the web site, and enter the\ndetails below when prompted\n\n"; $data .= sprintf("Username: %s\nPassword: %s\n\n",$email,$pwd); } $data .= "If you have any problems, or any questions about this software, please\ndon't hesitate to let us know by contacting support@logomanager.co.uk\n\n"; $data .= "You can order this product today by visiting http://www.logomanager.co.uk\n\n"; $data .= "Best regards,\n\nLogoManager Support"; $hdrs="From: LogoManager Support \r\n"; $hdrs.="Reply-To: \r\n"; $hdrs.="Return-Path: \r\n"; $smtp->email("LogoManager Support ", "$name <$email>", $hdrs, $subject, $data); $smtp->send(); return true; } function GetDDHistory($email, $productid) { $q="select * from demo_downloads where dd_product=$productid and dd_email='$email'"; $history_query=app_db_query($q); if(app_db_num_rows($history_query) != 1) return false; return app_db_fetch_array($history_query); } function CreateDDHistory($productid, $name, $email) { $q=sprintf("replace into demo_downloads (dd_product ,dd_email,dd_name,dd_emailed_reminder,dd_date,dd_dl_count) values(%s,'%s','%s',0,now(),0)",$productid, $email,$name); app_db_query($q); return true; } function IncrementDDHistory($productid, $email) { $hist=GetDDHistory($email, $productid); if(!is_array($hist) || $hist['dd_dl_count']>=5) return false; $q=sprintf("update demo_downloads set dd_dl_count=%s, dd_dl_date=now() where dd_product=%s and dd_email='%s'",$hist['dd_dl_count']+1,$productid, $email); app_db_query($q); return true; } function DoDemoDownload($productid, $name=0, $email=0) { global $demo_products; if(!IsCodedDownload($productid)) { header("Location: " . $demo_products[$productid]['trial']); exit; } if(!IncrementDDHistory($productid, $email)) { ShowError("Download account expired!"); return; } $pwd=MakeDemoPassword($productid, $name, $email); $keydata=MakeDemoKey($email, $pwd); $fname=$demo_products[$productid]['coded']; // no caching header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified // removed the next two because IE enforces nocache with https, and external files must be cached to run // header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 // header ("Pragma: no-cache"); $path=DIR_DOWNLOAD . $fname; $fname='Setup.exe'; $size = @filesize($path); if(!$size) { ShowError("File not found!"); return; } $fp = @fopen($path,'rb'); if(!$fp) { ShowError("Error opening file!"); return; } $filecontents=fread($fp, $size); fclose($fp); // merge the order ID if($pos=strpos($filecontents,"+OR+")) { $kd=pack("V",0); for($i=0; $i'; $body .=sprintf('Please enter your name:

%s
',$_REQUEST['name'],$vItemErrors['name']); $body .=sprintf('Please enter your email address:

%s
',$_REQUEST['email'],$vItemErrors['email']); $body .= ' Keep me updated on the latest news from LogoManager (occasional announcements only) '; return count($vItemErrors); } function DoDefault() { global $country,$title,$body,$demo_products,$descriptions; $title = 'Software downloads'; $body .= ''; $body .= sprintf(''); while(list($id,$item) = each($demo_products)) { $dl = ' Get the full version!
'; if(!empty($item['trial']) && ($id==10 || !IsFlaggedCountry($country))) { $filename="Setup.exe"; // $url=$item['trial']; // $url .= '?rand='. md5(rand(0,9999999)) .'&'. $filename; $url="download.php?action=getdemo&product=" . $id; // if(DIRECT_DOWNLOADS && !empty($demo_products[$id]['trial']) && !IsCodedDownload($id)) // { // $url=$demo_products[$id]['trial']; // } $size=''; if(isset($item['size'])) $size=sprintf(" (%sK)",round($item['size']/1024)); $dl.=sprintf('Download Download a free demo!%s',$url,$size); } $body .= sprintf('',$item['name']); $body .= sprintf('',$id,$item['icon'],$descriptions[$id],$dl); $body .= sprintf(''); } $body .= '

%s
%s%s

'; $body .= '



Join the mailing list!'; $body .= '

While you are downloading, why not make sure you keep up to date with the latest updates by joining our mailing list?'; $body .= '
You can receive news announcements via email.
Click here to subscribe now
'; $body .= '



Vote for us!'; $body .= '

Please vote for us by visiting the site below:


Click to find free tones and logos to use with LogoManager
'; } if(!empty($_REQUEST['dk'])) { $p1=$_REQUEST['dk']; if(ereg("^3D",$p1)) $p1=substr($p1,2); $dk=Decode64($p1); $productid=hexdec(substr($dk,0,2)); if(!is_array($demo_products[$productid]) || IsCodedDownload($_REQUEST['product'])) { $body = 'Invalid download id'; } else { header("Location: " . $demo_products[$productid]['trial']); die; } } else switch($_REQUEST['action']) { case 'getdemo': $id=$_REQUEST['product']; if(IsEmailDownload($id) || IsCodedDownload($id)) { DoRegister(); } else { DoDemoDownload($id); exit; } break; case 'doregister': $id=$_REQUEST['product']; if(!DoRegister(true)) { $title = 'Software download'; if($_REQUEST['list_subscribe']) { MailList_Subscribe($_REQUEST['name'],$_REQUEST['email']); } // work out the actual download URL if(!IsCodedDownload($_REQUEST['product'])) { $dk=Encode64(sprintf("%02x",$id)); $url="http://www.logomanager.co.uk/download.php?dk=" . $dk; } else { $pwd=MakeDemoPassword($_REQUEST['product'],$_REQUEST['name'],$_REQUEST['email']); $demokey=bin2hex(MakeDemoKey($_REQUEST['email'],$pwd)); $dk=Encode64(sprintf("%02x",$_REQUEST['product']).$demokey); $url=sprintf("download.php?action=download&product=%s&name=%s&email=%s", $_REQUEST['product'], rawurlencode($_REQUEST['name']) ,rawurlencode($_REQUEST['email']) ); } CreateDDHistory($_REQUEST['product'],$_REQUEST['name'],$_REQUEST['email']); $body .= "

Thank you for registering your interest in " . $demo_products[$_REQUEST['product']]['name'] . " "; if(IsEmailDownload($id)) { if(IsCodedDownload($id)) { $dl_url=0; $body .= '

You can download the demo version now by clicking on the link below: '; $body.=sprintf('

Download Download trial version',$url); $body .= '

Your trial licence key for this software has been emailed to ' . $_REQUEST['email'] . "."; } else { $dl_url=$url; $body .= "

Your download instructions have been emailed to " . $_REQUEST['email'] . "."; } MailDemoLicence($_REQUEST['product'],$_REQUEST['name'],$_REQUEST['email'], $dl_url); } else { $body .= '

You can download the demo version now by clicking on the link below: '; $body.=sprintf('

Download Download trial version',$url); // $body .= '

Your trial licence key for this software has been emailed to ' . $_REQUEST['email'] . "."; } } break; case 'download': DoDemoDownload($_REQUEST['product'],$_REQUEST['name'],$_REQUEST['email']); exit; default: DoDefault(); break; } function ShowError($msg) { global $tpl; $body = ''; $body .= '

Error - ' . $msg . ''; ShowPage("Product Activation - Error",$body); } function ShowPage($title,$data) { global $tpl,$body_top; $body = ''; $body .= '

'.$title.'

'; $body .= $body_top . $data; ob_start("ob_gzhandler"); $tpl = new FastTemplate(DIR_TEMPLATES); $tpl->define(array("logomanager" => "cat_simple.tpl")); $tpl->assign("TITLE","LogoManager - " . $title); $tpl->assign("META",''); $tpl->assign("MENU",''); $tpl->assign("BODY",$body); $tpl->parse("GLOBAL","logomanager"); $tpl->FastPrint(); $tpl['TITLE']="LogoManager - " . $title; $tpl['BODY']=$body; DoTemplate(); } if(empty($title)) $title="Download"; ShowPage($title,$body);*/ ?>