Showing posts with label jcow modules. Show all posts
Showing posts with label jcow modules. Show all posts

Tuesday, 3 January 2012

recent profile visitors [recento v1.0]

recento display recent profile visitors on users profile page in sidebar.also display  recent profile visitors and top profile visitors  in a facebook style popup box.




















download







please follow the installation instruction carefully


Instructions:


1.  extract and uploade recento to your jcow/modules folder.


2.now go to Home > Admin Panel > Modules check recento and click on update modules.


3.open file u.module.php in jcow/includes/libs in your text/code editor and than find function show_sidebar 




// following
$res = sql_query("select u.id,u.username,u.avatar from ".tb()."followers as f left join ".tb()."accounts as u on u.id=f.fid where f.uid='{$owner['id']}' order by u.lastlogin DESC limit 10");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
ass(array('title'=>t('Following'), 'content' => '<div class="toolbar">'.url('u/'.$owner['username'] .'/following',t('See all')).'</div>'.$output));


// friends
$res = sql_query("SELECT u.* FROM `".tb()."friends` as f left join `".tb()."accounts` as u on u.id=f.fid where f.uid={$owner['id']} ".dbhold('f')." ORDER BY f.created DESC LIMIT 9");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
ass(array('title'=>t('Friends'), 'content' => '<div class="toolbar">'.url('u/'.$owner['username'] .'/friends',t('See all')).'</div>'.$output));


4. insert this code below the above code




 // recent visitor
if ($client['id']) {
if ($client['id'] == $owner['id']) {
$res = sql_query("select u.* from ".tb()."recent_visitor as r left join ".tb()."accounts as u on u.id=r.vid where r.uid='{$owner['id']}' order by r.recent_visited DESC limit 10");
$output = '';
while ($row = sql_fetch_array($res)) {
$r = 1;
$output .= avatar($row);

$i++;
}

$recentvisitedlink= '<a href="#" onclick="jQuery.facebox({ ajax: \''.url('recento/recentvisited/'.$owner['id']  ).  '\' });return false;" >'.t('see all').'</a>';
ass(array('title'=>t('recent visitor'), 'content' => '<div class="toolbar">'.$recentvisitedlink.'</div>' .$output));
}
else
{
sql_query("INSERT INTO `".tb()."recent_visitor` (uid, vid, first_visited, recent_visited, visiting_count) VALUES
(  {$owner['id']},{$client['id']},current_timestamp, current_timestamp, 1)
ON DUPLICATE KEY UPDATE `visiting_count` = `visiting_count`+1;");

}
}
 // end of recent visitor


5.done









screen shots...


1.













2.



















Tuesday, 20 December 2011

fuser v1.0


fuser display friend and following in a facebook style popup box on users profile page.fuser module used facebox script which is already installed  jcow  for displaying liked users. so it will not give any extra burden to your network.











.


download


please follow the installation instruction carefully

1.uploade and extract fuser.zip to your jcow/modules folder.

2.now go to Home > Admin Panel > Modules check fuser and click on update modules.

3.open file u.module.php in jcow/includes/libs in your text/code editor and than find this code


// following
$res = sql_query("select u.id,u.username,u.avatar from ".tb()."followers as f left join ".tb()."accounts as u on u.id=f.fid where f.uid='{$owner['id']}' order by u.lastlogin DESC limit 10");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
ass(array('title'=>t('Following'), 'content' => '<div class="toolbar">'.url('u/'.$owner['username'] .'/following',t('See all')).'</div>'.$output));


// friends
$res = sql_query("SELECT u.* FROM `".tb()."friends` as f left join `".tb()."accounts` as u on u.id=f.fid where f.uid={$owner['id']} ".dbhold('f')." ORDER BY f.created DESC LIMIT 9");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
ass(array('title'=>t('Friends'), 'content' => '<div class="toolbar">'.url('u/'.$owner['username'] .'/friends',t('See all')).'</div>'.$output));

4. replace the above code with this one


// following
$res = sql_query("select u.id,u.username,u.avatar from ".tb()."followers as f left join ".tb()."accounts as u on u.id=f.fid where f.uid='{$owner['id']}' order by u.lastlogin DESC limit 10");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
$fllwrlink= '<a href="#" onclick="jQuery.facebox({ ajax: \''.url('fuser/fllwrfuser/'.$owner['id']  ).  '\' });return false;" >'.t('see all').'</a>';
ass(array('title'=>t('Following'), 'content' => '<div class="toolbar">'.$fllwrlink.'</div>'.$output));


// friends
$res = sql_query("SELECT u.* FROM `".tb()."friends` as f left join `".tb()."accounts` as u on u.id=f.fid where f.uid={$owner['id']} ".dbhold('f')." ORDER BY f.created DESC LIMIT 9");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
$frndslink= '<a href="#" onclick="jQuery.facebox({ ajax: \''.url('fuser/frndsfuser/'.$owner['id']  ).  '\' });return false;" >'.t('see all').'</a>';
ass(array('title'=>t('Friends'), 'content' => '<div class="toolbar">'.$frndslink.'</div>' .$vivek.$output));


5.done