function get_torrent_promotion_append($promotion = 1, $forcemode = "", $showtimeleft = false, $added = "", $promotionTimeType = 0, $promotionUntil = '') { global $CURUSER, $lang_functions; global $expirehalfleech_torrent, $expirefree_torrent, $expiretwoup_torrent, $expiretwoupfree_torrent, $expiretwouphalfleech_torrent, $expirethirtypercentleech_torrent; $sp_torrent = ""; $onmouseover = ""; if (get_global_sp_state() == 1) { switch ($promotion) { case 2: if ($showtimeleft && ($expirefree_torrent && $promotionTimeType == 0 || $promotionTimeType == 2)) { if ($promotionTimeType == 2) { $futuretime = strtotime($promotionUntil); } else { $futuretime = strtotime($added) + $expirefree_torrent * 86400; } $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if ($timeout) { $onmouseover = " onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<b><font class=\"free\">" . $lang_functions['text_free'] . "</font></b>" . $lang_functions['text_will_end_in'] . "<b>" . $timeout . "</b>") . "', 'trail', false, 'delay',500,'lifetime',3000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 300);\""; } else { $promotion = 1; } } break; case 3: if ($showtimeleft && ($expiretwoup_torrent && $promotionTimeType == 0 || $promotionTimeType == 2)) { if ($promotionTimeType == 2) { $futuretime = strtotime($promotionUntil); } else { $futuretime = strtotime($added) + $expiretwoup_torrent * 86400; } $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if ($timeout) { $onmouseover = " onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<b><font class=\"twoup\">" . $lang_functions['text_two_times_up'] . "</font></b>" . $lang_functions['text_will_end_in'] . "<b>" . $timeout . "</b>") . "', 'trail', false, 'delay',500,'lifetime',3000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 300);\""; } else { $promotion = 1; } } break; case 4: if ($showtimeleft && ($expiretwoupfree_torrent && $promotionTimeType == 0 || $promotionTimeType == 2)) { if ($promotionTimeType == 2) { $futuretime = strtotime($promotionUntil); } else { $futuretime = strtotime($added) + $expiretwoupfree_torrent * 86400; } $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if ($timeout) { $onmouseover = " onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<b><font class=\"twoupfree\">" . $lang_functions['text_free_two_times_up'] . "</font></b>" . $lang_functions['text_will_end_in'] . "<b>" . $timeout . "</b>") . "', 'trail', false, 'delay',500,'lifetime',3000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 300);\""; } else { $promotion = 1; } } break; case 5: if ($showtimeleft && ($expirehalfleech_torrent && $promotionTimeType == 0 || $promotionTimeType == 2)) { if ($promotionTimeType == 2) { $futuretime = strtotime($promotionUntil); } else { $futuretime = strtotime($added) + $expirehalfleech_torrent * 86400; } $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if ($timeout) { $onmouseover = " onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<b><font class=\"halfdown\">" . $lang_functions['text_half_down'] . "</font></b>" . $lang_functions['text_will_end_in'] . "<b>" . $timeout . "</b>") . "', 'trail', false, 'delay',500,'lifetime',3000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 300);\""; } else { $promotion = 1; } } break; case 6: if ($showtimeleft && ($expiretwouphalfleech_torrent && $promotionTimeType == 0 || $promotionTimeType == 2)) { if ($promotionTimeType == 2) { $futuretime = strtotime($promotionUntil); } else { $futuretime = strtotime($added) + $expiretwouphalfleech_torrent * 86400; } $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if ($timeout) { $onmouseover = " onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<b><font class=\"twouphalfdown\">" . $lang_functions['text_half_down_two_up'] . "</font></b>" . $lang_functions['text_will_end_in'] . "<b>" . $timeout . "</b>") . "', 'trail', false, 'delay',500,'lifetime',3000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 300);\""; } else { $promotion = 1; } } break; case 7: if ($showtimeleft && ($expirethirtypercentleech_torrent && $promotionTimeType == 0 || $promotionTimeType == 2)) { if ($promotionTimeType == 2) { $futuretime = strtotime($promotionUntil); } else { $futuretime = strtotime($added) + $expirethirtypercentleech_torrent * 86400; } $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if ($timeout) { $onmouseover = " onmouseover=\"domTT_activate(this, event, 'content', '" . htmlspecialchars("<b><font class=\"thirtypercent\">" . $lang_functions['text_thirty_percent_down'] . "</font></b>" . $lang_functions['text_will_end_in'] . "<b>" . $timeout . "</b>") . "', 'trail', false, 'delay',500,'lifetime',3000,'fade','both','styleClass','niceTitle', 'fadeMax',87, 'maxWidth', 300);\""; } else { $promotion = 1; } } break; } } if ($CURUSER['appendpromotion'] == 'word' && $forcemode == "" || $forcemode == 'word') { if ($promotion == 2 && get_global_sp_state() == 1 || get_global_sp_state() == 2) { $sp_torrent = " <b>[<font class='free' " . $onmouseover . ">" . $lang_functions['text_free'] . "</font>]</b>"; } elseif ($promotion == 3 && get_global_sp_state() == 1 || get_global_sp_state() == 3) { $sp_torrent = " <b>[<font class='twoup' " . $onmouseover . ">" . $lang_functions['text_two_times_up'] . "</font>]</b>"; } elseif ($promotion == 4 && get_global_sp_state() == 1 || get_global_sp_state() == 4) { $sp_torrent = " <b>[<font class='twoupfree' " . $onmouseover . ">" . $lang_functions['text_free_two_times_up'] . "</font>]</b>"; } elseif ($promotion == 5 && get_global_sp_state() == 1 || get_global_sp_state() == 5) { $sp_torrent = " <b>[<font class='halfdown' " . $onmouseover . ">" . $lang_functions['text_half_down'] . "</font>]</b>"; } elseif ($promotion == 6 && get_global_sp_state() == 1 || get_global_sp_state() == 6) { $sp_torrent = " <b>[<font class='twouphalfdown' " . $onmouseover . ">" . $lang_functions['text_half_down_two_up'] . "</font>]</b>"; } elseif ($promotion == 7 && get_global_sp_state() == 1 || get_global_sp_state() == 7) { $sp_torrent = " <b>[<font class='thirtypercent' " . $onmouseover . ">" . $lang_functions['text_thirty_percent_down'] . "</font>]</b>"; } } elseif ($CURUSER['appendpromotion'] == 'icon' && $forcemode == "" || $forcemode == 'icon') { if ($promotion == 2 && get_global_sp_state() == 1 || get_global_sp_state() == 2) { $sp_torrent = " <img class=\"pro_free\" src=\"pic/trans.gif\" alt=\"Free\" " . ($onmouseover ? $onmouseover : "title=\"" . $lang_functions['text_free'] . "\"") . " />"; } elseif ($promotion == 3 && get_global_sp_state() == 1 || get_global_sp_state() == 3) { $sp_torrent = " <img class=\"pro_2up\" src=\"pic/trans.gif\" alt=\"2X\" " . ($onmouseover ? $onmouseover : "title=\"" . $lang_functions['text_two_times_up'] . "\"") . " />"; } elseif ($promotion == 4 && get_global_sp_state() == 1 || get_global_sp_state() == 4) { $sp_torrent = " <img class=\"pro_free2up\" src=\"pic/trans.gif\" alt=\"2X Free\" " . ($onmouseover ? $onmouseover : "title=\"" . $lang_functions['text_free_two_times_up'] . "\"") . " />"; } elseif ($promotion == 5 && get_global_sp_state() == 1 || get_global_sp_state() == 5) { $sp_torrent = " <img class=\"pro_50pctdown\" src=\"pic/trans.gif\" alt=\"50%\" " . ($onmouseover ? $onmouseover : "title=\"" . $lang_functions['text_half_down'] . "\"") . " />"; } elseif ($promotion == 6 && get_global_sp_state() == 1 || get_global_sp_state() == 6) { $sp_torrent = " <img class=\"pro_50pctdown2up\" src=\"pic/trans.gif\" alt=\"2X 50%\" " . ($onmouseover ? $onmouseover : "title=\"" . $lang_functions['text_half_down_two_up'] . "\"") . " />"; } elseif ($promotion == 7 && get_global_sp_state() == 1 || get_global_sp_state() == 7) { $sp_torrent = " <img class=\"pro_30pctdown\" src=\"pic/trans.gif\" alt=\"30%\" " . ($onmouseover ? $onmouseover : "title=\"" . $lang_functions['text_thirty_percent_down'] . "\"") . " />"; } } return $sp_torrent; }
} } } elseif ($special_state == 6) { $addparam .= "spstate=6&"; if (get_global_sp_state() == 1) { $wherea[] = "sp_state = 6"; } else { if (get_global_sp_state() == 6) { } } } elseif ($special_state == 7) { $addparam .= "spstate=7&"; if (get_global_sp_state() == 1) { $wherea[] = "sp_state = 7"; } else { if (get_global_sp_state() == 7) { } } } if ($_GET) { $pick_type = 0 + $_GET["pktype"]; } elseif ($CURUSER['notifs']) { if (strpos($CURUSER['notifs'], "[pktype=0]") !== false) { $pick_type = 0; } elseif (strpos($CURUSER['notifs'], "[pktype=1]") !== false) { $pick_type = 1; } elseif (strpos($CURUSER['notifs'], "[pktype=2]") !== false) { $pick_type = 2; } elseif (strpos($CURUSER['notifs'], "[pktype=3]") !== false) { $pick_type = 3; }
$is_cheater = false; if ($cheaterdet_security) { if ($az['class'] < $nodetect_security && $self['announcetime'] > 10) { $is_cheater = check_cheater($userid, $torrent['id'], $upthis, $downthis, $self['announcetime'], $torrent['seeders'], $torrent['leechers']); } } if ($az["class"] == UC_VIP) { $downseedbonus = 0; } else { $downseedbonus = -$truedownthis / 1024 * 5.0E-7; } //下载影响积分,单位每K $upseedbonus = $trueupthis / 1024 * 1.2E-6; //上传影响积分,单位每K if (!$is_cheater && ($trueupthis > 0 || $truedownthis > 0)) { $global_promotion_state = get_global_sp_state(); if ($global_promotion_state == 1) { if ($torrent['sp_state'] == 3) { //$USERUPDATESET[] = "uploaded = uploaded + 2*$trueupthis".", seedbonus = seedbonus + 2*$upseedbonus"; $USERUPDATESET[] = "uploaded = uploaded + 2*{$trueupthis}" . ", seedbonus = seedbonus + {$upseedbonus}"; $USERUPDATESET[] = "downloaded = downloaded + {$truedownthis}" . ", seedbonus = seedbonus + {$downseedbonus}"; } elseif ($torrent['sp_state'] == 4) { $USERUPDATESET[] = "uploaded = uploaded + 2*{$trueupthis}" . ", seedbonus = seedbonus + {$upseedbonus}"; } elseif ($torrent['sp_state'] == 6) { $USERUPDATESET[] = "uploaded = uploaded + 2*{$trueupthis}" . ", seedbonus = seedbonus + {$upseedbonus}"; $USERUPDATESET[] = "downloaded = downloaded + {$truedownthis}/2" . ", seedbonus = seedbonus + {$downseedbonus}/2"; } else { if ($torrent['owner'] == $userid && $uploaderdouble_torrent > 0) { $upthis = $trueupthis * $uploaderdouble_torrent; } if ($torrent['sp_state'] == 2) {
function get_torrent_promotion_append($promotion = 1,$forcemode = "",$showtimeleft = false, $added = "", $promotionTimeType = 0, $promotionUntil = ''){ global $CURUSER,$lang_functions; global $expirehalfleech_torrent, $expirefree_torrent, $expiretwoup_torrent, $expiretwoupfree_torrent, $expiretwouphalfleech_torrent, $expirethirtypercentleech_torrent; $sp_torrent = ""; $onmouseover = ""; $timeout = 0; if (get_global_sp_state() == 1) { $futuretime = strtotime($added); if($added == "0000-00-00 00:00:00" || $added == "") $timeout = 0; else $timeout = gettime(date("Y-m-d H:i:s", $futuretime), false, false, true, false, true); if($promotion == 1) return ""; $onmouseover = "$timeout"; } if (($CURUSER['appendpromotion'] == 'word' && $forcemode == "" ) || $forcemode == 'word'){ if($timeout) $onmouseover = "[".$lang_functions['text_will_end_in'].$onmouseover."]"; if(($promotion==2 && get_global_sp_state() == 1) || get_global_sp_state() == 2){ $sp_torrent = " <b>[<font class='free' >".$lang_functions['text_free']."</font>]</b>"; } elseif(($promotion==3 && get_global_sp_state() == 1) || get_global_sp_state() == 3){ $sp_torrent = " <b>[<font class='twoup' >".$lang_functions['text_two_times_up']."</font>]</b>"; } elseif(($promotion==4 && get_global_sp_state() == 1) || get_global_sp_state() == 4){ $sp_torrent = " <b>[<font class='twoupfree' >".$lang_functions['text_free_two_times_up']."</font>]</b>"; } elseif(($promotion==5 && get_global_sp_state() == 1) || get_global_sp_state() == 5){ $sp_torrent = " <b>[<font class='halfdown' >".$lang_functions['text_half_down']."</font>]</b>"; } elseif(($promotion==6 && get_global_sp_state() == 1) || get_global_sp_state() == 6){ $sp_torrent = " <b>[<font class='twouphalfdown' >".$lang_functions['text_half_down_two_up']."</font>]</b>"; } elseif(($promotion==7 && get_global_sp_state() == 1) || get_global_sp_state() == 7){ $sp_torrent = " <b>[<font class='thirtypercent' >".$lang_functions['text_thirty_percent_down']."</font>]</b>"; } } elseif (($CURUSER['appendpromotion'] == 'icon' && $forcemode == "") || $forcemode == 'icon'){ if($timeout) $onmouseover = "[".$lang_functions['text_will_end_in'].$onmouseover."]"; if(($promotion==2 && get_global_sp_state() == 1) || get_global_sp_state() == 2) $sp_torrent = " <img class=\"pro_free\" src=\"pic/trans.gif\" alt=\"Free\" title=\"".$lang_functions['text_free']."\"/>"; elseif(($promotion==3 && get_global_sp_state() == 1) || get_global_sp_state() == 3) $sp_torrent = " <img class=\"pro_2up\" src=\"pic/trans.gif\" alt=\"2X\" title=\"".$lang_functions['text_two_times_up']."\"/>"; elseif(($promotion==4 && get_global_sp_state() == 1) || get_global_sp_state() == 4) $sp_torrent = " <img class=\"pro_free2up\" src=\"pic/trans.gif\" alt=\"2X Free\" title=\"".$lang_functions['text_free_two_times_up']."\"/>"; elseif(($promotion==5 && get_global_sp_state() == 1) || get_global_sp_state() == 5) $sp_torrent = " <img class=\"pro_50pctdown\" src=\"pic/trans.gif\" alt=\"50%\" title=\"".$lang_functions['text_half_down']."\"/>"; elseif(($promotion==6 && get_global_sp_state() == 1) || get_global_sp_state() == 6) $sp_torrent = " <img class=\"pro_50pctdown2up\" src=\"pic/trans.gif\" alt=\"2X 50%\" title=\"".$lang_functions['text_half_down_two_up']."\"/>"; elseif(($promotion==7 && get_global_sp_state() == 1) || get_global_sp_state() == 7) $sp_torrent = " <img class=\"pro_30pctdown\" src=\"pic/trans.gif\" alt=\"30%\" title=\"".$lang_functions['text_thirty_percent_down']."\"/>"; } if($timeout){ $sp_torrent = $sp_torrent ."<b>". $onmouseover ."</b>"; $sp_torrent = "<br /><font color=\"#888888\">".$sp_torrent."</font>"; } return $sp_torrent; }