Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Choose which filetypes to moderate Details »»
Choose which filetypes to moderate
Version: 1.00, by MrNase MrNase is offline
Developer Last Online: Sep 2010 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 04-26-2005 Last Update: 04-26-2005 Installs: 1
 
No support by the author.

Hello,

This one is a really quick one. You may take this as a base for another, better hack but you have to credit me

Support:
The most important thing first: I'll give full support but Iam not responsible for any damaged caused by this mini mod.
Please use this thread for any questions you have.

What does this hack do:
My members recently uploaded some .pdf which were 'stolen' and used without credit. As my members attach images regularly I searched for an option to restrict the attachment moderation only to .pdf so that won't happen again.

What files are modified:
/includes/functions_file.php - only ~ 2 minutes


Notes and explanations:
You'll find the following array when you successfully installed this mini mod:
Code:
	$moderatethisattachments = array(
					 'pdf',
					 'txt',
					 'doc',
					 'xls'
					 );
Here you can select which files should be moderated. The code above tell the script to moderate: pdf, txt, doc and xls (which I do on my forums).

You can add more extensions quite easily.. Here's another example which only moderates .avi:
Code:
 	$moderatethisattachments = array(
					 'avi'
					 );


I hope you like this mini mod. Hopefully one of the advanced coders takes up this idea and makes a nice hack out of this one (please contact me first via PM)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-27-2005, 09:03 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Some instructions may be useful? Just a thought..
Reply With Quote
  #3  
Old 04-27-2005, 09:08 AM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops sorry.. I had to add the url to this thread and I totally forgot to add the file afterwards
Reply With Quote
  #4  
Old 04-27-2005, 09:50 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your avi-only example has a comma too much on the end.
Reply With Quote
  #5  
Old 04-27-2005, 09:55 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack will fully override the basic permissions. So if a usergroup is set to always moderate, it won't be moderated if you also upload a non-moderated attachment............i think

i think the following would be better:
PHP Code:
    $visible iif($moderate01);
   
  if (
$visible)
  {
        
$attachment_name2 strtolower($attachment_name);
        
$extension file_extension($attachment_name2);
        
$moderatethisattachments = array(
                                
'pdf',
                                
'txt',
                                
'doc',
                                
'xls'
                               
);
        if(
in_array($extension$moderatethisattachments)) {
            
$visible '0';
        }
     } 
Reply With Quote
  #6  
Old 04-27-2005, 09:56 AM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have a look at the $globaltemplates-array() in various vB-files.. there's also a comma at the end

Thank you, I updated the hack and I also updated the code I have installed
Reply With Quote
  #7  
Old 04-27-2005, 10:10 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MrNase
Have a look at the $globaltemplates-array() in various vB-files.. there's also a comma at the end

Thank you, I updated the hack and I also updated the code I have installed
True, it is allowed, but not nice coding if you ask me. I guess it is done because it happened too many times that someone added a line and forgot to add a comma to the previous (copying the last line, and only changing names).

This is also why i don't like the layout of the coding. Instead of:
PHP Code:
$myarray = array(
  
'aa',
  
'bb',
  
'cc'
  
); 
I personally prefer:
PHP Code:
$myarray = array(
  
'aa'
 
'bb'
 
'cc'
  
); 
And for hacks adding new entries to these tables, i would suggest a new line instead of editing the existing code.

So instead of instructions to change:
PHP Code:
$myarray = array(
  
'aa',
  
'bb',
  
'cc'
  
); 
Into:
PHP Code:
$myarray = array(
  
'aa',
  
'bb',
  
'cc'  ,
  
'mynewhackvalue' 
  
); 
Just instruct to add the following line immediate after the original:
PHP Code:
$myarray[] = 'mynewhackvalue'
But now we are hijacking a thread.
Reply With Quote
  #8  
Old 04-27-2005, 01:34 PM
jugo jugo is offline
 
Join Date: Feb 2004
Location: Reading your emails.
Posts: 573
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is very helpful stuff though....Thanks for AAAALLLLL The info and for the hack.
Reply With Quote
  #9  
Old 04-30-2005, 10:43 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Iam glad you like it
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04475 seconds
  • Memory Usage 2,295KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete