If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
hi ... i need a little help :D .. i want to add in in user profile how many views he had in it and how were the last 10 users who saw her profile .. and a top of the most seen profiles ...
Hate romains that take codes from here and tell to all that they had made that
hi ... i need a little help :D .. i want to add in in user profile how many views he had in it and how were the last 10 users who saw her profile .. and a top of the most seen profiles ... [/b]
Add 1 row in ibwf_users table called: `prof_vazut`
Put this code in ($action=="viewuser") where you want to show
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//////////// Contor Profil User
$vws = mysql_fetch_array(mysql_query("SELECT prof_vazut FROM ibwf_users WHERE id='".$who."'"));
$views = $vws[0]+1;
echo "Profil vazut de: $views ori
";
/////////Actualizare
if(mypro(getuid_sid($sid), $who))
{
echo "";
}else{
mysql_query("UPDATE ibwf_users SET prof_vazut='".$views."' WHERE id='".$who."'");
}
//////////incheiere contor profil</div>
Last Profile viewer and last 10 viewers
Make one table like this:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>CREATE TABLE `ibwf_ultima_vizualizare` (
`whonick` varchar(20) collate latin1_general_ci NOT NULL,
`id` int(100) NOT NULL auto_increment,
`lastview` varchar(20) collate latin1_general_ci NOT NULL,
`ltime` int(100) NOT NULL default '0',
PRIMARY KEY (`whonick`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;</div>
Put this code in ($action=="viewuser") where you want to show
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//////////Ultima vizualizare profil * de catre cine
$sql = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_ultima_vizualizare WHERE whonick='".$whonick."'"));
if ($sql[0]>10)
{
$sql = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM ibwf_ultima_vizualizare WHERE whonick='".$whonick."'"));
$sql = $sql[0]-9;
mysql_query("DELETE FROM ibwf_ultima_vizualizare WHERE whonick='".$whonick."' AND id <'".$sql."'");
}
$lv=getnick_sid($sid);
$a = getuid_nick($whonick);
if($a!=$uid)
{
mysql_query("INSERT INTO ibwf_ultima_vizualizare SET lastview='".$lv."', whonick='".$whonick."', ltime='".time()."'");
}
$sql= mysql_fetch_array(mysql_query("SELECT lastview,ltime FROM ibwf_ultima_vizualizare WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 1"));
$a = getuid_nick($sql[0]);
$link = "<a href=\"index.php?action=viewuser&sid=$sid&who=$a\" >$sql[0]</a>";
echo "Ultima vizualizare de catre $link | <a href=\"index.php?action=ultimii10&who=$who&sid=$si d\"> + 10</a> ";
////////// Incheiere *vizualizator profil</div>
Here is window for last 10 users where they show:
Create new action called ultimii10 and put where you want in index.php
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>/////////////// Ultimii 10 vizitatori ai profilului
else if($action=="ultimii10")
{
addonline(getuid_sid($sid),"Vizualizare ultimii 10 vizitatori profil","");
if($who==""||$who==0)
{
$mnick = $_POST["mnick"];
$who = getuid_nick($mnick);
}
$whonick = getnick_uid($who);
echo "<card id=\"main\" title=\"Vizualizare ultimii 10 vizitatori profil\">";
echo "<p align=\"center\">";
$nick = getnick_sid($sid);
echo "$nick Aici poti vizualiza ultimii 10 useri care ti-au accesat profilul
";
echo "</p>";
echo "<p align=\"left\">";
$sql= mysql_query("SELECT lastview,ltime FROM wolfy_lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 10");
while($row = mysql_fetch_array($sql))
{
$a = getuid_nick($row[0]);
echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$a\" >$row[0]</a>";
$newtime =$row[1]+(0 *60 *60);
echo " ".date("D d M y - h:i:s a",$newtime)."
";
echo "------------
";
}
echo "</p>";
echo "<p align=\"center\">";
$a = getuid_nick($whonick);
echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$a\" >«Back to $whonick</a>
";
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Home</a>";
echo "</p>";
echo "</card>";
}</div>
Here is the top profile viewers Put this in list.php there is the statistics orders or where you want
And link to top profile:
echo "<a href=\"lists.php?action=topprofile&sid=$sid\">Top Profile Viewers</a>
";
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//////////////////////////////////Top Online
else if($action=="topprofile")
{
addonline(getuid_sid($sid),"Top Profile Vizualizate","lists.php?action=$action");
echo "<card id=\"main\" title=\"Top Profile Vizualizate\">";
echo "<p align=\"center\">";
echo "Top Profile Vizualizate";
echo "</p>";
if($page=="" || $page<=0)$page=1;
$num_items = regmemcount(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
$sql = "SELECT id, name, proviews FROM ibwf_users ORDER BY prof_vazut DESC LIMIT $limit_start, $items_per_page";
echo "
when i want view the profile it give me : "Fatal error: Call to undefined function mypro() in ............/profil.php on line 203" :sad:[/b]
Sorry :D
Put this in core.php
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>//////////////////////////////////////////functia contor profil by wolfy
function mypro($uid, $tid)
{
if($uid==$tid)
{
return true;
}
}</div>
Comment