can someone port this to im?
- Code: Select all
################################################################ MOD Title]http://phpbbmodders.org#[/url]# MOD De.scription: Allows you to define what age is needed to## view a certain forum## MOD Version: 1.0.0#### Installation Level: Intermediate## Installation Time: 10 Minutes## Files To Edit:## index.php## posting.php## viewtopic.php## viewforum.php## admin/admin_forums.php## language/lang_english/lang_admin.php## language/lang_english/lang_main.php## templates/subSilver/index_body.tpl## templates/subSilver/admin/forum_edit_body.tpl#### Included Files: (n/a)## License: [url=http://opensource.org/licenses/gpl-license.php]http://opensource.org/licenses/gpl-license.php[/url] GNU General Public License v2################################################################ For security purposes, please check: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]# for the latest version of this MOD. Although MODs are checked## before being allowed in the MODs Database there is no guarantee## that there are no security problems within the MOD. No support## will be given for MODs not found within the MODs Database which## can be found at [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]############################################################### Author Notes:#### Credits of this MOD go to following people## Ramon Fincken - He gave me the Links as tipps for what to use## Doe Ray Me - He made the "View Forum Postcount Threshold" MOD, that i used as a Base for my own.## Thanks a lot for this MOD! But you didn't secure posting.php## Cyberalien - eXtreme Styles MOD is so awesome!## Terrafrost - Birthdays MOD rocks! Thanks so much!## RMcGirr83 - His "Profile Age Add-on" add-on for the birthday MOD was very usefull.## I borrowed a little piece of code.## filmn requested this MOD. <img>#### Following MODs are required for this to work## eXtreme Styles: [url=http://phpbbstyles.com/viewtopic.php?t=356#]http://phpbbstyles.com/viewtopic.php?t=356#[/url]# Birthdays MOD: [url=http://www.phpbb.com/phpBB/viewtopic.php?t=342028#]http://www.phpbb.com/phpBB/viewtopic.php?t=342028#[/url]# XS-Birthdays compatibility: [url=http://www.phpbb.com/phpBB/viewtopic.php?p=2107785#2107785]http://www.phpbb.com/phpBB/viewtopic.ph ... 85#2107785[/url]################################################################## MOD History:#### 2006-06-13 - Version 0.1.0## - First release#### 2006-06-19 - Version 0.1.1## - Fix for no birthdate entered (thanks to Sam England, the admin of ivirtua)#### 2006-09-24 - Version 1.0.0## - Submitted to MODDB################################################################## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD################################################################-----[ SQL ]-------------------------------------------------#ALTER TABLE phpbb_forums ADD forum_view_age VARCHAR(150) NOT NULL default '0'; ##-----[ OPEN ]------------------------------------------------#index.php ##-----[ FIND ]------------------------------------------------#$posts = $forum_data[$j]['forum_posts']; ##-----[ BEFORE, ADD ]------------------------------------------------# if ( $forum_data[$j]['forum_view_age'] && $userdata['user_level'] != ADMIN ) { $bday_month_day = floor($userdata['user_birthday'] / 10000); $bday_year_age = $userdata['user_birthday'] - 10000*$bday_month_day; $fudge = ( gmdate('md') < $bday_month_day ) ? 1 : 0; $age = ( $bday_year_age ) ? (gmdate('Y')-$bday_year_age-$fudge) : '0'; if ( ($age <forum_data> $folder_alt, ##-----[ AFTER, ADD ]------------------------------------------------#'AGE_HIDDEN' => $age_hidden, ##-----[ OPEN ]------------------------------------------------#posting.php ##-----[ FIND ]------------------------------------------------#//// The user is not authed, if they're not logged in then redirect ##-----[ BEFORE, ADD ]------------------------------------------------#$forum_view_age = $post_info['forum_view_age']; $bday_month_day = floor($userdata['user_birthday'] / 10000);$bday_year_age = $userdata['user_birthday'] - 10000*$bday_month_day;$fudge = ( gmdate('md') < $bday_month_day ) ? 1 : 0;$age = ( $bday_year_age ) ? (gmdate('Y')-$bday_year_age-$fudge) : '0'; if ( ($age < $forum_view_age || !$age) && $userdata['user_level'] != ADMIN ){ message_die(GENERAL_MESSAGE, sprintf($lang['Forum_view_age_sorry'], $forum_view_age)); // Added because of registered user and guest conflict if (!$userdata['session_logged_in']) { message_die(GENERAL_MESSAGE, sprintf($lang['Forum_view_age_sorry'], $forum_view_age)); }} ##-----[ OPEN ]------------------------------------------------#viewtopic.php ##-----[ FIND ]------------------------------------------------#$sql = "SELECT t.topic_id, ##-----[ IN-LINE FIND ]------------------------------------------#, f.forum_id ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, f.forum_view_age ##-----[ FIND ]------------------------------------------------#$topic_time = $forum_topic_data['topic_time']; ##-----[ AFTER, ADD ]------------------------------------------#$forum_view_age = $forum_topic_data['forum_view_age']; $bday_month_day = floor($userdata['user_birthday'] / 10000);$bday_year_age = $userdata['user_birthday'] - 10000*$bday_month_day;$fudge = ( gmdate('md') < $bday_month_day ) ? 1 : 0;$age = ( $bday_year_age ) ? (gmdate('Y')-$bday_year_age-$fudge) : '0'; if ( $forum_view_age && ($age <forum_view_age>sql_query($sql)){ message_die(GENERAL_ERROR, 'Could not query forum information.', '', __LINE__, __FILE__, $sql);}$forum_information = $db->sql_fetchrow($result);$forum_view = $forum_information['forum_view_age']; $bday_month_day = floor($userdata['user_birthday'] / 10000);$bday_year_age = $userdata['user_birthday'] - 10000*$bday_month_day;$fudge = ( gmdate('md') < $bday_month_day ) ? 1 : 0;$age = ( $bday_year_age ) ? (gmdate('Y')-$bday_year_age-$fudge) : '0'; if ( $forum_view && ($age <forum_view> $lang['Forum_status'], ##-----[ AFTER, ADD ]------------------------------------------#'L_FORUM_VIEW_AGE' => $lang['Forum_view_age'], ##-----[ FIND ]------------------------------------------------#'FORUM_NAME' => $forumname, ##-----[ AFTER, ADD ]------------------------------------------#'FORUM_VIEW_AGE' => $forumviewage, ##-----[ FIND ]------------------------------------------#$sql = "INSERT INTO " . FORUMS_TABLE ##-----[ IN-LINE FIND ]------------------------------------------------#forum_status ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, forum_view_age ##-----[ FIND ]------------------------------------------#VALUES ('" . $next_id . ##-----[ IN-LINE FIND ]------------------------------------------------#" . intval($HTTP_POST_VARS['forumstatus']) . " ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, " . intval($HTTP_POST_VARS['forumviewage']) . " ##-----[ FIND ]------------------------------------------#SET forum_name ##-----[ IN-LINE FIND ]------------------------------------------------#, forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . " ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, forum_view_age = " . intval($HTTP_POST_VARS['forumviewage']) . " ##-----[ OPEN ]------------------------------------------------#language/lang_english/lang_admin.php ##-----[ FIND ]------------------------------------------------#$lang['Forum_status'] = 'Forum status'; ##-----[ AFTER, ADD ]-----------------------------------------#$lang['Forum_view_age'] = 'Required Age'; ##-----[ OPEN ]------------------------------------------------#language/lang_english/lang_main.php ##-----[ FIND ]------------------------------------------------#//// That's all, Folks!// ------------------------------------------------- ##-----[ BEFORE, ADD ]-----------------------------------------#//Forum View Age$lang['Forum_view_age_sorry'] = 'Sorry, you need to be <b>%d Years old</b> to view this forum'; ##-----[ OPEN ]------------------------------------------------#templates/subSilver/index_body.tpl ##-----[ FIND ]------------------------------------------------#<BEGIN> ##-----[ AFTER, ADD ]-----------------------------------------#<IF> ##-----[ FIND ]------------------------------------------------#<END> ##-----[ BEFORE, ADD ]-----------------------------------------#<ENDIF> ##-----[ OPEN ]------------------------------------------------#templates/subSilver/admin/forum_edit_body.tpl ##-----[ FIND ]------------------------------------------------# <tr> <td>{L_FORUM_STATUS}</td> <td><select>{S_STATUS_LIST}</select></td> </tr> ##-----[ AFTER, ADD ]-----------------------------------------# <tr> <td>{L_FORUM_VIEW_AGE}</td> <td><input></td> </tr>##-----[ SAVE/CLOSE ALL FILES ]--------------------------------## EoM