firstly..i want to say that i hv search but didnt found..so dont ask me to search..2ndly..anybody have that code share wit me plz.. External image (may be gone)
Profile Last View By...
Started on the old forum in March 2008 · view the original in the archive · old links redirect here
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.
what script iv got a code let me c if i can find it
Want something coded email me at sales@webnwaphost.com for a prices.
that shows it
$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 "
Profile Last Viewed By: $by
";
this updates it
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);
}
hope this works for you but it will need slite alteration to your specific script
Want something coded email me at sales@webnwaphost.com for a prices.
///////////index.php (viewuser)
$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 "
Profile Last Viewed By: $by
";
//////////where must iput this code?
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);
}
under it
Want something coded email me at sales@webnwaphost.com for a prices.
thats too long mate this is how i do mine
$wid = $_GET["wid"];
$me = userid_sesid($sesid);
$update = mysql_query("INSERT INTO mc_users SET last_view='".$me."' WHERE id='".$wid."'"));
//fetch last view
$lv = mysql_fetch_array(mysql_query("SELECT last_view FROM mc_users WHERE id='".$wid."'"));
echo "Last viewed by: ".nick_userid($lb[0]);
R.M.C
PHP Adovocate B)
wut is the sql table for bcfc n mckeny coding?
-- --------------------------------------------------------
--
-- Table structure for table `last`
--
CREATE TABLE `last` (
`username` varchar(30) NOT NULL default '',
`date` varchar(50) NOT NULL default '0000-00-00',
`who` varchar(30) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `last`
--
-- --------------------------------------------------------
Want something coded email me at sales@webnwaphost.com for a prices.
thats too long mate this is how i do mine
$wid = $_GET["wid"]; $me = userid_sesid($sesid); $update = mysql_query("INSERT INTO mc_users SET last_view='".$me."' WHERE id='".$wid."'")); //fetch last view $lv = mysql_fetch_array(mysql_query("SELECT last_view FROM mc_users WHERE id='".$wid."'")); echo "Last viewed by: ".nick_userid($lb[0]);
if your using lavalair its best for yu 2 use the code mckeny gave ya as its been coded for it wer as my code came from my script
Want something coded email me at sales@webnwaphost.com for a prices.
wat about a list of the last 10 users who view ur profile?
am gonna code it....External image (may be gone)
wat about a list of the last 10 users who view ur profile?
am gonna code it....External image (may be gone)
too easy add these two new fields in ibwf_users
lastview int(100) NOT NULL default '0'
ltime int(100) NOT NULL default '0'
in index.php under $action=="viewuser"
$lv= getuid_sid($sid);
$tm = time();
mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'"));
$sql = (mysql_query("SELECT lastview,ltime FROM ibwf_users WHERE uid='".$who."' ORDER BY ltime DESC LIMIT 10"));
while($row = mysql_fetch_array($sql)){
echo "Last viewed by: ".getnick_uid($row[0]);
$newtime =$row[1]+(6 *60 *60);
echo ".date("D d M y - H:i:s",$newtime).
";
echo "------------
";
}
mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'"));Here is error!Look Parse error: syntax error, unexpected ')' in /home2/lidijama/public_html/proba/index.php on line 2434
Ha ha, External image (may be gone) this shall work:
mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'");
Advertise your mobile site for FREE with AdTwirl
i have recoded it again copy and paste the code in index.php under $action=="viewuser" after the $whonick variable has been declared to show last 1 profile viewer
to show last 10 profile viewers
thats too long mate this is how i do mine
$wid = $_GET["wid"]; $me = userid_sesid($sesid); $update = mysql_query("INSERT INTO mc_users SET last_view='".$me."' WHERE id='".$wid."'")); //fetch last view $lv = mysql_fetch_array(mysql_query("SELECT last_view FROM mc_users WHERE id='".$wid."'")); echo "Last viewed by: ".nick_userid($lb[0]);
$update = mysql_query("INSERT INTO mc_users SET last_view='".$me."' WHERE id='".$wid."'"));
A WHERE clause cannot be used in INSERT SQL command so
this is how i do mine is 100% false
Ha ha, External image (may be gone) this shall work:
mysql_query("INSERT INTO ibwf_users SET lastview='".$lv."',ltime='".$tm."' WHERE uid='".$who."'");
this shall NOT work🙄
Yep. If u need ppl to see last 10 profile viewers of each profile then easiest way is to make a whole new table and in it add about 4 fields, eg: id, uid, who, time and
from that u can call last 10 entries for each 'who' with time.
And basically that will do External image (may be gone) External image (may be gone) External image (may be gone)
thank yall very much. One I wanna know is: What is a clause?
External image (may be gone) WapCHAT Forum Currenltly changing over to xhtml External image (may be gone) My Dowloads Site External image (may be gone)