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
L´autre fois,je te disais que le phpbb etait plus facillement manipulable,apparement non...je retire ce que j´ai dis! lol : )
UP! : )
Non c´est asez chaud parfois, ca dépend des mods que t´install, yen a ki sont corsé à mettre en place ! !
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(
cela depasse mes competence dsl!
attendez je vous dis ce qu´il faut faire, on sais jamais si il ya kk1 d´interresser
Partie 1:
##
##
##
##
##
##
##
##
##
##
#
#
SQL-query:
ALTER TABLE users ADD user_lastlogon INT ( 11) DEFAULT ´0´
#
#
SQL-query:
UPDATE users SET user_lastlogon=user_lastvisit
#
#
SQL-query:
INSERT INTO config ( config_name, config_value) VALUES ( ´hidde_last_logon´, ´0´)
#
#
language/lang_english/lang_main.php
#
#
//
// That´s all Folks!
//
-------------------------------------------------
#
#
//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
#
#
index.php
#
#
//
// Start output of page
#
#
//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);
#
#
´FORUM_LOCKED_IMG´ => $images[´forum_locked´],
#
#
´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,
#
#
includes/sessions.php
#
#
if ( ! empty($session_id) )
{
#
#
$expiry_time = $current_time - $board_config[´session_length´] ;
#
#
$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";
#
#
";
#
#
AND session_time > $expiry_time
#
#
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_time < $expiry_time
#
#
session_time < $expiry_time
#
#
UNIX_TIMESTAMP() - session_time >=172800
#
#
if ( $user_id ! = ANONYMOUS )
{
$last_visit = ( $userdata[´user_session_time´] > 0 ) ? $userdata[´user_session_time´] : $current_time;
$sql = "UPDATE " . USERS_TABLE . "
#
#
, user_lastvisit = $last_visit
#
#
, user_lastlogon = " . time() . "
#
#
includes/usercp_viewprofile.php
#
#
´JOINED´ => create_date($lang[´DATE_FORMAT´], $profiledata[´user_regdate´], $board_config[´board_timezone´]),
#
#
´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´],
#
#
templates/subsilver/index_body.tpl
#
#
<img src="templates/subSilver/images/whosonline.gif"
#
rowspan="2"
#
#
rowspan="3"
#
#
{NEWEST_USER}</span>
</td>
</tr>
#
#
<tr>
<td class="row1" align="left"><span
class="gensmall">{L_USERS_TODAY} {L_USERS_LAS
THOUR}<br />{USERS_TODAY_LIST}</br></span></td>
</tr>
#
templates/subsilver/profile_view_body.tpl
#
#
<td width="100%"><b><span class="gen">{JOINED}</span></b></td>
</tr>
#
#
<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>
#
#
Partie 2
##
##
##
##
##
##
##
##
##
##
#
#
memberlist.php
#
#
$order_by = "user_regdate ASC LIMIT $start, " . $board_config[´topics_per_page´];
break;
#
#
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;
#
#
$sql = "SELECT username, user_id
#
#
, user_regdate
#
#
, user_lastlogon, user_allow_viewonline
#
#
$mode_types_text = array($lang
#
#
(
#
#
$lang[´Last_logon´],
#
#
$mode_types = array(
#
#
(
#
#
´lastlogon´,
#
#
for($i = 0
#
#
0
#
#
( $userdata[´user_level´] == ADMIN ) ? 0:1
#
#
´L_ICQ´ => $lang[´ICQ´],
#
#
´L_LOGON´ => $lang[´Last_logon´],
#
#
´JOINED´ => $joined,
#
#
´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´],
#
#
templates/subsilver/memberlist_body.tpl
#
#
<th class="thTop" nowrap="nowrap">{L_JOINED}</th>
#
#
<th class="thTop" nowrap="nowrap">{L_LOGON}</th>
#
#
<span class="gensmall">{memberrow.JOINED}</span></td>
#
#
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span
class="gensmall">{memberrow.LAST_LOGON}</span></td
#
#
<td class="catbottom" colspan="
#
colspan="8"
#
#
colspan="9"
#
#
Partie 3:
##
##
##
##
##
##
##
#
#
language/lang_english/lang_admin.php
#
#
//
// That´s all Folks!
//
-------------------------------------------------
#
#
//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";
#
#
admin/admin_board.php
#
#
$prune_no = ( ! $new[´prune_enable´] ) ? "checked=\"checked\"" : "";
#
#
$hidde_last_logon_yes = ( $new[´hidde_last_logon´] ) ? "checked=\"checked\"" : "";
$hidde_last_logon_no = ( ! $new[´hidde_last_logon´] ) ? "checked=\"checked\"" : "";
#
#
"L_ENABLE_PRUNE" => $lang[´Enable_prune´],
#
#
"L_HIDDE_LAST_LOGON" => $lang[´Hidde_last_logon´],
"L_HIDDE_LAST_LOGON_EXPLAIN" => $lang[´Hidde_last_logon_expain´],
#
#
"PRUNE_NO" => $prune_no,
#
#
"HIDDE_LAST_LOGON_YES" => $hidde_last_logon_yes,
"HIDDE_LAST_LOGON_NO" => $hidde_last_logon_no,
#
#
templates/subSilver/admin/board_config_body.tpl
#
#
{PRUNE_NO} /> {L_NO}</td>
</tr>
#
#
<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>
#
#
ben voila...pour moi,c´est du pure charabia : -Þ
j´y connais rien : )
"Installation Level: Easy
Hum Hum ; )
Partie 4: ( Fin)
##
##
##
##
##
##
##
##
##
#
#
ALTER TABLE users ADD user_totaltime INT ( 11) DEFAULT ´0´
#
#
ALTER TABLE users ADD user_totallogon SMALLINT ( 5) DEFAULT ´0´
#
#
ALTER TABLE users ADD user_totalpages INT ( 11) not null
#
#
UPDATE users SET user_session_time = user_lastlogon
#
#
UPDATE users SET user_totallogon = 1 WHERE user_session_time<>0
#
#
language/lang_english/lang_main.php
#
#
//add to last visit mod
#
#
$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´;
#
#
includes/sessions.php
#
#
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
#
#
time() . "
#
#
, user_totallogon=user_totallogon+1
#
#
if
#
#
//
#
#
{
#
#
//
#
#
$sessiondata[´userid´] = $user_id;
}
#
#
}
#
#
//
#
#
if ( $userdata[´user_id´] ! = ANONYMOUS )
{
$sql = "UPDATE " . USERS_TABLE . "
#
#
if
#
#
//
#
#
{
#
#
//
#
#
SET
#
#
user_totalpages=user_totalpages+1,
user_totaltime=user_totaltime+($current_time-".$us
erdata[´session_time´]."),
#
#
}
//
// Delete expired sessions
#
#
}
#
#
//
#
#
includes/usercp_viewprofile.php
#
#
´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´],
#
#
´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´],
#
#
includes/functions.php
#
#
? >
#
#
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´];
}
#
#
includes/page_header.php
#
#
//
// Get basic ( usernames + totals) online
#
#
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());
}
#
templates/subsilver/profile_view_body.tpl
#
#
<td width="100%"><b><span class="gen">{LAST_LOGON}</span></b></td>
</tr>
#
#
<!-- 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 -->
#
#
Bah tout est expliqué je vois pas le problemes...
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
deja que jaimerai fair mon site avec 3foto de mmon pc alor ca!
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
tout cela me parait evident . je vois pas ou est le probleme caloun .
Caloun c´est un script pour quoi déjà?
L0ULL0UTEZ Posté le 02 janvier 2003 à 14:04:56
tout cela me parait evident . je vois pas ou est le probleme caloun .
--> LoL louloutez
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
Le truc c´est que tu veux savoir quand est venu la dernière personne sur ton site c´est ça ?