Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases

Reply
 
Thread Tools
Age Locked Forums Details »»
Age Locked Forums
Version: 0.2, by stuie_b stuie_b is offline
Developer Last Online: Aug 2018 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 08-01-2005 Last Update: 08-01-2005 Installs: 4
DB Changes
Code Changes  
No support by the author.

Ok this is my first hack and since i dont want to make people angre a posted it in here

Quote:
Provent unauthorized access ot a forum by an underaged user, Age Limit Will provent anyone
who isn't old enough to view the forum while allows those who are.

Features
+ Admins/mods are excempt from age limitation
+ User Defined age and forum to lock
+ Prevents access to post files aswell as forum
+ Removes Birthday date changing via profile (now only admin can change it)
+ Provents Searching to access posts
+ Provents Guest viewing of locked forums while other forums are open to guests
+ Provents Accessing thread/posts directly
+ Provents Access by using Forum Jump
+ Checks Age by using all D.O.B values


Thanks to KirbyDE for optimizations, sketch42 for bug testing, nexialys for bug testing
Version History
--- 0.2
-- Added Template edit thanks to sketch42
-- Changed method of age checking to check the day and month
--- 0.1E
-- Fixed Installer typo
-- Removed image relations in install.html
--- 0.1D
-- Optimized code thanks to KirbyDE


Please let me know what you all think

stuie_b :ermm:

Show Your Support

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

Comments
  #2  
Old 08-02-2005, 12:14 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Optimization suggestion
PHP Code:
function check_age($userid,$forumid)
{
    global 
$forumcache;
    
$userinfo fetch_userinfo($userid);
    
$now date('d-m-Y');
    
$bday explode("-"$userinfo['birthday']);
    
$now explode("-"$now);
    
$j $now[2] - $bday[2];
    return (int)(
$j >= $forumcache["$forumid"]['age_value']);
}


function 
check_lock($forumid)
{
    global 
$forumcache;
    return 
$forumcache["forumid"]['age_locked'];

Furthermore, you could remove the Locked Yes/No setting and define 0 being unlocked, would save memory.
And your age-check does only check the Year, should also check month/day.
Reply With Quote
  #3  
Old 08-02-2005, 01:17 PM
stuie_b stuie_b is offline
 
Join Date: Jul 2005
Location: Newcastle, UK
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks alot KirbyDE i've updated the code with your suggests, The check is still performed on the year for now but all other suggests were applied

thanks again

stuie_b
Reply With Quote
  #4  
Old 08-02-2005, 01:35 PM
nexialys
Guest
 
Posts: n/a
Default

in your install file, there is a typo:
PHP Code:
$DB_site->query("ALTER TABLE forum ADD age_value? varchar(10) DEFAULT ''"); 
just after age_value ...

and for your install.html, please don't add anything related to your own website... the actual style, icons and images are linked to your site, and will give you too much trafic and too much lag if your site is down one day...
Reply With Quote
  #5  
Old 08-02-2005, 02:19 PM
stuie_b stuie_b is offline
 
Join Date: Jul 2005
Location: Newcastle, UK
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks nexialys for the heads up on the installer typo fixed

thanks

stuie_b
Reply With Quote
  #6  
Old 08-02-2005, 02:26 PM
sketch42's Avatar
sketch42 sketch42 is offline
 
Join Date: May 2004
Location: Brooklyn, NY
Posts: 361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will this remove the birthday from the public profile as well?
Reply With Quote
  #7  
Old 08-02-2005, 02:27 PM
stuie_b stuie_b is offline
 
Join Date: Jul 2005
Location: Newcastle, UK
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no the birthday will still be displayed in the public profile

stuie_b
Reply With Quote
  #8  
Old 08-02-2005, 02:28 PM
sketch42's Avatar
sketch42 sketch42 is offline
 
Join Date: May 2004
Location: Brooklyn, NY
Posts: 361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the reason i asked is because i want to change this ..
Quote:
If you enter your birth date using the controls provided here, other forum visitors will be able to see your birthday on the forum calendar and in your profile. Adding your year of birth is optional.
this is what it shows during registration, and i wanted to word it in a way where it would discourage users from inputing a fake birthday from the start
Reply With Quote
  #9  
Old 08-02-2005, 02:40 PM
sketch42's Avatar
sketch42 sketch42 is offline
 
Join Date: May 2004
Location: Brooklyn, NY
Posts: 361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

k i found where it is in MEMBERINFO template

just find this

Code:
<div class="fieldset">
                        <if condition="$show['extrainfo']">
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <if condition="$userinfo['birthday']">
                                <tr>
                                        <td>
                                                <strong>$vbphrase[birthday]</strong>:<br />
                                                $userinfo[birthday]
                                        </td>
                                </tr>
                                </if>
                                $customfields
                                </table>
                        <else />
and change it to this

Code:
<div class="fieldset">
                        <if condition="$show['extrainfo']">
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">

                                                              $customfields
                                </table>
                        <else />
in case anyone else wants to do this

and than just edit that phrase
Reply With Quote
  #10  
Old 08-02-2005, 03:02 PM
stuie_b stuie_b is offline
 
Join Date: Jul 2005
Location: Newcastle, UK
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fixed the check procedure now checks against all three values, day month and year and added template edit thanks sketch42

stuie_b
Reply With Quote
Reply

Thread Tools

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 03:41 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.05606 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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete