Rangi na Forum


(m@teo) #1

mam problem otóż zainstalowałem hacka żeby wyświetalł najaktywniejszych an forum ale :

http://mateoo.ovh.org/moje/forumse.JPG

chce żeby wyświetlały się poprawne rangi? co musze zrobić?


(Dod) #2

hmm nie wiem czy mozna ccos takiego zrobic, ja przynajmniej nigdy nie doszedlem do tego jak to zrobic…

PS: Jak mozesz przegladac strony z taka iloscia ikon w browserze ? :shock:


(lazikar) #3

M@TEO masz zainstalowane Color ranks 2 Daboza ???

I ta modyfikacje to robisz jak niżej:

Napisałem teraz, u mnie działa poprawnie jak co pisz. :slight_smile:

# 

#-----[OPEN]------------------------------------------ 

#


includes/functions.php


# 

#-----[FIND]------------------------------------------ 

#




//

// MOD START - TOP 'X' USERS MOD - AbelaJohnB

// This function will be used to acquire the "Top 'x'" members of your forum.

// It can be called on any page that this file is included on.

// You can specific the amount of members it returns by chaning the function input string.

// Example:

// top_posters('10', x, x) will return Top Ten Members

// top_posters('5', x, x) will return Top Five Members

//

// If you want to limit ADMIN and/or MOD from showing, use the following methods:

//

// top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD

// top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD

// top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN

// top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD

//


function top_posters($str_input, $show_admin, $show_mod)

{

	global $db, $phpEx, $theme;

	// Show All

	if ( ( $show_admin == '1' ) && ( $show_mod == '1' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	// Show Admin But Not Moderators

	elseif ( ( $show_admin == '1' ) && ( $show_mod == '0' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . MOD . ") 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	// Show Moderators But Not Admins

	elseif ( ( $show_admin == '0' ) && ( $show_mod == '1' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	// Show Neither Admins Nor Moderators

	else/// ( ( $show_admin == '0' ) && ( $show_mod == '0' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") AND (u.user_level != " . MOD . ") 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	//

	if ( !($result = $db->sql_query($sql)) )

	{

		message_die(GENERAL_ERROR, 'Could not query forum top poster information', '', __LINE__ , __FILE__ , $sql);

	}

	// $top_posters = array();

	while( $row = $db->sql_fetchrow($result) )

	{

				$style_color = '';

				if ( $row['user_level'] == ADMIN )

				{

					$row['username'] = '' . $row['username'] . '';

					$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';

				}

				else if ( $row['user_level'] == MOD )

				{

					$row['username'] = '' . $row['username'] . '';

					$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';

				}

		$top_posters .= '' . $row['username'] . '(' . $row['user_posts'] . '), ';

	}

  return $top_posters;

}

// MOD END - TOP 'X' USERS MOD - AbelaJohnB


# 

#-----[REPLACE WITH]------------------------------------------ 

#


 //

// MOD START - TOP 'X' USERS MOD - AbelaJohnB

//



// Example:

// top_posters('10', x, x) will return Top Ten Members

// top_posters('5', x, x) will return Top Five Members

//

// If you want to limit ADMIN and/or MOD from showing, use the following methods:

//

// top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD

// top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD

// top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN

// top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD

//


function top_posters($str_input, $show_admin, $show_mod)

{

	global $db, $phpEx, $theme;

	// Show All

	if ( ( $show_admin == '1' ) && ( $show_mod == '1' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_rank, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	// Show Admin But Not Moderators

	elseif ( ( $show_admin == '1' ) && ( $show_mod == '0' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_rank, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . MOD . ") 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	// Show Moderators But Not Admins

	elseif ( ( $show_admin == '0' ) && ( $show_mod == '1' ) )

	{

		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_rank, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	// Show Neither Admins Nor Moderators

	else/// ( ( $show_admin == '0' ) && ( $show_mod == '0' ) )

	{




$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_rank, u.user_level, count(u.user_id) as user_posts

		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") AND (u.user_level != " . MOD . ") 

		GROUP BY user_id, username

		ORDER BY user_posts DESC

		LIMIT $str_input";

	}

	//

	if ( !($result = $db->sql_query($sql)) )

	{

		message_die(GENERAL_ERROR, 'Could not query forum top poster information', '', __LINE__ , __FILE__ , $sql);

	}

	// $top_posters = array();

	while( $row = $db->sql_fetchrow($result) )

	{


		$top_posters .= color_username($row['user_id'], $row['username'], $row['user_rank'], $row['user_posts']).'(' . $row['user_posts'] . '), ';

	}

  return $top_posters;

}

// MOD END - TOP 'X' USERS MOD - AbelaJohnB[/code]

(m@teo) #4

nie wiem jaką wersje mam zainstalowana tzn wgrałem gotowe pliki heh bo zadużo razy to instalowałem i mi się niechciało

PS: otworzyłem includes/functions.php

ale nie moge znależć ??

# 

#-----[FIND]------------------------------------------ 

# 




// 

// MOD START - TOP 'X' USERS MOD - AbelaJohnB 

// This function will be used to acquire the "Top 'x'" members of your forum. 

// It can be called on any page that this file is included on. 

// You can specific the amount of members it returns by chaning the function input string. 

// Example: 

// top_posters('10', x, x) will return Top Ten Members 

// top_posters('5', x, x) will return Top Five Members 

// 

// If you want to limit ADMIN and/or MOD from showing, use the following methods: 

// 

// top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD 

// top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD 

// top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN 

// top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD 

// 


function top_posters($str_input, $show_admin, $show_mod) 

{ 

   global $db, $phpEx, $theme; 

   // Show All 

   if ( ( $show_admin == '1' ) && ( $show_mod == '1' ) ) 

   { 

      $sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts 

      FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

      WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) 

      GROUP BY user_id, username 

      ORDER BY user_posts DESC 

      LIMIT $str_input"; 

   } 

   // Show Admin But Not Moderators 

   elseif ( ( $show_admin == '1' ) && ( $show_mod == '0' ) ) 

   { 

      $sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts 

      FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

      WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . MOD . ") 

      GROUP BY user_id, username 

      ORDER BY user_posts DESC 

      LIMIT $str_input"; 

   } 

   // Show Moderators But Not Admins 

   elseif ( ( $show_admin == '0' ) && ( $show_mod == '1' ) ) 

   { 

      $sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts 

      FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

      WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") 

      GROUP BY user_id, username 

      ORDER BY user_posts DESC 

      LIMIT $str_input"; 

   } 

   // Show Neither Admins Nor Moderators 

   else/// ( ( $show_admin == '0' ) && ( $show_mod == '0' ) ) 

   { 

      $sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts 

      FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 

      WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") AND (u.user_level != " . MOD . ") 

      GROUP BY user_id, username 

      ORDER BY user_posts DESC 

      LIMIT $str_input"; 

   } 

   // 

   if ( !($result = $db->sql_query($sql)) ) 

   { 

      message_die(GENERAL_ERROR, 'Could not query forum top poster information', '', __LINE__ , __FILE__ , $sql); 

   } 

   // $top_posters = array(); 

   while( $row = $db->sql_fetchrow($result) ) 

   { 

            $style_color = ''; 

            if ( $row['user_level'] == ADMIN ) 

            { 

               $row['username'] = '' . $row['username'] . ''; 

               $style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; 

            } 

            else if ( $row['user_level'] == MOD ) 

            { 

               $row['username'] = '' . $row['username'] . ''; 

               $style_color = 'style="color:#' . $theme['fontcolor2'] . '"'; 

            } 

      $top_posters .= '' . $row['username'] . '(' . $row['user_posts'] . '), '; 

   } 

  return $top_posters; 

} 

// MOD END - TOP 'X' USERS MOD - AbelaJohnB 

[/code]

(lazikar) #5

Skąd masz te pliki to mozna zobaczyc co tam masz. ;]

Zreszta jak tyle razy instalowałes ( Trwa to 2 minuty) to masz instalke


(m@teo) #6
MOD Title: Color Ranks

## MOD Author: Dabroz < dabroz@linuxpl.com > (N/A)

## MOD Description: Colorizes users' ranks. It also

## colorizes usernames using their

## ranks' colors.

##

## MOD Version: 1.4

(lazikar) #7

M@TEO ok, choc jest juz wersja 2.

Chodzi raczej o hacka do najaktywniejszych na forum. :slight_smile:

To do tego sa te zmiany i aby zobaczyć musze wiedziec co uzyłes.


(m@teo) #8

Aha!! Dobra zresztą już nie aktualne wywaliłem Najaktywniejsi bo za dużo roboty! Może keidy indziej się tym zajme :stuck_out_tongue:


(lazikar) #9

:o :o :o malutko. ;]

Tak apropo dla potomnych. ten kod wyzej działa na 100% Sprawdziłem. :slight_smile:

http://hbplus.aplus.pl/modules.php?name=Forums


(m@teo) #10

Heh dzięki lazikar właśnie mi się to udało zrobić sam zobaczy czy to dozbrze zrobiłem :stuck_out_tongue:

http://cgsm.be


(lazikar) #11

Jak widać ok. :slight_smile:


(m@teo) #12

http://cgsm.be

może ktoś sprawdzić czy chodzi wsyzstko ok??


(Airborn) #13

przejrzalem to co moglem bez rejestrowania sie… wydaje mi sie ze jest wszystko oki


(m@teo) #14

Kolejny problem mam otóż :

http://www.fotosik.pl/pokaz_obrazek/30j … tgo48.html

co zrobić żeby wyświetlały się poprawne rangi ?


(lazikar) #15

Podaj mi linka do tego moda. Musze widzieć kod. :slight_smile:


(m@teo) #16

http://mateoo.ovh.org/moje/users_of_the_day.txt

tu masz instrukcje :smiley:

Złączono Posta : 19.11.2005 (Sob) 21:10

heh jeszcze jedno pytanko co do Najaktywniejszych na forum:

Gdzie się podaje wartośc ilu najaktywniejszych userów ma pokazywać ?


(lazikar) #17

Więc aby kolorowało zmieniasz:

includes/page_header.php znajdz:

//

// Users of the day MOD

//


// ############ Edit below ############

// #

$display_not_day_userlist = 0;	// change to 1 here if you also want the list of the users who didn't visit to be displayed - zmień na 1 jesli chcesz zeby byli wyswietlani użykownicy, którzy NIE odwiedzili forum

$users_list_delay = 24; // change here to the number of hours wanted for the list - liczna godzin

// #

// ############ Edit above ############


$sql = "SELECT user_id, username, u.user_rank, user_allow_viewonline, user_level, user_session_time

	FROM ".USERS_TABLE."

	WHERE user_id > 0

	ORDER BY user_level DESC, username ASC";

if( !($result = $db->sql_query($sql)) )

{

	message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__ , __FILE__ , $sql);

}


$day_userlist = '';

$day_users = 0;

$not_day_userlist = '';

$not_day_users = 0;


while( $row = $db->sql_fetchrow($result) )

{

	$style_color = '';

	if ( $row['user_level'] == ADMIN )

	{

		$row['username'] = '' . $row['username'] . '';

		$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';

	}

	else if ( $row['user_level'] == MOD )

	{

		$row['username'] = '' . $row['username'] . '';

		$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';

	}

	if ( $row['user_allow_viewonline'] )

	{

		$user_day_link = '' . $row['username'] . '';

	}

	else

	{

		$user_day_link = '' . $row['username'] . '';

	}

	if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )

	{

		if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )

		{

			$day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;

			$day_users++;

		}

		else

		{

			$not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;

			$not_day_users++;

		}

	}

}


$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;


$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;


if ( $display_not_day_userlist )

{

	$day_userlist .= '
' . $not_day_userlist;

}[/code]




[color=darkred][b]Zamień na:[/b][/color]

[code] // // Users of the day MOD // // ############ Edit below ############ // # $users_list_delay = 24; // change here to the number of hours wanted for the list - liczna godzin // # // ############ Edit above ############ $sql = “SELECT user_id, username, user_rank, user_posts, user_session_time FROM “.USERS_TABLE.” WHERE user_id > 0 ORDER BY username ASC”; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, ‘Could not obtain user/day information’, ‘’, __LINE__, __FILE__, $sql); } $day_userlist = ‘’; $day_users = 0; while( $row = $db->sql_fetchrow($result) ) { $user_day_link = color_username($row[‘user_id’],$row[‘username’],$row[‘user_rank’],$row[‘user_posts’]); if ( $row[‘user_session_time’] >= ( time() - $users_list_delay * 7200 ) ) { $day_userlist .= ( $day_userlist != ‘’ ) ? ', ’ . $user_day_link : $user_day_link; $day_users++; } } $day_userlist = ( ( isset($forum_id) ) ? ‘’ : sprintf($lang[‘Day_users’], $users_list_delay, $day_users) ) . ’ ’ . $day_userlist; // // End of MOD //

$display_not_day_userlist = 0;	// change to 1 here if you also want the list of the users who didn't visit to be displayed - zmień na 1 jesli chcesz zeby byli wyswietlani użykownicy, którzy NIE odwiedzili forum

$users_list_delay = 24; // change here to the number of hours wanted for the list - liczna godzin

W tym samym pliku:)


(m@teo) #18
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed - zmień na 1 jesli chcesz zeby byli wyswietlani użykownicy, którzy NIE odwiedzili forum 

$users_list_delay = 24; // change here to the number of hours wanted for the list - liczna godzin

Ale gdzie dokłądniej to wpisuje? żeby 10 najaktywniejszysz pokazywało ?


(lazikar) #19

Ale ten mod pokazuje osoby odwiedzające forum przez okreslony czas. :slight_smile: wiec zmniejsz czas i bedziesz miał mniej. :slight_smile:

top x posters to mod o którym mowa była wyżej jest od najaktywniejszych. :slight_smile:

Napisz czy kolorki ci działaja. :slight_smile:


(m@teo) #20

tak lazikar dzięki kolejny raz działą !!

A w którym plki ustwaia się liczbe userów wyświetalanych j ako najaktywniejsi? mowa teraz o top x posters