4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Apollo13 on May 27, 2003, 05:03:56 PM



Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 27, 2003, 05:03:56 PM
DEUTSCH
========================================

So also zu erst einmal möchte ich sagen, dass dies mein erster eigener Mod ist, den ich hier veröffentliche. An dieser Stelle großes Lob an V@no der mir mal wieder dabei geholfen hat :lol:
Übersicht:
Mit diesem Mod kannst du die letzen Aktiven Benutzer anzeigen lassen mit User Name und Datum.

Geänderte Dateien:
- includes/page_header.php
- lang/<deine Sprache>/main.php

Neue Dateien:
- templates/<dein Template>/user_last_action_box.html

Installation

WICHTIG: Mache vorher von diesen Dateien ein Backup

1.)
Öffne die Datei includes/page_header.php und füge folgenen Code ein:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 5";
    $result = $site_db->query($sql);

    while ($row = $site_db->fetch_array($result)) {
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
    }

$site_template->register_vars(array(
  "lang_user_last_action" => $lang['lang_user_last_action'],    
  "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
  unset($user_last_action_box);
  unset($last_action_user_list);

Einfach vor dem einfügen und abspeichern

Anmerkung:
Wenn du du mehr als 5 letze aktive User anzeigen willst, änder einfach dies hier:
Einfach die gewünschte Zahl einfügen.

2.)
Erstelle ein neues Templateie user_last_action_box.html

Hier kannst du nun folgende Tag verwenden:

- {lang_user_last_action} Für die Anzeige der Überschrift
- {user_last_action_list} Für die Anzeige der Liste

Beispiel:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td class="head1">
      <table width="100%" border="0" cellspacing="0" cellpadding="3">
        <tr>
          <td valign="top" class="head1">{lang_user_last_action}</td>
        </tr>
        <tr>
          <td valign="top" class="row2">{user_last_action_list}</td>
        </tr>
      </table>
    </td>
  </tr>
</table>

3.)
Öffne die lang/<deine Sprache>/main.php und füge irgendwo aber vor dem

folgendes ein:

1
2
3
4
//-----------------------------------------------------
//--- Last active User ---------------------------------
//-----------------------------------------------------
$lang['lang_user_last_action'] = "Letze aktive User";

Feritg!

So nachdem du alle Dateien gespeichert hast und upgelaodet hast, kannst du überall in deinen Templates den Tag {user_last_action_box} einfügen und die Liste wird angezeigt.

ENGLSIH
===================================
Well this is the first mod i published. At this place much thanks 2 V@no who always help me. :lol:
Overview:
With this mod u can display the last active members with username and date.

Files 2 modify:
- includes/page_header.php
- lang/<your language>/main.php

New files:
- templates/<your template>/user_last_action_box.html

Installation

Important: Backup all files before u change something!!!

1.)
Open includes/page_header.php and add this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 5";
    $result = $site_db->query($sql);

    while ($row = $site_db->fetch_array($result)) {
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
    }

$site_template->register_vars(array(
  "lang_user_last_action" => $lang['lang_user_last_action'],    
  "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
  unset($user_last_action_box);
  unset($last_action_user_list);

U must add this before the
Tip:
If u want 2 display more than the last 5 users just edit this line into the number u want 2 display:

2.)
Create a new template user_last_action_box.html

U can use the following tags:

- {lang_user_last_action} Displayes headline
- {user_last_action_list} displayes last user list

Example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td class="head1">
      <table width="100%" border="0" cellspacing="0" cellpadding="3">
        <tr>
          <td valign="top" class="head1">{lang_user_last_action}</td>
        </tr>
        <tr>
          <td valign="top" class="row2">{user_last_action_list}</td>
        </tr>
      </table>
    </td>
  </tr>
</table>

3.)
Open lang/<your language>/main.php and add this before the

1
2
3
4
//-----------------------------------------------------
//--- Last active User ---------------------------------
//-----------------------------------------------------
$lang['lang_user_last_action'] = "Last active users";

Finished!

Well just save all files and uplaod them. Now u can use {user_last_action_box} on every template u want 2 display the last user list.


Title: [Mod] Letze aktive User / Last active users
Post by: toto1 on May 27, 2003, 06:45:29 PM
excellent mod thk


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 28, 2003, 09:47:56 PM
well have u updated yet, because i made some changes...


Title: [Mod] Letze aktive User / Last active users
Post by: V@no on May 29, 2003, 05:00:25 AM
when user is invisible, this mod will still show him in the list.
to fix that, find in the MOD's code:
1
WHERE user_level >= '".GUEST."'
replace it with:
1
WHERE user_level >= '".GUEST."' AND user_invisible = 0
or if u still want to see "invisible" users when u logged in as administrator (or when u are not admin and in invis, but still want to be showed in the list :
1
WHERE user_level >= '".GUEST."'".(($user_info['user_level'] == ADMIN) ? "" : " AND user_invisible = 0")." OR user_id = ".$user_info['user_id']."


Title: [Mod] Letze aktive User / Last active users
Post by: matthias44 on May 29, 2003, 01:46:23 PM
Hallo,

ich habs bei mir versucht, aber es klappt nicht!

Es zeigt mir einfach nichts an!

AN was kann das liegen?

mfg
Matthias


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 29, 2003, 01:50:51 PM
Hast du alles so gemacht wie beschrieben? Also wenn du das so gemacht haben solltest, müsste eigentlich alles gehen. Achja. HAst du den {user_last_action_box} in deinem TEmplate eingebaut. Zum Beispiel in der home.html? Weil sonst kann nüx angezeit werden


Title: [Mod] Letze aktive User / Last active users
Post by: matthias44 on May 29, 2003, 01:53:25 PM
Danke für die schnelle Antwort!

siehs dir selber mal an:

http://213.133.99.14/gallery/

hab alles so gemacht wies dasteht, es zeigt mir ja auch die  {lang_user_last_action} an nur die list halt nicht!


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 29, 2003, 01:58:00 PM
Ups da war ein Bug IM Code. Nimm mal diesen hier:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 5";
    $result = $site_db->query($sql);

    while ($row = $site_db->fetch_array($result)) {
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
    }

$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
  "user_last_action_box" => $user_last_action_box,
  "lang_user_last_action" => $lang['lang_user_last_action'],    
  "user_last_action_list" => $last_action_user_list
));
  unset($user_last_action_box);
  unset($last_action_user_list);


Title: [Mod] Letze aktive User / Last active users
Post by: matthias44 on May 29, 2003, 02:00:25 PM
Super es klappt!

Vielen Danke.

Matthias44


Title: ADD ON
Post by: Apollo13 on May 29, 2003, 11:15:43 PM
DEUTSCH
==================

Mit V@nos Hilfe hab ich gerade nen kleines addon gebastelt, welches "Heute" anzeigt, wenn das Datum innerhalb der letzen 24 Stunden liegt

1.)
Ersetze:

1
2
3
4

while ($row = $site_db->fetch_array($result)) {
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
    }


mit:

UPDATE am 31.05.2003
1
2
3
4
5
6
7
8
9

while ($row = $site_db->fetch_array($result)) {
    if($row['user_lastaction'] >= time() - 86400){
   $last_user_date = $lang['lang_user_last_today'];
   }else {
   $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
   }    
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
    }


2.)
in der main.php suche nach:
1
2

$lang['lang_user_last_action'] = "Letze aktive User";

und füge das dahinter ein:
1
2

$lang['lang_user_last_today'] = "Heute";


English
==================

With V@nos help i create a little addon, which displays "Today" if the date was included the last 24 hours

1.)
Replace:

1
2
3
4

while ($row = $site_db->fetch_array($result)) {
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
    }


with:

UPDATED 31.05.2003
1
2
3
4
5
6
7
8
9

 while ($row = $site_db->fetch_array($result)) {
    if($row['user_lastaction'] >= time() - 86400){
   $last_user_date = $lang['lang_user_last_today'];
   }else {
   $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
   }    
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
    }


2.)
in main.php find:
1
2

$lang['lang_user_last_action'] = "Last active User";

add after:
1
2

$lang['lang_user_last_today'] = "Today";


Title: [Mod] Letze aktive User / Last active users
Post by: Bany on May 30, 2003, 05:10:39 PM
Hm so geh es ja aber nach den Umbau das "heute" Angezeigt wird geht nichts mehr auf der Seite.


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 30, 2003, 11:57:55 PM
hmmm ichs chaus mir nochma an...


EDIT. ALso soweit cih das sehen konnte ist der code vollkommen richtig...

ICh frag V@no nochma...


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 31, 2003, 08:56:39 AM
Quote from: Bany   [Expand]
Hm so geh es ja aber nach den Umbau das "heute" Angezeigt wird geht nichts mehr auf der Seite.


HMmm immer wieder diese kleinen Bugs im Code...

So nun hier aber die gefixte Version...

UPDATE am 12.06.2003
1
2
3
4
5
6
7
8
9

while ($row = $site_db->fetch_array($result)) {
    if(date("dmy", $row['user_lastaction']) == date("dmy")) {
   $last_user_date = $lang['lang_user_last_today'];
   }else {
   $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
   }    
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
    }


Title: [Mod] Letze aktive User / Last active users
Post by: Bany on May 31, 2003, 11:28:49 AM
Na geht nun fast ist mir grade Ausgefallen. Heute soll doch nur heute Angezeigt werden. Ich war gester auf deiner Seite und werde immer noch mit Heute Angezeigt. Mußt du noch mal schauen woran das liegt. ich habe keine Ahnung von php.

Bany


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 31, 2003, 11:35:24 AM
doch das stimmt schon... DA du innerhalb der letzen 24 Stunden online warst bei mir. Also ich habe festgelegt, das heute in einem ZEitraum von 24 Stunden angezeigt wird... Kann man aber hier ändern

1
2

time() - 86400)


8640 stellt sich wie folgt zusammen: 60*60*24 wobei 24 die zahl der Stunden ist. wenn du also nur 12 Stunden haben willst, dann schautd as so aus:

1
2

time() - 60 * 60 * 12)



EDIT: IN der neuen VErsion ist das alles nicht mehr nötig, da es anders läuft. DIe Anzeige ist jetzt richtig!!!


Title: [Mod] Letze aktive User / Last active users
Post by: Bany on May 31, 2003, 11:45:33 AM
Hm aber wenn ich auf 12 stelle wäre ich ja nach 12 Stunden nicht mehr heute da gewesen. Würde in um 8.00 Uhr kommen wäre ich ja um 20.00 Uhr nicht mehr als Heute Angezeigt. Oder sehe ich das falsch ?
Man müßte noch das Datum mit ein beziehen glaube ich damit heute richtig Angezeit wird.


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on May 31, 2003, 12:08:10 PM
ja ok ich verstehe was du meinst... hmmm dann werd ich nochma an ner anderen version basteln...


Title: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on June 12, 2003, 05:41:15 PM
NEUE VErsion des ADDONS

UPDATE am 12.06.2003
1
2
3
4
5
6
7
8
9

while ($row = $site_db->fetch_array($result)) {
    if(date("dmy", $row['user_lastaction']) == date("dmy")) {
   $last_user_date = $lang['lang_user_last_today'];
   }else {
   $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
   }    
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
    }


Title: Re: [Mod] Letze aktive User / Last active users
Post by: universal on March 16, 2005, 11:00:06 AM
will this mod work with 4images 1.7.1?
and if it`s possible to change something to adopt it, please help ;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on March 17, 2005, 12:20:10 PM
i dont know if this will work in 1.71

in 1.7 its successfully tested


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on March 17, 2005, 12:42:07 PM
@ Cr@zy Sash,
danke für diesen kleinen Blickfang ...  :wink:
Quote  [Expand]
in 1.7 its successfully tested
kann ich voll und ganz bestätigen  :!:
mawenzi


Title: Re: [Mod] Letze aktive User / Last active users
Post by: bewibo on March 19, 2005, 11:25:32 AM
also ich habs unter der 1.71 nicht zum laufen gekriegt (kann nat. auch an mir liegen ^^)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ascanio on April 06, 2005, 07:35:22 PM
hi I have follow all the step and I don see the last user on the box :S
you can see in here www.girlsandgirls.tk on the right colum


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on April 06, 2005, 07:46:53 PM
hi I have follow all the step and I don see the last user on the box :S
you can see in here www.girlsandgirls.tk on the right colum

well u are running version 1.71-. This mod is only created and tested with 1.7


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ascanio on April 06, 2005, 07:56:18 PM
ok :( thanks!


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on April 06, 2005, 08:42:02 PM

well maybe i create this also 4 version 1,71...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ascanio on April 06, 2005, 09:43:16 PM
ok :) thanks!


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on April 07, 2005, 12:33:19 AM
with the new template engine, u can not parse template and then register tags for it, tags must be registered before parsing a template (that's actualy should be done in the first place, but we were spoiled with v1.7 that didnt care about it).

so, replace
1
2
3
4
5
6
$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
with:
1
2
3
4
5
$site_template->register_vars(array(
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ascanio on April 07, 2005, 12:49:49 AM
Thanks V@no


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on April 07, 2005, 07:01:49 AM
with the new template engine, u can not parse template and then register tags for it, tags must be registered before parsing a template (that's actualy should be done in the first place, but we were spoiled with v1.7 that didnt care about it).

so, replace
1
2
3
4
5
6
$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
with:
1
2
3
4
5
$site_template->register_vars(array(
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));

well very interessing...

now i know how 2 use the new template engine...;-)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ascanio on April 30, 2005, 11:05:51 PM
Hi I want to show the personal picture nest to the name but i'm getting errors i have try this:

1
$sql = "SELECT user_name, user_id, userpic, user_lastaction FROM ".USERS_TABLE."

and this:

1
$last_action_user_list .= "<img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "noimage.png" : $row['userpic']).'" width="37" height="39"><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";

What i'mdoing wrong?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on May 01, 2005, 04:39:22 AM
letslets see...u've mentioned about an error messages but u didnt provide it - thats wrong ;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on May 04, 2005, 12:53:49 PM
Hey Cr@zy Sash,

ist es möglich zu dem ADD-ON für heute, trotzdem die Uhrzeit anzeigen zu lassen?

z.B.
Toso - Heute - 12:53


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on May 09, 2005, 09:00:57 AM
Vielleicht jemand ne Idee?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on June 15, 2005, 09:37:18 AM
Hey Cr@zy Sash,

ist es möglich zu dem ADD-ON für heute, trotzdem die Uhrzeit anzeigen zu lassen?

z.B.
Toso - Heute - 12:53

Huhu? Kannst du mir helfen, Cr@zy Sash?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on June 15, 2005, 04:18:33 PM
hmmm schick mir am besten mal deine gesamten code vom addon


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on June 16, 2005, 09:04:58 AM
Das ist meine page_header.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: page_header.php                                      *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) f&uuml;r weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

// Cache Templates
$template_list 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset(
$templates_used) && $templates_used != "") {
  $template_list $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);

//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------
$total_images 0;
$total_categories 0;
$auth_cat_sql['auth_viewcat']['IN'] = 0;
$auth_cat_sql['auth_viewcat']['NOTIN'] = 0;
if (!empty(
$cat_cache)) {
  foreach ($cat_cache as $key => $val) {
    if (check_permission("auth_viewcat"$key)) {
      $total_categories++;
      if (isset($val['num_images'])) {
        $total_images += $val['num_images'];
      }
      else {
        $cat_cache[$key]['num_images'] = 0;
      }
      $auth_cat_sql['auth_viewcat']['IN'] .= ", ".$key;
    }
    else {
      $auth_cat_sql['auth_viewcat']['NOTIN'] .= ", ".$key;
    }
  }
}

$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,
  "thumb_url" => THUMB_PATH,
  "icon_url" => ICON_PATH,
  "template_url" => TEMPLATE_PATH,
  "template_image_url" => TEMPLATE_PATH."/images",
  "template_lang_image_url" => TEMPLATE_PATH."/images_".$config['language_dir'],
  "site_name" => $config['site_name'],
  "site_email" => $config['site_email'],
  "self" => $site_sess->url($self_url),
  "self_full" => $site_sess->url($script_url."/".$self_url),
  "script_version" => SCRIPT_VERSION,
  "cp_link" => ($user_info['user_level'] != ADMIN) ? "" "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Control Panel</a>]</p>\n",
  "total_categories" => $total_categories,
  "total_images" => $total_images,
  "url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
  "url_top_images" => $site_sess->url(ROOT_PATH."top.php"),
  "url_potm_link" => $site_sess->url(ROOT_PATH."potm.php"),
  "url_top_cat_images" => $site_sess->url(ROOT_PATH."top.php".(($cat_id && preg_match("/categories.php/"$self_url)) ? "?".URL_CAT_ID."=".$cat_id "")),
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
  "url_search" => $site_sess->url(ROOT_PATH."search.php"),
  "url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),
  "url_userlist" => $site_sess->url(ROOT_PATH."memberlist.php"),
  "url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
  "url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  "url_home" => $site_sess->url(ROOT_PATH."index.php"),
  "url_login" => (!empty($url_login)) ? $site_sess->url($url_login) : $site_sess->url(ROOT_PATH."login.php"),
  "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
  "url_member" => (!empty($url_member)) ? $site_sess->url($url_member) : $site_sess->url(ROOT_PATH."member.php"),
  "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
  "url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword")
));

if (!empty(
$additional_urls)) {
  $register_array = array();
  foreach ($additional_urls as $key => $val) {
    $register_array[$key] = $site_sess->url($val);
  }
  $site_template->register_vars($register_array);
}

// Replace Globals in $lang
$lang $site_template->parse_array($lang);

$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_registered_user" => $lang['registered_user'],
  "lang_random_image" => $lang['random_image'],
  "lang_categories" => $lang['categories'],
  "lang_sub_categories" => $lang['sub_categories'],
  "lang_new_images" => $lang['new_images'],
  "lang_top_images" => $lang['top_images'],
  "lang_potm_link" => $lang['potm_link'],
  "lang_search" => $lang['search'],
  "lang_advanced_search" => $lang['advanced_search'],
  "lang_lightbox" => $lang['lightbox'],
  "lang_userlist_title" => $lang['lang_userlist_title'],
  "lang_register" => $lang['register'],
  "lang_control_panel" => $lang['control_panel'],
  "lang_login" => $lang['login'],
  "lang_auto_login" => $lang['lang_auto_login'],
  "lang_logout" => $lang['logout'],
  "lang_lost_password" => $lang['lost_password'],
  "lang_user_name" => $lang['user_name'],
  "lang_password" => $lang['password'],
  "lang_go" => $lang['go'],
  "lang_images_per_page" => $lang['images_per_page'],
  "lang_user_online" => $lang['user_online'],
  "lang_user_online_detail" => $lang['user_online_detail'],
  "charset" => $lang['charset'],
  "direction" => $lang['direction']
));

//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------
$category_dropdown_selfjump get_category_dropdown($cat_id1);
$site_template->register_vars("category_dropdown_selfjump"$category_dropdown_selfjump);
$category_dropdown_form $site_template->parse_template("category_dropdown_form");
$site_template->register_vars(array("category_dropdown_form" => $category_dropdown_form));

$site_template->un_register_vars("category_dropdown_selfjump");
unset(
$category_dropdown_selfjump);
unset(
$category_dropdown_form);

//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image();
$site_template->register_vars("random_image"$random_image);
unset(
$random_image);

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  $setperpage intval($HTTP_POST_VARS['setperpage']);
  if ($setperpage) {
    $site_sess->set_session_var("perpage"$setperpage);
    $session_info['perpage'] = $setperpage;
  }
}

if (isset(
$session_info['perpage'])) {
  $perpage $session_info['perpage'];
}
else {
  $perpage ceil($config['default_image_rows'] * $config['image_cells']);
}

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
$setperpage_dropdown "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";
for(
$i 1$i <= $config['custom_row_steps']; $i++) {
  $setvalue $config['image_cells'] * $i;
  $setperpage_dropdown .= "<option value=\"".$setvalue."\"";
    if ($setvalue == $perpage) {
    $setperpage_dropdown .= " selected=\"selected\"";
  }
  $setperpage_dropdown .= ">";
  $setperpage_dropdown .= $setvalue;
  $setperpage_dropdown .= "</option>\n";
}
$setperpage_dropdown .= "</select>\n";
if (
$cat_id != 0) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
}
if (isset(
$show_result) && $show_result == 1) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
}
$site_template->register_vars("setperpage_dropdown"$setperpage_dropdown);
$setperpage_dropdown_form $site_template->parse_template("setperpage_dropdown_form");
$site_template->register_vars("setperpage_dropdown_form"$setperpage_dropdown_form);

$site_template->un_register_vars("setperpage_dropdown");
unset(
$setperpage_dropdown);
unset(
$setperpage_dropdown_form);

//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  else {
    $msg $lang['lightbox_register'];
  }
}
if (
$action == "removefromlightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  else {
    $msg $lang['lightbox_register'];
  }
}
if (
$action == "clearlightbox") {
  if ($user_info['user_level'] >= USER) {
    $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  else {
    $msg $lang['lightbox_register'];
  }
}

//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if ($action == "rateimage" && $id) {
  $rating intval($HTTP_POST_VARS['rating']);
  $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME "4images_";
  $cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
  if ($rating && $rating <= MAX_RATING && $id) {
    if (!isset($session_info['rated_imgs'])) {
      $session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
    }    
    $split_list 
= array();
    if (!empty($session_info['rated_imgs'])) {
      $split_list explode(" "$session_info['rated_imgs']);
    }
    if (!in_array($id$split_list) && !in_array($id$cookie_rated)) {
      $session_info['rated_imgs'] .= " ".$id;
      $session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      $site_sess->set_session_var("rated_imgs"$session_info['rated_imgs']);
      $cookie_rated[] = $id;
      $cookie_expire time() + 60 60 24 4;
      setcookie($cookie_name.'rated'serialize($cookie_rated), $cookie_expireCOOKIE_PATHCOOKIE_DOMAINCOOKIE_SECURE);
      update_image_rating($id$rating);
      $msg $lang['voting_success'];
    }
    else {
      $msg $lang['already_voted'];
    }
  }
  else {
    $msg $lang['voting_error'];
  }
}

//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
  $header $site_template->parse_template("header");
  $footer $site_template->parse_template("footer");
  $site_template->register_vars(array(
    "header" => $header,
    "footer" => $footer
  
));
  unset($header);
  unset($footer);
}

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
  $site_template->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"$user_info['user_name'], $lang['lang_loggedin_msg']));
  $user_box $site_template->parse_template("user_logininfo");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 1,
    "user_loggedout" => 0,
    "is_admin" => ($user_info['user_level'] == ADMIN) ? 0
  
));  
  $site_template
->un_register_vars("user_logininfo");
  unset($user_box);
}
else {
  $user_box $site_template->parse_template("user_loginform");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 0,
    "user_loggedout" => 1,
    "is_admin" => 0
  
));
  $site_template->un_register_vars("user_loginform");
  unset($user_box);
}
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '"
.GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 10"
;
    $result $site_db->query($sql);

while (
$row $site_db->fetch_array($result)) { 
   if(date("dmy"$row['user_lastaction']) == date("dmy")) { 
  $last_user_date $lang['lang_user_last_today']; 
  }else { 
  $last_user_date format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']); 
  }    
  $last_action_user_list 
.= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>"
   }

$user_last_action_box $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
  "user_last_action_box" => $user_last_action_box,
  "lang_user_last_action" => $lang['lang_user_last_action'],
  "user_last_action_list" => $last_action_user_list
));
  unset($user_last_action_box);
  unset($last_action_user_list);
?>



Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on June 16, 2005, 11:13:22 AM
1
2
3
4
5
6
7
8
while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']); 
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }   
  $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
   }

tausch den block einfach aus


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on June 16, 2005, 12:20:41 PM
Perfekt.  :mrgreen:
Vielen Vielen Danke!!!!!!!!!!


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Apollo13 on June 16, 2005, 12:28:01 PM
Perfekt.  :mrgreen:
Vielen Vielen Danke!!!!!!!!!!

np


Title: Re: [Mod] Letze aktive User / Last active users
Post by: geohei on August 20, 2005, 02:18:33 AM
Also bei mir geht gar nix. Ich habe 1.7.1 und hier sind alle Schritte die ich gemacht habe dokumentiert.
http://www.geohei.lu/geoheiBB/viewtopic.php?t=429

Würde mich freuen wenn mir jemand sagen könnte was hier schief läuft.

Grüße,


Title: Re: [Mod] Letze aktive User / Last active users
Post by: udaman on August 31, 2005, 01:26:42 AM
Hi everyone! Can someone tell me what I need to change to exclude Admins from this list. We have 3 Admins and I don't want them to show up in a list. Thanks!


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on August 31, 2005, 02:32:45 AM
hi udaman,
replace this :
1
2
3
...
WHERE user_level >= '".GUEST."'
...
with this :
1
2
3
...
WHERE user_level < '".ADMIN."'
...

mawenzi


Title: Re: [Mod] Letze aktive User / Last active users
Post by: udaman on August 31, 2005, 05:34:34 AM
I am actually using the following code and I tried replacing the WHERE user_level >= '".GUEST."' part with your code but it didn't do anything:

1
WHERE user_level >= '".GUEST."'".(($user_info['user_level'] == ADMIN) ? "" : " AND user_invisible = 0")." OR user_id = ".$user_info['user_id']."

Thank you for replying though!


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on August 31, 2005, 09:56:20 AM
... test it with IE (logged in) and at the same time with FF (not logged in) ... and you see the difference ...  :!:

mawenzi


Title: Re: [Mod] Letze aktive User / Last active users
Post by: udaman on September 03, 2005, 10:34:37 AM
It works! Thank you very very much!


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on September 03, 2005, 09:02:54 PM
For users who installed this MOD :

http://www.4homepages.de/forum/index.php?topic=9567.0

and would like to combine it with this one,

follow these steps.

In your includes/page_header.php file,

find :

Quote  [Expand]

SELECT user_name, user_id, user_lastaction


replace with :

1
2
3

SELECT user_name, user_id, user_lastaction, profile_hits


Then, find :

Quote  [Expand]

$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";


replace with :

1
2
3
4
5

$profile_hits = ($config['profile_hits_activation'] == 1) ? $lang['profile_hits'] . REPLACE_EMPTY . $row['profile_hits'] : $lang['profile_hits'] . REPLACE_EMPTY . $lang['profile_hits_na'];

$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><br>".$profile_hits."<br><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";


Then, find :

Quote  [Expand]

unset($user_last_action_box);
unset($last_action_user_list);


replace with :

1
2
3
4
5

unset($user_last_action_box);
unset($last_action_user_list);
unset($profile_hits);


It should work. ;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Rookie79 on September 04, 2005, 09:11:25 PM
Hi I want to show the personal picture nest to the name but i'm getting errors i have try this:

1
$sql = "SELECT user_name, user_id, userpic, user_lastaction FROM ".USERS_TABLE."

and this:

1
$last_action_user_list .= "<img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "noimage.png" : $row['userpic']).'" width="37" height="39"><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";

What i'mdoing wrong?

at first the error "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in..." was shown but now, nothing happend.
What's wrong or how can i implement the "Member personal Photo" MOD?

Thanx


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 06, 2005, 12:27:25 PM
Is it possible to show the userpic next to the Username?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 06, 2005, 01:55:10 PM
Wenn i try :
Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "member.jpg" : $row['userpic']).'" width="30" height="30">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span></td></tr></table><br>';

you can see the "member.jpg"to all users.

Wenn i try :
Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.$row['user_id'].'.jpg" width="37" height="39">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['userpic'].'</span></td></tr></table><br>';

Now you can see the userpics but the "member.jpg" does not show up for the users they have not upload a picture


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 11:06:16 AM
Wenn i try :
Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "member.jpg" : $row['userpic']).'" width="30" height="30">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span></td></tr></table><br>';

you can see the "member.jpg"to all users.

Wenn i try :
Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.$row['user_id'].'.jpg" width="37" height="39">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['userpic'].'</span></td></tr></table><br>';

Now you can see the userpics but the "member.jpg" does not show up for the users they have not upload a picture

Any ideas?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 11:52:55 AM
Habe jetzt keine Lust den ganzen Thread zu lesen daher poste doch mal den kompletten Code dann schaue ich es mir mal an...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 01:12:40 PM
Hier meine page_header.php. Der rote Teil ist der interessante.


Quote  [Expand]
<?php
/**************************************************************************
*                                                                        *
*    4images - A Web Based Image Gallery Management System               *
*    ----------------------------------------------------------------    *
*                                                                        *
*             File: page_header.php                                      *
*        Copyright: (C) 2002 Jan Sorgalla                                *
*            Email: jan@4homepages.de                                    *
*              Web: http://www.4homepages.de                             *
*    Scriptversion: 1.7                                                  *
*                                                                        *
*    Never released without support from: Nicky (http://www.nicky.net)   *
*                                                                        *
**************************************************************************
*                                                                        *
*    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
*    bedingungen (Lizenz.txt) f&uuml;r weitere Informationen.                 *
*    ---------------------------------------------------------------     *
*    This script is NOT freeware! Please read the Copyright Notice       *
*    (Licence.txt) for further information.                              *
*                                                                        *
*************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

// Cache Templates
$template_list = 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset($templates_used) && $templates_used != "") {
  $template_list = $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);

//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------
$total_images = 0;
$total_categories = 0;
$auth_cat_sql['auth_viewcat']['IN'] = 0;
$auth_cat_sql['auth_viewcat']['NOTIN'] = 0;
if (!empty($cat_cache)) {
  foreach ($cat_cache as $key => $val) {
    if (check_permission("auth_viewcat", $key)) {
      $total_categories++;
      if (isset($val['num_images'])) {
        $total_images += $val['num_images'];
      }
      else {
        $cat_cache[$key]['num_images'] = 0;
      }
      $auth_cat_sql['auth_viewcat']['IN'] .= ", ".$key;
    }
    else {
      $auth_cat_sql['auth_viewcat']['NOTIN'] .= ", ".$key;
    }
  }
}

$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,
  "thumb_url" => THUMB_PATH,
  "icon_url" => ICON_PATH,
  "template_url" => TEMPLATE_PATH,
  "template_image_url" => TEMPLATE_PATH."/images",
  "template_lang_image_url" => TEMPLATE_PATH."/images_".$config['language_dir'],
  "site_name" => $config['site_name'],
  "site_email" => $config['site_email'],
  "self" => $site_sess->url($self_url),
  "self_full" => $site_sess->url($script_url."/".$self_url),
  "script_version" => SCRIPT_VERSION,
  "cp_link" => ($user_info['user_level'] != ADMIN) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Control Panel</a>]</p>\n",
  "total_categories" => $total_categories,
  "total_images" => $total_images,
  "url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
  "url_top_images" => $site_sess->url(ROOT_PATH."top.php"),
  "url_potm_link" => $site_sess->url(ROOT_PATH."potm.php"),
  "url_top_cat_images" => $site_sess->url(ROOT_PATH."top.php".(($cat_id && preg_match("/categories.php/", $self_url)) ? "?".URL_CAT_ID."=".$cat_id : "")),
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
  "url_search" => $site_sess->url(ROOT_PATH."search.php"),
  "url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),
  "url_userlist" => $site_sess->url(ROOT_PATH."memberlist.php"),
  "url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
  "url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  "url_home" => $site_sess->url(ROOT_PATH."index.php"),
  "url_login" => (!empty($url_login)) ? $site_sess->url($url_login) : $site_sess->url(ROOT_PATH."login.php"),
  "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
  "url_member" => (!empty($url_member)) ? $site_sess->url($url_member) : $site_sess->url(ROOT_PATH."member.php"),
  "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
  "url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword")
));

if (!empty($additional_urls)) {
  $register_array = array();
  foreach ($additional_urls as $key => $val) {
    $register_array[$key] = $site_sess->url($val);
  }
  $site_template->register_vars($register_array);
}

// Replace Globals in $lang
$lang = $site_template->parse_array($lang);

$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_registered_user" => $lang['registered_user'],
  "lang_random_image" => $lang['random_image'],
  "lang_categories" => $lang['categories'],
  "lang_sub_categories" => $lang['sub_categories'],
  "lang_new_images" => $lang['new_images'],
  "lang_top_images" => $lang['top_images'],
  "lang_potm_link" => $lang['potm_link'],
  "lang_search" => $lang['search'],
  "lang_advanced_search" => $lang['advanced_search'],
  "lang_lightbox" => $lang['lightbox'],
  "lang_userlist_title" => $lang['lang_userlist_title'],
  "lang_register" => $lang['register'],
  "lang_control_panel" => $lang['control_panel'],
  "lang_login" => $lang['login'],
  "lang_auto_login" => $lang['lang_auto_login'],
  "lang_logout" => $lang['logout'],
  "lang_lost_password" => $lang['lost_password'],
  "lang_user_name" => $lang['user_name'],
  "lang_password" => $lang['password'],
  "lang_go" => $lang['go'],
  "lang_images_per_page" => $lang['images_per_page'],
  "lang_user_online" => $lang['user_online'],
  "lang_user_online_detail" => $lang['user_online_detail'],
  "charset" => $lang['charset'],
  "direction" => $lang['direction']
));

//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------
$category_dropdown_selfjump = get_category_dropdown($cat_id, 1);
$site_template->register_vars("category_dropdown_selfjump", $category_dropdown_selfjump);
$category_dropdown_form = $site_template->parse_template("category_dropdown_form");
$site_template->register_vars(array("category_dropdown_form" => $category_dropdown_form));

$site_template->un_register_vars("category_dropdown_selfjump");
unset($category_dropdown_selfjump);
unset($category_dropdown_form);

//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image", $random_image);
unset($random_image);

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  $setperpage = intval($HTTP_POST_VARS['setperpage']);
  if ($setperpage) {
    $site_sess->set_session_var("perpage", $setperpage);
    $session_info['perpage'] = $setperpage;
  }
}

if (isset($session_info['perpage'])) {
  $perpage = $session_info['perpage'];
}
else {
  $perpage = ceil($config['default_image_rows'] * $config['image_cells']);
}

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
$setperpage_dropdown = "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";
for($i = 1; $i <= $config['custom_row_steps']; $i++) {
  $setvalue = $config['image_cells'] * $i;
  $setperpage_dropdown .= "<option value=\"".$setvalue."\"";
    if ($setvalue == $perpage) {
    $setperpage_dropdown .= " selected=\"selected\"";
  }
  $setperpage_dropdown .= ">";
  $setperpage_dropdown .= $setvalue;
  $setperpage_dropdown .= "</option>\n";
}
$setperpage_dropdown .= "</select>\n";
if ($cat_id != 0) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
}
if (isset($show_result) && $show_result == 1) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
}
$site_template->register_vars("setperpage_dropdown", $setperpage_dropdown);
$setperpage_dropdown_form = $site_template->parse_template("setperpage_dropdown_form");
$site_template->register_vars("setperpage_dropdown_form", $setperpage_dropdown_form);

$site_template->un_register_vars("setperpage_dropdown");
unset($setperpage_dropdown);
unset($setperpage_dropdown_form);

//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "removefromlightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "clearlightbox") {
  if ($user_info['user_level'] >= USER) {
    $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}

//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if ($action == "rateimage" && $id) {
  $rating = intval($HTTP_POST_VARS['rating']);
  $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
  $cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
  if ($rating && $rating <= MAX_RATING && $id) {
    if (!isset($session_info['rated_imgs'])) {
      $session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
    }   
    $split_list = array();
    if (!empty($session_info['rated_imgs'])) {
      $split_list = explode(" ", $session_info['rated_imgs']);
    }
    if (!in_array($id, $split_list) && !in_array($id, $cookie_rated)) {
      $session_info['rated_imgs'] .= " ".$id;
      $session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      $site_sess->set_session_var("rated_imgs", $session_info['rated_imgs']);
      $cookie_rated[] = $id;
      $cookie_expire = time() + 60 * 60 * 24 * 4;
      setcookie($cookie_name.'rated', serialize($cookie_rated), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
      update_image_rating($id, $rating);
      $msg = $lang['voting_success'];
    }
    else {
      $msg = $lang['already_voted'];
    }
  }
  else {
    $msg = $lang['voting_error'];
  }
}

//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
  $header = $site_template->parse_template("header");
  $footer = $site_template->parse_template("footer");
  $site_template->register_vars(array(
    "header" => $header,
    "footer" => $footer
  ));
  unset($header);
  unset($footer);
}

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
  $site_template->register_vars("lang_loggedin_msg", preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU", $user_info['user_name'], $lang['lang_loggedin_msg']));
  $user_box = $site_template->parse_template("user_logininfo");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 1,
    "user_loggedout" => 0,
    "is_admin" => ($user_info['user_level'] == ADMIN) ? 1 : 0
  )); 
  $site_template->un_register_vars("user_logininfo");
  unset($user_box);
}
else {
  $user_box = $site_template->parse_template("user_loginform");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 0,
    "user_loggedout" => 1,
    "is_admin" => 0
  ));
  $site_template->un_register_vars("user_loginform");
  unset($user_box);
}
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 10";
    $result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']); 
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }   
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.$row['user_id'].'.jpg" width="37" height="39">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['userpic'].'</span></td></tr></table><br>'; 
 }


$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
  "user_last_action_box" => $user_last_action_box,
  "lang_user_last_action" => $lang['lang_user_last_action'],
  "user_last_action_list" => $last_action_user_list
));
  unset($user_last_action_box);
  unset($last_action_user_list);
?>



Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 02:32:18 PM
1
...cleared...

Versuche das mal


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 02:57:34 PM
Hey Danke für deine Mühe, aber trotzdem funktioniert es noch nicht so ganz.   :?

Jetzt wird bei jedem User das "member.jpg" angezeigt. Außerdem wird das lastlogin-Datum nicht mehr dargestellt.




Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 05:16:42 PM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction, userpic FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 10";
    $result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']);
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  } 
$userpic = $row['userpic'];
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" width="30" height="30">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span></td></tr></table><br>';
}

Sorry hatte was drin vergessen... )o:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 07:08:47 PM
Sehr cool.  Es funktioniert :mrgreen:

Einzige Schönheisfehler, das lastlogin-Datum wird nicht mehr dargestellt.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 07:35:28 PM
wie heisst es genau was nicht dargestellt wird?
Meinste "user_lastaction"?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 07:38:10 PM
wie heisst es genau was nicht dargestellt wird?
Meinste "user_lastaction"?
Ja genau...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 07:40:17 PM
1
...cleared...

Und jetzt?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 07:43:13 PM
Jetzt ist das Datum da aber bei jedem User wird wieder das member.jpg angezeigt.  :mrgreen:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 07:49:42 PM
Nur mal so zur Info, in der Datei von Dir war das Datum auch nicht mit drin.
Soll ich Dir das jetzt frickeln oder wie?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 07:56:30 PM
Nur mal so zur Info, in der Datei von Dir war das Datum auch nicht mit drin.
Soll ich Dir das jetzt frickeln oder wie?

Sorry, das Datum war in der allerersten Version drin. In meiner geposteten war es auch nicht da. Völlig übersehen. Brauchst nix frickeln. Wollte dir hier nicht immer mehr unterjubeln.
Trotzdem Danke. Klappt ja auch soweit...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on October 13, 2005, 08:00:37 PM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction, userpic FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 10";
$result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
if(date("dmy", $row['user_lastaction']) == date("dmy")) {
$last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']);
}else {
$last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
}
$userpic = $image_row['userpic'];
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" width="30" height="30">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span></td></tr></table><br><span class=\"smalltext\">'.$last_user_date.'</span>';
}

Und das?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on October 13, 2005, 08:13:29 PM
Nö.. :cry:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Nasser on November 08, 2005, 05:54:41 PM
I installed this MOD .. wonderfull thank you ..
but I have a small problem which I'm looking for a help here please :

I installed this MOD (( and )) an other MOD which is " Top 25 Uploaders "
it's here : http://www.4homepages.de/forum/index.php?topic=7678.0

the results are :

2 results ...
the first is : Most 25 Uploaders --> working fine
the second is : Last Active Users ---> not ! this group shows (( Top Uploaders + Last Active Users )) together in the same group!

can you help in this please ..


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on November 09, 2005, 02:58:06 AM
/me didnt understand the problem


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Nasser on November 09, 2005, 07:52:30 PM
ok .. sorry for my poor english ;)
this is what I mean :


(http://www.emarati.net/gallery/V@no.jpg)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on November 10, 2005, 12:06:55 AM
for this mod:
Above the code from Step 1 insert this line:
1
$last_action_user_list = "";

for "Top 25 Uploaders" mod:
Above the code from Step 2 insert this line:
1
$last_action_user_list = "";


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Nasser on November 10, 2005, 01:19:20 AM
that was very helpful
it's working great now :D:D

thank you !


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on November 10, 2005, 01:25:06 AM
To avoid this happend to somebody else, I've updated both mods :)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on November 16, 2005, 06:11:47 PM
funktioniert das nur mit der v1.7 ?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Acidgod on November 19, 2005, 03:13:05 PM
read the Post from V@no in this Thread:
http://www.4homepages.de/forum/index.php?topic=5911.msg32228#msg32228

With this modification this Mod will work for 1.71 i think...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: geohei on November 19, 2005, 03:17:56 PM
With this modification this Mod will work for 1.71 i think...

Yes, I have it running with 1.7.1.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on November 23, 2005, 05:38:28 PM
ist es möglich diesen mod zu erweitern so das jeder user sehen kann wer zuletzt sein profil besucht hat?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on November 28, 2005, 03:57:02 PM
well, maybe in english

is it possible to change this mod so that every user can see on his profile who last visited it?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Loda on December 02, 2005, 09:59:20 AM
hallo!
is it possible to hide users own name so that  user can't see his own name in the list ?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on December 02, 2005, 01:56:03 PM
is it possible to hide users own name so that  user can't see his own name in the list ?

Soll der User prinzipell seinen Namen nicht sehen ?
Oder ...
Soll der User nach Einstellung im Kontrollzentrum seinen Namen nicht sehen ?
(diese Variante funktioniert eigentlich schon ... wenn der User -Online-Status verstecken- aktiviert hat ...)

mawenzi


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Loda on December 02, 2005, 03:46:02 PM
er soll seinen namen nur in der " Letzte aktive User / Last active users" - Liste nicht sehen...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on December 03, 2005, 04:16:42 AM
hallo!
is it possible to hide users own name so that user can't see his own name in the list ?
Try replace
1
                WHERE user_level >= '".GUEST."'
with:
1
                WHERE user_level >= '".USER."' AND user_id <> ".$user_info['user_id']."


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on December 03, 2005, 03:33:42 PM
ich hab jetzt einfach mal versucht diese code in de member.php einzufügen, damit jeder user sehen kann wer zuletzt auf seinem profil war.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'
                   ORDER BY user_lastaction DESC
                LIMIT 5";
   $result = $site_db->query($sql);

   while ($row = $site_db->fetch_array($result)) {
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
   }

$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
 unset($user_last_action_box);
 unset($last_action_user_list);

das funktioniert aber nicht weil mir dann im profil gar nix angezeigt wird...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on December 04, 2005, 12:23:14 AM
@Jako,
1. Nur mit dem Einfügen des Codes in die member.php passiert auf deinen Memberseiten noch garnichts.
2. Mit der zusätzlichen Einbindung der Tags {user_last_action_box} und {lang_user_last_action} in deinen Member-Templates wird dir dann die Last-User-Box angezeigt.
3. Diese Last-User-Box zeigt dir dann aber selbstverständlich immer noch die letzten Besucher auf der Website (nicht nur im Profil) an, da du aus der 'USER_TABLE' die 'user_lastaction' ausliest und wie gesagt, betrifft das die gesamte Website.
4. Für die Umsetzung deiner Vorstellungen müssen mehrere Änderungen vorgenommen werden ... neues Feld in der 'USER_TABLE' , query zum Aktualisieren des Feldes beim Seitenzugriff , query zum Auslesen des Feldes ... analog zum MOD Last User ... u.e.m.
5. Für die Ausgabe der Profilhits gibt es einen MOD ... Dazu musst du aber die Suche bemühen ...  :wink:

mawenzi


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on December 04, 2005, 05:03:13 AM
den mod für die für die profil hits gibt es nicht mehr, es gibt zwar noch das topic aber der mod wurde rausgelöscht...

leider bin ich nicht so fit in php deshalb könnte bei der anzeige der letzten user auf den profilen noch etwas hilfe gebrauchen.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on December 14, 2005, 05:04:12 PM
well, maybe in english

is it possible to change this mod so that every user can see on his profile who last visited it?

come on, i really need this  :wink:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on December 15, 2005, 12:32:18 AM
4images does not store such information, so without a completly different mod, this is not possible.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jako on December 15, 2005, 04:24:19 PM
4images does not store such information, so without a completly different mod, this is not possible.

I alreads saw this, so it must be possible.

For Example look here: (http://partymetropole.de/jako/lastuser.jpg)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on December 15, 2005, 05:52:47 PM
@ Jako
read V@nos post carefully : without a completly different mod, this is not possible ... !

so ... please post your request in ... Mods & Plugins (Requests & Discussions) (http://www.4homepages.de/forum/index.php?board=11.0) ... not in this topic !


Title: Re: [Mod] Letze aktive User / Last active users
Post by: chip on January 15, 2006, 08:44:20 PM


Hi everyone,

Thanks Cr@zy Sash for this one  :D.


I do have a problem:

my guests are always shown with date: 01.01.1970 and time 1.00


Anyone an idea?




Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on January 15, 2006, 10:19:39 PM
1) the guest account is being used for every not logged in visitor, so their activity is not being logged.
2) IMO guests should not be showed at all.
replace
1
WHERE user_level >= '".GUEST."'
with
1
WHERE user_level > '".GUEST."'


Title: Re: [Mod] Letze aktive User / Last active users
Post by: chip on January 15, 2006, 10:48:53 PM

okay, thanks V@no


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Birne on January 17, 2006, 06:57:27 PM
Hi !

how to make this list for user, who are not logged in, invisible ?
I´m using this Mod in my home.html - Template.
Currently all User can see this list !

regards Birne


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on January 17, 2006, 07:03:18 PM
Since you're using this MOD from your home.html file, please post the codings you added from your index.php file and I will give further instructions.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Birne on January 17, 2006, 10:30:43 PM
Hi !
i don´t added any changes to my index.php.
btw: i´m using version 1.7.1 !

As described in the instruction i added the following code in my includes/page_header.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'
                   ORDER BY user_lastaction DESC
                LIMIT 5";
   $result = $site_db->query($sql);

   while ($row = $site_db->fetch_array($result)) {
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a>&nbsp;&nbsp;<span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span>&nbsp;&nbsp;&nbsp;";
   }

$site_template->register_vars(array(
"lang_user_last_action" => $lang['lang_user_last_action'],   
"user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));

 unset($user_last_action_box);
 unset($last_action_user_list);

regards birne


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on January 17, 2006, 10:46:10 PM
Quote  [Expand]

i don´t added any changes to my index.php.


Right. My bad.  :oops:

Now, in your includes/page_header.php file,

find :

Quote  [Expand]

$site_template->register_vars(array(
"lang_user_last_action" => $lang['lang_user_last_action'],   
"user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));

unset($user_last_action_box);
unset($last_action_user_list);


replace with :

1
2
3
4
5
6
7
8
9
10
11
12
13
14

if ($user_info['user_level'] > GUEST) {

$site_template->register_vars(array(
"lang_user_last_action" => $lang['lang_user_last_action'],   
"user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));

unset($user_last_action_box);
unset($last_action_user_list);

}


This should restrict GUEST level to see the window from now on. In the mean time, in your home.html file, you should be able to use :

Quote  [Expand]

{if user_loggedin}your HTML arguments here{endif user_loggedin}


;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Birne on January 17, 2006, 10:53:50 PM
cool, that works perfekty.
thanks TheOracle !


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on January 17, 2006, 10:54:16 PM
No problem - enjoy ! 8)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on January 18, 2006, 12:30:31 AM
Little help needed
Here is my code fragment from page_header.php file

$last_action_user_list .= "<TR class=\"row_bg_number\"><TD><img src=\"".TEMPLATE_PATH."/avatars/user_avatar_current\" width=\"30\" height=\"40\"/></TD><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br /><span class=\"smalltext\">".$last_user_date."</span><br /></TD></TR> ";


i dont know what should i place in field marked with red  
if some one could help me it would be great

edit: sorry i must remove >code< tag becouse >red< tag wont work


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on January 18, 2006, 03:05:03 PM
Quote  [Expand]

$last_action_user_list .= "<TR class=\"row_bg_number\"><TD><img src=\"".TEMPLATE_PATH."/avatars/user_avatar_current\" width=\"30\" height=\"40\"/></TD><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br /><span class=\"smalltext\">".$last_user_date."</span><br /></TD></TR> ";


change to :

Quote  [Expand]

$last_action_user_list .= "<TR class=\"row1(or row2 - your choice)\"><TD><img src=\"".TEMPLATE_PATH."/avatars/".$row['user_avatar']."\" name=\"icons\" border=\"0\" alt=\"\" width=\"30\" height=\"40\"/></TD><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br /><span class=\"smalltext\">".$last_user_date."</span><br /></TD></TR> ";


Then, from your SQL SELECT statement line, make sure you add the user_avatar row as well. ;)

Quote  [Expand]

edit: sorry i must remove >code< tag becouse >red< tag wont work


I know what you mean, this has been discussed before. :roll:

Use quote rather than code to use colors inside. ;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on January 19, 2006, 05:27:44 PM
Avatar wont work before becouse i forgot add user_avatar  to SQL SELECT statement line like U say  :oops: (THX)

With TR class....
I found something  in Last comments v1
http://www.4homepages.de/forum/index.php?topic=7848.0

now my code from page_header.php is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$sql = "SELECT user_name, user_id, user_lastaction, user_avatar FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'
                   ORDER BY user_lastaction DESC
                LIMIT 5";
   $result = $site_db->query($sql);
                $site_template->register_vars(array(
          ));
     
$bgcounter = 1;

while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']."  ".format_date($config['time_format'], $row['user_lastaction']);
  }else {
      $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $last_action_user_list .= "<TR class=\"row".$row_bg_number."\"><TD><img src=\"".TEMPLATE_PATH."/avatars/".((!empty($row['user_avatar'])) ? $row['user_avatar'] : "blank.gif")." \" name=\"icons\" border=\"0\" alt=\"\"  width=\"30\" height=\"40\"/></TD><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br /><span class=\"smalltext\">".$last_user_date."</span><br /></TD></TR> ";
}

and everything works  :)

edit ->  Zyga - > update
little correction  - previous version was with bug


Title: Re: [Mod] Letze aktive User / Last active users
Post by: IcEcReaM on February 05, 2006, 07:26:25 AM
Hey,
i installed the mod a few weeks ago,
but have to change the 4images code to integrate a board.

The Problem is here,
that the code, given on the first site, is not really compatible with 4images,
if you change standard values in session.php & constants.php.

So it would be nice, if a mod could change the code on the frist site,
to make it really 4images compatible.
although i know this would related to only a few members.  8)

This Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'
                   ORDER BY user_lastaction DESC
                LIMIT 5";
   $result = $site_db->query($sql);

   while ($row = $site_db->fetch_array($result)) {
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
   }

$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
 unset($user_last_action_box);
 unset($last_action_user_list);

should be like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT ".get_user_table_field("", "user_name").", ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_lastaction")." FROM ".USERS_TABLE."
              WHERE ".get_user_table_field("", "user_level")."l >= '".GUEST."'
              ORDER BY ".get_user_table_field("", "user_lastaction")." DESC
              LIMIT 5";
   $result = $site_db->query($sql);

   while ($row = $site_db->fetch_array($result)) {
      $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\"><b>".$row[$user_table_fields['user_name']]."</b></a> (<span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row[$user_table_fields['user_lastaction']])."</span>), ";
   }

$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
 unset($user_last_action_box);
 unset($last_action_user_list);

as you see i changed only the code to get the right get_user_table_fields, which declared in the config files,
if you dont use the standard config.

thanks


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on February 06, 2006, 06:17:33 AM
@icecream:

Actually, your codings above are nicely translated into 4images codings. Althought, two comments to state :

Quote  [Expand]

$sql = "SELECT ".get_user_table_field("", "user_name").", ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_lastaction")." FROM ".USERS_TABLE."
              WHERE ".get_user_table_field("", "user_level")."l >= '".GUEST."'
              ORDER BY ".get_user_table_field("", "user_lastaction")." DESC
              LIMIT 5";
   $result = $site_db->query($sql);


paranoidly known like this :

Quote  [Expand]

$sql = "

SELECT ".get_user_table_field("", "user_name").", ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_lastaction")."
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_level")."l >= '".GUEST."'
ORDER BY ".get_user_table_field("", "user_lastaction")." DESC
LIMIT 5

";

$result = $site_db->query($sql);


As for this line :

Quote  [Expand]

$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\"><b>".$row[$user_table_fields['user_name']]."</b></a> (<span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row[$user_table_fields['user_lastaction']])."</span>), ";


there's no need to add the $user_table_fields in this case. ;)

Meaning, it should simply go like this :

1
2
3

$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id'])."\"><b>".$row['user_name']."</b></a> (<span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span>), ";


;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on February 06, 2006, 06:56:39 AM
there's no need to add the $user_table_fields in this case. ;)
You are wrong.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: IcEcReaM on February 06, 2006, 09:13:03 PM
@Oracle:

you mean my formating of the code?
In my code it is like this,
is just because i modified things at that time  and thats
why this is formated like this as i posted here.

And like vano already said,
the $user_table_fields are needed.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on February 06, 2006, 09:16:22 PM
@icecream:

I didn't said it wasn't working or anything, I just stated it was working the first time even without the $user_table_fields since the first date release. ;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: IcEcReaM on February 06, 2006, 10:06:57 PM
ok, as i said, this works for about 98% of the users.
It affects only, if you modify your settings in constants.php & session.php
for non-standard table names and user variables,
which i need because i intergrated my board to the gallery using the boards usertable.

so with my comment, the mod should work also with these modifications,
and then $usertablefields modification is also needed like the "get_user_table_field" as i posted.
I mean if i post here a corection to make this useful mod 4images compatible,
then i do it corecctly..^^




Title: Re: [Mod] Letze aktive User / Last active users
Post by: TheOracle on February 06, 2006, 10:44:22 PM
Quote  [Expand]

so with my comment, the mod should work also with these modifications,
and then $usertablefields modification is also needed like the "get_user_table_field" as i posted.
I mean if i post here a corection to make this useful mod 4images compatible,
then i do it corecctly..^^


Thanks for the details and, yes, it has been done correctly. ;)


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Fastian on March 21, 2006, 04:29:14 PM
Is this possible to modify this Mod a bit to show somthing like

"Welcome to our newest member, xyz "

As we normally see in forums.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on March 21, 2006, 05:02:17 PM
http://www.4homepages.de/forum/index.php?topic=4879.msg20607#msg20607


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Fastian on March 22, 2006, 11:09:22 PM
I am using this Mod "[Mod] Search Engine Friendly URLs aka Short URLs "

By adding in my htaccess
1
RewriteRule ^profile([0-9]+)\.htm$ member.php?action=showprofile&user_id=$1&%{QUERY_STRING}

I can use the profile links as www.domain.com/profile1.htm (i.e. profile##.htm)

But Using this mod, The link of user profile on main page (where I show Last Active User) always show up as

http://www.domain.com/member.php?action=showprofile&user_id=44

What I need to change that the link of profile from this mod actually change to profile##.htm


Title: Re: [Mod] Letze aktive User / Last active users
Post by: IWS_steffen on April 22, 2006, 04:25:19 PM


Danke für den tollen [Mod] Letze aktive User / Last active users

Läuft super...


Gruß Steffen


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on May 20, 2006, 10:50:32 AM
Hey guys, how can i display the gender *.gif form my memberlist in my paher_header.php

Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1" bordercolor="#808080">
<tr><td width="36"><a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><p align="center">
<img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" width="35" height="35" border="1" style="border: 1px solid #000066"></td><td><b>
<a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'">'.$row['user_name'].'</a></b>
<img src=\"".TEMPLATE_PATH."/images/gender".htmlspecialchars($user_row['user_gender']).".gif\">
<br>'.$last_user_date.'</td></tr></table>


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on May 20, 2006, 03:32:27 PM
Hey guys, how can i display the gender *.gif form my memberlist in my paher_header.php

Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1" bordercolor="#808080">
<tr><td width="36"><a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><p align="center">
<img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" width="35" height="35" border="1" style="border: 1px solid #000066"></td><td><b>
<a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'">'.$row['user_name'].'</a></b>
<img src=\"".TEMPLATE_PATH."/images/gender".htmlspecialchars($user_row['user_gender']).".gif\">
<br>'.$last_user_date.'</td></tr></table>

in page_header.php ;)

in this line

Quote  [Expand]
<img src=\"".TEMPLATE_PATH."/images/gender".htmlspecialchars($user_row['user_gender']).".gif\">
delete red marked text

and in mysql line
Quote  [Expand]
$sql = "SELECT user_name, user_id, user_lastaction, user_sex, user_avatar FROM ".USERS_TABLE." 

add green marked text


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on May 21, 2006, 12:12:27 PM
Hey Zyga,

Now i try in page_header.php  :mrgreen::

Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1" bordercolor="#808080"><tr><td width="50"><a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><p align="center"><img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" height="35" border="1" style="border: 1px solid #000066"></td><td><b><a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'">'.$row['user_name'].'</a></b><img src=\"".TEMPLATE_PATH."/images/gender".$row['user_gender'].".gif\"><span class="smalltext"><br>'.$last_user_date.'</span></td></tr></table>';

and

Quote  [Expand]
$sql = "SELECT user_name, user_id, user_lastaction, user_gender, userpic FROM ".USERS_TABLE."


but it doesnot work...

Parse error: syntax error, unexpected T_STRING in /home/www/webXX/html/album/includes/page_header.php on line 430


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on May 21, 2006, 03:24:33 PM
whole my Last active User code with avatar support, gis mod and coloured row and "today" addon support is

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction, user_sex, user_avatar FROM ".USERS_TABLE."
                WHERE user_level > '".GUEST."' AND user_invisible = 0
                   ORDER BY user_lastaction DESC
                LIMIT 12";
   $result = $site_db->query($sql);
                $site_template->register_vars(array(
          ));
     $bgcounter = 1;
while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']."   ".format_date($config['time_format'], $row['user_lastaction']);
  }
  else {
      $last_user_date = format_date($config['date_format']."   ".$config['time_format'], $row['user_lastaction']);
  }
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $last_action_user_list .= "<TR class=\"row".$row_bg_number."\"><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['user_id'])."\"><img src=\"".TEMPLATE_PATH."/avatars/".((!empty($row['user_avatar'])) ? $row['user_avatar'] : "blank.gif")." \" name=\"icons\" border=\"0\" alt=\"\"  width=\"30\" height=\"40\"/></a></TD><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a>&nbsp;<img src=\"".TEMPLATE_PATH."/images/gender".$row['user_sex'].".gif\" alt=\"\"><br /><span class=\"smalltext\">".$last_user_date."</span><br /></TD></TR> ";
}


$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
"lang_user_last_action" => $lang['lang_user_last_action'],
"user_last_action_list" => $last_action_user_list,


));

just take what U need ;)
works ok


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on May 24, 2006, 01:07:59 PM
Same error:  :(

Parse error: syntax error, unexpected T_STRING in /home/www/webXX/html/album/includes/page_header.php on line 430


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on May 27, 2006, 11:28:39 AM
exactly what code is in line 430


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on May 27, 2006, 12:28:19 PM
This is Line 430:

$last_action_user_list .= '<table border="0" width="100%" id="table1" bordercolor="#808080"><tr><td width="50"><ahref="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><p align="center"><img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ?"member.jpg" : $row['userpic']).'" height="35" border="1" style="border: 1px solid #000066"></td><td><b><ahref="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'">'.$row['user_name'].'</a></b><img src=\"".TEMPLATE_PATH."/images/gender".$row['user_gender'].".gif\"><span class="smalltext"><br>'.$last_user_date.'</span></td></tr></table>';


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ivan on May 29, 2006, 01:52:26 PM
hallo,
ich benutze diesen mod und er läuft super ausser ein kleines problem habe ich.
und zwar habe ich die letzten 12 aktiven user rechts in eine tabelle 170px gepackt.
es wird mir das datum sowie zeit dann der benutzernamen angezeigt. nun gibt es
benutzernamen die länger sind als die tabellen breite. so wird nun die tabelle automatisch
verlängert und dies sieht nicht schön aus.

wie kann ich den benutzernamen z.b auf 10 zeichen begrenzen..

das es so aussieht (am schluss mit 3 punkten)

26.05.2006|10:45 Teenage... anstatt
26.05.2006|10:45 Teenageträumerin

wäre schöne wenn mir jemand helfen könnte..
vielen dank
gruss ivan


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on May 29, 2006, 02:52:26 PM
hallo Ivan,

für die Verkürzung der Benutzernamen in der Anzeige von Last active users auf max. 10 Zeichen wäre folgendes zu ändern ...
statt ...
1
2
3
while ($row = $site_db->fetch_array($result)) {
$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
   }
verwende ...
1
2
3
4
5
6
7
8
while ($row = $site_db->fetch_array($result)) {
    $max_length = 10; // hier max.Zeichen für Username eingeben
    $user_name_short = $row['user_name'];
         if (strlen($user_name_short) > $max_length) {
            $user_name_short = substr($row['user_name'], 0, $max_length)." ... ";
         }
$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$user_name_short."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
   }

... sollte funktionieren ...  :wink:
(P.S. ich glaube du hast die Reihenfolge ... Name, Datum ... geändert ... wäre dann noch anzupassen .)
mawenzi


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ivan on May 29, 2006, 03:49:00 PM
wau detlev... danke schön. werde es gleich heute abend ausprobieren....
vielen dank

gruss ivan


Title: Re: [Mod] Letze aktive User / Last active users
Post by: b.o.fan on May 31, 2006, 09:34:32 PM
Funtzt der Mod auch unter 1.72??


Title: Re: [Mod] Letze aktive User / Last active users
Post by: b.o.fan on June 03, 2006, 11:57:51 PM
ähm hello?

can i use this mod on 1.72??

thx bofan


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Stoleti on June 15, 2006, 06:42:15 PM
How can i added "country flags" before username , and make show 4 users per row ??

here is my code:

Quote  [Expand]
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction, userpic FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 25";
    $result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']);
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  } 
         $userpic = $row['userpic'];
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" width="100" height="100" border="0"></a>&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span></td></tr></table><br>';
}
   
$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
"lang_user_last_action" => $lang['lang_user_last_action'], 
"userpic" => $row['userpic'], 
"user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
 unset($user_last_action_box);
 unset($last_action_user_list);

 :?:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: ivan on June 26, 2006, 03:44:46 PM
hallo, da ich meine last aktiv user aus der index.php entfernt zwecks geschwindigkeit
möchte ich nun gerne, da ich mehr platz habe, dies in zwei spalten anzeigen.

wie kann ich dies bewirken, hier der code (ich denke es muss nur dies angepasst werden

1
$last_action_user_list .= "<span class=\"smalltext\">".$last_user_date."</span>&nbsp;&nbsp;&nbsp;<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$user_name_short."</b></a><br />";

gruss ivan


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on June 26, 2006, 05:33:58 PM
... und was soll genau in zwei spalten angezeigt werden ... ?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on July 04, 2006, 02:48:03 PM
Hey guys, how can i display the gender *.gif form my memberlist in my page_header.php

Quote  [Expand]
$last_action_user_list .= '<table border="0" width="100%" id="table1" bordercolor="#808080">
<tr><td width="36"><a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><p align="center">
<img src="'.ROOT_PATH.'/data/userpic/'.((empty($userpic)) ? "member.jpg" : $row['userpic']).'" width="35" height="35" border="1" style="border: 1px solid #000066"></td><td><b>
<a href="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'">'.$row['user_name'].'</a></b>
<img src=\"".TEMPLATE_PATH."/images/gender".htmlspecialchars($user_row['user_gender']).".gif\">
<br>'.$last_user_date.'</td></tr></table>

any new ideas?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on July 09, 2006, 05:42:39 PM

your red line in my code looks like

1
<img src=\"".TEMPLATE_PATH."/images/gender".$row['user_sex'].".gif\" alt=\"\">

remember to add user_sex, to sql querry

it works for me


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on July 10, 2006, 04:47:25 PM
Another question  :lol:

How to list the last five woman and the last five men separately?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: mawenzi on July 10, 2006, 05:13:02 PM
@ Toso,

... make two lists ... in page_header.php ... for example ...
1. woman-list
1
2
3
4
5
6
7
8
9
$last_action_user_list_woman = "";
$sql = "SELECT user_name, user_id, user_gender, user_lastaction FROM ".USERS_TABLE."
        WHERE user_level >= '".GUEST."' AND user_gender == 'w'
        ORDER BY user_lastaction DESC
        LIMIT 5";
...
$last_action_user_list_woman = ...
...
unset($last_action_user_list_woman);

2. man-list
1
2
3
4
5
6
7
8
9
$last_action_user_list_man = "";
$sql = "SELECT user_name, user_id, user_gender, user_lastaction FROM ".USERS_TABLE."
        WHERE user_level >= '".GUEST."' AND user_gender == 'm'
        ORDER BY user_lastaction DESC
        LIMIT 5";
...
$last_action_user_list_man = ...
...
unset($last_action_user_list_man);

3. in user_last_action_box.html use for the two lists ..
1
2
{last_action_user_list_woman}
{last_action_user_list_man}





Title: Re: [Mod] Letze aktive User / Last active users
Post by: Stoleti on July 11, 2006, 02:20:20 AM
i've installed one mod from here (country and gender at reg.) and i'm wondering about a option for sort by country ????


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Toso on July 11, 2006, 11:15:04 PM

your red line in my code looks like

1
<img src=\"".TEMPLATE_PATH."/images/gender".$row['user_sex'].".gif\" alt=\"\">

remember to add user_sex, to sql querry

it works for me

It works:

Quote  [Expand]
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction, user_gender, userpic FROM ".USERS_TABLE."
                WHERE user_level > '".GUEST."' AND user_invisible = 0
                   ORDER BY user_lastaction DESC
                LIMIT 12";
   $result = $site_db->query($sql);
                $site_template->register_vars(array(
          ));
     $bgcounter = 1;
while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']."   ".format_date($config['time_format'], $row['user_lastaction']);
  }
  else {
      $last_user_date = format_date($config['date_format']."   ".$config['time_format'], $row['user_lastaction']);
  }
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $last_action_user_list .= "<TR class=\"row".$row_bg_number."\"><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['user_id'])."\"><img src=\"".ROOT_PATH."/data/userpic/".((!empty($row['userpic'])) ? $row['userpic'] : "member.jpg")." \" name=\"icons\" border=\"1\" alt=\"\"  width=\"35\" height=\"40\"/></a></TD><TD><a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a>&nbsp;<img src=\"".TEMPLATE_PATH."/images/gender".$row['user_gender'].".gif\" alt=\"\"><br /><span class=\"smalltext\">".$last_user_date."</span><br /></TD></TR> ";
}
$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
  "user_last_action_box" => $user_last_action_box,
  "lang_user_last_action" => $lang['lang_user_last_action'],
  "user_last_action_list" => $last_action_user_list
));
  unset($user_last_action_box);
  unset($last_action_user_list);
?>

THX Zyga :mrgreen:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: chull on August 10, 2006, 02:45:10 AM
Hallo,

ich würde gerne das Userbild neben dem Namen einblenden. Habe den Thread schon gelesen und genau das auch gefunden, nur weicht der Code von dem den ich hab ziemlich ab. Was muss ich bei meinem Code verändern um das Bild anzeigen zu können.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'".(($user_info['user_level'] == ADMIN) ? "" : " AND user_invisible = 0")." OR user_id = ".$user_info['user_id']."
                   ORDER BY user_lastaction DESC
                LIMIT 5";
   $result = $site_db->query($sql);

   while ($row = $site_db->fetch_array($result)) {
   $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
   }

$user_last_action_box = $site_template->parse_template("user_last_action_box");
$site_template->register_vars(array(
 "user_last_action_box" => $user_last_action_box,
 "lang_user_last_action" => $lang['lang_user_last_action'],   
 "user_last_action_list" => $last_action_user_list
));
 unset($user_last_action_box);
 unset($last_action_user_list);
?>

Danke und Grüße

Chull


Title: Re: [Mod] Letze aktive User / Last active users
Post by: IGC on August 15, 2006, 01:11:43 AM
I've followed the installation step by step, but I still can't get it to work...

It displays nothing on the table created for that purpose...

It's like is not recognizing the {lang_user_last_action} and {last_action_user_list} commands.

It puts the table in, with the appropriate class usage, but there is nothing inside the table...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: V@no on August 17, 2006, 12:12:07 AM
I've updated the original code, it should now be compatible with v1.7.1 and newer.
Redo step 1.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Fastian on September 03, 2006, 02:50:57 PM
I just installed the mod
"[MOD] Treat bots as users with less rights  (http://www.4homepages.de/forum/index.php?topic=8752.0)

So now all the time Ii am seeing Bots in my "Active Member list"
Is there a way to exclude these searchbots from the list ??

Perhaps by restricting the user group from appearing in the "Last Active Users" list ??


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Fastian on October 24, 2006, 04:36:27 PM
Some of the things in this thread are not in English so I might have missed it.

The default "Last Active user list" is in a vertical way. Like
User 1
date 1
User 2
date 2
....

How can I change it to be show horizontally with max. 4 users in one row like
User 1     User 2       User 3      user 4
date 1     date 2      date 3      date 5

User 5
Date 5

I know the question seems stupid but I can’t get it working like this.  :oops:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Darkness2001 on October 31, 2006, 09:44:21 PM
Hallo,

habe den Mod eingebaut, klappt auch alles prima, aber..

warum bekomme ich jetzt wenn ich auf suchen gehe --> [edit] auf die suchseite [/edit] folgende Fehlermeldung:


Notice: Undefined variable: last_action_user_list in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 682

681    while ($row = $site_db->fetch_array($result)) {
682    $last_action_user_list .= '<a href ="'.$site_sess->url(ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id']).'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_comments'].'</span><br>';
}

$site_template->register_vars(array(
"user_comments_list" => $last_action_user_list,

WEr weiss Rat?

Grüße Darkness  :mrgreen:


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Zyga on November 01, 2006, 03:53:55 PM
I wasn't here long time and I miss 2 updates.
Now with winmerge I updated my gallery to 1.7.4 and I vgot little problem with this mod.

Read - I f-up something and after 4h with winmerge I cant find it please help :oops:
When I paste in to my main template tags {lang_user_last_action}, {user_last_action_list} it works
but with {user_last_action_box} it shows nothing.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: sooner1 on March 28, 2007, 10:52:05 PM
Without having enough english I have had a hard time getting this to work. I have done everything, however nothing shows on the main page except a blank bar where I would assume last active users should be, nothing else. What have I done wrong?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: vipersgarden on September 01, 2007, 03:00:43 PM
Was mich gewundert hat! Erst hier auf der letzten Seite wurde danach gefragt!
Wo muss man was umändern, um die Ausgabe nicht in Tabellenform, sondern in "einer Wurst", wie:

user1 dd.mm.yyyy hh.mm; user2 dd.mm.yyyy hh.mm; user3 dd.mm.yyyy hh.mm;, usw.

angezeigt zu bekommen.
Das würde a) weniger Platz benötigen und b) glaub ich auch ansprechender aussehen (wenn man es, so wie ich unter den "Derzeit online" stehen hat.

Danke


Title: Re: [Mod] Letze aktive User / Last active users
Post by: vipersgarden on September 01, 2007, 03:13:23 PM
OK, ich hab´s!

In der page_header.php (original Script von Seite 1) (innerhalb von "last active user")

suche nach:

1
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH.

Ersetze die folgenden Zeilen (vor dem closing tag "}" durch diesen Code:

1
"member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b>&nbsp;</a><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']).";&nbsp;";

Dann siehts so wie bei mir aus: VipersGarden Bildergalerie (http://"http://vipersgarden.at/4images")

Mario


Title: Re: [Mod] Letze aktive User / Last active users
Post by: merox on December 02, 2007, 06:08:01 PM
Bei mir funktioniert es nicht.Kann es sein das es an phpbb liegt.Da ich 4homepages in phpbb intergriert habe?Hilf mir bitte...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: merox on December 02, 2007, 07:04:56 PM
Kann es jemand dem hier da in englisch sagen bitte.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: merox on December 03, 2007, 01:32:06 PM
hats bei jemandenm geklappt der auch phpbb intergriert hat?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: skiemor on December 30, 2007, 01:07:56 AM
Nice MOD, thank you!  :D

Chris.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: masterred on February 15, 2008, 12:29:13 AM
hi

how cant modfy this MOD for work on 1.7.6 4images gallery

thanks


Title: Re: [Mod] Letze aktive User / Last active users
Post by: thunderstrike on February 15, 2008, 12:54:24 AM
Quote  [Expand]
how cant modfy this MOD for work on 1.7.6 4images gallery

Is no work for v1.76 ?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: masterred on February 15, 2008, 06:58:38 AM
hi

work fine on 1.7.6

 (http://www.imagehosting.com/out.php/t1580929_last.jpg) (http://www.imagehosting.com/out.php/i1580929_last.jpg)

i see


Title: Re: [Mod] Letze aktive User / Last active users
Post by: masterred on February 15, 2008, 08:05:33 AM
@ Toso,

... make two lists ... in page_header.php ... for example ...
1. woman-list
1
2
3
4
5
6
7
8
9
$last_action_user_list_woman = "";
$sql = "SELECT user_name, user_id, user_gender, user_lastaction FROM ".USERS_TABLE."
        WHERE user_level >= '".GUEST."' AND user_gender == 'w'
        ORDER BY user_lastaction DESC
        LIMIT 5";
...
$last_action_user_list_woman = ...
...
unset($last_action_user_list_woman);

2. man-list
1
2
3
4
5
6
7
8
9
$last_action_user_list_man = "";
$sql = "SELECT user_name, user_id, user_gender, user_lastaction FROM ".USERS_TABLE."
        WHERE user_level >= '".GUEST."' AND user_gender == 'm'
        ORDER BY user_lastaction DESC
        LIMIT 5";
...
$last_action_user_list_man = ...
...
unset($last_action_user_list_man);

3. in user_last_action_box.html use for the two lists ..
1
2
{last_action_user_list_woman}
{last_action_user_list_man}





where add this line in MOD code

thanks


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jan-Lukas on April 28, 2008, 10:36:58 PM
Hi,
Hab da ein Problem
Und zwar habe ich ein seperates Menü gebaut, und wenn ich da {user_last_action_box} einbaue, wird nichts angezeigt
und zwar wird das Menü so aufgerufen
<?php
 require "{template_url}/incl/menu.php";
 ?>
wenn ich es direkt in die home.html etc. einbaue klappt es, nur soll es in die menu.php rein.


Testseite (rechte Seite)
http://ue-ei-portal-sammlerkatalog.de/katupdate/ (http://ue-ei-portal-sammlerkatalog.de/katupdate/)

Linke Seite kommt später eine dynamisches Kategorie Menü rein

OK, hab es anders gelöst
Habe mein Menü in Menü und Werbung unterteilt, und dazwischen in der home.html dann die online User gepackt
geh alles ;)

einfügen in die home.html (und anderen templates)
<?php
 require "{template_url}/incl/menu.php";
 ?>
{user_last_action_box}
<?php
 require "{template_url}/incl/werbung.php";
 ?>


Title: Re: [Mod] Letze aktive User / Last active users
Post by: nobby on May 11, 2008, 08:18:25 AM
Hallo,

in der "thumbnail_bit.html" dieses Auskommentieren ({user_name_link})

Auskommentieren geht so: <!-- ... -->

nobby



Title: Re: [Mod] Letze aktive User / Last active users
Post by: honda2000 on September 01, 2008, 04:30:55 PM
Hallo,
wie bewirke ich denn, das mir z.b. 20 User, in 4 Spalten (nebeneinander) somit 5 User untereinander angezeigt werden??

Quote  [Expand]
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 20";
    $result = $site_db->query($sql);

  while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']); 
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }   
  $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
   }

Also etwas so:
User 1 xx.xx.xxx     User 2 xx.xx.xx   User 3 xx.xx.xx   User 4 xx.xx.xx
User 5 xx.xx.xxx     User 6 xx.xx.xx   User 7 xx.xx.xx   User 8 xx.xx.xx
User 9 xx.xx.xxx     User10 xx.xx.xx   User11 xx.xx.xx   User12 xx.xx.xx
User13 xx.xx.xxx    User14 xx.xx.xx   User15 xx.xx.xx   User16 xx.xx.xx
User 17 xx.xx.xxx    User18 xx.xx.xx  User19 xx.xx.xx   User20 xx.xx.xx

LG


Title: Re: [Mod] Letze aktive User / Last active users
Post by: AntiNSA2 on March 12, 2009, 09:33:40 PM
This is a stupid question I know... but I have spent a long time and I cant get the formatting right!

right now it looks like this:
Robert P. Eaton Jr.
Today
urlaubsbilder
06.03.2009 13:04
testman3
01.03.2009 11:20
Testman2
01.03.2009 11:17
TESTMAN
01.03.2009 02:41

which is cool, but how can I get the same information to be listed horizontally and not vertically, including with the today modification? a couple of paes earlier in the mod it does not work with the today modification...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: AntiNSA2 on March 12, 2009, 09:44:07 PM
Nevermind... just took out the breaks, will settle for single line...


But I see the add user flag and gender mod within this thread....

What I want to know is how to add user flag from user flag mod... the one that takes it from the ip... not the one that you select when register.. I mean V@nos user flag mod that is used with who is online...  Anyone?


Title: Re: [Mod] Letze aktive User / Last active users
Post by: AntiNSA2 on March 30, 2009, 09:45:49 AM
Greetings, hello and hi!

Two Things I can not find in this mod thread but am trying to do are:

1) Ad user flag (flag for location)
2) allow guests TO be seen

Anyone know?

With Great Thanks-
Robert


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jasi on April 03, 2009, 01:11:44 PM
Hallo,
wie bewirke ich denn, das mir z.b. 20 User, in 4 Spalten (nebeneinander) somit 5 User untereinander angezeigt werden??

Quote  [Expand]
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 20";
    $result = $site_db->query($sql);

  while ($row = $site_db->fetch_array($result)) {
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']); 
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }   
  $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
   }

Also etwas so:
User 1 xx.xx.xxx     User 2 xx.xx.xx   User 3 xx.xx.xx   User 4 xx.xx.xx
User 5 xx.xx.xxx     User 6 xx.xx.xx   User 7 xx.xx.xx   User 8 xx.xx.xx
User 9 xx.xx.xxx     User10 xx.xx.xx   User11 xx.xx.xx   User12 xx.xx.xx
User13 xx.xx.xxx    User14 xx.xx.xx   User15 xx.xx.xx   User16 xx.xx.xx
User 17 xx.xx.xxx    User18 xx.xx.xx  User19 xx.xx.xx   User20 xx.xx.xx

LG



@ honda2000

@ ALL

Öffne die Datei includes/page_header.php und suche folgenen Codeabschnitt:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                 WHERE user_level >= '".GUEST."'
                    ORDER BY user_lastaction DESC
                 LIMIT 5";
    $result = $site_db->query($sql);

    while ($row = $site_db->fetch_array($result)) {
    $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";
    }

$site_template->register_vars(array(
  "lang_user_last_action" => $lang['lang_user_last_action'],   
  "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
  unset($user_last_action_box);
  unset($last_action_user_list);

Suche dort:
while ($row = $site_db->fetch_array($result)) {

1. Füge darüber folgendes ein:

1
2
3
4
5
//Anzahl Spalten der Tabelle
$SPALTEN = 2;
$num=0;
$last_action_user_list .= "<table width=\"100%\" align=\"center\" cellspacing=\"12\" border=\"0\">\n  </tr>\n";
// Ende Anzahl Spalten der Tabelle

2. Suche danach weiter nach:
$last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  } 


Füge danach (darunter) folgendes ein: (...nach der geschweiften Klammer } ...)

1
2
if ($num % $SPALTEN == 0)// Neue Zeile beginnen
                $last_action_user_list .=  "</tr>\n </tr>\n";


3. Suche danach weiter nach:

1
$last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$row['user_name']."</b></a><br ><span class=\"smalltext\">".format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction'])."</span><br >";


Füge danach (darunter)  folgendes ein: => noch vor }


Füge folgendes direkt nach/unter } ein:

1
2
$last_action_user_list .= "</TR>\n ";
$last_action_user_list .= "</table>";

Unter $SPALTEN = 2;
kannst du nun festlegen/einstellen wie viele Spalten in einer (1) Reihe angezeigt werden sollen. Wenn du z.B. 3 oder 4 Spalten in einer Reihe nebeneinander haben möchtest, so änder den Wert 2 dementsprechend z.B. auf $SPALTEN = 3; ab.

Eine abgeänderte Variante mit 2 Spalten nebeneinander und 2 Reihen untereinander als Vorschau der letzen 4 angemeldeten User mit einigen eigenen Zusätzen findest du hier unter den letzten 3 neuen Bilder:

http://www.modkon-germany.de/modelgalerie/index.php

LG euer Jasi



Title: Re: [Mod] Letze aktive User / Last active users
Post by: 4ella on May 03, 2009, 01:58:22 AM
Hello i was searching all the forum and didn't find how to put country flag(I.P)into this Mod , I have installed this : http://www.4homepages.de/forum/index.php?topic=7831.0  , I saw on some sites that somebody has it also in last active user MOD  and have found some people here asking the same but no respond :(
pls help me to implement it too.

This is my page_header.php , where can I put it? , as I said i have just flags in the root , all Mods concerning flags working....
Thanks Daniel

Quote  [Expand]
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_lastaction FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'
                   ORDER BY user_lastaction DESC
                LIMIT 10";
    $result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
    $max_length = 18; // hier max.Zeichen für Username eingeben
    $user_name_short = $row['user_name'];
         if (strlen($user_name_short) > $max_length) {
            $user_name_short = substr($row['user_name'], 0, $max_length)." ... ";
         }
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']); 
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }
     
  $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><b>".$user_name_short."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
   }

$site_template->register_vars(array(
  "lang_user_last_action" => $lang['lang_user_last_action'],   
  "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
  unset($user_last_action_box);
  unset($last_action_user_list);

?>

Would be also nice to show online people with small icon like here in the previous post of Jasi
http://www.modkon-germany.de/modelgalerie/index.php   by the way , compliments for your site ...


Title: Re: [Mod] Letze aktive User / Last active users
Post by: 4ella on May 08, 2009, 08:00:44 PM
pls help me someone to get the country flag in last active users -:) , it would help me a lot because I need the visitors of my site to know that for e.g somebody from Italy was watching my site 2 hours ago , my site is international so I would use it a lot and I know that many of you just have it on your sites  , I'm sure that for most people here it's not a big problem to get the flag there, but for me it is :(


Title: Re: [Mod] Letze aktive User / Last active users
Post by: 4ella on May 16, 2009, 05:31:43 PM
Hi can anybody tell me how can i eliminate border from the flags ? it works like a link , but its very ugly , I would like to use the link function of the flag together with user name and also let user name bold and underlined .
(http://www.dancersrecruit.com/pictures/templates/default/images/screen.jpg)

this is my page header script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//-----------------------------------------------------
//--- Last active User --------------------------------
//-----------------------------------------------------
$last_action_user_list = "";
$sql = "SELECT user_name, user_id, user_country, user_lastaction FROM ".USERS_TABLE."
                WHERE user_level >= '".GUEST."'
                   ORDER BY user_lastaction DESC
                LIMIT 15";
    $result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
    $max_length = 18; // hier max.Zeichen für Username eingeben
    $user_name_short = $row['user_name'];
         if (strlen($user_name_short) > $max_length) {
            $user_name_short = substr($row['user_name'], 0, $max_length)." ... ";
         }
   if(date("dmy", $row['user_lastaction']) == date("dmy")) {
  $last_user_date = $lang['lang_user_last_today']." ".format_date($config['time_format'], $row['user_lastaction']); 
  }else {
  $last_user_date = format_date($config['date_format']." ".$config['time_format'], $row['user_lastaction']);
  }
     
  $last_action_user_list .= "<a href =\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row['user_id'])."\"><img src=\"".TEMPLATE_PATH."/images/flags/".$row['user_country'].".gif\" alt=\"\"><b>".$user_name_short."</b></a><br><span class=\"smalltext\">".$last_user_date."</span><br>";
   }

$site_template->register_vars(array(
  "lang_user_last_action" => $lang['lang_user_last_action'],   
  "user_last_action_list" => $last_action_user_list
));
$site_template->register_vars("user_last_action_box", $site_template->parse_template("user_last_action_box"));
  unset($user_last_action_box);
  unset($last_action_user_list);
I would appreciate any help .

Quote  [Expand]
Hi can anybody tell me how can i eliminate border from the flags ? it works like a link , but its very ugly , I would like to use the link function of the flag together with user name and also let user name bold and underlined .

Sorry I figure it out - I 've put into the code    -  border=\"0\"
Now it works fine.


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Nicky on May 16, 2009, 05:53:09 PM
hi,

hope this is okay for you
1
<img src=\"".TEMPLATE_PATH."/images/flags/".$row['user_country'].".gif\" alt=\"\" border=\"0\">


Title: Re: [Mod] Letze aktive User / Last active users
Post by: 4ella on May 16, 2009, 06:08:10 PM
Yes exactly it works like that , I ve figure it out 1 minute ago , thanks a lot Nicky , I didn't know how to put border-0 in PHP , i only knew that  in html and its different so I have found it in page header above - Thanks a lot anyway for very quick respond, Daniel


Title: Re: [Mod] Letze aktive User / Last active users
Post by: Jan-Lukas on December 26, 2011, 10:47:31 PM
Original Code funktioniert in der 1.7.10
weitere Funktionen nicht getestet


Title: Re: [Mod] Letze aktive User / Last active users
Post by: crs on January 16, 2012, 11:38:59 PM
N'abend!

Ich hätte eine Bitte, weil ich es nicht hinbekomme... :-/

Ich möchte die Namen der einzelnen User nebeneinander ohne Uhrzeit/Datum anzeigen lassen - die Schrift sollte nicht fett oder sonstiges sein, also unformatiert.
Genial wäre das ganze mit Länderflagge und Abstand zwischen den einzelnen Usern.

Ist das möglich?
Wäre großartig!
Danke!

///

I have one request, because I do not get it ... : - /

I would like to display the name of each user next to each other without time / date.
Would be awesome with all the countries flag and distance between the individual users.

Is that possible?
Would be great!
Thank you!