Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
netgoodies
Regular
Regular


Joined: Sep 26, 2005
Posts: 63
Location: Oxfordshire. United Kingdom.

PostPosted: Tue Nov 22, 2005 7:03 am Reply with quote

Hi

I have your Site Info block 2.1.1 and also the Instant Messaging addon from PCnuke.

I have tried to edit the site info block the way I want to integrate the two but without success.

I want the info block modified where it displays the nopm.gif adjacent to the user in the list of who_online_now.

Here is how it goes:
A. If user is online but not selected Instant messaging then nopm.gif with target to send private message.
Else-
B. If user is online and selected Instant messaging then im.gif with target to send instant message.

Instant messenger has added the field user_chatting in users table.

Info block edit suggested with instant messenger:

Code:
$sql = "SELECT $prefix"._session.".uname, $prefix"._session.".guest, $user_prefix"._users.".user_id, $user_prefix"._users.".user_from, $user_prefix"._users.".user_chatting FROM $prefix"._session.", $user_prefix"._users." WHERE $prefix"._session.".guest=0 AND $prefix"._session.".uname = $user_prefix"._users.".username";

$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
                                                                                                                           
while ($session = $db->sql_fetchrow($result)) {
    if (isset($session["guest"]) and $session["guest"] == 0) {
        if ($i < 10) {
        if ($session["user_chatting"]!=0 && $session["user_chatting"]!=NULL && (time()-$session["user_chatting"]) < 90 ) {
                $who_online_now .= "0$i:&nbsp;<A HREF=\"forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=$session[user_id]\">".$session[uname]."</a>&nbsp;&nbsp;<a href=\"#\" onClick=\"window.open('php121sendim.php?to=$session[user_id]','$session[user_id]','left=20,top=20,width=600,height=500,toolbar=0,resizeable=0');\"><img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\" border=0></a><br>\n";
        } else {
            $who_online_now .= "0$i:&nbsp;<A HREF=\"forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=$session[user_id]\">".$session[uname]."</a>&nbsp;&nbsp;<a href=\"messages-post-.html$session[user_id]\"><img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\" border=0></a><br>";
        }
        } else {
        if ($session["user_chatting"]!=0 && $session["user_chatting"]!=NULL && (date("U")-date("U",strtotime($session["user_chatting"])) < 90 )) {
                $who_online_now .= "$i:&nbsp;<A HREF=\"forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=$session[user_id]\">".$session[uname]."</a>&nbsp;&nbsp;<a href=\"#\" onClick=\"window.open('php121sendim.php?to=$session[user_id]','$session[user_id]','left=20,top=20,width=600,height=500,toolbar=0,resizeable=0');\"><img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\" border=0></a><br>\n";
        } else {
         $who_online_now .= "$i:&nbsp;<A HREF=\"forums.html?amp;file=profile&amp;mode=viewprofile&amp;u=$session[user_id]\">".$session[uname]."</a>&nbsp;&nbsp;<a href=\"messages-post-.html$session[user_id]\"><img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\" border=0></a><br>";
        }
        }
        $who_online_now .= ($i != $member_online_num ? "  " : "");
        $i++;
    }
}


Site info block to edit-
Code:
$sql = "SELECT SQL_NO_CACHE s.host_addr, u.user_id, u.username, u.user_allow_viewonline FROM $user_prefix"._session." s,".$user_prefix."_users u WHERE s.guest=0 AND u.username=s.uname ORDER BY u.username";

$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
$hiddenTotal = 0;
while ($member_result = $db->sql_fetchrow($result)) {
    if ($i < 10) $zi = "0$i";
    else $zi = $i;
    if (is_admin($admin)) {
      $zi = "<a href=\"http://$whoisServerString".$member_result['host_addr']."\" title=\"".$member_result['host_addr']."\" target=\"_blank\">".$zi."</a>";
   }
   $sessionNameModified = strlen($member_result['username'])<$nameMaxLength?$member_result['username']:substr($member_result['username'],0,10)."...";
    if (!$member_result['user_allow_viewonline']&&!is_admin($admin)) {
      $hiddenTotal++;
   }
    elseif (!$member_result['user_allow_viewonline']&&is_admin($admin)) {
      $hiddenTotal++;
      $who_online_now .= "$zi:&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=".$member_result['username']."\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\""._ALT_CHKPROFILE.$member_result['username']."\" title=\""._ALT_CHKPROFILE.$member_result['username']."\"></a>&nbsp;<a href=\"modules.php?name=Private_Messages&amp;mode=post&amp;u=".$member_result['user_id']."\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\""._ALT_SEND.$member_result['username']."\" title=\""._ALT_SEND.$member_result['username']."\"></a>&nbsp;<a title=\""._ALT_CHKPROFILE.$member_result['username']."\" href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=".$member_result['user_id']."\">".$sessionNameModified."</a>"._HIDDEN_ABBREV."<br />\n";
          $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
    else {
                $who_online_now .= "$zi:&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=".$member_result['username']."\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\""._ALT_CHKPROFILE.$member_result['username']."\" title=\""._ALT_CHKPROFILE.$member_result['username']."\"></a>&nbsp;<a href=\"modules.php?name=Private_Messages&amp;mode=post&amp;u=".$member_result['user_id']."\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\""._ALT_SEND.$member_result['username']."\" title=\""._ALT_SEND.$member_result['username']."\"></a>&nbsp;<a title=\""._ALT_CHKPROFILE.$member_result['username']."\" href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=".$member_result['user_id']."\">".$sessionNameModified."</a><br />\n";
       $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
}


Help please as I do not want to replace your more enhanced code which includes user ip on mouseover and user profile image.

Regards

Martyn
 
View user's profile Send private message Visit poster's website
netgoodies
PostPosted: Thu Nov 24, 2005 3:01 am Reply with quote

Anyone help me here ?
 
Nomad
Client


Joined: Jan 21, 2006
Posts: 87
Location: Arizona

PostPosted: Sat Mar 11, 2006 10:23 pm Reply with quote

Did you ever get this answered? Im also looking for a solution.

_________________
Nomad!~! 
View user's profile Send private message Visit poster's website AIM Address
netgoodies
PostPosted: Sun Jul 30, 2006 6:27 am Reply with quote

Nomad wrote:
Did you ever get this answered? Im also looking for a solution.


Hi

Sorry I have overlooked this post.

Yes I have sorted it out. See it at Only registered users can see links on this board! Get registered or login!

Regards

Martyn
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©