4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: martrix on May 05, 2005, 12:01:01 AM

Title: [MOD] Profile hits by Lucifix
Post 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:
Code: [Select]
         <td class="row1">{user_comments}</td>
        </tr>
insert below:
Code: [Select]
<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
Title: Re: [MOD] Profile hits by Lucifix
Post by: ascanio on May 06, 2005, 04:10:12 AM
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:

Code: [Select]
$lang['profile_hits'] = "Profile hits:";
in member_profile.html

Code: [Select]
{lang_profile_hits}
Title: Re: [MOD] Profile hits by Lucifix
Post by: ascanio on May 06, 2005, 04:11:08 AM
Any one knows what else is missing?
Title: Re: [MOD] Profile hits by Lucifix
Post by: ascanio on May 12, 2005, 10:03:03 PM
hello?
Title: Re: [MOD] Profile hits by Lucifix
Post by: ryoades on May 22, 2005, 09:46:20 PM
... the Counter from this Mod not works.
(field is empty)
what is the problem?
Title: Re: [MOD] Profile hits by Lucifix
Post by: universal on May 24, 2005, 09:15:05 AM
I think that the biggest problem is this :)
Quote
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
Title: Re: [MOD] Profile hits by Lucifix
Post by: martrix on May 24, 2005, 09:22:27 AM
exactly  :wink:
Title: Re: [MOD] Profile hits by Lucifix
Post by: ascanio on May 24, 2005, 05:58:01 PM
so this "mod" should be on Mods & Plugins (Requests & Discussions)
Title: Re: [MOD] Profile hits by Lucifix
Post by: Lucifix on May 25, 2005, 11:16:32 PM
I don't know if that will work but here we go:

Code: [Select]
// 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 ;)
Title: Re: [MOD] Profile hits by Lucifix
Post by: universal on May 30, 2005, 03:48:22 PM
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?
Title: Re: [MOD] Profile hits by Lucifix
Post by: ascanio on June 01, 2005, 08:31:22 PM
not working :(
Title: Re: [MOD] Profile hits by Lucifix
Post by: glitzer on August 31, 2005, 10:54:25 PM
PLEASE HELP ANYBODY???

It doesnt work for us :(

 :?
Title: Re: [MOD] Profile hits by Lucifix
Post by: Lucifix on August 31, 2005, 11:51:52 PM
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.
Title: Re: [MOD] Profile hits by Lucifix
Post by: glitzer on September 01, 2005, 07:02:52 AM
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  :?
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 01, 2005, 02:07:38 PM
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:

Code: [Select]
$lang['profile_hits'] = "Profile hits:";
in member_profile.html

Code: [Select]
{lang_profile_hits}

In your includes/page_header.php file,

find :

Quote

"lang_site_stats" => $lang['site_stats'],


add below :

Code: [Select]

"lang_profile_hits" => $lang['profile_hits'],


Then, in your member.php file,

replace :

Quote

// 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 :

Code: [Select]

// 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);

}

Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 01, 2005, 02:18:14 PM
Topic updated above. ;)
Title: Re: [MOD] Profile hits by Lucifix
Post by: Lucifix on September 01, 2005, 02:22:22 PM
You changed:

Code: [Select]
if ($user_info['user_level'] != ADMIN) {
to:

Code: [Select]
if ($user_info['user_level'] == USER) {
How does this change effect on count?
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 01, 2005, 02:52:28 PM
By specifying :

Quote

if ($user_info['user_level'] != ADMIN) {


you'd also include the GUEST levels (which is not recommended). ;)
Title: Re: [MOD] Profile hits by Lucifix
Post by: glitzer on September 01, 2005, 04:13:57 PM
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

:((
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 02, 2005, 12:03:59 AM
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.
Title: Re: [MOD] Profile hits by Lucifix
Post by: glitzer on September 02, 2005, 07:23:41 AM
i have tested it on admin and on guest level.

mh :(

Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 02, 2005, 01:23:58 PM
This works only under users. Isn't that what this topic was all about ?  :o
Title: Re: [MOD] Profile hits by Lucifix
Post by: Egly on September 03, 2005, 12:58:14 AM
It doesnt work for me...

Not as Admin and not as user...

Could somebody help me?
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 01:05:52 AM
Woops. In member.php file,

find :

Quote

"lang_icq" => $lang['icq']


add above :

Code: [Select]

"profile_hits1" => ($user_info['user_level'] == USER) ? $user_row['profile_hits'] : "",


Then, try it under a user account. It should work now. ;)
Title: Re: [MOD] Profile hits by Lucifix
Post by: Egly on September 03, 2005, 11:27:39 AM
Doesnt work  :(

You can test it here: http://www.amberger-fotogalerie.de
User: Test
password: test

It always shows "0"
Title: Re: [MOD] Profile hits by Lucifix
Post by: Egly on September 03, 2005, 11:30:45 AM
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:
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 01:47:16 PM
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.
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 02:35:55 PM
In member.php file,

replace :

Quote

WHERE user_id = '$user_id' AND user_level = '".USER."'


with :

Code: [Select]

WHERE ".get_user_table_field("", "user_id")." = ".$user_row['user_id'];


Will it work ?
Title: Re: [MOD] Profile hits by Lucifix
Post by: Egly on September 03, 2005, 03:22:04 PM
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'];"


";
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 03:40:27 PM
Quote

no. doesnt work.


Could you please be more specific on that rather than just saying that it doesn't work ??

Quote

have you forgotten the quote i maked red?


No, this is the right statement.
Title: Re: [MOD] Profile hits by Lucifix
Post by: Egly on September 03, 2005, 04:11:28 PM
Quote
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 :

Code: [Select]
// 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:

Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 04:14:00 PM
Quote

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.
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 06:16:39 PM
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.
Title: Re: [MOD] Profile hits by Lucifix
Post by: TheOracle on September 03, 2005, 08:19:22 PM
As promised, here we go :

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

;)
Title: Re: [MOD] Profile hits by Lucifix
Post by: martrix on September 09, 2005, 10:47:23 AM
Thank you TheOracle for posting that - I guess we can lock this topic now, because yours looks like a complete one :D
Title: Re: [MOD] Profile hits by Lucifix
Post by: Rembrandt on July 25, 2011, 02:52:05 PM
Hi!

also works with 1.7.10

mfg Andi
Title: Re: [MOD] Profile hits by Lucifix
Post by: MrAndrew on August 08, 2011, 10:03:30 AM
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 ##################
Title: Re: [MOD] Profile hits by Lucifix
Post by: Rembrandt on August 08, 2011, 05:09:49 PM
you are right, thank you!