Kostenloses Webkatalog Script - Link Script

kostenloses Webkatalog Script - Datei: class.phpmailer.php

 
  Download Webkatalog Script   Demo Webkatalog   Demo Adminbereich   Bücher PHP & Mysql   Forum  
 
Home » class.phpmailer.php

Linkaufbau & Link Building Steigerung der Relevanz, des PageRanks und der Besucherzahlen sind die Ziele von Link Building. Die [ Wekatalog Skript Erweiterung ] bietet eine einfache Möglichkeit der Steigerung der Besucherzahlen als auch Relevanz einer Website bei den etablierten Suchdienste Google, Yahoo, MSN oder ASK.

Einbindungsbeispiel Surftipps & Linkpartner
Webkatalog und Partner Seiten

<?
/* Beispiel zum Einbinden */
define('CG_LINK', true);
@include (
'url-anmelden-link-eintragen
/cg_config.php'
);
/*
Varibale $linkswebkat in *.php einbinden
<? echo $linkswebkat; ?>
Erzeugte Ausgabe:
Surftipps & Linkpartner
Webkatalog und Partner Seiten
*/
?>

Dateiname class.phpmailer.php (Größe 5.6 kB) (last upate 21.05.2007)
  1. <?php
  2. /*
  3. Das Script darf grundsätzlich frei genutzt und modifiziert werden, solange der Copyright Hinweiss & Link zu http://www.phplist.de erhalten bleibt.
  4. */
  5.  
  6. if (!defined('CG_LINK') )
  7. {
  8.         die("NÖÖ!");
  9. }
  10. require("phpmailer/class.phpmailer.php");
  11.  
  12. class PHPlistMailer extends PHPMailer {
  13.         var $isText = false;
  14.         var $WordWrap = 75;
  15.         var $encoding = 'base64';
  16.         var $image_types = array(
  17.         'gif'  => 'image/gif',
  18.         'jpg'  => 'image/jpeg',
  19.         'jpeg'  => 'image/jpeg',
  20.         'jpe'  => 'image/jpeg',
  21.         'bmp'  => 'image/bmp',
  22.         'png'  => 'image/png',
  23.         'tif'  => 'image/tiff',
  24.         'tiff'  => 'image/tiff',
  25.         'swf'  => 'application/x-shockwave-flash'
  26.         );
  27.  
  28.         function PHPlistMailer($messageid,$email) {
  29.                 $this->addCustomHeader("X-Mailer: cg-soft.de");
  30.                 $this->addCustomHeader("X-MessageID: $messageid");
  31.                 $this->addCustomHeader("X-ListMember: $email");
  32.                 $this->addCustomHeader("Precedence: bulk");
  33.  
  34.                 $this->Host = PHPMAILERHOST;
  35.                 //  $this->Helo = getConfig("website");
  36.                 //  $this->CharSet = getConfig("html_charset");
  37.                 /*
  38.                 if (isset($GLOBALS['phpmailer_smtpuser']) && $GLOBALS['phpmailer_smtpuser'] != '') {
  39.                 $this->SMTPAuth = true;
  40.                 $this->Username = $GLOBALS['phpmailer_smtpuser'];
  41.                 $this->Password = $GLOBALS['phpmailer_smtppassword'];
  42.                 #        logEvent('Sending authenticated email via '.PHPMAILERHOST);
  43.                 }
  44.                 */
  45.  
  46.                 $ip = gethostbyname($this->Host);
  47.                 if ($GLOBALS["message_envelope"]) {
  48.                         $this->Sender = $GLOBALS["message_envelope"];
  49.                         $this->addCustomHeader("Errors-To: ".$GLOBALS["message_envelope"]);
  50.                 }
  51.  
  52.                         $this->Mailer = "mail";
  53.                         #        logEvent('Sending via mail');
  54.  
  55.         }
  56.  
  57.         function add_html($html,$text = '',$templateid = 0) {
  58.                 $this->Body = $html;
  59.                 $this->IsHTML(true);
  60.                 if ($text) {
  61.                         $this->add_text($text);
  62.                 }
  63.                 $this->find_html_images_in_content($html);
  64.         }
  65.  
  66.         function add_text($text) {
  67.                 if (!$this->Body) {
  68.                         $this->IsHTML(false);
  69.                         $this->Body = $text;
  70.                 } else {
  71.                         $this->AltBody = $text;
  72.                 }
  73.         }
  74.  
  75.         function append_text($text) {
  76.                 if ($this->AltBody) {
  77.                         $this->AltBody .= $text;
  78.                 } else {
  79.                         $this->Body .= $text;
  80.                 }
  81.         }
  82.  
  83.         function build_message() {
  84.         }
  85.  
  86.         function send($to_name = "", $to_addr, $from_name, $from_addr, $subject = '', $headers = '',$envelope = '') {
  87.  
  88.                 $this->From = $from_addr;
  89.                 $this->FromName = $from_name;
  90.                 if (strstr(VERSION, "dev")) {
  91.                         $this->AddAddress($GLOBALS["developer_email"]);
  92.                 } else {
  93.                         $this->AddAddress($to_addr);
  94.                 }
  95.                 $this->Subject = $subject;
  96.  
  97.                 if(!parent::Send()) {
  98.                         echo ("Mailer Error: " . $this->ErrorInfo);
  99.                         return 0;
  100.                 }#
  101.                 return 1;
  102.         }
  103.  
  104.         function add_attachment($contents,$filename,$mimetype) {
  105.                 $cur = count($this->attachment);
  106.                 $this->attachment[$cur][0] = chunk_split(base64_encode($contents), 76, $this->LE);
  107.                 $this->attachment[$cur][1] = $filename;
  108.                 $this->attachment[$cur][2] = $filename;
  109.                 $this->attachment[$cur][3] = $this->encoding;
  110.                 $this->attachment[$cur][4] = $mimetype;
  111.                 $this->attachment[$cur][5] = false;
  112.                 $this->attachment[$cur][6] = "attachment";
  113.                 $this->attachment[$cur][7] = 0;
  114.         }
  115.  
  116.         function get_template_image_in_content($filename){
  117.                 $return = '';
  118.                 if($fp = fopen($filename, 'rb')){
  119.                         while(!feof($fp)){
  120.                                 $return .= fread($fp, 1024);
  121.                         }
  122.                         fclose($fp);
  123.                         return chunk_split(base64_encode($return));
  124.                 }else{
  125.                 return FALSE;
  126.         }
  127. }
  128.  
  129.  
  130. function find_html_images_in_content($content) {
  131.         while(list($key,) = each($this->image_types))
  132.         $extensions[] = $key;
  133.  
  134.         preg_match_all('/(:url\()+(.*('.implode('|', $extensions).'))+\)/i',$content , $images);
  135.  
  136.         for($i=0; $i<count($images[2]); $i++)
  137.         {
  138.                 $html_images[] = $images[2][$i];
  139.         }
  140.  
  141.         if(!empty($html_images))
  142.         {
  143.                 $html_images = array_unique($html_images);
  144.                 sort($html_images);
  145.                 for($i=0; $i<count($html_images); $i++)
  146.                 {
  147.                         if($image = $this->get_template_image_in_content($html_images[$i])){
  148.                                 $this->Body  = str_replace($html_images[$i], basename($html_images[$i]), $this->Body);
  149.                                 $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
  150.                                 $cid = $this->add_html_image($image, basename($html_images[$i]), $content_type);
  151.                                 $this->Body = str_replace(basename($html_images[$i]), "cid:$cid", $this->Body);#@@@
  152.                         }
  153.                 }
  154.         }
  155. }
  156.  
  157.  
  158. function find_html_images($templateid) {
  159.  
  160.         while(list($key,) = each($this->image_types))
  161.         $extensions[] = $key;
  162.  
  163.         preg_match_all('/"([^"]+\.('.implode('|', $extensions).'))"/Ui', $this->Body, $images);
  164.  
  165.         for($i=0; $i<count($images[1]); $i++){
  166.                 if($this->image_exists($templateid,$images[1][$i])){
  167.                         $html_images[] = $images[1][$i];
  168.                         $this->Body = str_replace($images[1][$i], basename($images[1][$i]), $this->Body);
  169.                 }
  170.         }
  171.  
  172.         if(!empty($html_images)){
  173.                 $html_images = array_unique($html_images);
  174.                 sort($html_images);
  175.                 for($i=0; $i<count($html_images); $i++){
  176.                         if($image = $this->get_template_image($templateid,$html_images[$i])){
  177.                                 $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
  178.                                 $cid = $this->add_html_image($image, basename($html_images[$i]), $content_type);
  179.                                 $this->Body = str_replace(basename($html_images[$i]), "cid:$cid", $this->Body);#@@@
  180.                         }
  181.                 }
  182.         }
  183. }
  184.  
  185. function add_html_image($contents, $name = '', $content_type='application/octet-stream') {
  186.         $cid = md5(uniqid(time()));
  187.         $cur = count($this->attachment);
  188.         $this->attachment[$cur][0] = $contents;
  189.         $this->attachment[$cur][1] = '';
  190.         $this->attachment[$cur][2] = $name;
  191.         $this->attachment[$cur][3] = $this->encoding;
  192.         $this->attachment[$cur][4] = $content_type;
  193.         $this->attachment[$cur][5] = false;
  194.         $this->attachment[$cur][6] = "inline";
  195.         $this->attachment[$cur][7] = $cid;
  196.         return $cid;
  197. }
  198.  
  199. function EncodeFile ($path, $encoding = "base64") {
  200.         # as we already encoded the contents in $path, return $path
  201.         return chunk_split($path, 76, $this->LE);
  202. }
  203. }
Webkat - Script
 kostenlos
 zuverlässig
 vielseitig
 anpassbar
 ohne Datenb.
 SEO freundlich
 Html Mail
 Template

Webkatalog Skript
Das Programm dient zur Online-Verwaltung von Linkpartner auf Ihrer Homepage.
Das Skript es ist klein, leicht zu installieren und benötigt keine Datenbank !

Linkpartner können einfach online verwaltet werden.
Ein editieren der Linkpartner kann bequem über den Adminbereich durchgeführt werden ( edit.php ).
Aussehen und Beschreibungen der Linkeinträge können selber erstellt werden. ( Etwas Html Kenntnisse sollten vorhanden sein. ) Die Einrichtung neuer Linkpartner ist NUR in einer Datei notwendig ! ( linki.php )

Bei Linknachfragen erhalten Linkpartner als auch der Admin eine Anfrage Mail.

 
hoch