Example #1
0
         if ($users[0] == $data['authorid']) {
             $touid = $users[1];
         } else {
             $touid = $users[0];
         }
         $lastsummary = removecode(trim($pmsarr['message']), 150);
         $lastmessage = array('lastauthorid' => $pmsarr['msgfromid'], 'lastauthor' => $pmsarr['msgfrom'], 'lastsummary' => $lastsummary);
         $lastmessage = addslashes(serialize($lastmessage));
         $db->query("UPDATE " . UC_DBTABLEPRE . "pm_lists SET lastmessage='{$lastmessage}' WHERE plid='{$data['plid']}'");
         $db->query("UPDATE " . UC_DBTABLEPRE . "pm_members SET lastdateline='{$pmsarr['dateline']}' WHERE plid='{$data['plid']}'");
         if ($count = $db->result_first("SELECT COUNT(*) FROM " . UC_DBTABLEPRE . getposttablename($data['plid']) . " WHERE plid='{$data['plid']}' AND delstatus IN (0, 1)")) {
             $db->query("UPDATE " . UC_DBTABLEPRE . "pm_members SET pmnum='{$count}' WHERE plid='{$data['plid']}' AND uid='{$touid}'");
         } else {
             $db->query("DELETE FROM " . UC_DBTABLEPRE . "pm_members WHERE plid='{$data['plid']}' AND uid='{$touid}'");
         }
         if ($count = $db->result_first("SELECT COUNT(*) FROM " . UC_DBTABLEPRE . getposttablename($data['plid']) . " WHERE plid='{$data['plid']}' AND delstatus IN (0, 2)")) {
             $db->query("UPDATE " . UC_DBTABLEPRE . "pm_members SET pmnum='{$count}' WHERE plid='{$data['plid']}' AND uid='{$data['authorid']}'");
         } else {
             $db->query("DELETE FROM " . UC_DBTABLEPRE . "pm_members WHERE plid='{$data['plid']}' AND uid='{$data['authorid']}'");
         }
     }
 }
 if ($next > 0) {
     $end = $next;
     echo "Other data short messages have been processed: {$start} / {$total} ...";
     $url_forward = "upgrade_1.5.2_1.6.0.php?action=pmstats&start={$end}&total={$total}&forward=" . urlencode($forward);
     echo "<br /><br /><br /><a href=\"{$url_forward}\">Browser will automatically reload the page, without human intervention. If your browser does not redirect for a long time, please click here</a>";
     echo "<script>setTimeout(\"redirect('{$url_forward}');\", 1250);</script>";
 } else {
     @touch($lock_file);
     echo "<font style='font-size:20px;'>The upgrade is completed</font>.<br>Original short message form (" . UC_DBTABLEPRE . "pms Table) No longer in use, we recommend that you test the function of short message and data is no problem, delete the table.<br>Will advanced/uc_client The file overwrite your uc_client Client.";
Example #2
0
    if ($users[0] == $data['authorid']) {
        $touid = $users[1];
    } else {
        $touid = $users[0];
    }
    $lastsummary = removecode(trim($pmsarr['message']), 150);
    $lastmessage = array('lastauthorid' => $pmsarr['msgfromid'], 'lastauthor' => $pmsarr['msgfrom'], 'lastsummary' => $lastsummary);
    $lastmessage = addslashes(serialize($lastmessage));
    $db_target->query("UPDATE " . $table_target . "ucenter_pm_lists SET lastmessage='{$lastmessage}' WHERE plid='{$data['plid']}'");
    $db_target->query("UPDATE " . $table_target . "ucenter_pm_members SET lastdateline='{$pmsarr['dateline']}' WHERE plid='{$data['plid']}'");
    if ($count = $db_target->result_first("SELECT COUNT(*) FROM " . $table_target . getposttablename($data['plid']) . " WHERE plid='{$data['plid']}' AND delstatus IN (0, 1)")) {
        $db_target->query("UPDATE " . $table_target . "ucenter_pm_members SET pmnum='{$count}' WHERE plid='{$data['plid']}' AND uid='{$touid}'");
    } else {
        $db_target->query("DELETE FROM " . $table_target . "ucenter_pm_members WHERE plid='{$data['plid']}' AND uid='{$touid}'");
    }
    if ($count = $db_target->result_first("SELECT COUNT(*) FROM " . $table_target . getposttablename($data['plid']) . " WHERE plid='{$data['plid']}' AND delstatus IN (0, 2)")) {
        $db_target->query("UPDATE " . $table_target . "ucenter_pm_members SET pmnum='{$count}' WHERE plid='{$data['plid']}' AND uid='{$data['authorid']}'");
    } else {
        $db_target->query("DELETE FROM " . $table_target . "ucenter_pm_members WHERE plid='{$data['plid']}' AND uid='{$data['authorid']}'");
    }
}
if ($next) {
    showmessage("正在处理短消息表 " . " {$start} 至 " . ($start + $limit) . " 行", "index.php?a={$action}&source={$source}&prg={$curprg}&start=" . ($start + $limit));
}
function removecode($str, $length)
{
    $uccode = new uccode();
    $str = $uccode->complie($str);
    return trim(cutstr(strip_tags($str), $length));
}
function getposttablename($plid)
Example #3
0
        $plid = $db_target->insert_id();
        //echo 123424;exit();
        $db_target->query("INSERT INTO " . $table_target . "ucenter_pm_members(plid, uid, isnew, lastupdate) VALUES('{$plid}', '{$data['msgfromid']}', '{$data['new']}', 0)");
        $db_target->query("INSERT INTO " . $table_target . "ucenter_pm_members(plid, uid, isnew, lastupdate) VALUES('{$plid}', '{$data['msgtoid']}', '{$data['new']}', 0)");
    }
    $db_target->query("INSERT INTO " . $table_target . "ucenter_pm_indexes(plid) VALUES('{$plid}')");
    $pmid = $db_target->insert_id();
    if ($founderid == $data['msgfromid']) {
        $delstatus = $data['delstatus'];
    } else {
        $delstatus = $data['delstatus'] == 1 ? 2 : ($data['delstatus'] == 2 ? 1 : 0);
    }
    if ($data['subject'] && strcmp($data['subject'], $data['message'])) {
        $data['message'] = $data['subject'] . "\r\n" . $data['message'];
    }
    $db_target->query("INSERT INTO " . $table_target . getposttablename($plid) . "(pmid, plid, authorid, message, delstatus, dateline) VALUES('{$pmid}', '{$plid}', '{$data['msgfromid']}', '" . $data['message'] . "', '{$delstatus}', '{$data['dateline']}')");
}
if ($next) {
    showmessage("继续转换数据表 " . $table_source . "pms" . " {$start} 至 " . ($start + $limit) . " 行/" . $total, "index.php?a={$action}&source={$source}&prg={$curprg}&start=" . ($start + $limit));
}
function relationship($fromuid, $touid)
{
    if ($fromuid < $touid) {
        return $fromuid . '_' . $touid;
    } elseif ($fromuid > $touid) {
        return $touid . '_' . $fromuid;
    } else {
        return '';
    }
}
function getposttablename($plid)