*/}}
YimingWu 11 hónapja
szülő
commit
93bfe4ceb9
7 módosított fájl, 173 hozzáadás és 26 törlés
  1. 4 0
      all_subscribers.php
  2. 60 0
      bkg.svg
  3. 79 20
      index.php
  4. 4 2
      mailconf.php
  5. 12 0
      mailsub.php
  6. 5 4
      styles/main.css
  7. 9 0
      zh.php

+ 4 - 0
all_subscribers.php

@@ -1 +1,5 @@
 <php
+661a853fc6c0c [[[xp8110@outlook.com]]] 
+661a860b9b94d [[[yiming@wellobserve.com]]] 
+66251f1982103 [[[wuyimingblog@aminmesbah.com]]] 
+664153bbb3b24 [[[sammyeyeballs@icloud.com]]] 

+ 60 - 0
bkg.svg

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="234.39282mm"
+   height="19.461691mm"
+   viewBox="0 0 234.39282 19.461691"
+   version="1.1"
+   id="svg5"
+   inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+   sodipodi:docname="bkg.svg"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview7"
+     pagecolor="#8c7146"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="1"
+     inkscape:pagecheckerboard="0"
+     inkscape:document-units="mm"
+     showgrid="false"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:zoom="0.90509668"
+     inkscape:cx="435.86504"
+     inkscape:cy="112.14272"
+     inkscape:window-width="1920"
+     inkscape:window-height="1021"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer1">
+    <sodipodi:guide
+       position="234.55933,19.203308"
+       orientation="0,-1"
+       id="guide6589" />
+  </sodipodi:namedview>
+  <defs
+     id="defs2" />
+  <g
+     inkscape:label="图层 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-15.12816,-125.7523)">
+    <path
+       style="fill:#ffffff;fill-opacity:0.40048146;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="m 249.3887,126.01068 c -35.71912,0 -66.78783,4.9264 -91.79737,4.9264 -36.29977,0 -63.661049,-4.9264 -142.330879,-4.9264 l 1e-6,19.07102 H 249.38869 Z"
+       id="path857-3"
+       sodipodi:nodetypes="cscccc" />
+    <path
+       style="fill:#ffffff;fill-opacity:0.2145189;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="m 249.3887,127.97702 c -57.9978,0 -107.1937,4.01839 -142.51922,4.01839 -36.299764,0 -71.9445,-4.2578 -91.609029,-4.2578 V 145.0817 H 249.38869 Z"
+       id="path857"
+       sodipodi:nodetypes="cscccc" />
+  </g>
+</svg>

+ 79 - 20
index.php

@@ -174,6 +174,8 @@ class LA{
                 $lang = substr($lang,0,5);
                 if(preg_match("/zh/i",$lang))$this->LanguageAppendix = 'zh';
                 else $this->LanguageAppendix = 'en';
+            }else{
+                $this->LanguageAppendix = 'en';
             }
         }
         if(isset($LA_GLOBAL_LANG)){
@@ -597,7 +599,7 @@ li{display:block;}
 .clean_table{border:none;font-size:1em !important;}.clean_table thead{box-shadow:none;}.clean_table td{vertical-align:top;}
 table{width:100%;border-collapse:collapse;border-bottom:2px solid %black%;border-top:3px solid %black%;}
 .settings input,.post inpiut{border:none!important;}
-.post table img{max-width:min(100%, 10rem) !important;}
+.post table img{max-width:min(100%, 20rem) !important;}
 td{padding-left:0.1em;padding-right:0.1em;}
 td:first-child{padding-left:0;}
 td:last-child{padding-right:0;}
@@ -850,10 +852,11 @@ width:2em;height:2em;display:block;border:1px solid %black%;background-color:rgb
 .center>tbody>tr>td{white-space:normal;vertical-align:top;min-width:1em;}
 .center>tbody>tr>td:first-child{text-align:center;color:%gray%;padding-left:0.1em;}
 .center>tbody>tr>td:nth-child(1)>*{}
-.center>tbody>tr>td:nth-child(2){text-align:center;color:%gray%;}
+.center>tbody>tr>td:nth-child(2){text-align:center;color:%gray%;box-shadow:0.3em 0px 0px -0.15em %black%44;}
+.center>tbody>.no_line>td:nth-child(2){box-shadow:none;}
 .center>tbody>tr>td:nth-child(2) a{color:%gray%;}
 .center>tbody>tr>td:nth-child(2) .marked{color:%black% !important;}
-.center>tbody>tr>td:nth-child(3){width:100%;text-align:left;}
+.center>tbody>tr>td:nth-child(3){width:100%;text-align:left;padding-left:0.5em;}
 .center>tbody>tr>td:nth-child(3)>div{overflow:auto;}
 .center>tbody>tr>td:last-child{padding-right:0.5em;}
 .main>.center>tbody>tr{border-bottom:1px dotted %black%;}
@@ -2817,6 +2820,20 @@ blockquote{border-left:2px solid black;}
                     return 0;
                 };
             }
+
+            if(isset($_GET['send']) && isset($_GET['addr']) && isset($_GET['post']) && $_GET['post']!=''){
+                require_once("mailsub.php"); $this->ReadPosts(); $this->ReadImages();
+                $post = &$this->GetPost($_GET['post'],true); if($post==$this->NULL_POST){ echo $this->T("问题"); exit; }
+                $content = $this->GenerateSinglePost($post, 0, 0, 0, 0, 0);
+                //$content = preg_replace("/(=[\'\"](.*\.php)?)(\?)/","$1{$GLOBALS['MY_HOST']}/$3",$content);
+                //$content = preg_replace("/(src=[\'\"])(images)/","$1{$GLOBALS['MY_HOST']}/$2",$content);
+                //$content = preg_replace("/(=[\'\"])(Files)/","$1{$GLOBALS['MY_HOST']}/$2",$content);
+                $content = $content."<br />.<hr />".mailsub_regular_text($_GET['send'],$_GET['addr']);
+                $title=$this->GetPostTitle($post);
+                if(send_email($_GET['addr'],$title,$content)<0){ echo $this->T("问题"); exit; }
+                echo $content; exit;
+            }
+
             if(isset($_POST['gallery_edit_confirm']) && isset($_POST['gallery_edit_new_name']) && $_POST['gallery_edit_new_name']!=''){
                 $old_name = isset($_POST['gallery_edit_old_name'])?$_POST['gallery_edit_old_name']:"";
                 $new_name = $_POST['gallery_edit_new_name'];
@@ -3316,7 +3333,7 @@ blockquote{border-left:2px solid black;}
     function MakePostingFieldsV2($reply_to=NULL, $show_hint=false){ $STR="";
         if(isset($this->WayBack)){
             $STR.="<span class='gray'><i>{$this->T('以过去日期浏览时不能发帖。')}</i></span>";
-            $this->TFill(2,$STR); $this->TRow(); return;
+            $this->TFill(2,$STR); $this->TExtra("class='hidden_on_print no_line'"); $this->TRow(); return;
         }
         $STR.="<form action='{$_SERVER['REQUEST_URI']}' method='post' style='display:none;' id='post_form'></form>
         <div class='smaller'><div style='display:".($show_hint?"block":"none")."'>
@@ -3342,7 +3359,7 @@ blockquote{border-left:2px solid black;}
         if($reply_to){
             $STR.="<input style='display:none;' type=input form='post_form' id='post_reply_to' name='post_reply_to' value='{$reply_to}' />";
         }
-        $this->TFill(2,$STR);$this->TExtra("class='hidden_on_print'"); $this->TRow();
+        $this->TFill(2,$STR);$this->TExtra("class='hidden_on_print no_line'"); $this->TRow();
     }
 
     function MakeLinkedPostsV2(&$p){ $STR="";
@@ -3419,7 +3436,7 @@ blockquote{border-left:2px solid black;}
         EOT; }  $th=NULL; $STR.="<br /><h2>";
         $is_wide = (isset($post['wide'])&&$post['wide']) || ($is_thread && isset($post['tid']['wide']) && $post['tid']['wide']);
         if($is_thread){ $th = $post['tid']; $STR.=$this->T('话题'); }else{ $STR.=$this->T('话题');$this->T('详细'); } $STR.="</h2>";
-        $this->TFill(2,$STR); $this->TExtra("class='hidden_on_print'"); $this->TRow();
+        $this->TFill(2,$STR); $this->TExtra("class='hidden_on_print no_line'"); $this->TRow();
         $cat = NULL;
         if($is_thread) { if(isset($th['categories']) && isset($th['categories'][0])){ $cat = $th['categories']; } }
         else { if(isset($post['categories']) && isset($post['categories'][0])) { $cat = $post['categories']; } }
@@ -3429,17 +3446,17 @@ blockquote{border-left:2px solid black;}
             EOT; foreach($cat as $c){ $STR.=("<a href='?category=".$c."'>".($c=='none'?$this->T('未分类'):$this->T($c))."</a> "); }
             $STR.="</p>";
         }
-        $STR.="<br class='hidden_on_print' />"; $this->TFill(2,$STR); $this->TRow(); $is_reversed=false;
+        $STR.="<br class='hidden_on_print' />"; $this->TFill(2,$STR); $this->TExtra("class='no_line'");  $this->TRow();$is_reversed=false;
         if($is_thread){ $use_arr = $th['arr']; $hinted=false;
             $last_end_wide = true; $is_reversed=$this->IsReversedThread($th);
             foreach($use_arr as &$p){$use_class="";if($p==$post){$use_class.=" active_post";}
                 if($last_end_wide){$use_class.=" last_wide";}
                 $make_title = ($p == $post);
-                if(isset($p['restart'])){  $STR="<li class='restart'><h3>{$p['restart']} …</h3></li>"; $this->TFill(0,$STR,3); $this->TRow(); }
+                if(isset($p['restart'])){  $STR="<li class='restart'><h3>{$p['restart']} …</h3></li>"; $this->TFill(0,$STR,3); $this->TExtra("class='no_line'"); $this->TRow(); }
                 $this->MakeSinglePostV2($p,true,false,$use_class,false, false, false, true, false, false);
                 if($make_title){ $STR.='<script>
                     document.title+=" | '.addslashes(preg_replace('/\r|\n/u', ' ', mb_substr($this->GetPostTitle($p),0,100))).'"</script>';
-                    $this->TFill(2,$STR);
+                    $this->TFill(2,$STR); $this->TExtra("class='no_line'"); 
                 }
                 if($is_reversed && !$hinted){ $hinted = true; 
                     if($this->LoggedIn && (!$this->InHereMode)){
@@ -3463,12 +3480,12 @@ blockquote{border-left:2px solid black;}
                 <br class='hidden_on_desktop' />".
                 $this->ReadableTime(isset($post['tid']['last']['version'])?$post['tid']['last']['version']:$post['tid']['last']['id'])."
             </div>";
-        $this->TFill(2,$STR); $this->TRow(); $STR="";
+        $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow(); $STR="";
         if(!$is_reversed && ($this->LoggedIn && (!$this->InHereMode))){
             $STR.="<div class='hidden_on_print'><br />{$this->MakePostingFieldsV2($is_thread?$th['last']['id']:$post['id'], true)}</div>";
-            $this->TFill(2,$STR); $this->TRow();
+            $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow();
         }
-        if($this->NewsletterEnabled){ $STR=$this->MakeSubscription(); $this->TFill(2,$STR); $this->TRow(); }
+        if($this->NewsletterEnabled){ $STR=$this->MakeSubscription(); $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow(); }
         //$this->MakeCommentSection($post);
         $STR="";
         if(isset($post['slides']) || ($is_thread&&isset($post['tid']['slides']))){
@@ -3550,7 +3567,7 @@ blockquote{border-left:2px solid black;}
         }
         $this->SpecialPinned=$tmppinned;
         if($this->NewsletterEnabled && !isset($category) && !isset($search_term) && !$this->NotesView){
-            $STR=$this->MakeSubscription(); $this->TFill(2,$STR); $this->TRow(); $STR='';
+            $STR=$this->MakeSubscription(); $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow(); $STR='';
         }
         $STR.="<br /><h2>".(isset($search_term)?$this->T('搜索'):
                                 (isset($category)?("<span class='gray'>".$this->T('分类')."</span> ".
@@ -3559,17 +3576,17 @@ blockquote{border-left:2px solid black;}
                                     ($this->LoggedIn?" <a href='".$INDEXPHP."?set_notes_view=".($this->NotesView?'0':'1')."'>N</a> ".
                                     "<a href='".$INDEXPHP."?comments=all'>@</a> <a href='".$INDEXPHP."?statistics=all'>%</a>":"")."</span>")).
                     "</h2><br />";
-        $this->TFill(2,$STR); $this->TRow();
+        $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow();
         if(isset($search_term)){
             $STR.="<form action='".$INDEXPHP."' method='post' style='display:none;' id='search_form'></form>".
             "<input id='search_content' name='search_content' rows='4' form='search_form' type='text' value='$search_term'>".
             "<input class='button' form='search_form' type='submit' name='search_button' value='{$this->T('搜索')}'>";
-            $this->TFill(2,$STR); $this->TRow();
+            $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow();
         }else if(isset($category)){
             $STR.="<div></div>";
-            $this->TFill(2,$STR); $this->TRow();
+            $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow();
         }else if($this->LoggedIn){
-            $this->TFill(2,$STR); $this->TRow();
+            $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow();
             $this->MakePostingFieldsV2(NULL,false);
         }
         $this->PostsPerPage=20;
@@ -3608,7 +3625,7 @@ blockquote{border-left:2px solid black;}
         $STR.="<a href='".$INDEXPHP."?offset=".($this->CurrentOffset+1).
             (isset($search_term)?"&search=".$search_term:(isset($category)?"&category=".$category:""))."'>".
             " → {$this->T('下一页')}</a>";
-        $this->TFill(0,$STR,3); $this->TExtra($EXTRA); $this->TRow();
+        $this->TFill(0,$STR,3); $this->TExtra($EXTRA); $this->TExtra("class='no_line'");  $this->TRow();
     }
 
     function GeneratePage($is_section=false,$extra_classes=""){ $S="";
@@ -4193,7 +4210,7 @@ blockquote{border-left:2px solid black;}
             </div><div class='spacer hidden_on_print'></div>
             EOT;
         }
-        $this->TFill(2,$STR); $this->TRow();
+        $this->TFill(2,$STR); $this->TExtra("class='no_line'"); $this->TRow();
     }
     function MakeSidebar(){ ?>
         <div class='left mobile_fold'><?php if(isset($this->SpecialSidebar) && ($p = &$this->GetPost($this->SpecialSidebar))!=NULL){
@@ -5126,6 +5143,48 @@ blockquote{border-left:2px solid black;}
         </div>
     <?php
     }
+
+    function MakeSubscribers(){ ?>
+        <table><tbody><tr><td><?=$this->T("帖子")?></td><td><input type='text' id='mail_news_id' name='mail_news_id'></td></tr>
+        <?php
+        $subs=file_get_contents("all_subscribers.php");
+        if(preg_match_all("/(.+)\s+\[\[\[(.*)\]\]\]/u",$subs,$ma,PREG_SET_ORDER)){
+            foreach($ma as $m){ ?>
+                <tr><td><a id="send<?=$m[1]?>" ondblclick="SendNews(this,'<?=$m[1]?>','<?=$m[2]?>')"><?=$this->T("发送");?></a></td>
+                <td id="content<?=$m[1]?>"><?=$m[2];?></td><?php
+            }
+        } ?>
+        </tbody></table><script>
+            function copyElementToClipboard(element) {
+                window.getSelection().removeAllRanges();
+                let range = document.createRange();
+                range.selectNode(element);
+                window.getSelection().addRange(range);
+                document.execCommand('copy');
+                window.getSelection().removeAllRanges();
+            }
+            function SendNews(but,id,email){
+                txt=document.querySelector("#mail_news_id"); if(!txt)return;
+                post=txt.value; if(post=='') return;
+                but.innerHTML = "<?=$this->T('稍等')?>"; but.ondblclick=null;
+                var xhr = new XMLHttpRequest();
+                function wrapidxhr(_id){ return function() {
+                    if (this.readyState == 4) {
+                        btn = document.querySelector('#send'+_id);
+                        if(this.status == 200){ btn.innerHTML="<?=$this->T('好')?>"
+                            //ctn = document.querySelector('#content'+_id);
+                            //ctn.innerHTML=this.responseText.trim();
+                            //copyElementToClipboard(ctn);
+                            //ctn.innerHTML="<?=$this->T('复制到剪贴板')?>";
+                        }else{ btn.innerHTML="<?=$this->T('问题')?>" }
+                    }
+                }; };
+                xhr.onreadystatechange = wrapidxhr(id)
+                xhr.open("GET", "<?=$INDEXPHP?>?post="+post.toString()+'&send='+id.toString()+'&addr='+email.toString(), true);
+                xhr.send();
+            }
+        </script><?php
+    }
     
     function MakeExtraOperations(){ global $INDEXPHP; ?>
         <div class='settings' style='overflow:auto;'>
@@ -5155,7 +5214,7 @@ blockquote{border-left:2px solid black;}
             <?php if($this->NewsletterEnabled){
                 $subs=file_get_contents("all_subscribers.php"); ?>
                 <br /><br /><h3><?=$this->T('邮件订阅者')?></h3>
-                <textarea rows="4" class='full_box' wrap="off"><?=$subs?substr($subs,5):"error"?></textarea>
+                <?php $this->MakeSubscribers(); ?>
             <?php } ?>
 
             <br />

+ 4 - 2
mailconf.php

@@ -15,11 +15,13 @@ $GLOBALS['MAILSUB_CONFIRM']="<h2>Confirm Subscription</h2>
 ";
 
 $GLOBALS['MAILSUB_REGULAR']="
-<p>This is Yiming's email newsletter from WellObserve.com. <a href='{EDITSUBSCRIPTION}'>Edit your subscription</a></p><br />
+<p>This is Yiming's email newsletter from <a href='https://www.WellObserve.com'>WellObserve.com</a>.<br/>
+You can reply to this email for inquiries or questions.</p>
+<p><a href='{EDITSUBSCRIPTION}'>Edit your subscription</a></p><br />
 ";
 
 $GLOBALS['MAILSUB_WELCOME']="
-<p>You have subscribed to Yiming's email newsletter from WellObserve.com. Edit your subscription below:</p><br />
+<p>You have subscribed to Yiming's email newsletter from <a href='https://www.WellObserve.com'>WellObserve.com</a>. Edit your subscription below:</p><br />
 <a href='{EDITSUBSCRIPTION}'>{EDITSUBSCRIPTION}</a>
 ";
 

+ 12 - 0
mailsub.php

@@ -118,9 +118,14 @@ if(isset($_GET['unsubscribe'])&&isset($_GET['id'])){
     fclose($f); $f=0;
 
     echo "<h2>Successfully unsubscribed</h2>";
+    exit;
 }
 
 function send_email($to,$subject,$body){
+    global $mail;
+    global $mailconf;
+    require_once("mailconf.php");
+    if(!$mail){ $mail = new PHPMailer(true); }
     try {
         global $mail;
         global $mailconf;
@@ -139,6 +144,7 @@ function send_email($to,$subject,$body){
         $mail->addAddress($to);
     
         //Content
+        $mail->CharSet=PHPMailer::CHARSET_UTF8;
         $mail->isHTML(true);                                  //Set email format to HTML
         $mail->Subject = $subject;
         $mail->Body    = $body;
@@ -167,4 +173,10 @@ function send_welcome($id,$address){
     $link="{$GLOBALS['MY_HOST']}/mailsub.php?unsubscribe=$addressencode&id=$id";
     $body=preg_replace("/\{EDITSUBSCRIPTION\}/",$link,$GLOBALS['MAILSUB_WELCOME']);
     send_email($address,"Welcome!",$body);
+}
+function mailsub_regular_text($id,$address){
+    $addressencode=urlencode($address);
+    $link="{$GLOBALS['MY_HOST']}/mailsub.php?unsubscribe=$addressencode&id=$id";
+    $body=preg_replace("/\{EDITSUBSCRIPTION\}/",$link,$GLOBALS['MAILSUB_REGULAR']);
+    return $body;
 }

+ 5 - 4
styles/main.css

@@ -45,7 +45,7 @@ li{display:block;}
 .clean_table{border:none;font-size:1em !important;}.clean_table thead{box-shadow:none;}.clean_table td{vertical-align:top;}
 table{width:100%;border-collapse:collapse;border-bottom:2px solid #f8ca9b;border-top:3px solid #f8ca9b;}
 .settings input,.post inpiut{border:none!important;}
-.post table img{max-width:10rem !important;}
+.post table img{max-width:min(100%, 20rem) !important;}
 td{padding-left:0.1em;padding-right:0.1em;}
 td:first-child{padding-left:0;}
 td:last-child{padding-right:0;}
@@ -298,10 +298,11 @@ width:2em;height:2em;display:block;border:1px solid #f8ca9b;background-color:rgb
 .center>tbody>tr>td{white-space:normal;vertical-align:top;min-width:1em;}
 .center>tbody>tr>td:first-child{text-align:center;color:#f8ca9b88;padding-left:0.1em;}
 .center>tbody>tr>td:nth-child(1)>*{}
-.center>tbody>tr>td:nth-child(2){text-align:center;color:#f8ca9b88;}
+.center>tbody>tr>td:nth-child(2){text-align:center;color:#f8ca9b88;box-shadow:0.3em 0px 0px -0.15em #f8ca9b44;}
+.center>tbody>.no_line>td:nth-child(2){box-shadow:none;}
 .center>tbody>tr>td:nth-child(2) a{color:#f8ca9b88;}
 .center>tbody>tr>td:nth-child(2) .marked{color:#f8ca9b !important;}
-.center>tbody>tr>td:nth-child(3){width:100%;text-align:left;}
+.center>tbody>tr>td:nth-child(3){width:100%;text-align:left;padding-left:0.5em;}
 .center>tbody>tr>td:nth-child(3)>div{overflow:auto;}
 .center>tbody>tr>td:last-child{padding-right:0.5em;}
 .main>.center>tbody>tr{border-bottom:1px dotted #f8ca9b;}
@@ -385,7 +386,7 @@ border-radius:unset;box-shadow:unset;text-shadow:unset;}.img_btn_hidden{opacity:
 border-radius:unset;box-shadow:unset;font-size:1.3rem;text-shadow:unset;}
 .opt_compact,.ref_compact{line-break:anywhere;}
 .table_top{left:unset;width:100%;overflow:auto;}
-.post table img{max-width:30vw !important;}
+.post table img{min(100%, 30vw) !important;}
 .product_ref{width:100%;display:block;}
 .post_dummy > *{width:100%;max-width:25rem;}
 .center_exp .post>.imd,.center_exp .p_row{width:100%;max-width:25rem;}

+ 9 - 0
zh.php

@@ -0,0 +1,9 @@
+<?php
+
+global $LA_GLOBAL_LANG;
+
+$LA_GLOBAL_LANG ="zh";
+
+include("index.php");
+
+?>