CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Besoin d'aide pour installer un MOD

Caloun
Caloun
Niveau 10
02 janvier 2003 à 12:31:35

qui serait chaud pour m´aider à installer le mod last visit sur mon forum ? ( faudrai aussi le traduire en french)

j´ai déjà tenter d´installer ce mod et j´ai failli foutre en l´air mon forum, heuresement que j´avais une save de ma base sql

Coms
Coms
Niveau 10
02 janvier 2003 à 13:14:22

L´autre fois,je te disais que le phpbb etait plus facillement manipulable,apparement non...je retire ce que j´ai dis! lol : )

UP! : )

Caloun
Caloun
Niveau 10
02 janvier 2003 à 13:35:36

Non c´est asez chaud parfois, ca dépend des mods que t´install, yen a ki sont corsé à mettre en place ! !

Coms
Coms
Niveau 10
02 janvier 2003 à 13:40:47

ben je vois ça,ça fait deux fois que tu demande de l´aide,d´ailleur il y a pas grand monde qui te repond... : o(

Dominator-fr
Dominator-fr
Niveau 10
02 janvier 2003 à 13:42:28

cela depasse mes competence dsl!

Caloun
Caloun
Niveau 10
02 janvier 2003 à 13:46:56

attendez je vous dis ce qu´il faut faire, on sais jamais si il ya kk1 d´interresser

Partie 1:

    1. ###############################################
    2. ###
    3. Mod Title: Last Visit Mod
    4. Mod Version: 1.2.4
    5. Author: Niels Chr. Rød Denmark < ncr@db9.dk > http://mods.db9.dk

##

    1. This mod is for phpBB2 ver 2.0.2

##

    1. Description: This mod will enable logning of the users last visit time,
    2. after this mod, users can see when another user have last visited
    3. the board, this is shown in the correspondings users profile.
    4. This mod support, user level and hidden users
    5. Admin will always be able to see other users last visit, regardless of the settings
    6. if board config is "off", then only admin can see the information
    7. if board is "on", then all users kan se other users last visit
    8. except hidden users, who will still be "hidden"
    9. This mod, will also display the number of reg/hidden and guest users today on the index page

##

##

##

    1. Installation Level: Easy
    2. Installation Time: 10-15 Minutes
    3. Files To Edit: 6
    4. language/subsilver/lang_main.php
    5. includes/usercp_viewprofile.php
    6. includes/sessions.php
    7. index.php
    8. templates/subsilver/index_body.tpl
    9. templates/subsilver/profile_view_body.tpl
    10. Include files: 1
    11. db_update.php

##

    1. History:
    2. 0.9.0. - initial BETA for RC-2
    3. 1.0.0. - initial release for RC-2
    4. 1.0.10. - History started, change in how timezones are handled
    5. 1.0.11. - corrected a typo in how timezones are handled
    6. 1.0.12. - corection to follow phpBB2 coding guidelines
    7. 1.0.13. - Now includes the number of users witch have visited the board the last hour
    8. 1.0.14. - fixed that the language part was missing from the last hour addition
    9. 1.0.15. - added extra feature, that how meny guest visited the board today are also countet
    10. 1.0.16. - missed something in the page_header.php file
    11. 1.0.17. - moved some changes from page_header.php over to index.php, for incresed performance
    12. 1.0.18. - fixed session.php that guest users are reset from the "today list"
    13. 1.0.19. - guest was still beeing reset, new change to session.php $dato
    14. 1.2.0. - BETA for phpBB2 version 2.0.2.
    15. 1.2.1. - typo, missed a comma in session.php
    16. 1.2.2. - fixed that guest users was not counted rigth if mixed timezones
    17. 1.2.3. - removed som added code in session.php
    18. 1.2.4. - add, posibilty to log guest users time

##

    1. ###############################################
    2. #########
    3. This MOD is released under the GPL License.
    4. Intellectual Property is retained by the MOD Author(s) listed above
    1. ###############################################
    2. #########
    3. For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
    4. latest version of this MOD. Downloading this MOD from other sites could cause malicious code
    5. to enter into your phpBB Forum. As such, phpBB will not offer support for MOD´s not offered
    6. in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
    1. ###############################################
    2. #########
    3. Authors Notes:

##

    1. Instead of runing the SQL commands your self, I have also included a db_update.php file
    2. if you are loged in as ADMIN, you can run this file, witch will do the neasessary changes to the DB
    3. the file will by it self put prefix on your tables, else
    4. if you are using a prefix to you DB tabels then you have to add this to
    5. the [ADD SQL] commands, e.g. "phpbb_users" instead of just "users" - ONLY
    6. in the initial [ADD SQL] commands, not in the php code !

##

##

    1. The most important thing to keep in mind is, take your time, make
    2. sure you are finding the correct lines to modify, then take care to paste the new code.
    3. Please also keep in mind, if you are using more than one language file or theme at your
    4. site, you will need to edit the corrosponding files for each occurrence. Good Luck!
    1. ###############################################
    2. ############
    3. Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
    4. and the Database
    1. ###############################################
    2. ############

#

  1. -----[ ADD SQL ]------------------------------------------

#

SQL-query:
ALTER TABLE users ADD user_lastlogon INT ( 11) DEFAULT ´0´

#

  1. -----[ ADD SQL ]------------------------------------------

#

SQL-query:
UPDATE users SET user_lastlogon=user_lastvisit

#

  1. -----[ ADD SQL ]------------------------------------------

#

SQL-query:
INSERT INTO config ( config_name, config_value) VALUES ( ´hidde_last_logon´, ´0´)

    1. ###############################################
    2. ###############

#

  1. -----[ OPEN ]------------------------------------------

#

language/lang_english/lang_main.php

#

  1. -----[ FIND ]------------------------------------------

#

  1. AT THE BOTTOM OF THE PAGE

//
// That´s all Folks!
//
-------------------------------------------------

#

  1. -----[ BEFORE, ADD ]------------------------------------------

#

//add to last visit mod
$lang[´Last_logon´] = ´Last Visit´;
$lang[´Hidde_last_logon´] = ´Hidden´;
$lang[´Never_last_logon´] = ´Never´;
$lang[´Users_today_zero_total´] = ´In total <b>0</b> users have visited this site today : : ´;
$lang[´Users_today_total´] = ´In total <b>%d</b> user have visited this site today : : ´;
$lang[´User_today_total´] = ´In total <b>%d</b> users have visited this site today : : ´;
$lang[´Users_lasthour_explain´] = ´, %d of them within the last hour.´;
$lang[´Users_lasthour_none_explain´] = ´´; //showen of none have visited the last hour, fill if you like

#

  1. -----[ OPEN ]------------------------------------------

#

index.php

#

  1. -----[ FIND ]------------------------------------------

#

//
// Start output of page

#

  1. -----[ BEFORE, ADD ]------------------------------------------

#

//show dayly users mod
$current_time=time();
$time1Hour=$current_time-3600;
$minutes = date(´is´, $current_time);
$hour_now = $current_time - ( 60*($minutes[0].$minutes[1])) - ( $minutes[2].$minutes[3]);
$dato=create_date(´H´, $current_time,$board_config[´board_timezone´]);
$timetoday = $hour_now - ( 3600*$dato);
$sql = ´SELECT session_ip, MAX(session_time) as session_time FROM ´.SESSIONS_TABLE.´ WHERE session_user_id="´.ANONYMOUS.´" AND session_time >= ´.$timetoday.´ AND session_time< ´.($timetoday+86399).´ GROUP BY session_ip´;
if ( !$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, "Couldn´t retrieve guest user today data", "", __LINE__, __FILE__, $sql);
while( $guest_list = $db->sql_fetchrow($result))
{
if ( $guest_list[´session_time´] >$time1Hour) $users_lasthour++;
}
$guests_today = $db->sql_numrows($result);
$sql = ´SELECT
user_id,username,user_allow_viewonline,user_level,
user_lastlogon FROM ´ . USERS_TABLE . ´ WHERE user_id!="´.ANONYMOUS.´" AND user_session_time >= ´.$timetoday.´ AND user_session_time< ´.($timetoday+86399).´ ORDER BY username´;
if ( !$result = $db->sql_query($sql)) message_die(GENERAL_ERROR, "Couldn´t retrieve user today data", "", __LINE__, __FILE__, $sql);
while( $todayrow = $db->sql_fetchrow($result))
{
$style_color = "";
if( $todayrow[´user_level´] == ADMIN )
{
$todayrow[´username´] = ´<b>´ . $todayrow[´username´] . ´</b>´;
$style_color = ´style="color:#´ . $theme[´fontcolor3´] . ´"´;
}
else if( $todayrow[´user_level´] == MOD )
{
$todayrow[´username´] = ´<b>´ . $todayrow[´username´] . ´</b>´;
$style_color = ´style="color:#´ . $theme[´fontcolor2´] . ´"´;
}
if ( $todayrow[´user_lastlogon´]>=$time1Hour)
{
$users_lasthour++;
}
$users_today_list . = ( $users_today_list&& ( $todayrow[´user_allow_viewonline´] || $userdata[user_level]==ADMIN))? ´, ´:´´;
$users_today_list.=( $todayrow[´user_allow_viewonline´])?´ <a href="´ . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $todayrow[´user_id´]) . ´"´ . $style_color . ´><b>´ . $todayrow[´username´] . ´</b></a>´:(($userdata[user_level]==ADMIN)?´ <a href="´ . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $todayrow[´user_id´]) . ´"´ . $style_color . ´><i>´ . $todayrow[´username´] . ´</i></a>´:´´);
if ( !$todayrow[´user_allow_viewonline´]) $logged_hidden_today++;
else $logged_visible_today++;
}
$total_users_today = $db->sql_numrows($result)+$guests_today;
if ( empty($total_users_today) )
{
$users_today_list = $lang[´None´];
}
$users_today_list = $lang[´Registered_users´].´ ´ . $users_today_list;
$l_today_user_s = ( $total_users_today) ? ( ( $total_users_today == 1 ) ? $lang[´User_today_total´] : $lang[´Users_today_total´] ) : $lang[´Users_today_zero_total´];
$l_today_r_user_s = ( $logged_visible_today) ? ( ( $logged_visible_today == 1 ) ? $lang[´Reg_user_total´] : $lang[´Reg_users_total´] ) : $lang[´Reg_users_zero_total´];
$l_today_h_user_s = ( $logged_hidden_today) ? ( ($logged_hidden_today == 1) ? $lang[´Hidden_user_total´] : $lang[´Hidden_users_total´] ) : $lang[´Hidden_users_zero_total´];
$l_today_g_user_s = ( $guests_today) ? ( ($guests_today == 1) ? $lang[´Guest_user_total´] : $lang[´Guest_users_total´]) : $lang[´Guest_users_zero_total´];
$l_today_users = sprintf($l_today_user_s, $total_users_today);
$l_today_users . = sprintf($l_today_r_user_s, $logged_visible_today);
$l_today_users . = sprintf($l_today_h_user_s, $logged_hidden_today);
$l_today_users . = sprintf($l_today_g_user_s, $guests_today);

#

  1. -----[ FIND ]------------------------------------------

#

´FORUM_LOCKED_IMG´ => $images[´forum_locked´],

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

´USERS_TODAY_LIST´ => $users_today_list,

´L_USERS_LASTHOUR´
=>($users_lasthour)?sprintf($lang[´Users_lasthour_
explain´],$users_lasthour):$lang[´Users_lasthour_n
one_explain´],
´L_USERS_TODAY´ =>$l_today_users,

#

  1. -----[ OPEN ]------------------------------------------

#

includes/sessions.php

#

  1. -----[ FIND ]------------------------------------------

#

if ( ! empty($session_id) )
{

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

$expiry_time = $current_time - $board_config[´session_length´] ;

#

  1. -----[ FIND ]------------------------------------------

#

$sql = "SELECT u.*, s.*
FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = ´$session_id´
AND u.user_id = s.session_user_id";

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

";

#

  1. -----[ IN-LINE BEFORE, ADD ]------------------------------------------

#

AND session_time > $expiry_time

#

  1. -----[ FIND ]------------------------------------------

#

$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_time < $expiry_time

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

session_time < $expiry_time

#

  1. -----[ IN-LINE REPLACE WITH ]------------------------------------------

#

UNIX_TIMESTAMP() - session_time >=172800

#

  1. -----[ FIND ]------------------------------------------

#

if ( $user_id ! = ANONYMOUS )
{
$last_visit = ( $userdata[´user_session_time´] > 0 ) ? $userdata[´user_session_time´] : $current_time;
$sql = "UPDATE " . USERS_TABLE . "

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

, user_lastvisit = $last_visit

#

  1. -----[ IN-LINE AFTER, ADD ]------------------------------------------

#

, user_lastlogon = " . time() . "

#

  1. -----[ OPEN ]------------------------------------------

#

includes/usercp_viewprofile.php

#

  1. -----[ FIND ]------------------------------------------

#

´JOINED´ => create_date($lang[´DATE_FORMAT´], $profiledata[´user_regdate´], $board_config[´board_timezone´]),

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

´L_LOGON´ => $lang[´Last_logon´],
´LAST_LOGON´ => ( $userdata[´user_level´] == ADMIN || ( !$board_config[´hidde_last_logon´] && $profiledata[´user_allow_viewonline´])) ? ( ($profiledata[´user_lastlogon´])? create_date($board_config[´default_dateformat´], $profiledata[´user_lastlogon´],
$board_config[´board_timezone´]):$lang[´Never_last
_logon´]):$lang[´Hidde_last_logon´],

#

  1. -----[ OPEN ]------------------------------------------

#

  1. ( make sure to edit this file for every theme you use).

templates/subsilver/index_body.tpl

#

  1. -----[ FIND ]------------------------------------------

#

<img src="templates/subSilver/images/whosonline.gif"

#

  1. -----[ IN-LINE FIND ]------------------------------------------
  2. if other mods installed the value could be different

rowspan="2"

#

  1. -----[ IN-LINE REPLACE WITH ]------------------------------------------

#

rowspan="3"

#

  1. -----[ FIND ]------------------------------------------

#

{NEWEST_USER}</span>
</td>
</tr>

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

<tr>
<td class="row1" align="left"><span
class="gensmall">{L_USERS_TODAY} {L_USERS_LAS
THOUR}<br />{USERS_TODAY_LIST}</br></span></td>
</tr>

#

  1. -----[ OPEN ]------------------------------------------
  2. ( make sure to edit this file for every theme you use).

templates/subsilver/profile_view_body.tpl

#

  1. -----[ FIND ]------------------------------------------

#

<td width="100%"><b><span class="gen">{JOINED}</span></b></td>
</tr>

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

<tr>
<td valign="middle" align="right"><span class="gen">{L_LOGON}: </span></td>
<td width="100%"><b><span class="gen">{LAST_LOGON}</span></b></td>
</tr>

#

  1. -----[ SAVE/CLOSE ALL FILES ]------------------------------------------

#

  1. EoM
Caloun
Caloun
Niveau 10
02 janvier 2003 à 13:47:30

Partie 2

    1. ###############################################
    2. ###
    3. Mod Title: Last Visit Member list Mod ( PART 2)
    4. Mod Version: 1.2.0
    5. Author: Niels Chr. Rød Denmark < ncr@db9.dk > http://mods.db9.dk

##

    1. This mod is for phpBB2 ver 2.0.2

##

    1. Description: This mod will enable users to see other users
    2. last visit in the memberlist, the information is stored already, but other users can not see
    3. it, after this mod, users can see when another user have last visited
    4. the board, this is shown in the memberlist.
    5. This feture support, user level and hidden users
    6. Admin will always be able to se all users last visit, regardless of the settings
    7. if board config is "off", then only admin can see the information
    8. if board is "on", then all users kan se other users last visit
    9. except hidden users, who always will be "hidden"
    10. only admin can sort by "last visit" since

##

##

##

    1. Installation Level: Easy
    2. Installation Time: 2-4 Minutes
    3. Files To Edit: 2
    4. memberlist.php
    5. templates/subsilver/member_body.tpl

##

    1. History:
    2. 1.0.10. - Last release for phpBB2 version 2.0.0.
    3. 1.2.0. - code updated for phpBB2 version 2.0.2.

##

    1. ###############################################
    2. #########
    3. This MOD is released under the GPL License.
    4. Intellectual Property is retained by the MOD Author(s) listed above
    1. ###############################################
    2. #########
    3. For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
    4. latest version of this MOD. Downloading this MOD from other sites could cause malicious code
    5. to enter into your phpBB Forum. As such, phpBB will not offer support for MOD´s not offered
    6. in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
    1. ###############################################
    2. #########
    3. Authors Notes:

##

    1. This mod Asumes that "Last Visit PART 1" mod have already be made !

##

    1. The most important thing to keep in mind is, take your time, make
    2. sure you are finding the correct lines to modify, then take care to paste the new code.
    3. Please also keep in mind, if you are using more than one language file or theme at your
    4. site, you will need to edit the corrosponding files for each occurrence. Good Luck!

##

    1. ###############################################
    2. ############
    3. Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
    4. and the Database
    1. ###############################################
    2. ############

#

  1. -----[ OPEN ]------------------------------------------

#

memberlist.php

#

  1. -----[ FIND ]------------------------------------------

#

$order_by = "user_regdate ASC LIMIT $start, " . $board_config[´topics_per_page´];
break;

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

case ´lastlogon´:
$order_by = ( $userdata[´user_level´] == ADMIN ) ? "user_lastlogon $sort_order LIMIT $start, " . $board_config[´topics_per_page´] : "username $sort_order LIMIT $start, " . $board_config[´topics_per_page´];
break;

#

  1. -----[ FIND ]------------------------------------------

#

$sql = "SELECT username, user_id

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

, user_regdate

#

  1. -----[ IN-LINE AFTER, ADD ]------------------------------------------

#

, user_lastlogon, user_allow_viewonline

#

  1. -----[ FIND ]------------------------------------------

#

$mode_types_text = array($lang

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

(

#

  1. -----[ IN-LINE AFTER, ADD ]------------------------------------------

#

$lang[´Last_logon´],

#

  1. -----[ FIND ]------------------------------------------

#

$mode_types = array(

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

(

#

  1. -----[ IN-LINE AFTER, ADD ]------------------------------------------

#

´lastlogon´,

#

  1. -----[ FIND ]------------------------------------------

#

for($i = 0

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

0

#

  1. -----[ IN-LINE REPLACE WITH ]------------------------------------------

#

( $userdata[´user_level´] == ADMIN ) ? 0:1

#

  1. -----[ FIND ]------------------------------------------

#

´L_ICQ´ => $lang[´ICQ´],

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

´L_LOGON´ => $lang[´Last_logon´],

#

  1. -----[ FIND ]------------------------------------------

#

´JOINED´ => $joined,

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

´LAST_LOGON´ => ( $userdata[´user_level´] == ADMIN || ( !$board_config[´hidde_last_logon´] && $row[´user_allow_viewonline´])) ? ( ($row[´user_lastlogon´])? create_date($board_config[´default_dateformat´], $row[´user_lastlogon´],
$board_config[´board_timezone´]):$lang[´Never_last
_logon´]):$lang[´Hidde_last_logon´],

#

  1. -----[ OPEN ]------------------------------------------

#

  1. ( make sure to edit this file for every theme you use).

templates/subsilver/memberlist_body.tpl

#

  1. -----[ FIND ]------------------------------------------

#

<th class="thTop" nowrap="nowrap">{L_JOINED}</th>

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

<th class="thTop" nowrap="nowrap">{L_LOGON}</th>

#

  1. -----[ FIND ]------------------------------------------

#

<span class="gensmall">{memberrow.JOINED}</span></td>

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span
class="gensmall">{memberrow.LAST_LOGON}</span></td

#

  1. -----[ FIND ]------------------------------------------

#

<td class="catbottom" colspan="

#

  1. -----[ IN-LINE FIND ]------------------------------------------
  2. if other mods installed, the value can be different, increase it by one

colspan="8"

#

  1. -----[ IN-LINE REPLACE WITH ]------------------------------------------

#

colspan="9"

#

  1. -----[ SAVE/CLOSE ALL FILES ]------------------------------------------

#

  1. EoM
Caloun
Caloun
Niveau 10
02 janvier 2003 à 13:48:24

Partie 3:

    1. ###############################################
    2. ###
    3. Mod Title: Last Visit Admin Mod
    4. Mod Version: 1.2.0.
    5. Author: Niels Chr. Denmark < ncr@db9.dk > ( Niels Chr. Rød) HTTP://mods.db9.dk

##

    1. Description: This mod is part 3, of a Last visit mod.
    2. It will make it posible for a administrator to control if
    3. last visit are displayed to ordenary users or only admin

##

    1. This mod is for phpBB2 ver 2.0.2

##

##

    1. Installation Level: Easy
    2. Installation Time: 5-10 Minutes
    3. Files To Edit: 3
    4. admin/admin_board.php
    5. language/lang_english/lang_admin.php
    6. templates/subsilver/board_config_body.tpl

##

    1. History:
    2. 0.9.0. - initial release for phpBB2 RC-2
    3. 1.0.0. - initial release for phpBB2 ver 2.0.0.
    4. 1.0.1. - minor change to lang_admin.php
    5. 1.2.0. - now confirmed for phpBB2 version 2.0.2.

##

    1. ###############################################
    2. #########
    3. This MOD is released under the GPL License.
    4. Intellectual Property is retained by the MOD Author(s) listed above
    1. ###############################################
    2. #########
    3. For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
    4. latest version of this MOD. Downloading this MOD from other sites could cause malicious code
    5. to enter into your phpBB Forum. As such, phpBB will not offer support for MOD´s not offered
    6. in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
    1. ###############################################
    2. #########
    3. Authors Notes:
    4. remember to include minimum PART 1 of the last visit mod before this PART 3

##

    1. The most important thing to keep in mind is, take your time, make
    2. sure you are finding the correct lines to modify, then take care to paste the new code.
    3. Please also keep in mind, if you are using more than one language file or theme at your
    4. site, you will need to edit the correct files for each occurrence. Good Luck!
    1. ###############################################
    2. ###

#

  1. -----[ OPEN ]------------------------------------------

#

  1. ( make sure to edit this file for every language your admin uses).

language/lang_english/lang_admin.php

#

  1. -----[ FIND ]------------------------------------------

#

  1. AT THE BOTTOM OF THE PAGE

//
// That´s all Folks!
//
-------------------------------------------------

#

  1. -----[ BEFORE, ADD ]------------------------------------------

#

//Added Last Visit mod
$lang[´Hidde_last_logon´] = "Hidde last logon time";
$lang[´Hidde_last_logon_expain´] = "If this is set to yes, users last logon time, is hidden to other users except administrators";

#

  1. -----[ OPEN ]------------------------------------------

#

admin/admin_board.php

#

  1. -----[ FIND ]------------------------------------------

#

$prune_no = ( ! $new[´prune_enable´] ) ? "checked=\"checked\"" : "";

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

$hidde_last_logon_yes = ( $new[´hidde_last_logon´] ) ? "checked=\"checked\"" : "";
$hidde_last_logon_no = ( ! $new[´hidde_last_logon´] ) ? "checked=\"checked\"" : "";

#

  1. -----[ FIND ]------------------------------------------

#

"L_ENABLE_PRUNE" => $lang[´Enable_prune´],

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

"L_HIDDE_LAST_LOGON" => $lang[´Hidde_last_logon´],
"L_HIDDE_LAST_LOGON_EXPLAIN" => $lang[´Hidde_last_logon_expain´],

#

  1. -----[ FIND ]------------------------------------------

#

"PRUNE_NO" => $prune_no,

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

"HIDDE_LAST_LOGON_YES" => $hidde_last_logon_yes,
"HIDDE_LAST_LOGON_NO" => $hidde_last_logon_no,

#

  1. -----[ OPEN ]------------------------------------------

#

  1. ( make sure to edit this file for every theme your admin uses).

templates/subSilver/admin/board_config_body.tpl

#

  1. -----[ FIND ]------------------------------------------

#

{PRUNE_NO} /> {L_NO}</td>
</tr>

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

<tr>
<td class="row1">{L_HIDDE_LAST_LOGON}<br /><span
class="gensmall">{L_HIDDE_LAST_LOGON_EXPLAIN}</spa
n></td>
<td class="row2"><input type="radio" name="hidde_last_logon" value="1" {HIDDE_LAST_LOGON_YES} /> {L_YES} <input type="radio" name="hidde_last_logon" value="0" {HIDDE_LAST_LOGON_NO} /> {L_NO}</td>
</tr>

#

  1. -----[ SAVE/CLOSE ALL FILES ]------------------------------------------

#

  1. EoM
Coms
Coms
Niveau 10
02 janvier 2003 à 13:48:39

ben voila...pour moi,c´est du pure charabia : -Þ

j´y connais rien : )

amdforever
amdforever
Niveau 10
02 janvier 2003 à 13:48:55

"Installation Level: Easy

    1. Installation Time: 10-15 Minutes "

Hum Hum ; )

Caloun
Caloun
Niveau 10
02 janvier 2003 à 13:49:12

Partie 4: ( Fin)

    1. ###############################################
    2. ###
    3. Mod Title: Last Visit Mod PART 4 ( require part 1)
    4. Mod Version: 0.9.7
    5. Author: Niels Chr. Rød Denmark < ncr@db9.dk > http://mods.db9.dk

##

    1. This mod is for phpBB2 ver 2.0.2

##

    1. Description: Part 4, will add the information to the users profile, about how meny time the user have visited the site,
    2. and how long time the users have spend on the forum in total, and the last time he/she visited the site, and finaly how meny page hits he/she have had

##

    1. After this part 4 I have added a "switch" to the template "system", so you can use
    2. <!-- BEGIN switch_user_is_moderator --> and <!-- END switch_user_is_moderator -->
    3. or you can use <!-- BEGIN switch_user_is_not_moderator --> and <!-- END switch_user_is_not_moderator -->
    4. this can be used in any template, and together with any other information, NOT only this mod.
    5. This mod uses this, to hide the uses online information so it is only showen to ADMIN/MODERATORS in the users profile

##

    1. Installation Level: Easy
    2. Installation Time: 5-10 Minutes
    3. Files To Edit: 6
    4. language/lang_english/lang_main.php
    5. includes/usercp_viewprofile.php
    6. includes/sessions.php
    7. includes/page_header.php
    8. includes/functions.php
    9. templates/subsilver/profile_view_body.tpl

##

    1. History:
    2. 0.9.0. - Beta release of PART 4
    3. 0.9.1. - changed the initial SQL, so the starting time are 0 for all users
    4. 0.9.2. - changed the update SQL in session.php
    5. 0.9.3. - changed some code in usercp_viewprofile.php, causing wrong info
    6. 0.9.4. - changed the IN-LINE,FIND in session.php, causing a "error in your SQL syntax"
    7. 0.9.5. - now also include users PAGE HITS
    8. 0.9.6. - changed some code in usercp_viewprofile.php, causing wrong page hits
    9. 0.9.7. - add, guest users time can be logged

##

    1. ###############################################
    2. #########
    3. This MOD is released under the GPL License.
    4. Intellectual Property is retained by the MOD Author(s) listed above
    1. ###############################################
    2. #########
    3. For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
    4. latest version of this MOD. Downloading this MOD from other sites could cause malicious code
    5. to enter into your phpBB Forum. As such, phpBB will not offer support for MOD´s not offered
    6. in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
    1. ###############################################
    2. #########
    3. Authors Notes:

##

    1. PART 4 of this mod, require PART 1
    2. Instead of runing the SQL commands your self, I have also included a db_update.php file
    3. if you are loged in as ADMIN, you can run this file, witch will do the neasessary changes to the DB
    4. the file will by it self put prefix on your tables, else
    5. if you are using a prefix to you DB tabels then you have to add this to
    6. the [ADD SQL] commands, e.g. "phpbb_users" instead of just "users" - ONLY
    7. in the initial [ADD SQL] commands, not in the php code !

##

##

    1. The most important thing to keep in mind is, take your time, make
    2. sure you are finding the correct lines to modify, then take care to paste the new code.
    3. Please also keep in mind, if you are using more than one language file or theme at your
    4. site, you will need to edit the corrosponding files for each occurrence. Good Luck!
    1. ###############################################
    2. ############
    3. Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
    4. and the Database
    1. ###############################################
    2. ############

#

  1. -----[ ADD SQL ]------------------------------------------

#

ALTER TABLE users ADD user_totaltime INT ( 11) DEFAULT ´0´

#

  1. -----[ ADD SQL ]------------------------------------------

#

ALTER TABLE users ADD user_totallogon SMALLINT ( 5) DEFAULT ´0´

#

  1. -----[ ADD SQL ]------------------------------------------

#

ALTER TABLE users ADD user_totalpages INT ( 11) not null

#

  1. -----[ ADD SQL ]------------------------------------------

#

UPDATE users SET user_session_time = user_lastlogon

#

  1. -----[ ADD SQL ]------------------------------------------

#

UPDATE users SET user_totallogon = 1 WHERE user_session_time<>0

    1. ###############################################
    2. ###############

#

  1. -----[ OPEN ]------------------------------------------

#

language/lang_english/lang_main.php

#

  1. -----[ FIND ]------------------------------------------

#

//add to last visit mod

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

$lang[´Years´] = ´Years´;
$lang[´Year´] = ´Year´;
$lang[´Weeks´] = ´Weeks´;
$lang[´Week´] = ´Week´;
$lang[´Day´] = ´Day´;
$lang[´Total_online_time´] = ´Total Online Duration´;
$lang[´Last_online_time´] = ´Last Online Duration´;
$lang[´Number_of_visit´] = ´Number of visits´;
$lang[´Number_of_pages´] = ´Number of page hits´;

#

  1. -----[ OPEN ]------------------------------------------

#

includes/sessions.php

#

  1. -----[ FIND ]------------------------------------------

#

if ( $user_id ! = ANONYMOUS )
{
$last_visit = ( $userdata[´user_session_time´] > 0 ) ? $userdata[´user_session_time´] : $current_time;
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

time() . "

#

  1. -----[ IN-LINE AFTER, ADD ]------------------------------------------

#

, user_totallogon=user_totallogon+1

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

if

#

  1. -----[ IN-LINE BEFORE ADD ]------------------------------------------

#

//

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

{

#

  1. -----[ IN-LINE BEFORE ADD ]------------------------------------------

#

//

#

  1. -----[ FIND ]------------------------------------------

#

$sessiondata[´userid´] = $user_id;
}

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

}

#

  1. -----[ IN-LINE BEFORE ADD ]------------------------------------------

#

//

#

  1. -----[ FIND ]------------------------------------------

#

if ( $userdata[´user_id´] ! = ANONYMOUS )
{
$sql = "UPDATE " . USERS_TABLE . "

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

if

#

  1. -----[ IN-LINE BEFORE ADD ]------------------------------------------

#

//

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

{

#

  1. -----[ IN-LINE BEFORE ADD ]------------------------------------------

#

//

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

SET

#

  1. -----[ IN-LINE AFTER ADD ]------------------------------------------

#

user_totalpages=user_totalpages+1,
user_totaltime=user_totaltime+($current_time-".$us
erdata[´session_time´]."),

#

  1. -----[ FIND ]------------------------------------------

#

}

//
// Delete expired sessions

#

  1. -----[ IN-LINE FIND ]------------------------------------------

#

}

#

  1. -----[ IN-LINE BEFORE ADD ]------------------------------------------

#

//

#

  1. -----[ OPEN ]------------------------------------------

#

includes/usercp_viewprofile.php

#

  1. -----[ FIND ]------------------------------------------

#

´LAST_LOGON´ => ( $userdata[´user_level´] == ADMIN || ( !$board_config[´hidde_last_logon´] && $profiledata[´user_allow_viewonline´])) ? ( ($profiledata[´user_lastlogon´])? create_date($board_config[´default_dateformat´], $profiledata[´user_lastlogon´],
$board_config[´board_timezone´]):$lang[´Never_last
_logon´]):$lang[´Hidde_last_logon´],

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

´L_TOTAL_ONLINE_TIME´ => $lang[´Total_online_time´],
´TOTAL_ONLINE_TIME´ => make_hours($profiledata[´user_totaltime´]),
´L_LAST_ONLINE_TIME´ => $lang[´Last_online_time´],
´LAST_ONLINE_TIME´ =>
make_hours($profiledata[´user_session_time´]-$prof
iledata[´user_lastlogon´]),
´L_NUMBER_OF_VISIT´ => $lang[´Number_of_visit´],
´NUMBER_OF_VISIT´ => ( $profiledata[´user_totallogon´]>0) ? $profiledata[´user_totallogon´]: $lang[´None´],
´L_NUMBER_OF_PAGES´ => $lang[´Number_of_pages´],
´NUMBER_OF_PAGES´ => ( $profiledata[´user_totalpages´]) ? $profiledata[´user_totalpages´]: $lang[´None´],

#

  1. -----[ OPEN ]------------------------------------------

#

includes/functions.php

#

  1. -----[ FIND ]------------------------------------------

#

? >

#

  1. -----[ BEFORE, ADD ]------------------------------------------

#

function make_hours($base_time)
{
global $lang;
$years = floor($base_time/31536000);
$base_time = $base_time - ( $years*31536000);
$weeks = floor($base_time/604800);
$base_time = $base_time - ( $weeks*604800);
$days = floor($base_time/86400);
$base_time = $base_time - ( $days*86400);
$hours = floor($base_time/3600);
$base_time = $base_time - ( $hours*3600);
$min = floor($base_time/60);
$sek = $base_time - ( $min*60);
if ( $sek<10) $sek =´0´.$sek;
if ( $min<10) $min =´0´.$min;
if ( $hours<10) $hours =´0´.$hours;
$result=(($years)?$years.´ ´.(($years==1)?$lang[´Year´]:$lang[´Years´]).´, ´:´´).
(($years || $weeks)?$weeks.´ ´.(($weeks==1)?$lang[´Week´]:$lang[´Weeks´]).´, ´:´´).
(($years || $weeks || $days) ? $days.´ ´.(($days==1)?$lang[´Day´]:$lang[´Days´]).´, ´:´´).
(($hours)?$hours.´:´:´00:´).(($min)?$min.´:´ : ´00:´).$sek;
return ( $result)?$result:$lang[´None´];
}

#

  1. -----[ OPEN ]------------------------------------------

#

includes/page_header.php

#

  1. -----[ FIND ]------------------------------------------

#

//
// Get basic ( usernames + totals) online

#

  1. -----[ BEFORE, ADD ]------------------------------------------

#

if ( ! $userdata[´user_level´]==MOD )
{

$template->assign_block_vars(´switch_user_is_not_
moderator´, array());
} else
{

$template->assign_block_vars(´switch_user_is_mode
rator´, array());
}

#

  1. -----[ OPEN ]------------------------------------------
  2. ( make sure to edit this file for every theme you use).

templates/subsilver/profile_view_body.tpl

#

  1. -----[ FIND ]------------------------------------------

#

<td width="100%"><b><span class="gen">{LAST_LOGON}</span></b></td>
</tr>

#

  1. -----[ AFTER, ADD ]------------------------------------------

#

<!-- BEGIN switch_user_is_moderator -->
<tr>
<td valign="middle" align="right"><span
class="gen">{L_TOTAL_ONLINE_TIME}: </span></t
d>
<td width="100%"><b><span class="gen">{TOTAL_ONLINE_TIME}</span></b></td>
</tr>
<tr>
<td valign="middle" align="right"><span
class="gen">{L_LAST_ONLINE_TIME}: </span></td

<td width="100%"><b><span class="gen">{LAST_ONLINE_TIME}</span></b></td>
</tr>
<tr>
<td valign="middle" align="right"><span
class="gen">{L_NUMBER_OF_VISIT}: </span></td>

<td width="100%"><b><span class="gen">{NUMBER_OF_VISIT}</span></b></td>
</tr>
<tr>
<td valign="middle" align="right"><span
class="gen">{L_NUMBER_OF_PAGES}: </span></td>

<td width="100%"><b><span class="gen">{NUMBER_OF_PAGES}</span></b></td>
</tr>

<!-- END switch_user_is_moderator -->

#

  1. -----[ SAVE/CLOSE ALL FILES ]------------------------------------------

#

  1. EoM
amdforever
amdforever
Niveau 10
02 janvier 2003 à 13:49:51

Bah tout est expliqué je vois pas le problemes...

Caloun
Caloun
Niveau 10
02 janvier 2003 à 13:51:27

ba vi fais le moi alors si t si malin que ca ! !

j´ai déja tester et c parti legeremet en sucette avec la partie sql, je ne sais pas pkoi d´ailleurs

Dominator-fr
Dominator-fr
Niveau 10
02 janvier 2003 à 14:00:38

deja que jaimerai fair mon site avec 3foto de mmon pc alor ca!

Caloun
Caloun
Niveau 10
02 janvier 2003 à 14:04:45

Il me faut tout de même quelqu´un pour ce mod, en plus faut traduire kk truc en french pour pas que ca apparaisse en francais sur le forum

L0ULL0UTEZ
L0ULL0UTEZ
Niveau 3
02 janvier 2003 à 14:04:56

tout cela me parait evident . je vois pas ou est le probleme caloun .

Wolferyne
Wolferyne
Niveau 10
02 janvier 2003 à 14:05:13

Caloun c´est un script pour quoi déjà?

Caloun
Caloun
Niveau 10
02 janvier 2003 à 14:09:01

L0ULL0UTEZ Posté le 02 janvier 2003 à 14:04:56
tout cela me parait evident . je vois pas ou est le probleme caloun .

--> LoL louloutez

Caloun
Caloun
Niveau 10
02 janvier 2003 à 14:10:26

Wolferyne Posté le 02 janvier 2003 à 14:05:13
Caloun c´est un script pour quoi déjà?

--> C´est pour mettre en place le Mod LastVisit

Wolferyne
Wolferyne
Niveau 10
02 janvier 2003 à 14:44:40

Le truc c´est que tu veux savoir quand est venu la dernière personne sur ton site c´est ça ?

Sous forums
  • Aide à l'achat Mac
  • Création de sites web
  • Création de Jeux
  • Linux
  • Programmation
  • Internet
  • Steam Deck
  • Macintosh
  • Hardware
La vidéo du moment