phpBBHacks.com - Last 50 posts needs flood control HELP
Talk martial arts at KarateForums.com
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Username:    Password:
Remember Me?    
   I Lost My Password!
Bookmark and Share
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Support
 See a User Guidelines violation? Please contact us.
Author Message

keefy
Not So New User

Joined: 23 Jan 2005
Posts: 44

PostPosted: March 3rd 2010, 8:51 pm    Post subject: Last 50 posts needs flood control HELP Reply with quote

I have a mod installed where users can just click 1 link to view the last 50 posts (however ive set this to only 25 posts) what i need though is to put some flood control in there so it cant be abused.

here is the last50.php code.

Code:
<?php

// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

// standard session management
$userdata = session_pagestart($user_ip, PAGE_TEMPLATE);
init_userprefs($userdata);

// set page title
$page_title = 'Last 25 Posts';

// standard page header
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

// assign template
$template->set_filenames(array(
        'body' => 'last50.tpl')
);

$template->pparse('body');

// standard page footer
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>


Ive looked in the search.php and found some flood control code and tried to add it, but it did not work (not good at programming)

Code:
// Flood control
      //
      $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "se.session_ip = '$user_ip'" : 'se.session_user_id = ' . $userdata['user_id'];
      $sql = 'SELECT MAX(sr.search_time) AS last_search_time
         FROM ' . SEARCH_TABLE . ' sr, ' . SESSIONS_TABLE . " se
         WHERE sr.session_id = se.session_id
            AND $where_sql";
      if ($result = $db->sql_query($sql))
      {
         if ($row = $db->sql_fetchrow($result))
         {
            if (intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) < intval($board_config['search_flood_interval'])&& !$watched)
            {
               message_die(GENERAL_MESSAGE, $lang['Search_Flood_Error']);
            }
         }
      }


Can anyone help me please. im running PHPBB version 2.x
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Support All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil - phpBB Portugal - phpBBpersian.com

Network: iFroggy Hosting - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - KarateForums.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Disclosure Policy - Staff - User Guidelines >

Copyright © 2001-2012. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.