Seite 1 von 5

HILFE mein FORUM FUNKT. GARNICHT MEHR!!!!color-group Mod

Verfasst: 13.02.2006 16:21
von retosch
ich habe da einpaar probleme mit der Installation. Hier ein auszug der Installationanleitung. Ab den rotenbereich klappt es nicht mehr mit der Installtaion :oops: . Da ich nicht mehr weiter komme.



#-----[ UPLOAD ]------------------------------------------
# If you are having trouble understanding this section, read
# the goodies/understanding_upload.txt file.
#
nivisec_install.php to /
nivisec_schema/*.* to nivisec_schema/
admin/admin_color_groups.php to admin/
language/lang_english/lang_color_groups.php to language/lang_english/
includes/functions_color_groups.php to includes/
templates/subSilver/admin/*.* to templates/subSilver/admin/

#
#-----[ RUN ]------------------------------------------
#
nivisec_install.php

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

#
#-----[ FIND ]------------------------------------------
#
define('CATEGORIES_TABLE', $table_prefix.'categories');

#
#-----[ AFTER, ADD ]------------------------------------------
#
define('COLOR_GROUPS_TABLE', $table_prefix.'color_groups');

#
#-----[ OPEN ]------------------------------------------
#
index.php

#
#-----[ FIND ]------------------------------------------
#
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
color_groups_setup_list();

#
#-----[ FIND ]------------------------------------------
#
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';

#
#-----[REPLACE WITH ]------------------------------------------
#
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']);
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------
#
[ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]

#
#-----[ REPLACE WITH ]------------------------------------------
#
{COLOR_GROUPS_LIST}

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

#
#-----[ FIND ]------------------------------------------
#
if (defined('SHOW_ONLINE'))
{


#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if ( $row['user_allow_viewonline'] )
{
$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
$logged_visible_online++;
}
else
{
$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
$logged_hidden_online++;
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
$user_online_link = color_group_colorize_name($row['user_id']);
if ( $row['user_allow_viewonline'] )
{
$logged_visible_online++;
}
else
{
$logged_hidden_online++;
}

#
#-----[ OPEN ]------------------------------------------
#
viewonline.php

#
#-----[ FIND ]------------------------------------------
#
$username = $row['username'];

$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
}
else if ( $row['user_level'] == MOD )
{
$username = '<b style="color:#' . $theme['fontcolor2'] . '">' . $username . '</b>';
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);
$username = color_group_colorize_name($user_id, true);

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

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
'POSTER_NAME' => $poster,

#
#-----[ REPLACE WITH ]------------------------------------------
#
'POSTER_NAME' => ($poster_name = color_group_colorize_name($poster_id, true)) ? $poster_name : $poster,

#
#-----[ OPEN ]------------------------------------------
#
memberlist.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
'USERNAME' => $username,

#
#-----[ REPLACE WITH ]------------------------------------------
#
'USERNAME' => color_group_colorize_name($user_id, true),

#
#-----[ OPEN ]------------------------------------------
#
privmsg.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
$username_from = $privmsg['username_1'];

#
#-----[ REPLACE WITH ]------------------------------------------
#
$username_from = color_group_colorize_name($privmsg['user_id_1'], true);

#
#-----[ FIND ]------------------------------------------
#
$username_to = $privmsg['username_2'];

#
#-----[ REPLACE WITH ]------------------------------------------
#
$username_to = color_group_colorize_name($privmsg['user_id_2'], true);

#
#-----[ FIND ]------------------------------------------
#
'FROM' => $msg_username,

#
#-----[ REPLACE WITH ]------------------------------------------
#
'FROM' => color_group_colorize_name($msg_userid, true),

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#
include_once($phpbb_root_path.'includes/functions_color_groups.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
$moderators[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';

#
#-----[ REPLACE WITH ]------------------------------------------
#
$moderators[] = color_group_colorize_name($row['user_id']);

#
#-----[ FIND ]------------------------------------------
#
$topic_author = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $topic_rowset[$i]['user_id']) . '">' : '';
$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : ( ( $topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['Guest'] );

$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '</a>' : '';

#
#-----[ REPLACE WITH ]------------------------------------------
#
$topic_author = ($topic_rowset[$i]['user_id'] == ANONYMOUS ) ? (($topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['Guest'] ) : color_group_colorize_name($topic_rowset[$i]['user_id']);

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



Ich hoffe es kann mir jemand weiter helfen.

Verfasst: 13.02.2006 16:26
von retosch
Hier ein auszug vom Script den ich ändern muss. Datei functions_color_groups.php

<?php
/***************************************************************************
* $RCSfile: functions_color_groups.php,v $
* -------------------
* copyright : (C) 2002-2003 Nivisec.com
* email : support@nivisec.com
*
* $Id: functions_color_groups.php,v 1.3 2003/09/03 02:52:46 nivisec 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.
*
***************************************************************************/
if (!defined('IN_PHPBB') || !IN_PHPBB) die('Invalid Function Include, Hacking Attempt?');

define('RGB_COLOR_LIST', 'aqua,black,blue,fuchsia,gray,green,lime,maroon,navy,olive,purple,red,silver,teal,white,yellow');
define('COPYRIGHT_NIVISEC_FORMAT',
'<br /><span class="copyright"><center>
%s
&copy; %s
<a href="http://www.nivisec.com" class="copyright">Nivisec.com</a>.
</center></span>'
);


if (!function_exists('copyright_nivisec'))
{
/**
* @return void
* @desc Prints a sytlized line of copyright for module
*/
function copyright_nivisec($name, $year)
{
printf(COPYRIGHT_NIVISEC_FORMAT, $name, $year);
}
}

if (!function_exists('check_font_color_nivisec'))
{
/**
* @return boolean
* @param item string
* @desc Checks for a valid color entry in the form of one of default words or #rrggbb. Assumes $colors is defined already.
*/
function check_font_color_nivisec($item)
{
global $colors;
//Find out if it's a valid hex or valid word
if (!preg_match("/#[0-9,A-F,a-f]{6}/", $item) && !in_array($item, explode(",", RGB_COLOR_LIST)))
{
return false;
}
//If we get this far, it exists and/or is valid
return true;
}
}

if (!function_exists('find_lang_file_nivisec'))
{
/**
* @return boolean
* @param filename string
* @desc Tries to locate and include the specified language file. Do not include the .php extension!
*/
function find_lang_file_nivisec($filename)
{
global $lang, $phpbb_root_path, $board_config, $phpEx;

if (file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/$filename.$phpEx"))
{
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/$filename.$phpEx");
}
elseif (file_exists($phpbb_root_path . "language/lang_english/$filename.$phpEx"))
{
include_once($phpbb_root_path . "language/lang_english/$filename.$phpEx");
}
else
{
message_die(GENERAL_ERROR, "Unable to find a suitable language file for $filename!", '');
}
return true;
}
}
if (!function_exists('set_filename_nivisec'))
{
/**
* @return boolean
* @param filename string
* @param handle string
* @desc Sets the filename to handle in the $template class. Saves typing for me :)
*/
function set_filename_nivisec($handle, $filename)
{
global $template;

$template->set_filenames(array(
$handle => $filename
));

return true;
}
}
if (!function_exists('do_query_nivisec'))
{
/**
* @return void
* @param sql string
* @param $result_list array
* @param error string
* @desc Does $sql query. If error, prints $error and modifies reference $result_list to be a row set
*/
function do_query_nivisec($sql, &$result_list, $error)
{
global $db;

if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, $error, '', __LINE__, __FILE__, $sql);
}
$result_list = $db->sql_fetchrowset($result);
}
}

if (!function_exists('do_fast_query_nivisec'))
{
/**
* @return void
* @param sql string
* @param error string
* @desc Does $sql query and doesn't bother with results. If error, prints $error
*/
function do_fast_query_nivisec($sql, $error)
{
global $db;

if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, $error, '', __LINE__, __FILE__, $sql);
}
}
}

if (!function_exists('get_color_group_order_max'))
{
function get_color_group_order_max()
{
global $db, $lang;

$sql = 'SELECT max(order_num) as max FROM ' . COLOR_GROUPS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

return $row['max'];
}
}

if (!function_exists('get_color_group_order_min'))
{
function get_color_group_order_min()
{
global $db, $lang;

$sql = 'SELECT MIN(order_num) as min FROM ' . COLOR_GROUPS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

return $row['min'];
}}
/**
* @return void
* @param new string
* @param orig string
* @param type int
* @desc Updates user levels of type based on the difference between new and orig string lists
*/
if (!function_exists('color_groups_update_group_id'))
{
function color_groups_update_group_id($group_list, $user_list, $group_id)
{
global $lang, $db, $status_message;
/* Debugging for this function */
$debug = false;

$sql = array();

// Set all old user's and groups to "NO COLOR GROUP" to take care of any deletions //
$sql[] = 'UPDATE ' . USERS_TABLE . "
SET user_color_group = 0
WHERE user_color_group = $group_id";
$sql[] = 'UPDATE ' . GROUPS_TABLE . "
SET group_color_group = 0
WHERE group_color_group = $group_id";
// Set all new list items to have the color group, if we were given a list //
if (!empty($user_list))
{
$sql[] = 'UPDATE ' . USERS_TABLE . "
SET user_color_group = $group_id
WHERE user_id IN ($user_list)";
}
if (!empty($group_list))
{
$sql[] = 'UPDATE ' . GROUPS_TABLE . "
SET group_color_group = $group_id
WHERE group_id IN ($group_list)";
}

// DO the actual SQL commands now //
foreach($sql as $command)
{
if (!$db->sql_query($command))
{
message_die(GENERAL_ERROR, $lang['Error_Group_Table'], '', __LINE__, __FILE__, $sql);
}
}

$status_message .= $lang['Updated_Group'];
}}

if (!function_exists('color_groups_setup_list'))
{
function color_groups_setup_list()
{
global $lang, $template, $db;

$sql = 'SELECT * FROM ' . COLOR_GROUPS_TABLE . '
WHERE hidden = 0
ORDER BY order_num ASC';
if (!$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, $lang['Error_Group_Table'], '', __LINE__, __FILE__, $sql);
$list = '';
while ($row = $db->sql_fetchrow($result))
{
$list .= '&nbsp;[ <span style="font-weight:bold;color:' . $row['group_color'] . '">' . $row['group_name'] . '</span> ]&nbsp;';
}

$template->assign_var('COLOR_GROUPS_LIST', $list);
}}

if (!function_exists('color_group_colorize_name'))
{
function color_group_colorize_name($user_id, $no_profile = false)
{
global $board_config, $phpEx, $db, $phpbb_root_path;

// First see if the user is Anon
if ($user_id != ANONYMOUS)
{
// Get the user info and see if they are assigned a color_group //
$sql = 'SELECT u.user_color_group, u.username, c.* FROM ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . " c
WHERE u.user_id = $user_id
AND u.user_color_group = c.group_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

if (!isset($row['username']))
{
//If there was a problem before, we don't want a blank username!
$sql = 'SELECT username FROM ' . USERS_TABLE . "
WHERE user_id = $user_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
}
$username = $row['username'];

if (isset($row['group_color']))
{
// WE found the highest level color, head out now //
$style_color = 'style="font-weight:bold;color:' . $row['group_color'] . '"';
}
else
{
// Now start looking for user group memberships //
$sql = 'SELECT c.* FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u, ' . COLOR_GROUPS_TABLE . ' c, ' . GROUPS_TABLE . ' g
WHERE ug.user_id = ' . $user_id . '
AND u.user_id = ug.user_id
AND ug.group_id = g.group_id
AND g.group_color_group = c.group_id
AND g.group_single_user = 0';
//print $sql;
$result = $db->sql_query($sql);
$curr = 10000000000000;
$style_color = '';
while ($row = $db->sql_fetchrow($result))
{
// If our new group in the list is a higher order number, it's color takes precedence //
if ($row['order_num'] < $curr)
{
$curr = $row['order_num'];
$style_color = 'style="font-weight:bold;color:' . $row['group_color'] . '"';
}
}
}

// Make the profile link or no and return it //
if ($no_profile)
{
$user_link = "<span $style_color>$username</span>";
}
else
{
$user_link = '<a href="' . append_sid($phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id") . '"' . $style_color .'>' . $username . '</a>';
}
return($user_link);
}
else
{
return false;
}
}}

?>

Verfasst: 13.02.2006 19:51
von rabbit
wäre schön, wenn du erstmal den ganzen code wieder löschen könntest, da er die DB unnötig belastet. es ist immer besser, nur code-auszüge (d.h. wenige zeilen, nur die wirklich wichtigen) zu posten udn bei ganzen dateien lieber dies zu tun: KB:datei. ;)

und an der functions_color_groups.php musst du nichts ändern, die wird doch im MOD-paket mitgeliefert.

btw, ein besserer MOD, da weniger ressourcen-lastig, ist der AGCM (advanced group color management) von phantomk. eine suche hier auf dem board sollte dir einen download-link geben.

Verfasst: 13.02.2006 20:51
von retosch
Hi rabbit, also ich habe diesen MOD im Netz gefunden . Aber beim öffnen der AGCM.txt ist mir ja du spucke weg geblieben. Was dort alles steht in sachen " wie Installiere ich es " . Da ich von Programmieren kein Plan habe, find ich diese Art von Install echt DERBE. Irgenwie kapiere ich diese ART von Installieren nicht. Die ganzen Script änderungen etc. . Gib es nicht eine simple art zu Installieren ??? Oder rabbit WIE INSTALLIERE ich es ???? Ein Kumpel von mir ist gelernter Adminastrator / Microsoft , sogar er meinte diese Anleitung sind für en A..... . Kannst du mir weiterhelfen ???? :oops: :oops: :oops:

Verfasst: 13.02.2006 20:55
von Fabrizio
Hi retosch,

lese dir bitte zuerst die MODs FAQ genau durch, denn damit dürfte dein Problem was zu tun ist bei der Installation so gut wie geklärt sein. Wenn du dann noch Fragen hast, kannst du sie ja immer noch stellen. Um die MODs FAQ zu verstehen, muss man keine großartigen Programmierkenntnisse besitzen. Mit der haben viele von uns angefangen, also nur Mut.

Gruß,
Fabrizio

Verfasst: 13.02.2006 20:55
von Valerie Raghnall
was mal wieder die allgemeine meinung über m$ bestätigt ;-)
die anleitungen sagen dir genau was du tun musst... du selber musst da ja nicht programmieren, sondern nur schritt für schritt das tun, was in der anleitung steht. für umfangreiche mods ist eben viel zu tun...

lies dir mal die Mods-FaQ durch, dann wird dir sicher einiges klarer :)

Verfasst: 13.02.2006 21:05
von retosch
danke euch beiden für diesen RAT bezüglich "LESE DIE FAQ " . Doch leider bringt es mich kein stück weiter bei dieser Installation :x . Ich meine HEY muss ich diese ganzen Scrip ändern....????? Ich hatte probleme mit einer identischen Software, da hieß es nur nee versuch dies HIER ( AGCM ) , ich bin ja dankbar für jede HILFE & TIPPS . Aber ich verstehe nicht warum ist es soo komplex alles. Ich mein geht es nicht viel einfacher einen MOD zu Installieren ??? Ich meine ja wenn mein Kumpel "Admin-beruflich" schon sagt, diese ART von Installation ist viel zu schwer & manchmal auch blöde erklärt zu (ungenau) . Dann Frage ich mich, da ich eh nichts mit dieser Materie zu tun habe, wie soll ich es dann schaffen ???

Verfasst: 13.02.2006 21:08
von Fabrizio
retosch hat geschrieben:danke euch beiden für diesen RAT bezüglich "LESE DIE FAQ " . Doch leider bringt es mich kein stück weiter bei dieser Installation :x . Ich meine HEY muss ich diese ganzen Scrip ändern....????? Ich hate probleme mit einer identischen Software, da hieß es nur nee versuch dies HIER ( AGCM ) , ich bin ja danbar für jede HILFE & TIPPS . Aber ich verstehe nicht warum ist es soo komplex alles. Ich mein geht es nicht viel einfacher ???
Hmpf, aus deiner Frage lässt sich aber schließen, dass du die MODs FAQ nicht gelesen hast, sorry. Ja, du musst alles das machen, was in der Installationsanleitung steht. Die Übersetzungen zu den Begriffen "find" etc. findest du in der mehrmals angesprochenen MODs FAQ und damit sollte dies kein Problem sein. :-? Versuche es doch erst einmal...

Verfasst: 13.02.2006 21:11
von retosch
Okay Fabrizio aber Hand aufs Herz . Wenn man dies liest:

MOD Title: Advanced Group Color Management
## MOD Author: Phantomk <phantomk@modmybb.com> (N/A) http://www.modmybb.com/
## MOD Description: Modify's the Group system to add colors.
## MOD Version: 1.2.4
##
## Installation Level: Advanced
## Installation Time: 60 Minutes
## Files To Edit: 29

da sage ich mir OH MEIN GOTT :-? :-? :-? :evil:

Verfasst: 13.02.2006 21:12
von Valerie Raghnall
du musst am script doch gar nix ändern, du musst nur das tun, was du tun willst. nämlich nen mod einbauen. dafür musst du eben einfach die anweisungen in der - von dir als script bezeichneten - installanleitung ausführen. wo ist dein problem? lesen, suchen, kopieren, löschen und einfügen wirst du ja wohl können. oder hast du noch nie ein worddokument verändert?