Seite 1 von 1
Keine gezählten Posts
Verfasst: 18.05.2004 23:03
von Moonspell
Hi.
ch suche eine Mod mit der man einzelne Foren einstellen kann das Posts nciht gezählt werden.
Verfasst: 18.05.2004 23:07
von PhilippK
Verfasst: 18.05.2004 23:09
von Firestarter
Code: Alles auswählen
<?php
/***************************************************************************
* mod_install.php
* -------------------
* begin : Sunday, April 14, 2002
* copyright : (C) 2002 Bulletin Board Mods
* email : ssjslim@yahoo.com
*
* $Id: mod_install.php,v 1.0.0 2002/04/19 12:59:59 explosive Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path='./';
include($phpbb_root_path.'extension.inc');
include($phpbb_root_path.'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if( !$userdata['session_logged_in'] )
{
header('Location: ' . append_sid("login.$phpEx?redirect=mod_install.$phpEx", true));
}
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
if( !strstr($dbms, "mysql") )
{
if( !isset($bypass) )
{
$message = 'This mod has only been tested on MySQL and may only work on MySQL.<br />';
$message .= 'Click <a href="mod_install.php?bypass=true">here</a> to install anyways.';
message_die(GENERAL_MESSAGE, $message);
}
}
$sql = array();
$sql[] = "INSERT INTO " . CONFIG_TABLE . " VALUES ('no_post_count_forum_id', '')";
$sql_count = count($sql);
echo "<html>\n";
echo "<body>\n";
for($i = 0; $i < $sql_count; $i++)
{
echo "Running :: " . $sql[$i];
flush();
if ( !$db->sql_query($sql[$i]) )
{
$errored = true;
$error = $db->sql_error();
echo " -> <b>FAILED</b> ---> <u>" . $error['message'] . "</u><br /><br />\n\n";
}
else
{
echo " -> <b>COMPLETED</b><br /><br />\n\n";
}
}
if( $errored )
{
$message = "Some of the querys have failed, contact me so I can fix the errors.";
}
else
{
$message = "The table have been edited successfully. You can now delete this file. To undo any changes run the mod_uninstall.php file.";
}
echo "\n<br />\n<b>COMPLETE!</b><br />\n";
echo $message . "<br />\n";
echo "</body>\n";
echo "</html>\n";
exit();
?>
#################################################################
## Mod Title: Stop Posts Count From Increasing
## Mod Version: 1.0.0
## Author: ssjslim < ssjslim@yahoo.com > - http://bbmod.sourceforge.net
## Description: Stop a user's posts count from increasing when they post in a certain forum.
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: functions_post.php, admin_board.php, board_config_body.tpl, lang_main.php
## Included Files: mod_install.php, mod_uninstall.php
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
#################################################################
##
## Author Note:
## You should change all your languages and themes if you use others
## then English and subSilver.
#################################################################
##
## Installation
##
## 1) Upload all files to their respective location in this format.
##
## /mod_install.php (Only needed for install)
## /mod_uninstall.php (Only needed for uninstall)
##
## 2) Run mod_install.php from your web broswer to make the table changes.
## 3) Read below to make the rest of the changes.
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
if ( $topic_update_sql != '' )
{
$sql = "UPDATE " . TOPICS_TABLE . " SET
$topic_update_sql
WHERE topic_id = $topic_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
}
#
#-----[ AFTER, ADD ]----------------------------------
#
$board_config['no_post_count_forum_id'] = $GLOBALS['board_config']['no_post_count_forum_id'];
if( strstr($board_config['no_post_count_forum_id'], ',') )
{
$fids = explode(',', $board_config['no_post_count_forum_id']);
while( list($foo, $id) = each($fids) )
{
$fid[] = intval( trim($id) );
}
}
else
{
$fid[] = intval( trim($board_config['no_post_count_forum_id']) );
}
reset($fid);
#
#-----[ FIND ]------------------------------------------
#
if ( $mode != 'poll_delete' )
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $mode != 'poll_delete' && in_array($forum_id, $fid) == false )
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'NO_POST_COUNT_FORUM_ID' => $new['no_post_count_forum_id'],
'NO_POST_COUNT' => $lang['no_post_count'],
'NO_POST_COUNT_EXPLAIN' =>$lang['no_post_count_explain'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_MAX_POLL_OPTIONS}</td>
<td class="row2"><input type="text" name="max_poll_options" size="4" maxlength="4" value="{MAX_POLL_OPTIONS}" /></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<tr>
<td class="row1">{NO_POST_COUNT}<br /><span class="gensmall">{NO_POST_COUNT_EXPLAIN}</span></td>
<td class="row2"><input type="text" name="no_post_count_forum_id" maxlength="255" value="{NO_POST_COUNT_FORUM_ID}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['A_critical_error'] = "A Critical Error Occurred";
#
#-----[ AFTER, ADD ]------------------------------------------
#
//No Post Count MOD
$lang['no_post_count'] = "No post count in forum";
$lang['no_post_count_explain'] = "Forum IDs of forums you don't want users post to increase. Separate multiple forum IDs with commas";
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Verfasst: 18.05.2004 23:12
von Moonspell
Eine Frage noch, funktioniert ads mit Hierarchy?