Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
diablo996
New Member
New Member


Joined: Oct 16, 2002
Posts: 5

PostPosted: Thu Mar 03, 2005 9:24 am Reply with quote

Anyone know how this could be hacked? I found a hack for phpbb, 'tried' to change it so it would work but I just dont know enough about this stuff. Some things worked but some didnt after I tried it. Anyone able to help out at all?

Here is the one I found if someone wants to take a look: Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
chatserv
Member Emeritus


Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico

PostPosted: Fri Mar 04, 2005 12:48 pm Reply with quote

Looking into it.
 
View user's profile Send private message Visit poster's website
chatserv
PostPosted: Fri Mar 04, 2005 1:20 pm Reply with quote

Hope this helps, didn't get a chance to test it.

Here are the install steps:
Code:
###############################################

##   Hack Title:      Always show 'edited by'
##   Hack Version:   0.0.3
##   Author:         Freakin' Booty ;-P
##   Website:      http://freakingbooty.no-ip.com
##   Description:   When a user edits a post, 'edited by' is always shown. Without this hack,
##               'edited by' is only shown after a reply has been posted.
##               Also shows what user has edited the post.
##   Compatibility:   2.0.4 - 2.0.11
##
##   Installation Level: Easy
##   Installation Time: 5-10 minutes
##   Files To Edit: 3
##      viewtopic.php
##      includes/constants.php
##      includes/functions_post.php
##
##   Included Files: 1
##      db_update.php
##
##   History:
##      0.0.3:   Fixed a bug where the data is input for the first time.
##      0.0.2:   Now shows who exactly has edited the post, and how many times. On top also shows what the last
##            post time was.
##      0.0.1:   Initial release
##
##   Author Notes:
##      0.0.2 is unreleased, so that is why there are no upgrade instructions or anything.
##
##   Support:      http://www.phpbbhacks.com/forums
##   Copyright:      ©2003-04 Freakin' Booty ;-P - Always show 'edited by' 0.0.3
##
###############################################
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
##   Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
##   This hack is released under the GPL License.
##   This hack can be freely used, but not distributed, without permission.
##   Intellectual Property is retained by the hack author(s) listed above.
###############################################

#
#-----[ COPY ]--------------------------------------------
#
# Run this file once as an administrator and then delete it immediately
#
db_update.php      => db_update.php

#
#-----[ OPEN ]--------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]--------------------------------------------
#
   if ( $postrow[$i]['post_edit_count'] )
   {
      $l_edit_time_total = ( $postrow[$i]['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];

      $l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']), $postrow[$i]['post_edit_count']);
   }
   else
   {
      $l_edited_by = '';
   }

#
#-----[ REPLACE WITH ]------------------------------------
#
   $sql = "SELECT pe.*, u.username
         FROM " . POSTS_EDIT_TABLE . " pe, " . USERS_TABLE . " u
         WHERE pe.post_id = " . $postrow[$i]['post_id'] . "
            AND pe.user_id = u.user_id
         ORDER BY pe.post_edit_time DESC";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not obtain posts edit count information', '', __LINE__, __FILE__, $sql);
   }

   $l_edited_by = '';
   while ( $row = $db->sql_fetchrow($result) )
   {
      $l_edit_time_total = ( $row['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];
      $l_edited_by .= ( ($l_edited_by == '') ? '<br />' : '' ) . '<br />' . sprintf($l_edit_time_total, $row['username'], create_date($board_config['default_dateformat'], $row['post_edit_time'], $board_config['board_timezone']), $row['post_edit_count']);
   }

#
#-----[ OPEN ]--------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]--------------------------------------------
#
define('POSTS_TABLE', $prefix.'_bbposts');

#
#-----[ AFTER, ADD ]-------------------------------------
#
define('POSTS_EDIT_TABLE', $prefix.'_bbposts_edit');

#
#-----[ OPEN ]--------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND, DELETE ]------------------------------------
#
   $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";

#
#-----[ FIND ]--------------------------------------------
#
   $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";

#
#-----[ INLINE, FIND & DELETE ]---------------------------
#
" . $edited_sql . "

#
#-----[ FIND ]--------------------------------------------
#
   add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));

#
#-----[ BEFORE, ADD ]-------------------------------------
#
   if( $mode == 'editpost' )
   {
      $sql = "SELECT * FROM " . POSTS_EDIT_TABLE . "
            WHERE post_id = $post_id
               AND user_id = " . $userdata['user_id'];
      if( !$result = $db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Could not retrieve post edit count information', '', __LINE__, __FILE__, $sql);
      }

      $sql = ( $row = $db->sql_fetchrow($result) ) ? "UPDATE " . POSTS_EDIT_TABLE . " SET post_edit_count = post_edit_count + 1, post_edit_time = $current_time WHERE post_id = $post_id AND user_id = " . $userdata['user_id'] : "INSERT INTO " . POSTS_EDIT_TABLE . " (post_id, user_id, post_edit_count, post_edit_time) VALUES ($post_id, " . $userdata['user_id'] . ", 1, $current_time)";
      if( !$result = $db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Could not update post edit count information', '', __LINE__, __FILE__, $sql);
      }
   }

#
#----[ SAVE & CLOSE ALL FILES ]---------------------------
#





And here's the db_update file:
Code:
<?php


/***************************************************************************
 *                               db_update.php
 *                            -------------------
 *   Hack:      Always show 'edited by' 0.0.3
 *   Copyright:   ©2003-04 Freakin' Booty ;-P
 *   Website:   http://freakingbooty.no-ip.com
 *   Support:   http://www.phpbbhacks.com/forums
 *
 *
 ***************************************************************************/

/***************************************************************************
 *   This hack is released under the GPL License.
 *   This hack can be freely used, but not distributed, without permission.
 *   Intellectual Property is retained by the hack author(s) listed above.
 ***************************************************************************/


if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die ("You can't access this file directly...");
}
if ($popup != "1"){
    $module_name = basename(dirname(__FILE__));
    require("modules/".$module_name."/nukebb.php");
}
else
{
    $phpbb_root_path = 'modules/Forums/';

}
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);


//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);
init_userprefs($userdata);
//
// End session management
//


//
// Not logged in, not authorised
//
if( !$userdata['session_logged_in'] )
{
   $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
   header($header_location . append_sid('login.'.$phpEx.'?redirect=db_update.'.$phpEx));
   exit;
}

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}


$page_title = 'Updating the database';
include("includes/page_header.php");
global $db, $prefix;
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "CREATE TABLE `" . $prefix . "_bbposts_edit` (`post_id` mediumint(8) unsigned NOT NULL default '0', `user_id` mediumint(8) unsigned NOT NULL default '0', `post_edit_count` smallint(5) unsigned NOT NULL default '0', `post_edit_time` int(11) default NULL, KEY `post_id` (`post_id`));";

for( $i = 0; $i < count($sql); $i++ )
{
   if( !$result = $db->sql_query ($sql[$i]) )
   {
      $error = $db->sql_error();

      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
   }
   else
   {
      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
   }
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28">&nbsp;</td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.<br />If you have run into any errors, please visit the <a href="http://www.phpbbhacks.com/forums" target="_phpbbhacks">phpBBHacks.com support forums</a> and ask someone for help.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';

include("includes/page_tail.php");

?>
 
diablo996
PostPosted: Fri Mar 04, 2005 2:03 pm Reply with quote

Heh...I think we musta made about the same changes cause it did the same thing. Ok, when you try to PM someone, nothing shows up. Also, if you try to edit a post (your own or someone elses) nothing shows up either. I really appreciate teh help chatserv....you rock! =D
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©