| // +----------------------------------------------------------------------+ /** * * Raw mime encoding class * * What is it? * This class enables you to manipulate and build * a mime email from the ground up. * * Why use this instead of mime.php? * mime.php is a userfriendly api to this class for * people who aren't interested in the internals of * mime mail. This class however allows full control * over the email. * * Eg. * * // Since multipart/mixed has no real body, (the body is * // the subpart), we set the body argument to blank. * * $params['content_type'] = 'multipart/mixed'; * $email = new Mail_mimePart('', $params); * * // Here we add a text part to the multipart we have * // already. Assume $body contains plain text. * * $params['content_type'] = 'text/plain'; * $params['encoding'] = '7bit'; * $text = $email->addSubPart($body, $params); * * // Now add an attachment. Assume $attach is * the contents of the attachment * * $params['content_type'] = 'application/zip'; * $params['encoding'] = 'base64'; * $params['disposition'] = 'attachment'; * $params['dfilename'] = 'example.zip'; * $attach =& $email->addSubPart($body, $params); * * // Now build the email. Note that the encode * // function returns an associative array containing two * // elements, body and headers. You will need to add extra * // headers, (eg. Mime-Version) before sending. * * $email = $message->encode(); * $email['headers'][] = 'Mime-Version: 1.0'; * * * Further examples are available at http://www.phpguru.org * * TODO: * - Set encode() to return the $obj->encoded if encode() * has already been run. Unless a flag is passed to specifically * re-build the message. * * @author Richard Heyes * @version $Revision: 1.3 $ * @package Mail */ class Mail_mimePart { /** * The encoding type of this part * @var string */ var $_encoding; /** * An array of subparts * @var array */ var $_subparts; /** * The output of this part after being built * @var string */ var $_encoded; /** * Headers for this part * @var array */ var $_headers; /** * The body of this part (not encoded) * @var string */ var $_body; /** * Constructor. * * Sets up the object. * * @param $body - The body of the mime part if any. * @param $params - An associative array of parameters: * content_type - The content type for this part eg multipart/mixed * encoding - The encoding to use, 7bit, 8bit, base64, or quoted-printable * cid - Content ID to apply * disposition - Content disposition, inline or attachment * dfilename - Optional filename parameter for content disposition * description - Content description * charset - Character set to use * @access public */ function Mail_mimePart($body = '', $params = array()) { if (!defined('MAIL_MIMEPART_CRLF')) { define('MAIL_MIMEPART_CRLF', defined('MAIL_MIME_CRLF') ? MAIL_MIME_CRLF : "\r\n", TRUE); } foreach ($params as $key => $value) { switch ($key) { case 'content_type': $headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : ''); break; case 'encoding': $this->_encoding = $value; $headers['Content-Transfer-Encoding'] = $value; break; case 'cid': $headers['Content-ID'] = '<' . $value . '>'; break; case 'disposition': $headers['Content-Disposition'] = $value . (isset($dfilename) ? '; filename="' . $dfilename . '"' : ''); break; case 'dfilename': if (isset($headers['Content-Disposition'])) { $headers['Content-Disposition'] .= '; filename="' . $value . '"'; } else { $dfilename = $value; } break; case 'description': $headers['Content-Description'] = $value; break; case 'charset': if (isset($headers['Content-Type'])) { $headers['Content-Type'] .= '; charset="' . $value . '"'; } else { $charset = $value; } break; } } // Default content-type if (!isset($headers['Content-Type'])) { $headers['Content-Type'] = 'text/plain'; } //Default encoding if (!isset($this->_encoding)) { $this->_encoding = '7bit'; } // Assign stuff to member variables $this->_encoded = array(); $this->_headers = $headers; $this->_body = $body; } /** * encode() * * Encodes and returns the email. Also stores * it in the encoded member variable * * @return An associative array containing two elements, * body and headers. The headers element is itself * an indexed array. * @access public */ function encode() { $encoded =& $this->_encoded; if (!empty($this->_subparts)) { srand((double)microtime()*1000000); $boundary = '=_' . md5(uniqid(rand()) . microtime()); $this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . "\t" . 'boundary="' . $boundary . '"'; // Add body parts to $subparts for ($i = 0; $i < count($this->_subparts); $i++) { $headers = array(); $tmp = $this->_subparts[$i]->encode(); foreach ($tmp['headers'] as $key => $value) { $headers[] = $key . ': ' . $value; } $subparts[] = implode(MAIL_MIMEPART_CRLF, $headers) . MAIL_MIMEPART_CRLF . MAIL_MIMEPART_CRLF . $tmp['body']; } $encoded['body'] = '--' . $boundary . MAIL_MIMEPART_CRLF . implode('--' . $boundary . MAIL_MIMEPART_CRLF, $subparts) . '--' . $boundary.'--' . MAIL_MIMEPART_CRLF; } else { $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . MAIL_MIMEPART_CRLF; } // Add headers to $encoded $encoded['headers'] =& $this->_headers; return $encoded; } /** * &addSubPart() * * Adds a subpart to current mime part and returns * a reference to it * * @param $body The body of the subpart, if any. * @param $params The parameters for the subpart, same * as the $params argument for constructor. * @return A reference to the part you just added. Ia:9:{s:4:"time";i:1214152965;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"USA";s:10:"money_type";s:2:"us";s:17:"money_type_prefix";s:1:"$";s:12:"http_referer";s:0:"";s:4:"cart";a:0:{}}a:7:{s:4:"time";i:1214142929;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"RUS";s:10:"money_type";s:2:"us";s:17:"money_type_prefix";s:1:"$";}a:9:{s:4:"time";i:1214145995;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"CHN";s:10:"money_type";s:2:"us";s:17:"money_type_prefix";s:1:"$";s:12:"http_referer";s:0:"";s:4:"cart";a:0:{}}a:9:{s:4:"time";i:1214154857;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"USA";s:10:"money_type";s:2:"eu";s:17:"money_type_prefix";s:6:"€";s:12:"http_referer";N;s:4:"cart";a:0:{}}a:9:{s:4:"time";i:1214106085;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"USA";s:10:"money_type";s:2:"us";s:17:"money_type_prefix";s:1:"$";s:12:"http_referer";s:0:"";s:4:"cart";a:0:{}}a:9:{s:4:"time";i:1214135927;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"USA";s:10:"money_type";s:2:"us";s:17:"money_type_prefix";s:1:"$";s:12:"http_referer";s:0:"";s:4:"cart";a:0:{}}a:13:{s:4:"time";i:1214080885;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"USA";s:10:"money_type";s:2:"us";s:17:"money_type_prefix";s:1:"$";s:12:"http_referer";s:0:"";s:4:"cart";a:2:{i:0;a:9:{s:2:"id";s:3:"647";s:9:"parent_id";s:3:"647";s:7:"generic";b:1;s:8:"quantity";i:1;s:5:"price";d:69.9930000000000092086338554508984088897705078125;s:9:"name_item";s:0:"";s:12:"name_package";s:15:"Viagra + Cialis";s:11:"description";s:50:"Viagra 10 pills x 100 mg + Cialis 10 pills x 20 mg";s:6:"upsale";a:1:{s:3:"use";b:0;}}i:1;a:7:{s:2:"id";s:4:"3945";s:9:"parent_id";s:3:"188";s:8:"quantity";i:1;s:5:"price";s:1:"0";s:9:"name_item";s:36:"2 pills X 100 mg";s:12:"name_package";s:6:"Viagra";s:11:"description";s:0:"";}}s:12:"order_stored";b:0;s:13:"cart_delivery";i:0;s:8:"discount";i:0;s:14:"discount_value";d:0;}a:13:{s:4:"time";i:1214142833;s:3:"aid";s:0:"";s:4:"said";s:0:"";s:7:"referer";N;s:7:"country";s:3:"GBR";s:10:"money_type";s:2:"po";s:17:"money_type_prefix";s:7:"£";s:12:"http_referer";s:0:"";s:4:"cart";a:2:{i:0;a:9:{s:2:"id";s:3:"299";s:9:"parent_id";s:3:"188";s:8:"quantity";i:1;s:5:"price";d:34.1495000000000032969182939268648624420166015625;s:9:"name_item";s:36:"10 pills x 50 mg";s:7:"generic";b:1;s:12:"name_package";s:6:"Viagra";s:11:"description";s:246:"Viagra (Sildenafil) is an oral drug for male impotence, also known as erectile dysfunction. Having been around for a lot longer, Viagra has a great safety track record and proven effects that start acting in 30 minutes and last for about 5 hours.";s:6:"upsale";a:6:{s:3:"use";b:1;s:4:"type";s:7:"upgrade";s:3:"num";s:8:"30 pills";s:5:"price";d:48.66000000000000369482222595252096652984619140625;s:4:"save";s:6:"19.16%";s:2:"id";s:3:"300";}}i:1;a:7:{s:2:"id";s:4:"3945";s:9:"parent_id";s:3:"188";s:8:"quantity";i:1;s:5:"price";s:1:"0";s:9:"name_item";s:36:"2 pills X 100 mg";s:12:"name_package";s:6:"Viagra";s:11:"description";s:0:"";}}s:12:"order_stored";b:0;s:13:"cart_delivery";i:0;s:8:"discount";i:0;s:14:"discount_value";d:0;}a:4:{s:8:"col_info";a:2:{i:0;O:8:"stdClass":13:{s:4:"name";s:4:"name";s:5:"table";s:12:"pligg_totals";s:3:"def";s:0:"";s:10:"max_length";i:9;s:8:"not_null";i:1;s:11:"primary_key";i:1;s:12:"multiple_key";i:0;s:10:"unique_key";i:0;s:7:"numeric";i:0;s:4:"blob";i:0;s:4:"type";s:6:"string";s:8:"unsigned";i:0;s:8:"zerofill";i:0;}i:1;O:8:"stdClass":13:{s:4:"name";s:5:"total";s:5:"table";s:12:"pligg_totals";s:3:"def";s:0:"";s:10:"max_length";i:4;s:8:"not_null";i:1;s:11:"primary_key";i:0;s:12:"multiple_key";i:0;s:10:"unique_key";i:0;s:7:"numeric";i:1;s:4:"blob";i:0;s:4:"type";s:3:"int";s:8:"unsigned";i:0;s:8:"zerofill";i:0;}}s:11:"last_result";a:3:{i:0;O:8:"stdClass":2:{s:4:"name";s:9:"published";s:5:"total";s:2:"17";}i:1;O:8:"stdClass":2:{s:4:"name";s:6:"queued";s:5:"total";s:4:"3006";}i:2;O:8:"stdClass":2:{s:4:"name";s:7:"discard";s:5:"total";s:1:"8";}}s:8:"num_rows";i:3;s:12:"return_value";i:3;};s:2:"15";s:3:"rgt";s:2:"16";s:13:"category_name";s:6:"Fetish";s:18:"category_safe_name";s:6:"Fetish";s:13:"category_lang";s:2:"en";}i:9;O:8:"stdClass":7:{s:11:"category_id";s:2:"49";s:17:"category__auto_id";s:2:"49";s:3:"lft";s:2:"17";s:3:"rgt";s:2:"18";s:13:"category_name";s:13:"DVD Downloads";s:18:"category_safe_name";s:12:"DVDDownloads";s:13:"category_lang";s:2:"en";}i:10;O:8:"stdClass":7:{s:11:"category_id";s:2:"19";s:17:"category__auto_id";s:2:"19";s:3:"lft";s:2:"19";s:3:"rgt";s:2:"20";s:13:"category_name";s:7:"Erotica";s:18:"category_safe_name";s:7:"Erotica";s:13:"category_lang";s:2:"en";}i:11;O:8:"stdClass":7:{s:11:"category_id";s:2:"33";s:17:"category__auto_id";s:2:"33";s:3:"lft";s:2:"21";s:3:"rgt";s:2:"22";s:13:"category_name";s:6:"Ethnic";s:18:"category_safe_name";s:6:"Ethnic";s:13:"category_lang";s:2:"en";}i:12;O:8:"stdClass":7:{s:11:"category_id";s:2:"35";s:17:"category__auto_id";s:2:"35";s:3:"lft";s:2:"23";s:3:"rgt";s:2:"24";s:13:"category_name";s:11:"Foot Fetish";s:18:"category_safe_name";s:10:"FootFetish";s:13:"category_lang";s:2:"en";}i:13;O:8:"stdClass":7:{s:11:"category_id";s:2:"36";s:17:"category__auto_id";s:2:"36";s:3:"lft";s:2:"25";s:3:"rgt";s:2:"26";s:13:"category_name";s:3:"Gay";s:18:"category_safe_name";s:3:"Gay";s:13:"category_lang";s:2:"en";}i:14;O:8:"stdClass":7:{s:11:"category_id";s:2:"37";s:17:"category__auto_id";s:2:"37";s:3:"lft";s:2:"27";s:3:"rgt";s:2:"28";s:13:"category_name";s:5:"Group";s:18:"category_safe_name";s:5:"Group";s:13:"category_lang";s:2:"en";}i:15;O:8:"stdClass":7:{s:11:"category_id";s:2:"38";s:17:"category__auto_id";s:2:"38";s:3:"lft";s:2:"29";s:3:"rgt";s:2:"30";s:13:"category_name";s:11:"Interracial";s:18:"category_safe_name";s:11:"Interracial";s:13:"category_lang";s:2:"en";}i:16;O:8:"stdClass":7:{s:11:"category_id";s:2:"39";s:17:"category__auto_id";s:2:"39";s:3:"lft";s:2:"31";s:3:"rgt";s:2:"32";s:13:"category_name";s:8:"Lesbians";s:18:"category_safe_name";s:8:"Lesbians";s:13:"category_lang";s:2:"en";}i:17;O:8:"stdClass":7:{s:11:"category_id";s:2:"40";s:17:"category__auto_id";s:2:"40";s:3:"lft";s:2:"33";s:3:"rgt";s:2:"34";s:13:"category_name";s:6:"Mature";s:18:"category_safe_name";s:6:"Mature";s:13:"category_lang";s:2:"en";}i:18;O:8:"stdClass":7:{s:11:"category_id";s:2:"41";s:17:"category__auto_id";s:2:"41";s:3:"lft";s:2:"35";s:3:"rgt";s:2:"36";s:13:"category_name";s:4:"Oral";s:18:"category_safe_name";s:4:"Oral";s:13:"category_lang";s:2:"en";}i:19;O:8:"stdClass":7:{s:11:"category_id";s:2:"42";s:17:"category__auto_id";s:2:"42";s:3:"lft";s:2:"37";s:3:"rgt";s:2:"38";s:13:"category_name";s:11:" Pornstars";s:18:"category_safe_name";s:9:"Pornstars";s:13:"category_lang";s:2:"en";}i:20;O:8:"stdClass":7:{s:11:"category_id";s:2:"43";s:17:"category__auto_id";s:2:"43";s:3:"lft";s:2:"39";s:3:"rgt";s:2:"40";s:13:"category_name";s:7:" Teens";s:18:"category_safe_name";s:5:"Teens";s:13:"category_lang";s:2:"en";}i:21;O:8:"stdClass":7:{s:11:"category_id";s:2:"44";s:17:"category__auto_id";s:2:"44";s:3:"lft";s:2:"41";s:3:"rgt";s:2:"42";s:13:"category_name";s:8:"Trannies";s:18:"category_safe_name";s:8:"Trannies";s:13:"category_lang";s:2:"en";}i:22;O:8:"stdClass":7:{s:11:"category_id";s:2:"48";s:17:"category__auto_id";s:2:"48";s:3:"lft";s:2:"43";s:3:"rgt";s:2:"44";s:13:"category_name";s:4:"Toys";s:18:"category_safe_name";s:4:"Toys";s:13:"category_lang";s:2:"en";}i:23;O:8:"stdClass":7:{s:11:"category_id";s:2:"50";s:17:"category__auto_id";s:2:"50";s:3:"lft";s:2:"45";s:3:"rgt";s:2:"46";s:13:"category_name";s:6:"Videos";s:18:"category_safe_name";s:6:"Videos";s:13:"category_lang";s:2:"en";}i:24;O:8:"stdClass":7:{s:11:"category_id";s:2:"20";s:17:"category__auto_id";s:2:"20";s:3:"lft";s:2:"47";s:3:"rgt";s:2:"48";s:13:"category_name";s:7:"WebCams";s:18:"category_safe_name";s:7:"WebCams";s:13:"category_lang";s:2:"en";}i:25;O:8:"stdClass":7:{s:11:"category_id";s:2:"47";s:17:"category__auto_id";s:2:"47";s:3:"lft";s:2:"49";s:3:"rgt";s:2:"50";s:13:"category_name";s:16:"WebCam Pro Shows";s:18:"category_safe_name";s:14:"WebCamProShows";s:13:"category_lang";s:2:"en";}}s:8:"num_rows";i:26;s:12:"return_value";i}€}€}€}€}€}€ }€ }€}€(}€>}€y}€«}€8}€l}€E}€°}€}€Ð