PDA

View Full Version : Online Offline Mod that works with WSS



mystical
10-31-2012, 06:23 PM
If you want to show if a user is online or offline on their profile....
Go to this thread :
http://forum.avscripts.net/showthread.php?10486-User-Online-Offline-mod-5-6&highlight=users+online
It works for us too.....

Just change this line in the onlineoffline.php file

Change This:
$query = "SELECT * FROM ava_usersonline WHERE user_id = '$id' ";

Change it to:
$query = "SELECT * FROM wss_usersonline WHERE user_id = '$id' ";


Thanks go to TwistedGenius!

Delta12
10-31-2012, 10:46 PM
This works great on profile pages, thank you for the share and thanks to TwistedGenius for the MOD :)

I can't seem to make it work on the member list. My member list and profile pages was previously modified with the help of "The One" so that only registered users can view them which makes it a bit more tricky now to make the member list function with the online or offline buttons :(

Delta12
11-02-2012, 06:11 PM
I would really like to make the member's list work with the online/offline MOD. Is there anyone that can please help me with the code, it would be much appreciated? Here is my existing code


<?php
if ($user['login_status'] == 1) {
if (isset($_GET['sort'])) {
if ($_GET['sort'] == 'username') {
$sort = 'username';
}
else if ($_GET['sort'] == 'location') {
$sort = 'location';
}
else {
$sort = 'id';
}
}
else {
$sort = 'username';
}

if (isset($_GET['order'])) {
if ($_GET['order'] == 'asc') {
$order = 'asc';
}
else {
$order = 'desc';
}
}
else {
$order = 'asc';
}

if (!isset($_GET['page'])) {
$page = 1;
}
else {
$page = intval($_GET['page']);
if ($page == 0)
$page = 1;
}
$mpp = 30;
$from = (($page * $mpp) - $mpp);

$sql = mysql_query("SELECT * FROM wss_users WHERE activate = 1 ORDER BY $sort $order LIMIT $from, $mpp");

echo '
<table border="0" cellspacing="0" cellpadding="0" id="member_list">
<tr>
<td></td>
<td>
<strong>'.ML_USERNAME.'</strong>
<a href="'.MemberListUrl('username', 'asc', 1).'"><img src="'.$setting['site_url'].'/images/plus.png" alt="tinyup" width="10" height="10" /></a>
<a href="'.MemberListUrl('username', 'desc', 1).'"><img src="'.$setting['site_url'].'/images/minus.png" alt="tinyup" width="10" height="10" /></a>
</td>
<td>
<strong>'.ML_JOIN_DATE.'</strong>
<a href="'.MemberListUrl('date', 'desc', 1).'"><img src="'.$setting['site_url'].'/images/plus.png" alt="tinyup" width="10" height="10" /></a>
<a href="'.MemberListUrl('date', 'asc', 1).'"><img src="'.$setting['site_url'].'/images/minus.png" alt="tinyup" width="10" height="10" /></a>
</td>
<td>
<strong>'.ML_LOCATION.'</strong>
<a href="'.MemberListUrl('location', 'desc', 1).'"><img src="'.$setting['site_url'].'/images/plus.png" alt="tinyup" width="10" height="10" /></a>
<a href="'.MemberListUrl('location', 'asc', 1).'"><img src="'.$setting['site_url'].'/images/minus.png" alt="tinyup" width="10" height="10" /></a>
</td>
</tr>';
while ($row = mysql_fetch_array($sql)) {
$profile_url = ProfileUrl($row['id'], $row['seo_url']);

if($row['avatar'] == '') {
if ($row['facebook'] == 1) {
$avatar = 'http://graph.facebook.com/'.$row['facebook_id'].'/picture';
}
else {
$avatar = $setting['site_url'].'/uploads/avatars/default.png';
}
}
else {
$avatar = $setting['site_url'].'/uploads/avatars/'.$row['avatar'];
}

if($row['location'] == '') {
$location = UNSPECIFIED;
}
else {
$location = $row['location'];
}

echo '<tr>
<td width="40"><img src="'.$avatar.'" width="'.$template['memberlist_avatar_width'].'" height="'.$template['memberlist_avatar_height'].'" alt="avatar" /></td>
<td><a href="'.$profile_url.'">'.$row['username'].'</a></td>
<td>'.FormatDate($row['joined'], 'any').'</td>
<td>'.$location.'</td>
</tr>';
}

echo' </table>';

// Pages
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM wss_users WHERE activate = 1"),0);
$total_pages = ceil($total_results / $mpp);

if ($total_pages > 1) {

echo '<div class="category_pages">';

if($page > 1){
$prev = ($page - 1);
$url = MemberListUrl($sort, $order, $prev);

echo '<a href="'.$url.'">&laquo; '.PREVIOUS.'</a> ';

}

if ($page > 4) {
$url = MemberListUrl($sort, $order, 1);
echo '<a href="'.$url.'">1</a> ';
}
if ($page > 5) {
$url = MemberListUrl($sort, $order, 2);
echo '<a href="'.$url.'">2</a> ... ';
}

$low = $page - 4;
$high = $page + 8;

for($i = 1; $i <= $total_pages; $i++){
if (($i > $low) && ($i < $high)) {
if($page == $i){
echo '<b><a href="#">'.$i.'</a></b> ';
}
else {
$url = MemberListUrl($sort, $order, $i);
echo '<a href="'.$url.'">'.$i.'</a> ';
}
}
}

if (($page < $total_pages - 8)) {
$penultimate = $total_pages - 1;
$url = MemberListUrl($sort, $order, $penultimate);
echo ' ... <a href="'.$url.'">'.$penultimate.'</a> ';
}
if (($page < $total_pages - 7)) {
$url = MemberListUrl($sort, $order, $total_pages);
echo '<a href="'.$url.'">'.$total_pages.'</a> ';
}

if($page < $total_pages){
$next = ($page + 1);
$url = MemberListUrl($sort, $order, $next);
echo '<a href="'.$url.'">'.NEXT.' &raquo;</a> ';
}

echo '</div>';
}
}
else{
echo '<div align="center">Log in to view the members list</div>';
}
?>

Delta12
11-03-2012, 12:29 PM
Just to update the thread, I managed to get the MOD to work on the member's list by going through the code line by line and inserting the bits I didn't have. The part of the code that gave me issues regardless of what image path I specified was


if ($num_results > 0){
$onlineimage = '<img src="'.$url.'/images/online.png" width="59" height="18" />';
}
else {
$onlineimage = '<img src="'.$url.'/images/offline.png" width="59" height="18" />';
}

The only way I got the online/offline images to display was to replace the code above with


if ($num_results > 0){
$onlineimage = '<img src="/images/online.png" width="59" height="18" />';
}
else {
$onlineimage = '<img src="/images/offline.png" width="59" height="18" />';
}

Thanks to TwistedGenius for creating the MOD and thanks to mystical for letting the forum know that it was possible to convert the MOD to WSS :)

Clayman
03-28-2014, 04:22 PM
Hey is this MOD working with the Memberlist? On the ProfilePage they show me the Status but on the memberlist all users is listed as offline

mystical
03-29-2014, 03:56 AM
Hey is this MOD working with the Memberlist? On the ProfilePage they show me the Status but on the memberlist all users is listed as offline

It works with both. Just follow the directions in my post and add what Delta added.

play-games
03-29-2014, 05:17 AM
Hey Mystical, why are you spamming me via PM?
------------------------------------------------------------------------------------------
Well, I decided to give it a go and try the cam thing anyway. I did not use my own hosting for it as I don't see a need. Trying to save money. Check it out here and let me know what you think.

http://camlink.removed
------------------------------------------------------------------------------------------
Has someone hacked your account?

Bad Wolf
03-29-2014, 12:08 PM
Hey Mystical, why are you spamming me via PM?
------------------------------------------------------------------------------------------
Well, I decided to give it a go and try the cam thing anyway. I did not use my own hosting for it as I don't see a need. Trying to save money. Check it out here and let me know what you think.

http://camlink.removed
------------------------------------------------------------------------------------------
Has someone hacked your account?
Well i have known him for almost 4 years and he has never spammed anyone yet.

mystical
03-29-2014, 12:20 PM
Considering I delete some of the spam here it is highly unlikely that I sent you spam. I sent that message to another member. I have no idea how it got in your mailbox. As a matter of fact I have no clue who you even are. I will be asking Andy what happened though. That would explain why I never got a response from the person I sent it to. :D

mystical
03-29-2014, 12:25 PM
I just sent Andy a PM to see what happened. Hopefully you don't get that one too. :p

Clayman
03-29-2014, 03:43 PM
ok now it works thank you

mystical
04-02-2014, 06:40 PM
my member list and profile pages was previously modified with the help of "the one" so that only registered users can view them.

games and softwares (www.highlycompressedgamez.in)

spam in this post. Redirects to infected files! Do not click on this persons link in the signature.