[2.0.10] Moderator CP

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
95
65%
Very Good
27
18%
Good
13
9%
Fair
3
2%
Poor
9
6%
 
Total votes: 147

User avatar
shaykana
Registered User
Posts: 108
Joined: Mon Sep 04, 2006 12:11 am
Location: Canada
Contact:

Re: [2.0.10] Moderator CP

Post by shaykana » Sun Feb 10, 2008 3:45 pm

Okay, so on board two, I originally forgot to run the SQL with the prefix of that board (different from phpbb_). So I ran them again with the other prefix, and now board two works fine.

Just in case I forgot to copy a file to the first board, I recopied all the files used on board two onto board one. I ran the SQL again on board one, but board one still won't show any modules.

I just can't figure out why.

User avatar
milkman
Registered User
Posts: 165
Joined: Mon Nov 29, 2004 1:55 am
Location: Loughborough, UK
Contact:

Re: [2.0.10] Moderator CP

Post by milkman » Sun Feb 10, 2008 5:33 pm

Hmm, this is most strange. I'm glad you got it working in one board. I've never really tested it in a multi-board environment. Perhaps I have hardcoded a database entry somewhere, though I can't think where... :?:
Milkman [MilkHub]

User avatar
shaykana
Registered User
Posts: 108
Joined: Mon Sep 04, 2006 12:11 am
Location: Canada
Contact:

Re: [2.0.10] Moderator CP

Post by shaykana » Mon Feb 11, 2008 3:50 pm

It's a little inconvenient, but for the time being, moderators can at least access the MCP from board two and edit accounts and such for both boards since the user accounts are the same all in one database.

They just can't do anything to the actual first board itself since they use a different prefix in the database.

forumatic
Registered User
Posts: 2
Joined: Tue Mar 04, 2008 9:56 pm

Re: [2.0.10] Moderator CP

Post by forumatic » Tue Mar 04, 2008 10:00 pm

hello!

i have installed this mod and i got an error when i was trying to configure my acp

Failed to update general configuration for ('modcp_levels_used', '');

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'modcp_levels_used', '');'' at line 3

UPDATE phpbb_config SET config_value = '(''modcp_levels_used'', '''');' WHERE config_name = '('modcp_levels_used', '');'

Line : 79
File : admin_board.php


Hope u help me figure out what is wrong.

thank you

User avatar
milkman
Registered User
Posts: 165
Joined: Mon Nov 29, 2004 1:55 am
Location: Loughborough, UK
Contact:

Re: [2.0.10] Moderator CP

Post by milkman » Wed Mar 05, 2008 10:22 am

Hi forumatic,

Can you confirm which version of ModCP you have installed? When I look in the current version of the file the error you refer to should be happening around line 160 not 79. Perhaps you could download another copy and try that?
Last edited by milkman on Wed Mar 05, 2008 10:43 am, edited 1 time in total.
Milkman [MilkHub]

User avatar
milkman
Registered User
Posts: 165
Joined: Mon Nov 29, 2004 1:55 am
Location: Loughborough, UK
Contact:

Re: [2.0.10] Moderator CP

Post by milkman » Wed Mar 05, 2008 10:35 am

Moderator CP is now 1.2.9.

2008/03/05 - Version 1.2.9 (Milkman)
  • admin/admin_modcp.php now checks and inserts $board_config['modcp_levels_used']
  • Removed SQL instruction from install file
Download from milk-hub.net.
Milkman [MilkHub]

forumatic
Registered User
Posts: 2
Joined: Tue Mar 04, 2008 9:56 pm

Re: [2.0.10] Moderator CP

Post by forumatic » Wed Mar 05, 2008 10:33 pm

milkman wrote:Hi forumatic,

Can you confirm which version of ModCP you have installed? When I look in the current version of the file the error you refer to should be happening around line 160 not 79. Perhaps you could download another copy and try that?
hi milkman

this is the version of mdcp that i installed. i also installed the one that u gave me but i still get the same error...nothing changed. is it better that i just reinstalled it and download the new version in ur site? help please...thanks

Code: Select all

<?php
/***************************************************************************
 *                            admin_modcp.php
 *                            ---------------
 *   begin                : Sunday, Dec 26, 2004
 *   copyright            : (C) 2005 web-milk.co.uk
 *   email                : milkman@web-milk.co.uk
 *
 *   $Id: admin_modcp.php, v1.1.00.01 2005/08/15 17:01:20 kooky 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', 1);

if( !empty($setmodules) )
{
	$file = basename(__FILE__);
	$module['Modcp']['Configuration'] = $file;
	return;
}

// Dummy function, always returns true;
function check_perms( $category = '', $module = '', $level = '' )
{
	return true;
}

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

// 
// Let's get the config data that we want
// 
$sql = "SELECT *
	FROM " . CONFIG_TABLE . "
	WHERE config_name LIKE 'modcp_module_%'";
if (!$result = $db->sql_query($sql))
{
	message_die(CRITICAL_ERROR, 'Could not query config information in admin_board', '', __LINE__, __FILE__, $sql);
}
else
{
	while ($row = $db->sql_fetchrow($result))
	{
		// The config_name is in the form modcp_module_<Cat-name>_<Mod-name>, let's split it up.
		list($category, $module_name) = split('_', substr($row['config_name'], strlen('modcp_module_')));

		$category = str_replace('-', '_', $category);
		$module_name = str_replace('-', '_', $module_name);

		$installed_module[$category][$module_name] = explode(',', $row['config_value']);
	}
}

//
// Let's do the update baby, yeah!
//
if (isset($HTTP_POST_VARS['submit']))
{
	$level_used = array(
		MAIN_MOD => 1,	// Forced on
		MOD      => 0,
		SUPPORT  => 0,
		VIP      => 0,
		BOT      => 0
	);
	foreach($HTTP_POST_VARS as $config_name => $config_value)
	{
		if ($config_name != 'submit')
		{
			// Split the config_name up and check if it is installed.
			list($category, $module_name) = split('_', substr($config_name, strlen('modcp_module_')));

			$category = str_replace('-', '_', $category);
			$module_name = str_replace('-', '_', $module_name);

			// Main mod has access to all when a module is enabled!
			$n_perms = count($config_value); if (in_array(0, $config_value)) $n_perms--;
			if ( $n_perms && !in_array(MAIN_MOD, $config_value) )
			{
				$config_value[] = MAIN_MOD;
			}

			// Make a note of the user levels that have permissions.
			foreach ($config_value as $l) if ($l != 0)
			{
				$level_used[$l] = 1;
			}

			$config_value = implode(',', $config_value);

			if (isset($installed_module[$category][$module_name]))
			{
				// Update
				$sql = "UPDATE " . CONFIG_TABLE . " SET
					config_value = '" . str_replace("\'", "''", $config_value) . "'
					WHERE config_name = '$config_name'";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Failed to update general configuration for $category/$module_name", "", __LINE__, __FILE__, $sql);
				}
			}
			else
			{
				// Insert
				$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
					VALUES ('$config_name', '". str_replace("\'", "''", $config_value) . "')";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Failed to update general configuration for $category/$module_name", "", __LINE__, __FILE__, $sql);
				}
			}
		}
	}

	// Update the used flags
	$comma = '';
	foreach ($level_used as $l => $used) if ($used == 1)
	{
		$level_used_list .= "$comma$l";
		$comma = ',';
	}

	$sql = "UPDATE " . CONFIG_TABLE . " SET
		config_value = '" . str_replace("\'", "''", $level_used_list) . "'
		WHERE config_name = 'modcp_levels_used'";
	if ( !$db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, "Failed to update general configuration for $category/$module_name", "", __LINE__, __FILE__, $sql);
	}

	$message = $lang['Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_config'], '<a href="' . append_sid('admin_modcp.' . $phpEx) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . $phpEx . '?pane=right') . '">', '</a>');
	message_die(GENERAL_MESSAGE, $message);
}
elseif (isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']))
{
	if (isset($HTTP_POST_VARS['mode']))
	{
		$mode = $HTTP_POST_VARS['mode'];
	}
	else
	{
		$mode = urldecode($HTTP_GET_VARS['mode']);
	}
	if (isset($HTTP_POST_VARS['name']))
	{
		$name = $HTTP_POST_VARS['name'];
	}
	else
	{
		$name = urldecode($HTTP_GET_VARS['name']);
	}

	// Check that the name is a modcp_module
	list($category, $module_name) = split('_', substr($name, strlen('modcp_module_')));

	$category = str_replace('-', '_', $category);
	$module_name = str_replace('-', '_', $module_name);

	if (!isset($installed_module[$category][$module_name]))
	{
		message_die(GENERAL_ERROR, "The requested module ($category/$module_name) is not installed.");
	}

	switch($mode)
	{
		case 'disable':
			if (!empty($name))
			{
				// Update
				$sql = "UPDATE " . CONFIG_TABLE . " SET
					config_value = '0'
					WHERE config_name = '$name'";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Failed to update general configuration for $category/$module_name", "", __LINE__, __FILE__, $sql);
				}

				$message = $lang['Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_config'], '<a href="' . append_sid('admin_modcp.' . $phpEx) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . $phpEx . '?pane=right') . '">', '</a>');
				message_die(GENERAL_MESSAGE, $message);
			}
			break;
		case 'remove':
			if (!empty($name))
			{
				// Delete
				$sql = "DELETE FROM " . CONFIG_TABLE . "
					WHERE config_name = '$name'";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, "Failed to update general configuration for $category/$module_name", "", __LINE__, __FILE__, $sql);
				}

				$message = $lang['Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_config'], '<a href="' . append_sid('admin_modcp.' . $phpEx) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . $phpEx . '?pane=right') . '">', '</a>');
				message_die(GENERAL_MESSAGE, $message);
			}
			break;
	}
}

// 
// Get a list of the modules present
// 
$dir = @opendir($phpbb_root_path .'modcp');

$module = array();
$modcp_module = array();
$setmodules = 1;
while( $file = @readdir($dir) )
{
	if ( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
	{
		include($phpbb_root_path . 'modcp/' . $file);
	}
}

@closedir($dir);

unset($setmodules);
ksort($module);
ksort($modcp_module);

// 
// Compare the two lists to make a list of new, installable modules.
// 
if (!empty($modcp_module))
{
	foreach($modcp_module as $category => $module_list)
	{
		foreach($module_list as $mod => $v)
		{
			if (!isset($installed_module[$category][$mod]))
			{
				$new_module[$category][$mod] = array();
			}
		}
	}
	unset($module_list);
}

// 
// Let's do some outputting..
// 

// Global stuff...
$template->set_filenames(array(
	'body' => 'admin/modcp_config_body.tpl'
	)
);

$s_hidden_fields = '';

$template->assign_vars(array(
	'S_MODCP_ACTION' => append_sid('admin_modcp.' . $phpEx),
	'L_MODCP_TITLE' => $lang['Modcp_title'],
	'L_MODCP_EXPLAIN' => $lang['Modcp_explain'],
	'L_WHO_ACCESS' => $lang['Who_access'],

	'L_MODULE_PERMISSIONS' => $lang['Modcp_permissions'],

	'L_NEW_MODULES' => $lang['New_modules'],
	'L_NEW_MODULES_EXPLAIN' => $lang['New_modules_explain'],

	'L_MODULE_NO_INSTALL' => $lang['Module_no_install'],
	'L_MODULE_NO_INSTALL_EXPLAIN' => $lang['Module_no_install_explain'],

	'L_SUBMIT' => $lang['Submit'],
	'L_RESET' => $lang['Reset'],
	'L_DISABLE' => $lang['Disable'],
	'L_REMOVE' => $lang['Remove'],

	'S_HIDDEN_FIELDS' => $s_hidden_fields)
);

$checkbox_mask = '<input type="checkbox" id="%FIELD_NAME%[%N%]" name="%FIELD_NAME%[%N%]" value="%LEVEL%"%CHECKED% /> <label for="%FIELD_NAME%[%N%]">%LANG%</label>&nbsp;&nbsp;';

//  First the installed modules, if there are any..
if (!empty($installed_module))
{
	foreach($installed_module as $category => $module_list)
	{
		ksort($module_list);

		// Prepare the category name
		$cat_name = (isset($lang[$category])) ? $lang[$category] : ucwords(str_replace('_', ' ', $category));

		$template->assign_block_vars('category', array(
			'L_CAT_NAME' => $cat_name)
		);

		$i = 0; // Reset for each category
		foreach($module_list as $mod => $v)
		{
			// Prepare the module name
			$mod_name = (isset($lang[$mod])) ? $lang[$mod] : ucwords(str_replace('_', ' ', $mod));

			// Prepare the field name
			$field_name = 'modcp_module_' . str_replace('_', '-', $category) . '_' . str_replace('_', '-', $mod);

			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

			// Does the module file still exist?
			if (isset($modcp_module[$category][$mod]))
			{
				$s_checkboxes = '<input type="hidden" name='. $field_name .'[0]" value="0" />';

				// Is user class present?  Test for MAIN_MOD
				if (defined('MAIN_MOD'))
				{
					$n = 1;

					// Main Moderators (needed for the User Class Mod only)
					$checked = (in_array(MAIN_MOD, $v)) ? ' checked="checked"' : '';
					$this_checkbox = $checkbox_mask;
					$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
					$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
					$this_checkbox = str_replace('%LEVEL%', MAIN_MOD, $this_checkbox);
					$this_checkbox = str_replace('%CHECKED%', $checked, $this_checkbox);
					$this_checkbox = str_replace('%LANG%', $lang['Main_Moderators'], $this_checkbox);
					$s_checkboxes .= $this_checkbox;

					// Moderators
					$checked = (in_array(MOD, $v)) ? ' checked="checked"' : '';
					$this_checkbox = $checkbox_mask;
					$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
					$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
					$this_checkbox = str_replace('%LEVEL%', MOD, $this_checkbox);
					$this_checkbox = str_replace('%CHECKED%', $checked, $this_checkbox);
					$this_checkbox = str_replace('%LANG%', $lang['Moderators'], $this_checkbox);
					$s_checkboxes .= $this_checkbox;

					// Support Team (needed for the User Class Mod only)
					$checked = (in_array(SUPPORT, $v)) ? ' checked="checked"' : '';
					$this_checkbox = $checkbox_mask;
					$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
					$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
					$this_checkbox = str_replace('%LEVEL%', SUPPORT, $this_checkbox);
					$this_checkbox = str_replace('%CHECKED%', $checked, $this_checkbox);
					$this_checkbox = str_replace('%LANG%', $lang['Support'], $this_checkbox);
					$s_checkboxes .= $this_checkbox;

					// V.I.P.s (needed for the User Class Mod only)
					$checked = (in_array(VIP, $v)) ? ' checked="checked"' : '';
					$this_checkbox = $checkbox_mask;
					$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
					$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
					$this_checkbox = str_replace('%LEVEL%', VIP, $this_checkbox);
					$this_checkbox = str_replace('%CHECKED%', $checked, $this_checkbox);
					$this_checkbox = str_replace('%LANG%', $lang['VIP'], $this_checkbox);
					$s_checkboxes .= $this_checkbox;

					// Bots (needed for the User Class Mod only)
					$checked = (in_array(BOT, $v)) ? ' checked="checked"' : '';
					$this_checkbox = $checkbox_mask;
					$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
					$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
					$this_checkbox = str_replace('%LEVEL%', BOT, $this_checkbox);
					$this_checkbox = str_replace('%CHECKED%', $checked, $this_checkbox);
					$this_checkbox = str_replace('%LANG%', $lang['Bots'], $this_checkbox);
					$s_checkboxes .= $this_checkbox;
				}
				else
				{
					// There's only one person who can use this, a moderator!
					$checked = (in_array(MOD, $v)) ? ' checked="checked"' : '';
					$this_checkbox = $checkbox_mask;
					$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
					$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
					$this_checkbox = str_replace('%LEVEL%', MOD, $this_checkbox);
					$this_checkbox = str_replace('%CHECKED%', $checked, $this_checkbox);
					$this_checkbox = str_replace('%LANG%', $lang['Moderators'], $this_checkbox);
					$s_checkboxes .= $this_checkbox;
				}

				$template->assign_block_vars('category.module', array(
					'ROW_CLASS' => $row_class,
					'ROW_COLOR' => '#' . $row_color,

					'L_MODULE_NAME' => $mod_name,

					'S_CHECKBOXES' => $s_checkboxes,

					'U_DISABLE' => append_sid("admin_modcp.$phpEx?mode=disable&name=" . urlencode($field_name)),
					'U_REMOVE' => append_sid("admin_modcp.$phpEx?mode=remove&name=" . urlencode($field_name))
					)
				);
			}
			else if (!isset($module[$category][$mod]))
			{
				$template->assign_block_vars('category.remove_module', array(
					'ROW_CLASS' => $row_class,
					'ROW_COLOR' => '#' . $row_color,

					'L_MODULE_NAME' => $mod_name,
					'L_MESSAGE' => $lang['Module_not_present'],
					'U_REMOVE' => append_sid("admin_modcp.$phpEx?mode=remove&name=" . urlencode($field_name))
					)
				);
			}
			else
			{
				$template->assign_block_vars('category.remove_module', array(
					'ROW_CLASS' => $row_class,
					'ROW_COLOR' => '#' . $row_color,

					'L_MODULE_NAME' => $mod_name,
					'L_MESSAGE' => $lang['Module_not_configure'],
					'U_REMOVE' => append_sid("admin_modcp.$phpEx?mode=remove&name=" . urlencode($field_name))
					)
				);
			}
			// Increase the module counter
			$i++;
		}
	}
}
else
{
	$template->assign_block_vars('nothing_installed', array(
		'L_MESSAGE' => $lang['New_modules_no_install'])
	);
}

// Now the modules that are not installed yet...
if (!empty($new_module))
{
	// A switch for new stuff.
	$template->assign_block_vars('new', array());

	foreach($new_module as $category => $module_list)
	{
		ksort($module_list);

		// Prepare the category name
		$cat_name = (isset($lang[$category])) ? $lang[$category] : ucwords(str_replace('_', ' ', $category));
	
		$template->assign_block_vars('new.category', array(
			'L_CAT_NAME' => $cat_name)
		);

		$i = 0;  // Reset for each category
		foreach($module_list as $mod => $v)
		{
			// Prepare the module name
			$mod_name = (isset($lang[$mod])) ? $lang[$mod] : ucwords(str_replace('_', ' ', $mod));

			// Prepare the field name
			$field_name = 'modcp_module_' . str_replace('_', '-', $category) . '_' . str_replace('_', '-', $mod);

			$s_checkboxes = '';
			// Is user class present?  Test for MAIN_MOD
			if (defined('MAIN_MOD'))
			{
				$n = 1;

				// Main Moderators (needed for the User Class Mod only)
				$this_checkbox = $checkbox_mask;
				$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
				$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
				$this_checkbox = str_replace('%LEVEL%', MAIN_MOD, $this_checkbox);
				$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
				$this_checkbox = str_replace('%LANG%', $lang['Main_Moderators'], $this_checkbox);
				$s_checkboxes .= $this_checkbox;

				// Moderators
				$this_checkbox = $checkbox_mask;
				$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
				$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
				$this_checkbox = str_replace('%LEVEL%', MOD, $this_checkbox);
				$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
				$this_checkbox = str_replace('%LANG%', $lang['Moderators'], $this_checkbox);
				$s_checkboxes .= $this_checkbox;

				// Support Team (needed for the User Class Mod only)
				$this_checkbox = $checkbox_mask;
				$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
				$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
				$this_checkbox = str_replace('%LEVEL%', SUPPORT, $this_checkbox);
				$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
				$this_checkbox = str_replace('%LANG%', $lang['Support'], $this_checkbox);
				$s_checkboxes .= $this_checkbox;

				// V.I.P.s (needed for the User Class Mod only)
				$this_checkbox = $checkbox_mask;
				$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
				$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
				$this_checkbox = str_replace('%LEVEL%', VIP, $this_checkbox);
				$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
				$this_checkbox = str_replace('%LANG%', $lang['VIP'], $this_checkbox);
				$s_checkboxes .= $this_checkbox;

				// Bots (needed for the User Class Mod only)
				$this_checkbox = $checkbox_mask;
				$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
				$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
				$this_checkbox = str_replace('%LEVEL%', BOT, $this_checkbox);
				$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
				$this_checkbox = str_replace('%LANG%', $lang['Bots'], $this_checkbox);
				$s_checkboxes .= $this_checkbox;
			}
			else
			{
				// There's only one person who can use this, a moderator!
				$this_checkbox = $checkbox_mask;
				$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
				$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
				$this_checkbox = str_replace('%LEVEL%', MOD, $this_checkbox);
				$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
				$this_checkbox = str_replace('%LANG%', $lang['Moderators'], $this_checkbox);
				$s_checkboxes .= $this_checkbox;
			}

			//
			// An extra checkbox saying "No Permissions"
			//
			$this_checkbox = $checkbox_mask;
			$this_checkbox = str_replace('%FIELD_NAME%', $field_name, $this_checkbox);
			$this_checkbox = str_replace('%N%', $n++, $this_checkbox);
			$this_checkbox = str_replace('%LEVEL%', 0, $this_checkbox);
			$this_checkbox = str_replace('%CHECKED%', '', $this_checkbox);
			$this_checkbox = str_replace('%LANG%', $lang['No_one'], $this_checkbox);
			$s_checkboxes .= $this_checkbox;

			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

			$template->assign_block_vars('new.category.module', array(
				'ROW_CLASS' => $row_class,
				'ROW_COLOR' => '#' . $row_color,

				'L_MODULE_NAME' => $mod_name,

				'S_CHECKBOXES' => $s_checkboxes
				)
			);
			// Increase the module counter
			$i++;
		}
	}
}

// And lastly the files that cannot be installed...
if (!empty($module))
{
	// A switch for new stuff.
	$template->assign_block_vars('old', array());

	foreach($module as $category => $module_list)
	{
		ksort($module_list);

		// Prepare the category name
		$cat_name = (isset($lang[$category])) ? $lang[$category] : ucwords(str_replace('_', ' ', $category));

		$template->assign_block_vars('old.category', array(
			'L_CAT_NAME' => $cat_name
			)
		);

		$i = 0;  // Reset for each category
		foreach($module_list as $mod => $v)
		{
			// Prepare the module name
			if (isset($lang[$mod]))
			{
				$mod_name = $lang[$mod];
			}
			else
			{
				$mod_name = ucwords(str_replace('_', ' ', $mod));
			}

			if ( !($i % 2) )
			{
				$row_color = $theme['td_color1'];
			}
			else
			{
				$row_color = $theme['td_color2'];
			}
			if ( !($i % 2) )
			{
				$row_class = $theme['td_class1'];
			}
			else
			{
				$row_class = $theme['td_class2'];
			}

			$template->assign_block_vars('old.category.module', array(
				'ROW_CLASS' => $row_class,
				'ROW_COLOR' => '#' . $row_color,

				'L_MODULE_NAME' => $mod_name
				)
			);
			// Increase the module counter
			$i++;
		}
	}
}

$template->pparse('body');
include('./page_footer_admin.' . $phpEx);

?>

merebel
Registered User
Posts: 195
Joined: Mon Mar 13, 2006 6:18 pm
Location: Lewiston, Maine

Re: [2.0.10] Moderator CP

Post by merebel » Mon Mar 17, 2008 1:33 am

installed the mod and when I click on the moderator control panel I get this error

Code: Select all

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@rebellegion.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


no problems on the install and everything else works fine


Keith

User avatar
milkman
Registered User
Posts: 165
Joined: Mon Nov 29, 2004 1:55 am
Location: Loughborough, UK
Contact:

Re: [2.0.10] Moderator CP

Post by milkman » Mon Mar 17, 2008 8:10 am

Hi Keith,

I've seen this error before but I cannot remember what we did to fix it. Perhaps you can have a read back through this topic a bit and try some of what other people have tried. Unfortunately the dreaded Internal Server Error is very hard to diagnose/fix.

Milkman
Milkman [MilkHub]

merebel
Registered User
Posts: 195
Joined: Mon Mar 13, 2006 6:18 pm
Location: Lewiston, Maine

Re: [2.0.10] Moderator CP

Post by merebel » Mon Mar 17, 2008 1:56 pm

milkman wrote:Hi Keith,

I've seen this error before but I cannot remember what we did to fix it. Perhaps you can have a read back through this topic a bit and try some of what other people have tried. Unfortunately the dreaded Internal Server Error is very hard to diagnose/fix.

Milkman

got it found out I had the wrong version needed vr 1.1.2 and downlaoded the right one and once done set the chmod on the modcp to 755 and that fixed it

Keith

jesj
Registered User
Posts: 5
Joined: Thu Apr 10, 2008 7:47 am

Re: [2.0.10] Moderator CP

Post by jesj » Mon Apr 21, 2008 6:32 am

does anyone know how to fix this so it works with the ShopMod
because everytime my mod goes to the MCP it shows a "Not Authorized"

User avatar
marian0810
Former Team Member
Posts: 3011
Joined: Mon May 21, 2007 9:17 pm
Location: The Netherlands
Name: Marian
Contact:

Re: [2.0.10] Moderator CP

Post by marian0810 » Mon Apr 21, 2008 7:11 am

You have to make sure that the same php files that are in the admin/ folder are also in the modcp/ folder.
Then you have to edit all referrals to admin/whatever-file in the relevant php files and change them to modcp/whatever-file and page_footer_admin to page_footer_mod.
At least that how it works for me with version 1.0.5.
You and me, time and space. You watch us run!

jesj
Registered User
Posts: 5
Joined: Thu Apr 10, 2008 7:47 am

Re: [2.0.10] Moderator CP

Post by jesj » Mon Apr 21, 2008 8:39 am

It still doesn't work. I was using the latest version of the Mod CP so I uninstalled it and then installed version 1.0.5 and I'm still getting the same problem, I made sure everthing was correct. But i dont know what you mean by changing the referrals?

I used easymod to install 1.0.5

User avatar
milkman
Registered User
Posts: 165
Joined: Mon Nov 29, 2004 1:55 am
Location: Loughborough, UK
Contact:

Re: [2.0.10] Moderator CP

Post by milkman » Mon Apr 21, 2008 8:55 am

Have a read through the How to add new modules file in the contrib section. This explains how to add new modules to modcp.
Milkman [MilkHub]

User avatar
marian0810
Former Team Member
Posts: 3011
Joined: Mon May 21, 2007 9:17 pm
Location: The Netherlands
Name: Marian
Contact:

Re: [2.0.10] Moderator CP

Post by marian0810 » Mon Apr 21, 2008 9:27 am

Maybe I can explain it better with an example. One of the things I added to the modcp was the report function. Among the files I had to upload were admin_report.php to admin/admin_report.php and reports_body.tpl to subSilver/admin/reports_body.tpl
So what I did was I also uploaded the php file to modcp/ and the tpl file to subSilver/modcp/
And all the lines In the php file that looked like this:

Code: Select all

'body' => 'admin/reports_body.tpl'
I changed to

Code: Select all

'body' => 'modcp/reports_body.tpl'
and

Code: Select all

include('./page_footer_admin.' . $phpEx);
I changed to

Code: Select all

include('./page_footer_mod.' . $phpEx);
There were a few more, but these are examples. Look for everything with admin/ in it.
And the result was that moderators can now check and handle all reported posts the same as admins.

I don't know anything about Easymod though, it's the one thing I could never get to work :D And I like doing everything manually.
You and me, time and space. You watch us run!

Post Reply

Return to “[2.0.x] MOD Database Cleanup”

Who is online

Users browsing this forum: No registered users and 5 guests

cron