The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
![]()
Hi Andrew, thanks for your reply.
Since most of the attachments are pictures and less than 200KB in filesize, I wouldn't mind broken transfers. If in the membership plan 10MB bandwidth are mentioned, I would secretly allow members a bandwidth consumption of around 15MB to avoid situations like that. I would reduce usergroups to the basic ones and don't let members have multiple usergroups. In my case those would simply be: Banned and Guests (no access anyway), Unsubscribed, Subscribed, Actives and the obvious i.e. Moderators and Administrators. Because I am thinking about a subscription plan for my website. So I need to make it more valueable for members to pay a sum once in a while. I want to achieve that by giving users bandwith (or not). I have further worked on it: Code:
if($vbulletin->userinfo['usergroupid'] = 6) { $limitation = 1; } $result = $db->query_read("SELECT current_bandwidth FROM " . TABLE_PREFIX . "user WHERE userid = $vbulletin->userinfo[userid]); // Get the current bandwidth usage $current_quota = $result['current_bandwidth'] + $attachmentinfo['filesize']; // Calculate the current quota being used including the file which the user wants to download now. if($current_quota < $limitation) { SHOW ATTACHMENT } else { DON'T SHOW ATTACHMENT } $db_query_write("UPDATE " . TABLE_PREFIX . "user SET current_bandwidth = $current_quota WHERE userid = $vbulletin->userinfo['userid']"); So please, if by looking over the code you find anything which doesn't match up, I hope you can help me. Cheers --------------- Added [DATE]1250419067[/DATE] at [TIME]1250419067[/TIME] --------------- As predicted, it doesn't work. When opening attachments, it will not write the quota into the database. I use the "attachment_start" hook. --------------- Added [DATE]1250431666[/DATE] at [TIME]1250431666[/TIME] --------------- Strange enough, even if I active the following plugin, all thumbnails and attachments are broken. Code:
$db->query_write(" UPDATE " . TABLE_PREFIX . "user SET current_bandwidth = 10 WHERE userid = $vbulletin->userinfo[userid] "); |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|