vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Age Lock Hack (https://vborg.vbsupport.ru/showthread.php?t=95992)

stuie_b 09-09-2005 10:00 PM

Age Lock Hack
 
UPDATE: Updated the code to work with latest versions (both stable and beta)

Quote:

----------------------
Whats it all about?
----------------------
Age Lock is an all-in-one Forum locking facillity that works off the users age instead of there permissions
It gives you the abillity to keep those Under 18's out of your adult section :D

IMPORTANT NOTICE: Please Make sure you uninstall any currently installed versions prior to
installing this version!! THIS IS A MUST DUE TO MAJOR CODE CHANGES!

---------------
Installaiton?
---------------

- Log into you Admin Control Panel -
#############################################
-----------------------------------------------
1.) Upload the contents of the Upload folder to your forum root
2.) Find Plugin System
3.) Click Manage Products
4.) Click [Add/Import Product]
5.) Under Import Product
6.) Select the Product-AgeLock.xml file
7.) Make sure Allow Overwrite is turned OFF!
8.) Press Import
-----------------------------------------------

Total Template edits: 1
Total File Modifications: 0
Total Plugins: 1
Total Hooks Used: 6
Total extra sql querys: 0

Make sure to read the txt files before installing!!!
limited support will be provided!

enjoy and dont forget to click install :)

Stuie B

ged 09-10-2005 03:38 PM

This can be used especially in forums that have adult content.

Azhrialilu 09-10-2005 04:28 PM

oh this is just what I was waiting for! Sweetness :D

nexialys 09-10-2005 04:47 PM

the idea of deleting the content of the template modifyprofile_birthday is irrelevent... just add a new plugin for the hook: profile_editprofile_start, add simply a "no_permission" thingy...

btw, i think it would be more efficient to be conditional to a setting - admin can activate this or not, so if not, the users will be able to change their birthday

Andreas 09-10-2005 08:31 PM

Quote:

+ Removes Birthday date changing via profile (now only admin can change it)
+ Allows user to hide birthday from public view
This is redundant; RC3 does this by default.

mindfrost82 10-11-2005 02:45 PM

Quote:

Originally Posted by KirbyDE
This is redundant; RC3 does this by default.

I see where they can hide their birthday, but how to you make it so they can't change their birthday? I can't seem to find this option.

mindfrost82 10-11-2005 02:54 PM

Also, would it be possible for me to implement this with vBshout? I have a shoutbox, but I would prefer it if that was only accessible to adult users as well.

*Clicks Install* Just the hack I was looking for :)

mindfrost82 10-12-2005 01:16 AM

Sorry, but one more question.

Is there a way to make it so that the forums are hidden?

I setup a test account, and it still shows the forum, but when I click on the it gives me the message about being too young. I would prefer it if they couldn't see the forums to begin with.

moonclamp 10-16-2005 11:39 PM

Is it possible to toggle the option to edit the date of birth?

The reason for this is so that some birthday data was incorrect during an import from phpbb and I want to allows users some time to correct any errors before enabling it

stuie_b 10-17-2005 07:30 AM

Quote:

Also, would it be possible for me to implement this with vBshout
i can have a look into if you like but it maybe a step where you would have to modify the code!

Quote:

Is there a way to make it so that the forums are hidden?
from what i've been told the only way to hide forum without code modification is to use a usergroup (could be wrong)

Quote:

Is it possible to toggle the option to edit the date of birth?
Thats the next step, i'm looking into a usergroup method that would allow the forum admin to allow certain usergroups the abillity to edit there birthday

i should have a beta version by the end of the week for you with most of these included (hopefully)


stuie b

KBV 11-14-2005 12:25 PM

I love the idea, but it dosn't work.

MySQL Error : Unknown column 'age_locked' in 'field list'
Error Number : 1054
Referrer : http://www.japani.no/forum/admincp/f...o=edit&f=30&s=

stuie_b 11-14-2005 02:10 PM

not sure why you get that but it does work, i've just installed it onto the latest VB release and it works 100%, if you would like me to try to install it for you just pm me

stuie b

katholic 11-15-2005 05:34 PM

Would this work on exsisting members or only new members? Also would it work on 3.5.1?

stuie_b 11-16-2005 10:07 AM

as long as all of your members have a date of birth set in there profiles it will work for them all,

and yes it works for 3.5.1

stuie_b

Vizionz 11-17-2005 02:03 AM

Code:

<tr>
                                                        <td>$vbphrase[month]:</td>
                                                        <td>$vbphrase[day]:</td>
                                                        <td><if condition="$show['birthday_optional']">$vbphrase[year_optional]:<else />$vbphrase[year]</if></td>
                                                </tr>
                                                <tr>
                                                        <td><select name="month" id="bd_month">
                                                                <option value="-1" $monthselected[default]></option>
                                                                <option value="01" $monthselected[01]>$vbphrase[january]</option>
                                                                <option value="02" $monthselected[02]>$vbphrase[february]</option>
                                                                <option value="03" $monthselected[03]>$vbphrase[march]</option>
                                                                <option value="04" $monthselected[04]>$vbphrase[april]</option>
                                                                <option value="05" $monthselected[05]>$vbphrase[may]</option>
                                                                <option value="06" $monthselected[06]>$vbphrase[june]</option>
                                                                <option value="07" $monthselected[07]>$vbphrase[july]</option>
                                                                <option value="08" $monthselected[08]>$vbphrase[august]</option>
                                                                <option value="09" $monthselected[09]>$vbphrase[september]</option>
                                                                <option value="10" $monthselected[10]>$vbphrase[october]</option>
                                                                <option value="11" $monthselected[11]>$vbphrase[november]</option>
                                                                <option value="12" $monthselected[12]>$vbphrase[december]</option>
                                                        </select> &nbsp;</td>
                                                        <td><select name="day" id="bd_day">
                                                                <option value="-1" $dayselected[default]></option>
                                                                <option value="01" $dayselected[01]>1</option>
                                                                <option value="02" $dayselected[02]>2</option>
                                                                <option value="03" $dayselected[03]>3</option>
                                                                <option value="04" $dayselected[04]>4</option>
                                                                <option value="05" $dayselected[05]>5</option>
                                                                <option value="06" $dayselected[06]>6</option>
                                                                <option value="07" $dayselected[07]>7</option>
                                                                <option value="08" $dayselected[08]>8</option>
                                                                <option value="09" $dayselected[09]>9</option>
                                                                <option value="10" $dayselected[10]>10</option>
                                                                <option value="11" $dayselected[11]>11</option>
                                                                <option value="12" $dayselected[12]>12</option>
                                                                <option value="13" $dayselected[13]>13</option>
                                                                <option value="14" $dayselected[14]>14</option>
                                                                <option value="15" $dayselected[15]>15</option>
                                                                <option value="16" $dayselected[16]>16</option>
                                                                <option value="17" $dayselected[17]>17</option>
                                                                <option value="18" $dayselected[18]>18</option>
                                                                <option value="19" $dayselected[19]>19</option>
                                                                <option value="20" $dayselected[20]>20</option>
                                                                <option value="21" $dayselected[21]>21</option>
                                                                <option value="22" $dayselected[22]>22</option>
                                                                <option value="23" $dayselected[23]>23</option>
                                                                <option value="24" $dayselected[24]>24</option>
                                                                <option value="25" $dayselected[25]>25</option>
                                                                <option value="26" $dayselected[26]>26</option>
                                                                <option value="27" $dayselected[27]>27</option>
                                                                <option value="28" $dayselected[28]>28</option>
                                                                <option value="29" $dayselected[29]>29</option>
                                                                <option value="30" $dayselected[30]>30</option>
                                                                <option value="31" $dayselected[31]>31</option>
                                                        </select> &nbsp;</td>
                                                        <td><input type="text" class="bginput" name="year" value="$year" size="4" maxlength="4" id="bd_year" /></td>
                                                        <td rowspan="2">&nbsp; <input type="button" class="button" value="$vbphrase[clear]" onclick="clear_birthday()" /></td>
                                                </tr>
                                                </table>


Removing that also removes that from registration. then when someone tries to register they cant because it requires age.

bigmonay2k 11-17-2005 03:42 AM

demo

davidw 11-17-2005 09:50 AM

* christianb subscribes to this thread

How hard would this be to set up a reversely? For example: I've got forums that are for teens only (under the age of 18) - this would work great if that would be possible. :D

KBV 11-17-2005 12:22 PM

I thought I should try an uninstall it and then install it again. But I got this

Code:

Database error in vBulletin 3.5.0:

Invalid SQL:
ALTER TABLE forum DROP COLUMN age_locked;

MySQL Error  : Table 'japani_forum.forum' doesn't exist
Error Number : 1146
Date        : Thursday, November 17th 2005 @ 03:21:31 PM
Script      : http://www.japani.no/forum/admincp/plugin.php
Referrer    : http://www.japani.no/forum/admincp/plugin.php?do=productdelete&productid=AgeLimit&s=
Classname    : vb_database


stuie_b 11-17-2005 01:50 PM

Quote:

Originally Posted by KBV
I thought I should try an uninstall it and then install it again. But I got this

Code:

Database error in vBulletin 3.5.0:

Invalid SQL:
ALTER TABLE forum DROP COLUMN age_locked;

MySQL Error  : Table 'japani_forum.forum' doesn't exist
Error Number : 1146
Date        : Thursday, November 17th 2005 @ 03:21:31 PM
Script      : http://www.japani.no/forum/admincp/plugin.php
Referrer    : http://www.japani.no/forum/admincp/plugin.php?do=productdelete&productid=AgeLimit&s=
Classname    : vb_database



It seems as it isn't updating the tables correctly, Try installing it again but this time try using the "Allow Overwrite" set to YES

Stuie B

Mastar 11-17-2005 02:10 PM

Can this hack be used for individual sections in the site or is this just for reigstering to enter the site?

stuie_b 11-17-2005 02:50 PM

Yes the hack works with the forums and not the registration

Mastar 11-17-2005 03:09 PM

Quote:

Originally Posted by stuie_b
Yes the hack works with the forums and not the registration

Thank you! I installed and when I went to set it for a particular forum I got this:

Code:


Database error in vBulletin 3.5.1:

Invalid SQL:
UPDATE forum SET
        title_clean = 'XXX Passwords',
        title = 'XXX Passwords',
        description_clean = 'Have Some Good XXX Site Passwords? Post Them Here',
        description = 'Have Some Good XXX Site Passwords? Post Them Here',
        link = '',
        displayorder = 9,
        daysprune = 30,
        parentid = 77,
        newpostemail = '',
        newthreademail = '',
        ### Bitfield: forum.options ###
                options = IF(options & 8, options - 8, options),
                options = IF(options & 16, options - 16, options),
                options = IF(options & 32, options - 32, options),
                options = IF(options & 131072, options - 131072, options),
                options = IF(options & 32768, options - 32768, options),
                options = IF(options & 8192, options - 8192, options),
                options = IF(options & 4, options, options + 4),
                options = IF(options & 1, options, options + 1),
                options = IF(options & 2, options, options + 2),
                options = IF(options & 16384, options, options + 16384),
                options = IF(options & 256, options - 256, options),
                options = IF(options & 64, options, options + 64),
                options = IF(options & 128, options, options + 128),
                options = IF(options & 512, options, options + 512),
                options = IF(options & 1024, options, options + 1024),
                options = IF(options & 2048, options, options + 2048),
                options = IF(options & 4096, options, options + 4096),
                options = IF(options & 65536, options, options + 65536),
        styleid = 0,
        password = '',
        accessf_nb = 0,
        accesst_nb = 0,
        create_nb = 0,
        reply_nb = 0,
        allowprefix = 1,
        prefixrequired = 1,
        banner = '',
        bannerlink = '',
        banneralt = '',
        bannercode = '',
        age_locked = '1',
        age_value = '18',
        age_type = '1'
WHERE forumid = 83;

MySQL Error  : Unknown column 'age_type' in 'field list'
Error Number : 1054
Date        : Friday, November 18th 2005 @ 01:13:39 AM
Script      : http://www.******.com/admincp/forum.php
Referrer    : http://www.******.com/admincp/forum.php?do=edit&f=83&s=
IP Address  : *******
Username    : ******
Classname    : vb_database


KBV 11-17-2005 04:15 PM

Same error as me, and the second time I tried it and selected YES on overwrite, same error.

mindfrost82 11-17-2005 06:39 PM

Quote:

Originally Posted by Mastar
Thank you! I installed and when I went to set it for a particular forum I got this:

Code:


Database error in vBulletin 3.5.1:

Invalid SQL:
UPDATE forum SET
        title_clean = 'XXX Passwords',
        title = 'XXX Passwords',
        description_clean = 'Have Some Good XXX Site Passwords? Post Them Here',
        description = 'Have Some Good XXX Site Passwords? Post Them Here',
        link = '',
        displayorder = 9,
        daysprune = 30,
        parentid = 77,
        newpostemail = '',
        newthreademail = '',
        ### Bitfield: forum.options ###
                options = IF(options & 8, options - 8, options),
                options = IF(options & 16, options - 16, options),
                options = IF(options & 32, options - 32, options),
                options = IF(options & 131072, options - 131072, options),
                options = IF(options & 32768, options - 32768, options),
                options = IF(options & 8192, options - 8192, options),
                options = IF(options & 4, options, options + 4),
                options = IF(options & 1, options, options + 1),
                options = IF(options & 2, options, options + 2),
                options = IF(options & 16384, options, options + 16384),
                options = IF(options & 256, options - 256, options),
                options = IF(options & 64, options, options + 64),
                options = IF(options & 128, options, options + 128),
                options = IF(options & 512, options, options + 512),
                options = IF(options & 1024, options, options + 1024),
                options = IF(options & 2048, options, options + 2048),
                options = IF(options & 4096, options, options + 4096),
                options = IF(options & 65536, options, options + 65536),
        styleid = 0,
        password = '',
        accessf_nb = 0,
        accesst_nb = 0,
        create_nb = 0,
        reply_nb = 0,
        allowprefix = 1,
        prefixrequired = 1,
        banner = '',
        bannerlink = '',
        banneralt = '',
        bannercode = '',
        age_locked = '1',
        age_value = '18',
        age_type = '1'
WHERE forumid = 83;

MySQL Error  : Unknown column 'age_type' in 'field list'
Error Number : 1054
Date        : Friday, November 18th 2005 @ 01:13:39 AM
Script      : http://www.******.com/admincp/forum.php
Referrer    : http://www.******.com/admincp/forum.php?do=edit&f=83&s=
IP Address  : 66.176.27.30
Username    : ******
Classname    : vb_database


Same here.

stuie_b 11-17-2005 07:39 PM

Appologies all it seems i forgot to add the install bit for the age_type field, please downlaod the hack again and try that

krg2k 11-17-2005 11:18 PM

all the errors you guys and I are getting is because of Table PRECIXES ... if you have table prefixes it will give you errors and installing and uninstalling will be a mess ....

so don't mess around with it untill stuie_b fixes the code for table prefixes....

peace

mindfrost82 11-17-2005 11:43 PM

I installed it again and got the same problem.

I'm not using table prefixes either.

Mastar 11-17-2005 11:50 PM

Same problem with no prefix

mindfrost82 11-18-2005 11:19 AM

Also after doing this, people are saying they can't get into the forums that have an age limit :(

stuie_b 11-18-2005 08:05 PM

I've sorted the Prefix error, so can you please try the new version even if you dont use Prefixes.

cheers

stuie b

Mastar 11-18-2005 08:36 PM

I'm sorry to say that it still doesn't work. Still getting the DB error. I edited the template again and uploaded the product.

stuie_b 11-18-2005 08:39 PM

can you tell me if there is only one uninstall/install code when you edit the plugin

cheers

Mastar 11-18-2005 08:46 PM

Quote:

Originally Posted by stuie_b
can you tell me if there is only one uninstall/install code when you edit the plugin

cheers


Install Code:
Code:

require_once('./global.php');
$db->query("ALTER TABLE " . TABLE_PREFIX . "forum ADD age_locked ENUM('0','1') DEFAULT '0'");
$db->query("ALTER TABLE " . TABLE_PREFIX . "forum ADD age_type ENUM('0','1') DEFAULT '0'");
$db->query("ALTER TABLE " . TABLE_PREFIX . "forum ADD age_value varchar(10) DEFAULT ''");
$db->query("INSERT INTO " . TABLE_PREFIX . "phrase (`phraseid`, `languageid`, `varname`, `text`, `phrasetypeid`) VALUES ('', '-1', 'ageincorrect', 'Sorry but this forum has been age locked, <br>You seem to be too young to view this forum!!', '1000')");

Uninstall Code:
Code:

require_once('./global.php');
$db->query("ALTER TABLE " . TABLE_PREFIX . "forum DROP COLUMN age_locked");
$db->query("ALTER TABLE " . TABLE_PREFIX . "forum DROP COLUMN age_value");
$db->query("ALTER TABLE " . TABLE_PREFIX . "forum DROP COLUMN age_type");
$db->query("DELETE FROM " . TABLE_PREFIX . "phrase WHERE varname='ageincorrect'");


Mastar 11-20-2005 06:32 PM

New error I found after I install Gallery and try to create a Category:

Code:

Fatal error: Field age_locked is not defined in $validfields in class vb_datamanager_forum in /includes/class_dm.php on line 485
And this hack will not delete. Getting a DB error:

Database error in vBulletin 3.5.1:

Code:

Invalid SQL:
ALTER TABLE forum DROP COLUMN age_locked;

MySQL Error  : Can't DROP 'age_locked'. Check that column/key exists
Error Number : 1091
Date        : Monday, November 21st 2005 @ 04:42:01 AM
Script      : http://www.******.com/admincp/plugin.php
Referrer    : http://www.********.com/admincp/plugin.php?do=productdelete&productid=AgeLimit&s=
IP Address  : *******
Username    : *****
Classname    : vb_database

Any thoughts?

stuie_b 11-21-2005 11:06 AM

It's because the plugin hasn't been installed correctly for some reason it is'nt installing it for you???

To uninstall the plugin, edit the plugin and remove the uninstall code, save it and then retry the uninstall

cheers

stuie

Mastar 11-21-2005 02:26 PM

Quote:

Originally Posted by stuie_b
It's because the plugin hasn't been installed correctly for some reason it is'nt installing it for you???

To uninstall the plugin, edit the plugin and remove the uninstall code, save it and then retry the uninstall


cheers


stuie

Kool it is uninstalled.

KBV 12-01-2005 09:50 PM

Works on my site, but only for people who are older. If I want a forum that is for people 15 and under, it allowes people 15 and over to post, but not below. Yes, I have tried changing the 0 and 1 thing.

stuie_b 12-02-2005 09:22 PM

Quote:

Originally Posted by KBV
Works on my site, but only for people who are older. If I want a forum that is for people 15 and under, it allowes people 15 and over to post, but not below. Yes, I have tried changing the 0 and 1 thing.

thanks for the notification i've re-written the code and have also removed the install/uninstall code from the plugin and added an external installer to see if that will fix the problems with the fields not being created correctly in the database


cheers


Stuie B

KBV 12-03-2005 06:44 AM

Thank you, it works perfect now. ;) Great work Stuie!

KBV 12-11-2005 07:46 AM

The mod is letting people not of the given age into the forums that have a lock. I've observered several 15-17 year olds in my 18+ forum. Not posting, but luriking, because posting would get them banned.

Anyone else see this behaviour?


All times are GMT. The time now is 12:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01622 seconds
  • Memory Usage 1,884KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete