The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Hey thanks! =) Your code works properly.
Now I tried to stop the script from executing. I tried using die() and exit() but both did not stop the script from showing the attachment. What would I need to do in order to stop the attachment from showing up? |
#12
|
||||
|
||||
exit; should stop execution of the script. Are you sure the code is actually run?
|
#13
|
|||
|
|||
What I tried was to create a new plugin with hook "attachment_start" and with the simple line exit(). But still, the attachment would show up. I cleared the cache and it still showed up.
--------------- Added [DATE]1250506111[/DATE] at [TIME]1250506111[/TIME] --------------- Got it working now. Strange thing is, it will not exit the script when the thumb and attachment have been cached before? Is there a better hook for this purpose than attachment_start? --------------- Added [DATE]1250506751[/DATE] at [TIME]1250506751[/TIME] --------------- It is very strange. On my test installation, it would work with 2 pictures, it would not work with another and it would show the path to the other instead of anything else. |
#14
|
|||
|
|||
Quote:
|
#15
|
|||
|
|||
Yup, I have just tried around a little bit and found out that cached attachments are shown in either case.
May I ask for help on this one: Code:
$query = $db->query_read("SELECT current_bandwidth FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo[userid]); $add = $query[current_bandwidth] + 550; |
#16
|
|||
|
|||
Quote:
Code:
$asb = $vbulletin->db->query_read(" SELECT current_bandwidth FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo[userid]); while ($query = $vbulletin->db->fetch_array($asb)) { // process record } Code:
$query = $vbulletin->db->query_first(" SELECT current_bandwidth FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo[userid]); |
#17
|
|||
|
|||
Great news. You just helped me to get the script working. Here's the code:
Code:
$limit = 10000000; $query = $vbulletin->db->query_first(" SELECT current_bandwidth FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo[userid]); $add = $query['current_bandwidth'] + $attachmentinfo['filesize']; $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "user SET current_bandwidth = $add WHERE userid = " . $vbulletin->userinfo[userid] ); if($add > $limit) { exit(); } Also, currently, when the limit is crossed, it will show a blank attachment. Is it possible to use the space for a proper message telling the user that their bandwidth has exceeded the allowance? Simply adding a print wouldn't do the trick. |
#18
|
|||
|
|||
Quote:
|
#19
|
|||
|
|||
I found this article. Is it helpful to follow some of its instructions for the task that you described?
https://vborg.vbsupport.ru/showthread.php?t=98009 |
#20
|
|||
|
|||
Quote:
Code:
eval(standard_error('Unable to download attachment - bandwidth allowance exceeded')); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|