4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: b.o.fan on August 20, 2006, 04:48:36 PM
-
Hello @ all... I have made a littel thing to show the last User on User's Profil.
Here is the Requestion: look here (http://www.4homepages.de/forum/index.php?topic=10801.0)
SAVE YOUR FILES, AND MAKE A BACKUP!
Changed Files:
./member.php
./includes/constants.php
./lang/<your_language>/main.php
./templates/<your_tempalte>/member_profile.html
Make a new database-field.
You can use this Code:
CREATE TABLE `4images_lastuser` (
`lastuser_id` smallint(5) NOT NULL auto_increment,
`userprofil_id` smallint(10) NOT NULL default '0',
`user_on_id` smallint(10) NOT NULL default '0',
`last_date` int(15) NOT NULL default '0',
PRIMARY KEY (`lastuser_id`)
) TYPE=MyISAM ;
1.
Open ./includes/constants.php
Find there:
define('WORDLIST_TABLE', $table_prefix.'wordlist');
add after
define('LASTUSER_TABLE', $table_prefix.'lastuser');
2.
Open ./member.php
2.1.Find there:
if ($user_row = get_user_info($user_id)) {
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
if (!empty($user_homepage) && $user_homepage != REPLACE_EMPTY) {
$user_homepage_button = "<a href=\"".$user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$user_homepage."\" /></a>";
}
else {
$user_homepage_button = REPLACE_EMPTY;
}
add after
if($user_info['user_id'] <> GUEST)
{
if($user_info[user_id] <> $user_row['user_id'])
{
$query = "SELECT COUNT(*) FROM ".LASTUSER_TABLE." WHERE userprofil_id = '".$user_row['user_id']."' AND user_on_id = '".$user_info[user_id]."' ";
$sql = mysql_query($query);
$on = mysql_result($sql,0);
if($on == "0")
{
$time = time();
$query = "INSERT INTO ".LASTUSER_TABLE." (userprofil_id, user_on_id, last_date) VALUES ('".$user_row['user_id']."', '".$user_info[user_id]."', '".$time."') ";
$sql = mysql_query($query);
}
if($on == "1")
{
$new_time = time();
$query = "UPDATE ".LASTUSER_TABLE." SET last_date = '".$new_time."' WHERE userprofil_id = '".$user_row['user_id']."' AND user_on_id = '".$user_info[user_id]."' ";
$sql = mysql_query($query);
}
}
$limit = 5; // IF YOU WANT SHOW MORE THEN 5 CHANGE IT ;)
$query = "SELECT lastuser_id, userprofil_id, user_on_id, last_date, u.user_id, user_name FROM (".LASTUSER_TABLE." i)
LEFT JOIN ".USERS_TABLE." u ON (u.user_id) = i.user_on_id
WHERE userprofil_id = ".$user_row['user_id']." ORDER BY i.last_date DESC LIMIT 0 , ".$limit."";
$sql = mysql_query($query);
while($ds = mysql_fetch_object($sql))
{
$on_time = date("d.m.Y H:i", $ds->last_date);
$last_user .= "<a href='member.php?action=showprofile&user_id=".$ds->user_id."'>".$ds->user_name."</a> <small>(".$on_time.")</small> | ";
}
$query = "SELECT COUNT(*) FROM ".LASTUSER_TABLE." WHERE userprofil_id = '".$user_row['user_id']."' ";
$sql = mysql_query($query);
$on = mysql_result($sql,0);
if($on > $limit)
{
$query = "SELECT * FROM ".LASTUSER_TABLE." WHERE userprofil_id = '".$user_row['user_id']."' ORDER BY last_date DESC LIMIT ".$limit.", ".$limit." ";
$sql = mysql_query($query);
$ds = mysql_fetch_object($sql);
$query = "DELETE FROM ".LASTUSER_TABLE." WHERE userprofil_id = '".$user_row['user_id']."' AND last_date <= ".$ds->last_date." ";
$sql = mysql_query($query);
}
}
2.2.Find
"user_icq" => $user_icq,
add before
"last_user" => $last_user,
"lang_last_user" => $lang['last_user'],
3.Open ./lang/<your_language>/main.php
add before
?>
this here:
/// GERMAN ///
//-------------------------------------------
//----Last User on Profil -------------------
//-------------------------------------------
$lang['last_user'] = "Letze User: ";
/// ENGLISH ///
//-------------------------------------------
//----Last User on Profil -------------------
//-------------------------------------------
$lang['last_user'] = "Last User: ";
Open ./template/<your_template>/member_profile.html
add where you want:
<b>{lang_last_user}</b> {last_user}
pls feedback ;)
Have Fun ;)
-
Great Mod !!!
A Question, can we set for 5 (last users) ??? :oops:
-
Great Mod !!!
A Question, can we set for 5 (last users) ??? :oops:
i dont undersand...
-
Great Mod !!!
A Question, can we set for 5 (last users) ??? :oops:
i dont undersand...
I mean the last 5 users at profile (visitors) :)
-
you can change this with
$limit = 5;
-
you can change this with $limit = 5;
:D Thanks !!
-
how make it track only reg. users and not Guest's !?
Guest (20.08.2006 14:28) |
-
fantastic! great work! :wink:
-
@b.o.fan:
Nice mod, but please make it use 4images build-in database class.($site_db)
also, debuging leftovers? echo $time;
:)
@Stoleti:
Looks like a bug. line if($user_id <> GUEST)
Should be if($user_info['user_id'] <> GUEST)
-
Still Showing Guests.....
This would be just for users with account :|
-
well, yes, it will show guests, cause they already were added into the database...but in the future when the limit reached and old entries deleted, guests should not be logged again...
-
@b.o.fan:
Nice mod, but please make it use 4images build-in database class.($site_db)
also, debuging leftovers? echo $time;
:)
@Stoleti:
Looks like a bug. line if($user_id <> GUEST)
Should be if($user_info['user_id'] <> GUEST)
oops :)
the 4images class? hmm... how i can use this? i'm not perfect ;)
-
I don´t see the names from the last users...
I see <b>{lang_last_user}</b> but I don´t see {last_user} in the plofile...
My site: http://www.paxykochan.net/myart/member.php?action=showprofile&user_id=2
please could you help me??
-
I don´t see the names from the last users...
I see <b>{lang_last_user}</b> but I don´t see {last_user} in the plofile...
My site: http://www.paxykochan.net/myart/member.php?action=showprofile&user_id=2
please could you help me??
dit you step 2.2.?
-
yes... i did all steps..
that are my files (member.php and constant.php):
constants.php
PLEASE ATTACH THE FILES.
DO NOT SHOW CONTENT OF THE FILES IN THE REPLYS, IT ONLY MAKES THIS FORUM SLOWER
-
Thanks for this Great Mod...
-
Thanks for this Great Mod...
Thanx :oops: :oops:
-
i did all steps..
that are my files (member.php and constant.php) please... i need help.. i would like to have your great mod installed in my site
-
we can also show with userpic ?? :P
-
i did all steps..
that are my files (member.php and constant.php) please... i need help.. i would like to have your great mod installed in my site
i will look what i can do.
-
we can also show with userpic ?? :P
yes. i will look, how i can do this. then i post it ;)
-
i did all steps..
that are my files (member.php and constant.php) please... i need help.. i would like to have your great mod installed in my site
i will look what i can do.
thank you very much :D
-
hi! i tried to install this mod in another gallery without any modification, only phpbb integer 4images.. and this mod doesn´t work too . does this mod work in 1.7.3 version?
-
hi! i tried to install this mod in another gallery without any modification, only phpbb integer 4images.. and this mod doesn´t work too . does this mod work in 1.7.3 version?
i work with 1.73
-
i've this code:
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$config['userpic_width']."\" height=\"".$config['userpic_height']."\" border=\"0\"></a>" : $lang['no_random_userpic'];
how make show userpics with username as " alt="USERNAME" " ???
-
yes! it would be great!!
I would like that the guest people could see the last users.. is it possible ?
-
WOW i am searching such a long time for that mod...
NOW i installed it... @ 1.7.2 Great!!! Works Perfect .... i will post here, if i got any errors...
Today is a great day !!!! YEEEEEEAAAAAAAHHHHHHH!!!
-
Question:
How can i add the gender symbol to each visitor...
user Gender is user_sex in my 4homepages
-
So hier nun das Ergebnis meines Hardcore-Test:
Limit 25
Bei ca. 84000 Einträgen war Schluss
Die Datenbank hat dann nur noch sporadisch "neue" Last User on Profil angezeigt.
Abhilfe kann wirklich erst nachdem der lastuser_table geleert war, dann wieden wieder alle Last User on Profil im Profil eingetragen.
------
I test it. But near 84000 inserts in lastuser_table the Last User on Profil Mod ends.
No more inserts in the table, just someone perhaps.
in the moment that i delete the inserts from the lastuser_table the system runs!
kind regards
Daniel
-
I test it. But near 84000 inserts in lastuser_table the Last User on Profil Mod ends.
Question - after long time for have 84000 inserts in SQL table ?
-
The Limit for Last User in Profil is 25.
After six Weeks i have 84000 inserts in the lastuser table. (about 84t)
And then the MOD works just perhaps. Sometimes it work and sometimes it dont work.
-
The Limit for Last User in Profil is 25.
After six Weeks i have 84000 inserts in the lastuser table. (about 84t)
And then the MOD works just perhaps. Sometimes it work and sometimes it dont work.
Ok, I check code. I see why.
1 - MOD is no check for same user visit self profile (is count too).
2 - MOD is no check for different user visit target profile after 1 time (is count too).
3 - MOD is inject for all visit.
4 - MOD is no remove data after days (like postcards) - (is count too).
Is why, after 6 weeks, you have 84000 inserts ( 8O ) and good thing for host support hi DB permission ...
I say for no one use this MOD if small DB permission of host ...
-
Next Stop:
Datasets: 7897 insgesamt
Highest lastuser_id:32767 (colum one ind lastuser table)
No mohr Data write in Database
Feld Typ Attribute Null Standard Extra Aktion
lastuser_id smallint(5) Nein auto_increment Ändern Löschen Primärschlüssel Index Unique Volltext
userprofil_id smallint(10) Nein 0 Ändern Löschen Primärschlüssel Index Unique Volltext
user_on_id smallint(10) Nein 0 Ändern Löschen Primärschlüssel Index Unique Volltext
last_date int(15) Nein 0 Ändern Löschen Primärschlüssel Index Unique Volltext
PRIMARY PRIMARY 7897 Bearbeiten Löschen lastuser_id
-
i've this code:
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$config['userpic_width']."\" height=\"".$config['userpic_height']."\" border=\"0\"></a>" : $lang['no_random_userpic'];
how make show userpics with username as " alt="USERNAME" " ???
is there already a solution how to make this possible? I mean not showing username with text in member profile but also with a user pic?
Looking forward to your suggestions.
Greetz,
bergblume
-
Next Stop:
Datasets: 9481 insgesamt
Highest lastuser_id:32767 (colum one ind lastuser table)
No mohr Data write in Database
-
Daniel,
defination of columns are in your case wrong:
you should ALTER colums with smallint to int
BACKUP YOUR DATABASE FIRST!
mysql query for phpmyadmin:
ALTER TABLE `4images_lastuser` CHANGE `lastuser_id` `lastuser_id` INT( 10 ) NOT NULL AUTO_INCREMENT
V@no (http://www.4homepages.de/forum/index.php?action=profile;u=596) mentioned that here (http://www.4homepages.de/forum/index.php?topic=7193.0)
-
OK
lastuser_id table changed to "int"
I make a new test now.
thanks in advance Nicky
Daniel
-
...works it with 1.7.7..???
the variables {lang_last_user} and {last_user} gives no output on member_profile.html.
thanks for answer...!
ralf