extract($item); $CAT = get_cat($catid); $linkurl = $MOD['linkurl'] . $linkurl; if (!check_group($_groupid, $MOD['group_show']) || !check_group($_groupid, $MOD['group_contact']) || !check_group($_groupid, $CAT['group_show'])) { dheader($linkurl); } $fee = get_fee($item['fee'], $MOD['fee_view']); if ($MG['fee_mode'] && $MOD['fee_mode']) { $fee = 0; } if ($item['username'] == $_username) { $fee = 0; } if ($fee) { if ($_userid) { check_pay($moduleid, $itemid) or dheader($linkurl); } else { dheader($linkurl); } } $db->query("UPDATE {$table} SET download=download+1 WHERE itemid={$itemid}"); $fileurl = trim($fileurl); $localfile = str_replace(DT_PATH, '', $fileurl); if (strpos($localfile, '://') !== false) { $local = false; } else { $localfile = DT_ROOT . '/' . $localfile; if ($DT['pcharset']) { $localfile = convert($localfile, DT_CHARSET, $DT['pcharset']); } if (is_file($localfile)) {
mysql_query("DELETE FROM " . TABLE_PROVIDER . " WHERE provider_id={$provider_id}") or Error(1, __FILE__, __LINE__); mysql_query("UPDATE " . TABLE_ORDER . " SET provider_id=0 WHERE provider_id={$provider_id}") or Error(1, __FILE__, __LINE__); Header("Location: ?p={$part}&order_id={$order_id}&step=3"); exit; } if (isset($saveprovider_id)) { $url = "?p={$part}&order_id={$order_id}&step=3"; check_pay($order_id, $url); $provider_id = (int) $saveprovider_id; mysql_query("UPDATE " . TABLE_ORDER . " SET provider_id='{$provider_id}' WHERE order_id={$order_id}") or Error(1, __FILE__, __LINE__); Header("Location: {$url}"); exit; } if (@$saveorder3) { $url = "?p={$part}&order_id={$order_id}&step=3"; check_pay($order_id, $url); $sql_arr = array(); $error = 0; foreach ($data_arr3 as $v) { $val = from_form(@${$v}); $sql_arr[] = "{$v}='" . escape_string(trim($val)) . "'"; } $sql_str = join(", ", $sql_arr); mysql_query("UPDATE " . TABLE_ORDER . " SET {$sql_str} WHERE order_id={$order_id}") or Error(1, __FILE__, __LINE__); if (@$print && $provider_id) { $sql = mysql_query("SELECT * FROM " . TABLE_PROVIDER . " WHERE provider_id={$provider_id}") or Error(1, __FILE__, __LINE__); $arr = mysql_fetch_array($sql); if ($arr['provider'] == 1) { generate_order($order_id, 'dogovor', $stamp); generate_order($order_id, 'dogovor_p1', $stamp); generate_order($order_id, 'dogovor_p2', $stamp);
exit; } extract($item); $fee = get_fee($item['fee'], $MOD['fee_view']); $currency = $MOD['fee_currency']; $unit = $currency == 'money' ? $DT['money_unit'] : $DT['credit_unit']; $name = $currency == 'money' ? $DT['money_name'] : $DT['credit_name']; $member = array(); if (check_group($_groupid, $MOD['group_contact'])) { if ($fee) { if ($MG['fee_mode'] && $MOD['fee_mode']) { $user_status = 3; } else { $mid = $moduleid; if ($_userid) { if (check_pay($mid, $itemid)) { $user_status = 3; } else { $user_status = 2; $linkurl = $MOD['linkurl'] . $linkurl; $fee_back = $currency == 'money' ? dround($fee * intval($MOD['fee_back']) / 100) : ceil($fee * intval($MOD['fee_back']) / 100); $pay_url = $MODULE[2]['linkurl'] . 'pay.php?mid=' . $mid . '&itemid=' . $itemid . '&username='******'&fee_back=' . $fee_back . '&fee=' . $fee . '¤cy=' . $currency . '&sign=' . crypt_sign($_username . $mid . $itemid . $username . $fee . $fee_back . $currency . $linkurl . $title) . '&title=' . rawurlencode($title) . '&forward=' . urlencode($linkurl); } } else { $user_status = 0; } } } else { $user_status = 3; } } else {
if ($open < 3) { $_key = $open == 2 ? $password : $answer; $str = get_cookie('photo_' . $itemid); $pass = $str == md5(md5($DT_IP . $open . $_key . DT_KEY)); if ($_username && $_username == $username) { $pass = true; } } else { $pass = true; } $pass or dheader($MOD['linkurl'] . 'private.php?itemid=' . $itemid); if (get_fee($item['fee'], $MOD['fee_view'])) { if ($MG['fee_mode'] && $MOD['fee_mode']) { $user_status = 3; } else { if ($_userid && check_pay($moduleid, $itemid)) { $user_status = 3; } else { $user_status = 0; } } } else { $user_status = 3; } $user_status == 3 or dheader($linkurl); $adddate = timetodate($addtime, 3); $editdate = timetodate($edittime, 3); $linkurl = $MOD['linkurl'] . $linkurl; $pagesize = 30; $offset = ($page - 1) * $pagesize; $pages = pages($items, $page, $pagesize);