4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: martrix on May 05, 2005, 12:01:01 AM
-
Originally posted by / Author: Lucifix
1.) copy the file "install_profile_hits.php" from the attachment in your root and call it to. (www.yourDomain.xx/install_profile_hits.php)
2.) search in includes/db_field_definitions.php "?>" and insert above:
//############ Mod Profile Hits #################
$additional_user_fields['user_profile_hits'] = array($lang['user_profile_hits'], "text", 0);
3.) search in lang/yourLanguage/main.php:
//--- Users -------------------------------------------
//-----------------------------------------------------
insert below:
(english)
$lang['user_profile_hits'] = "Profile hits:";
(deutsch)
$lang['user_profile_hits'] = "Profil hits:";
4.) search in member.php section ($action == "showprofile"):
$site_template->register_vars(array(
"user_id" => $user_row['user_id'],
replace:
//############ Start Profile Hits #################
if ($user_info['user_level'] != ADMIN) {
$sql = "UPDATE ".USERS_TABLE."
SET user_profile_hits = user_profile_hits + 1
WHERE user_id = $user_id";
$site_db->query($sql);
}
//############ End Profile Hits ##################
$site_template->register_vars(array(
"user_id" => $user_row['user_id'],
"user_profile_hits" => ($user_row['user_profile_hits']),//############ Mod Profile Hits ##################
5.) search in templates/yourTemplates/member_profile.html:
<td class="row1">{user_comments}</td>
</tr>
insert below:
<tr>
<td class="row2"><b>{lang_user_profile_hits}</b></td>
<td class="row2">{user_profile_hits}</td>
</tr>
I did just re-publish that mod.
You should know, that there were some "unsolved" things around it for some users, but I don't have the "second" page of that mod saved anymore, so I do not know if somebody did find the solution :(
So tell me, if it works...
have fun
-
I have try what u have post and I think that it does not work :S
Some steps that are missing I guess:
in lang/<your language>/main.php
add:
$lang['profile_hits'] = "Profile hits:";
in member_profile.html
{lang_profile_hits}
-
Any one knows what else is missing?
-
hello?
-
... the Counter from this Mod not works.
(field is empty)
what is the problem?
-
I think that the biggest problem is this :)
You should know, that there were some "unsolved" things around it for some users, but I don't have the "second" page of that mod saved anymore, so I do not know if somebody did find the solution
-
exactly :wink:
-
so this "mod" should be on Mods & Plugins (Requests & Discussions)
-
I don't know if that will work but here we go:
// Update Profile Hits
if ($user_info['user_level'] != ADMIN && $user_info['user_id'] != $user_id) {
$sql = "UPDATE ".USERS_TABLE."
SET profile_hits = profile_hits + 1
WHERE user_id = $user_id";
$site_db->query($sql);
}
// End Update Profile Hits
Field=profile_hits
Type = smallint
Length/Values = 8
Attributes = Blank
Null = Not Null
Default** = 0
Extra = Blank
Circle Filled on ---.
Let me know if this will work ;)
-
Hm why it counts only my profile visits? When i put this [{profile_hits1}] into membrs profile template, it shows on my [8] but if I look into other profile i see []. Can someone explain?
-
not working :(
-
PLEASE HELP ANYBODY???
It doesnt work for us :(
:?
-
Don't know what could be wrong, but I would suggest you to check if maybe hits are working but they don't show in templates.
-
Hi Lucifix,
i see only "hits" and next to is a blank field...and no number, its nothing.
it will be so fine, when we can use the script..
can you check this once again??
pleaaaaaaaaaaaaaase :lol: :D :?
-
I have try what u have post and I think that it does not work :S
Some steps that are missing I guess:
in lang/<your language>/main.php
add:
$lang['profile_hits'] = "Profile hits:";
in member_profile.html
{lang_profile_hits}
In your includes/page_header.php file,
find :
"lang_site_stats" => $lang['site_stats'],
add below :
"lang_profile_hits" => $lang['profile_hits'],
Then, in your member.php file,
replace :
// Update Profile Hits
if ($user_info['user_level'] != ADMIN) {
$sql = "UPDATE ".USERS_TABLE."
SET profile_hits = profile_hits + 1
WHERE user_id = $user_id";
$site_db->query($sql);
}
with :
// Update Profile Hits
if ($user_info['user_level'] == USER) {
$sql = "
UPDATE ".USERS_TABLE."
SET profile_hits = profile_hits + 1
WHERE user_id = '$user_id' AND user_level = '".USER."'
";
$site_db->query($sql);
}
-
Topic updated above. ;)
-
You changed:
if ($user_info['user_level'] != ADMIN) {
to:
if ($user_info['user_level'] == USER) {
How does this change effect on count?
-
By specifying :
if ($user_info['user_level'] != ADMIN) {
you'd also include the GUEST levels (which is not recommended). ;)
-
Hi oracle, thanks for your help, but it dont work
i have not idea what the problem is.
the "lang" is right...it shows profile hits: but it doesnt shows a number and count
:((
-
Have you tested this under a user account or admin account ?
Assuming you're under the admin account, according to the first post, it was my understanding that these counts were supposed to be shown only as user levels. Is this correct ?
If not, a simple modification could be made.
Please advise.
-
i have tested it on admin and on guest level.
mh :(
-
This works only under users. Isn't that what this topic was all about ? :o
-
It doesnt work for me...
Not as Admin and not as user...
Could somebody help me?
-
Woops. In member.php file,
find :
"lang_icq" => $lang['icq']
add above :
"profile_hits1" => ($user_info['user_level'] == USER) ? $user_row['profile_hits'] : "",
Then, try it under a user account. It should work now. ;)
-
Doesnt work :(
You can test it here: http://www.amberger-fotogalerie.de
User: Test
password: test
It always shows "0"
-
I just found out, that i can edit the "Profile Hits" in the admin panel (edit user)....
So i can update the profile hits manually? :roll: :lol:
-
Well ... I just followed from the first post. If it's not showing from the member profile page, it would need to be all re-coded in order to show it right.
-
In member.php file,
replace :
WHERE user_id = '$user_id' AND user_level = '".USER."'
with :
WHERE ".get_user_table_field("", "user_id")." = ".$user_row['user_id'];
Will it work ?
-
no. doesnt work.
have you forgotten the quote i maked red?
Code:
$sql = "
UPDATE ".USERS_TABLE."
SET profile_hits = profile_hits + 1
WHERE ".get_user_table_field("", "user_id")." = ".$user_row['user_id'];"
";
-
no. doesnt work.
Could you please be more specific on that rather than just saying that it doesn't work ??
have you forgotten the quote i maked red?
No, this is the right statement.
-
Could you please be more specific on that rather than just saying that it doesn't work ??
Sorry if it sounds rude what im saying :oops:
I dont know what i should tell you more than "it doesnt work". It only shows a 0 and my hits won´t be counted.
this is my code in member.php :
// Update Profile Hits
if ($user_info['user_level'] == USER) {
$sql = "UPDATE ".USERS_TABLE."
SET profile_hits = profile_hits + 1
WHERE ".get_user_table_field("", "user_id")." = ".$user_row['user_id'];
$site_db->query($sql);
}
// End Update Profile Hits
my table settings are as follows:
Field=profile_hits
Type = smallint
Length/Values = 8
Attributes = Blank
Null = Not Null
Default** = 0
Extra = Blank
Circle Filled on ---.
thanks for your endurance with me TheOracle :lol:
it would be really cool if we could get it working :mrgreen:
-
It only shows a 0 and my hits won´t be counted.
Now, that's an answer.
Ok, so it would seems that I'd need to test this out myself. In the mean time, I will try to ajust the counts if it fails to update from my end.
-
Update:
Gentlement, I have successfully & entirely corrected this MOD as, now, everything works successfully from my end.
The corrections will be posted on a different topic under the Request & Discussions as a new MOD since you will also have the ability to select / un-select that option from the ACP - > Settings page as a screenshot will be posted in the mean time on that new topic.
The reason why I'm setting this as an additional option, from ACP, is for the fact that counting requires a little bit more ressources and trafic on your album. For security reasons, this feature will be activated only under your consent due to weaker web servers.
Hopefully, you'll understand. ;)
That said, an additonal update will be posted here in order to point you out to the new topic.
Important note:. Everything you did here will have to be done again - entirely. Thanks for your understanding. If you have any questions, regarding this subject, you'll be welcomed to do so on the new topic.
-
As promised, here we go :
http://www.4homepages.de/forum/index.php?topic=9567.0
;)
-
Thank you TheOracle for posting that - I guess we can lock this topic now, because yours looks like a complete one :D
-
Hi!
also works with 1.7.10
mfg Andi
-
Step 4 from first post have a error!
Change:
//############ Start Profile Hits #################
if ($user_info['user_level'] != ADMIN) {
$sql = "UPDATE ".USERS_TABLE."
SET profile_hits = profile_hits + 1
WHERE user_id = $user_id";
$site_db->query($sql);
}
//############ End Profile Hits ##################
$site_template->register_vars(array(
"user_id" => $user_row['user_id'],
"user_profile_hits" => ($user_row['user_profile_hits']),//############ Mod Profile Hits ##################
With:
//############ Start Profile Hits #################
if ($user_info['user_level'] != ADMIN) {
$sql = "UPDATE ".USERS_TABLE."
SET user_profile_hits = user_profile_hits + 1
WHERE user_id = $user_id";
$site_db->query($sql);
}
//############ End Profile Hits ##################
$site_template->register_vars(array(
"user_id" => $user_row['user_id'],
"user_profile_hits" => ($user_row['user_profile_hits']),//############ Mod Profile Hits ##################
-
you are right, thank you!