Profile Viewed Times For Lavalair

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

10 replies · 1,540 views · started 18 years ago · 1 min read

TL;DR · summary of 10 replies
  • Metulj provided a fix to prevent users from updating their own profile views.
  • Rukiya added a new row in the ibwf_users SQL table and provided updated index.php code under "viewuser" action.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
rukiya Lead · 569 posts #3

yeah i would love to get the codes for it. can anyone help me please?

new row has to be added in ibwf_users sql table

`profileview` int(100) NOT NULL default '0',

then add this code index.php under "viewuser" action

$sql= mysql_fetch_array(mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
$sql1 =$sql[0]+1;
mysql_query("UPDATE ibwf_users SET profileview='".$sql1."' WHERE id='".$who."'");
$sql2=mysql_fetch_array( mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
echo "Profile viewed $sql2[0] times";
metulj Super moderator Principal · 1,726 posts #8

new row has to be added in ibwf_users sql table

`profileview` int(100) NOT NULL default '0',

then add this code index.php under "viewuser" action

$sql= mysql_fetch_array(mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
$sql1 =$sql[0]+1;
mysql_query("UPDATE ibwf_users SET profileview='".$sql1."' WHERE id='".$who."'");
$sql2=mysql_fetch_array( mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
echo "Profile viewed $sql2[0] times";

well this code does update profile view.. but theres a small problem i cannot prevent to update views when i look into my own profile? so its kind a like cheat.. every user can update number of profile views by him self so how to fix that? External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

rukiya Lead · 569 posts #9

well this code does update profile view.. but theres a small problem i cannot prevent to update views when i look into my own profile? so its kind a like cheat.. every user can update number of profile views by him self so how to fix that? External image (may be gone)

here is the fixed code new row has to be added in ibwf_users sql table

`profileview` int(100) NOT NULL default '0',

then add this code index.php under "viewuser" action

$sql= mysql_fetch_array(mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
if ($who==$uid)
{
$sql1 = $sql[0];
}
else {
$sql1 = $sql[0]+1;
}
mysql_query("UPDATE ibwf_users SET profileview='".$sql1."' WHERE id='".$who."'");
$sql2=mysql_fetch_array( mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
echo "Profile viewed $sql2[0] times";
metulj Super moderator Principal · 1,726 posts #11

here is the fixed code new row has to be added in ibwf_users sql table

`profileview` int(100) NOT NULL default '0',

then add this code index.php under "viewuser" action

$sql= mysql_fetch_array(mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
if ($who==$uid)
{
$sql1 = $sql[0];
}
else {
$sql1 = $sql[0]+1;
}
mysql_query("UPDATE ibwf_users SET profileview='".$sql1."' WHERE id='".$who."'");
$sql2=mysql_fetch_array( mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'"));
echo "Profile viewed $sql2[0] times";

thank you for fixed code works perfect External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close