Profile Last View By...

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

45 replies · 3,892 views · started 18 years ago · 1 min read

TL;DR · summary of 45 replies
  • The code to show the last 10 profile viewers was not working as expected.
  • A solution was proposed by rukiya, but it resulted in a syntax error on line 2434 of index.php for some users.
  • Another user provided an alternative approach using three fields: id, uid, and who. However, this did not work for everyone due to different database configurations or issues with the SQL query structure.
  • The thread concluded that showing the last 10 profile viewers required creating a new table specifically for tracking these views, which was deemed necessary by some users.

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

16 participants
GumSlone Administrator Principal · 1,690 posts #42

downloaded last 10 profile viewers script and changed table name to ibwf_lastview , before it was only lastview in sql table just need to know do i have to change sql query insert into ibwf_lastview FROM command is getting table ibwf_lastview INSERT command is inserting in field of table ibwf_lastview is it ? just need to know how to viw last 10 users or is it necessary to complete 10 than only i be able to view

CODE

$lv=getnick_sid($sid); mysql_query("INSERT INTO lastview SET lastview='".$lv."', whonick='".$whonick."', ltime='".time()."'"); $sql= mysql_query("SELECT lastview,ltime FROM ibwf_lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC"); $counter=0; while($row = mysql_fetch_array($sql)){ if($counter<10){ echo "Last viewed by $row[0] "; $newtime =$row[1]+(6 *60 *60); echo "".date("D d M y - H:i:s a",$newtime)." "; echo "------------ "; $counter++; } }

this is a bad coding which may use many server ressources,

try this:

$lv=getnick_sid($sid);
mysql_query("INSERT INTO lastview SET lastview='".$lv."', whonick='".$whonick."', ltime='".time()."'");
$sql= mysql_query("SELECT lastview,ltime FROM ibwf_lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 10");
$counter=0;
while($row = mysql_fetch_array($sql)){
echo "Last viewed by $row[0] ";
$newtime =$row[1]+(6 *60 *60); 
echo "[b]".date("D d M y - H:i:s a",$newtime)."[/b]
";
echo "------------
";
}

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

modfiles Developer · 200 posts #44

for hypertype

$dvws = mysql_fetch_array(mysql_query("SELECT dproviews, dayviews, yearviews FROM ibwf_users WHERE id='".$who."'"));

i get an error in this part.. i dont see the dproviews, dayviews, yearviews in sql that is posted.

sweetangel Lead · 885 posts #46
  $sqlthing = mysql_query("SELECT * FROM last WHERE username='$name'");
  $dt=(mysql_result($sqlthing,0,"date"));
  $by=(mysql_result($sqlthing,0,"who"));
//echo "
Profile Last Viewed At
$dt";
echo "
Ultima visita profilo di: $by
";

$sql2 = "UPDATE last SET who='$username' WHERE username='$name'";
$result2 = mysql_query($sql2);
$dt = date('Y-m-d H:i:s');
$sql = "SELECT * FROM last where username='$name'";
$result = mysql_query($sql);
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows=="1")
{
$sql = "UPDATE last SET date='$dt' WHERE username='$name'";
$result = mysql_query($sql);
}
if ($number_of_rows=="0")
{

$dt = date('Y-m-d H:i:s');

$sql11 = "INSERT INTO last (username,date,who) VALUES
('$name','$dt','$username')";
$result11 = mysql_query($sql11);
}

this not work at my wapdesire script...any1 can help to fix??!!

if like my post click:

External image (may be gone)

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