廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 4482 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
月光 手機
個人頭像
個人文章 個人相簿 個人日記 個人地圖
社區建設獎
頭銜:看我代替月亮懲罰你!看我代替月亮懲罰你!
版主
級別: 版主 該用戶目前不上站
版區: Unix-like, 網站架設
推文 x42 鮮花 x565
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[程式] 讓4X版使用以前的ipdata格式...
【插件名稱】讓4.0.1版使用以前的ipdata格式...
【適用版本】其他
【插件來源】原創
【插件類型】程式
【是否升級資料庫】
【插件介紹】

怪事...附件就是無法上傳ˊˋ上傳3次沒一次成功的所以算了不加ipdata了= =
就直接把postfunc.php用代碼的方式發吧= =


複製程式
<?php
!function_exists('readover') && exit('Forbidden');
function cvipfrom($ip){
       $datadir = 'ipdata/'
       $ip_detail = explode('.', $ip);
       if(file_exists($datadir.$ip_detail[0].'.txt')) {
              $ip_fdata = fopen($datadir.$ip_detail[0].'.txt', 'r');
       } else {
              if(!($ip_fdata = fopen($datadir.Ɔ.txt', 'r'))) {
                     echo 'IP data file error'
              }
       }
       for ($i = 0; $i <= 3; $i++) {
              $ip_detail[$i] = sprintf('%03d', $ip_detail[$i]);
       }
       $ip = join('.', $ip_detail);
       do {
              $ip_data = fgets($ip_fdata, 200);
              $ip_data_detail = explode("|", $ip_data);
              if($ip >= $ip_data_detail[0] && $ip <= $ip_data_detail[1]) {
                     fclose($ip_fdata);
                     return $ip_data_detail[2].$ip_data_detail[3];
              }
       } while(!feof($ip_fdata));
       fclose($ip_fdata);
       return '末知網路'
}
function ipselect($db,$offset,$ip){
       fseek($db,$offset,SEEK_SET);
       $l_d=fgets($db,100);
       $ip_a=explode("|",$l_d);
       if ($ip>=$ip_a[0] && $ip<=$ip_a[1]) return $ip_a[2].$ip_a[3];
}
function nset($db){
       $l_d=fgets($db,100);
       $ip_a=explode("\t",$l_d);
       return array($l_d,$ip_a[2].$ip_a[3]);
}
function lastinfo($fid,$allowhtm=0,$type='',$sys_type=''){
       global $db,$R_url,$htmdir,$foruminfo,$tid,$windid,$timestamp,$atc_title,$t_date,$replytitle;
       if($type == 'new'){
              $rt['tid']      = $tid;
              $rt['postdate'] = $timestamp;
              $rt['lastpost'] = $timestamp;
              $author   = $windid;
              $subject  = substrs($atc_title,21);
              $topicadd = ",tpost=tpost+1,article=article+1,topic=topic+1";
              $fupadd   = "tpost=tpost+1,article=article+1,topic=topic+1";
       } elseif($type == 'reply'){
              $rt['tid']      = $tid;
              $rt['postdate'] = $t_date;
              $rt['lastpost'] = $timestamp;
              $author         = $windid;
              $subject  = $atc_title ? substrs($atc_title,21) : 'Re:'.addslashes(substrs($replytitle,21));
              $topicadd = ",tpost=tpost+1,article=article+1";
              $fupadd   = "tpost=tpost+1,article=article+1";
       } else{
              $rt = $db->get_one("SELECT tid,author,postdate,subject,lastpost,lastposter FROM pw_threads WHERE fid='$fid' ORDER BY lastpost DESC LIMIT 0,1");

              if($rt['postdate'] == $rt['lastpost']){
                     $subject = addslashes(substrs($rt['subject'],21));
                     $author  = $rt['author'];
              }else{
                     $subject = 'Re:'.addslashes(substrs($rt['subject'],21));
                     $author  = $rt['lastposter'];
              }
              $topicadd=$fupadd="";
       }

       $htmurl   = $htmdir.'/'.$fid.'/'.date('ym',$rt['postdate']).'/'.$rt['tid'].'.html'
       $new_url  = file_exists(R_P.$htmurl) && $allowhtm && $sys_type!=ƇB' ? "$R_url/$htmurl" : "read.php?tid=$rt[tid]&page=e#a";
       $lastpost = $subject."\t".addslashes($author)."\t".$rt['lastpost']."\t".$new_url;
       $db->update("UPDATE pw_forumdata SET lastpost='$lastpost' $topicadd WHERE fid='$fid'");

       if($foruminfo['type'] == 'sub'){
              if($foruminfo['password'] != '' || $foruminfo['allowvisit'] != '' || $foruminfo['f_type'] == 'hidden'){
                     $lastpost = ''
              } else{
                     $lastpost = "lastpost='$lastpost'";
              }
              if($lastpost && $fupadd){
                     $lastpost .= ', '
              }
              if($lastpost || $fupadd){
                     $db->update("UPDATE pw_forumdata SET $lastpost $fupadd WHERE fid='$foruminfo[fup]'");
                     $rt1 = $db->get_one("SELECT fup,type FROM pw_forums WHERE fid='$foruminfo[fup]'");
                     if($rt1['type'] == 'sub'){
                            $db->update("UPDATE pw_forumdata SET $lastpost $fupadd WHERE fid='$rt1[fup]'");
                     }
              }
       }
}

function bbspostguide(){
       global $db,$gp_uploadmoney,$creditset,$db_creditset,$db_upgrade,$db_hour,$ifupload,$groupid,$windid,$winduid,$winddb,$timestamp,$top_post,$fatherid,$fid,$tid,$tdtime,$db_autochange;

       $creditset = get_creditset($creditset,$db_creditset);
       if($db_autochange){
              if (file_exists(D_P."data/bbscache/set_cache.php")){
                     list(,$set_control) = explode("|",readover(D_P."data/bbscache/set_cache.php"));
              } else{
                     $set_control = 0;
              }
              if (($timestamp - $set_control) > $db_hour * 3600){
                     require_once(R_P.'require/postconcle.php');
              }
       }
       if($groupid != 'guest'){
              if($tdtime >= $winddb['lastpost']){
                     $winddb['todaypost'] = 1;
              } else{
                     $winddb['todaypost'] ++;
              }
              $winddb['lastpost'] = $timestamp;
              $winddb['postnum'] ++;
              if($ifupload){
                     $winddb['money'] -= $gp_uploadmoney;
              }

              if($top_post){
                     $winddb['rvrc']  += $creditset['rvrc']['Post'];
                     $winddb['money'] += $creditset['money']['Post'];
                     customcredit($winduid,$creditset,'Post');
              } else{
                     $winddb['rvrc']  += $creditset['rvrc']['Reply'];
                     $winddb['money'] += $creditset['money']['Reply'];
                     customcredit($winduid,$creditset,'Reply');
              }
              $memberid = getmemberid($winddb['postnum'],$winddb['rvrc'],$winddb['money'],$winddb['credit'],$winddb['onlinetime']);
              $winddb['memberid']!=$memberid && $db->update("UPDATE pw_members SET memberid='$memberid' WHERE uid='$winduid'");
              $db->update("UPDATE pw_memberdata SET postnum='$winddb[postnum]',rvrc='$winddb[rvrc]',money='$winddb[money]',todaypost='$winddb[todaypost]',lastpost='$winddb[lastpost]',uploadtime='$winddb[uploadtime]',uploadnum='$winddb[uploadnum]' WHERE uid='$winduid'");
       }else{       
              Cookie('userlastptime',$timestamp);
       }
}

function getmemberid($postnum,$rvrc,$money,$credit,$oltime){
       global $db_upgrade,$lneed;

       switch($db_upgrade){
              case 1:       $nums = $postnum;            break;
              case 2:       $nums = floor($rvrc/10);     break;
              case 3:       $nums = $money;              break;
              case 4:       $nums = $credit;             break;
              case 5:       $nums = floor($oltime/3600); break;
              default:$nums = $postnum;            break;
       }

       arsort($lneed);
       reset($lneed);
       foreach($lneed as $key=>$lowneed){
              $gid=$key;
              if($nums>=$lowneed){
                     break;
              }
       }
       return $gid;
}

function check_data($type="post"){
       global $atc_usesign,$article,$msg_info,$vt_select,$db_titlemax,$db_postmin,$db_postmax,$atc_money;
       $atc_title=trim($_POST['atc_title']);
       $atc_content=trim($_POST['atc_content']);
       unset($_POST['atc_content']);
       if (strlen($atc_content)>=$db_postmax || strlen($atc_content)<$db_postmin){
              Showmsg('postfunc_content_limit');
       }
       if(empty($article) && !$atc_title || strlen($atc_title)>$db_titlemax){
              Showmsg('postfunc_subject_limit');
       }
       if ($atc_money>1000 || $atc_money<0){
              Showmsg('postfunc_money_limit'); 
       }
       if ($type=="vote" && empty($vt_select)){
              Showmsg('postfunc_noempty');
       }
       $atc_title = Char_cv($atc_title);
       $atc_content=$atc_usesign<2 ? Char_cv($atc_content) : preg_replace('/javascript/i','java script',str_replace('.','.',$atc_content));
       return array($atc_title,$atc_content);
}

//自動url轉變函數
function autourl($message){
       global $db_autoimg;
       if($db_autoimg==1){
              $message= preg_replace(array(
                                   "/(?<=[^\]a-z0-9-=\"'\\/])((https?|ftp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\│]+\.gif)/i",
                                   "/(?<=[^\]a-z0-9-=\"'\\/])((https?|ftp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\│]+\.jpg)/i"
                            ), array(
                                   "[img]\\1\\3[/img]",
                                   "[img]\\1\\3[/img]"
                            ), ' '.$message);
       }
       $message= preg_replace(       array(
                                   "/(?<=[^\]a-z0-9-=\"'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\│]+)/i",
                                   "/(?<=[^\]a-z0-9\/\-_.~?=:.])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
                            ), array(
                                   "[url]\\1\\3[/url]",
                                   "[email]\\0[/email]"
                            ), ' '.$message);

       return $message;
}

function html_check($souce){
       global $db_bbsurl,$picpath,$attachname;
       if(strpos($souce,$db_bbsurl)!==false){
              $souce=str_replace($picpath,'p_w_picpath',$souce);
              $souce=str_replace($attachname,'p_w_upload',$souce);
       }
       return $souce;
}
?>


[ 此文章被月光在2005-12-18 06:39重新編輯 ]



月光論壇
http://bbs.dj...com/


===================================
贊助本站 -- 刊登廣告 -- 物超所值虛擬主機租用
獻花 x0 回到頂端 [樓 主] From:台灣中華電信 | Posted:2005-12-14 11:02 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.021681 second(s),query:15 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言