|
|
|
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo
|
|
|
Moved by: lui 12-01-2010, 18:09 |
Information Browsers |
| Author |
Message |
Mario14125
$user_id=2

Helped: 17 times Posts: 580 Location: Wrocław
|
Posted: 09-01-2010, 16:28 Information Browsers
Forum address: [ www.phpBB-MODs.pl ] |
|
|
| Code: | ################################################################################
## Nazwa Modyfikacji: Information Browsers
## Autor Modyfikacji: qbs
## Opis Modyfikacji: Informacje Przeglądarek w widoku profilu użytkownika
##
## Wersja modyfikacji: 1.0
## Poziom Instalacji: Łatwy
## Czas instalacji: 2 Minuty
##
##
## Plików do edycji:
## /includes/usercp_viewprofile.php
## /templates/subSilver/profile_view_body.tpl
## /language/lang_polish/lang_main.php
##
################################################################################
#
#----------[ Otwórz ]----------
#
/includes/usercp_viewprofile.php
#
#----------[ Znajdź ]----------
#
$template->pparse('body');
#
#----------[ Dodaj przed ]----------
#
$sql = "SELECT user_agent, COUNT(*) as how_much
FROM " . POSTS_TABLE . "
WHERE poster_id = $user_id
GROUP BY user_agent";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t obtain user agents list', '', __LINE__, __FILE__, $sql);
}
$marker = $total_usage = 0;
$ua_db = $ico_sys_db = $ico_brow_db = $usages = array();
while ( $row = $db->sql_fetchrow($result) )
{
$user_agent = unserialize(stripslashes($row['user_agent']));
$total_usage += $row['how_much'];
if ( trim($user_agent[2]) == "" ) continue;
$usages[md5($user_agent[2])] = $row['how_much'];
$ico_sys_db[$marker] = $user_agent[0];
$ico_brow_db[$marker] = $user_agent[1];
$ua_db[$marker] = $user_agent[2];
$marker++;
}
if ( count($ua_db) )
{
$template->assign_block_vars('user_agents', array(
'L_USER_AGENTS' => $lang['uas_title_mod'],
'L_BROWSERS' => $lang['uas_browsers_mod'],
'L_USAGE' => $lang['uas_usage_mod']
));
foreach( $ua_db as $marker => $user_agent )
{
$ico_sys = '<img src="' . $images['images'] . '/user_agent/' . $ico_sys_db[$marker] . '" alt="" title="' . $user_agent . '" border="0">';
$ico_brow = '<img src="' . $images['images'] . '/user_agent/' . $ico_brow_db[$marker] . '" alt="" title="' . $user_agent . '" border="0">';
$usage = $usages[md5($user_agent)] . ' (' . round($usages[md5($user_agent)] / $total_usage * 100,1) . '%)';
$template->assign_block_vars('user_agents.rows',array(
'UAS_ICO_SYSTEM' => $ico_sys,
'UAS_ICO_BROWSER' => $ico_brow,
'UAS_USER_AGENT' => $user_agent,
'UAS_USAGE' => $usage
));
}
}
#
#----------[ Otwórz ]----------
#
/templates/subSilver/profile_view_body.tpl
#
#----------[ Znajdź ]----------
#
<!-- END photo -->
</table>
#
#----------[ Dodaj po ]----------
#
<!-- BEGIN user_agents -->
<br />
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th class="thHead" height="28" colspan="4">{user_agents.L_USER_AGENTS}</th>
</tr>
<tr>
<td align="center" colspan="3" class="cat"><b>{user_agents.L_BROWSERS}:</b></td>
<td align="center" class="cat"><b>{user_agents.L_USAGE}:</b></td>
</tr>
<!-- BEGIN rows -->
<tr>
<td align="center" class="row1">{rows.UAS_ICO_SYSTEM}</td>
<td align="center" class="row1">{rows.UAS_ICO_BROWSER}</td>
<td align="center" class="row1">{rows.UAS_USER_AGENT}</td>
<td align="center" class="row1">{rows.UAS_USAGE}</td>
</tr>
<!-- END rows -->
<tr>
<td colspan="4" class="cat"> </td>
</tr>
</table>
<!-- END user_agents -->
#
#----------[ Otwórz ]----------
#
/language/lang_polish/lang_main.php
#
#----------[ Znajdź ]----------
#
//
// That's all Folks!
// -------------------------------------------------
#
#----------[ Dodaj przed ]----------
#
$lang['uas_title_mod'] = 'Używane przeglądarki';
$lang['uas_browsers_mod'] = 'Przeglądarka';
$lang['uas_usage_mod'] = 'Użycia';
#
#-----[ Koniec ]--------------
# |
//poprawka dla leni
#
#----------[ Otwórz ]----------
#
/language/lang_polish/lang_main.php
#
#----------[ Znajdź ]----------
#
$lang['uas_title_mod'] = 'Używane przeglądarki';
$lang['uas_browsers_mod'] = 'Przeglądarka';
$lang['uas_usage_mod'] = 'Użycia';
#
#----------[ Zamień na ]----------
#
$lang['uas_title_mod'] = 'Używane przegl±darki';
$lang['uas_browsers_mod'] = 'Przegl±darka';
$lang['uas_usage_mod'] = 'Użycia';
#
#-----[ Koniec ]--------------
#
Masz problem z instalacją modyfikacji Napisz do mnie Na pewno się jakoś dogadamy |
| Last edited by lui on 12-01-2010, 18:09; edited 2 times in total |
|
|
|
 |
~Boltex
$user_id=25k


Helped: 73 times Posts: 917 Location: Łomża

|
Posted: 09-01-2010, 20:15
Forum address: Cały czas w budowie |
|
|
| Mario14125, demo? |
|
|
|
 |
kevin_
Użyszkodnik

Helped: 568 times Posts: 2148

|
|
|
|
 |
Mario14125
$user_id=2

Helped: 17 times Posts: 580 Location: Wrocław
|
Posted: 09-01-2010, 20:31
Forum address: [ www.phpBB-MODs.pl ] |
|
|
Boltos, tak, to to co podał kevin_ |
|
|
|
 |
|
|
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 cannot attach files in this forum You can download files in this forum
|
Add this topic to your bookmarks Printable version
|
Kopiowanie wszelkich treści zawartych na forum, modyfikacji oraz instrukcji bez zgody administracji i autorów tematów/postów zabronione!
Powered by phpBB modified by Przemo © 2003 phpBB Group | | Page generated in 0.11 second. SQL queries: 11 | |
 |
|