shout box converted into a just friends block

A while back i added that shout box to the profile pages, at that time i wondered if someone in here has something simular in the sense of just having your friends view and chat in that box. Something similar like the friends bulletin and so forth. It has a quick auto refresh and the user does not have to refresh over and over to view comments, it can also be inserted into the profile page, just food for thought that's all.

Everyday is a new beginning.
Quote · 22 Apr 2013

Seems easy enough to just add 'friends' permissions to it...

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 22 Apr 2013

Remember, if you have google ads on any of those pages with "shout-boxes, chat" you are in violation of their terms.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 22 Apr 2013

Hey Skyforum, you do know what i mean correct, u know how the shout box technically every member can view every comment. Well to change it so that if you being the member has your own shout box in your profile page, within that shout only that user and their friends chat in there, and only friends can view the chat not the whole site. So your saying that its that easy to just change the permissions?

Everyday is a new beginning.
Quote · 22 Apr 2013

newton u mean that if you have google ads in a users profile and a shout box as well ur violating google's terms? what da!

Everyday is a new beginning.
Quote · 22 Apr 2013

 

newton u mean that if you have google ads in a users profile and a shout box as well ur violating google's terms? what da!

 yes, I speak from experience on this, trust me. 

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 22 Apr 2013

Thanks but i will check and from what i remember i don't think i do on members profiles, but that's stupid r they nuts, oh well, i don't and never did like their ads, but thanks its good to know. I would like to know why, i will check

Everyday is a new beginning.
Quote · 22 Apr 2013

I only lost one site, they gave me a chance to remove them on my other sites. Not this one..

remember, top and bottom banners are shown on EVERY page of the site.

https://support.google.com/adsense/bin/answer.py?hl=en&stc=aspe-1pp-en&answer=48182

Google AdSense ad serving has been disabled to your site

ADS IN NEWSLETTERS/EMAIL/CHAT PROGRAMS: As stated in our program policies, AdSense publishers may not place ad code, search boxes or search results in emails or email programs sent to third parties. This includes but is not limited to newsletters, instant messaging (IMs), and chat sites. Due to privacy regulations, potential legal risk and targeting concerns, we cannot permit publishers to serve ads against message content or on pages that contain dynamic content.

This message was sent from a notification-only email address that does not accept incoming email. Please do not reply to this message.
-------------------------------------------------------------------------------------------------------------------------------

Hello,

During a recent review of your account we found that you are currently displaying Google ads in a manner that is not compliant with our program policies (https://www.google.com/support/adsense/bin/answer.py?answer=48182&stc=aspe-1pp-en).

--------------------------------------------------
EXAMPLE PAGE: http://www.duvallocals.info/page/jacksonville_full_page_chat

Please note that this URL is an example and that the same violations may exist on other pages of this website or other sites in your network.

VIOLATION(S) FOUND:

ADS IN NEWSLETTERS/EMAIL/CHAT PROGRAMS: As stated in our program policies, AdSense publishers may not place ad code, search boxes or search results in emails or email programs sent to third parties. This includes but is not limited to newsletters, instant messaging (IMs), and chat sites. Due to privacy regulations, potential legal risk and targeting concerns, we cannot permit publishers to serve ads against message content or on pages that contain dynamic content. 

ACTION TAKEN: We have disabled ad serving to your site.

ACCOUNT STATUS: ACTIVE
Your AdSense account remains active. However, please note that our team reserves the right to disable your account at any time. As such, we encourage you to become familiar with our program policies and monitor your network accordingly.

Issue ID# xxxxxxx

--------------------------------------------------
Thank you for your cooperation.

Sincerely,

The Google AdSense Team
----------------
For more information regarding this email, please visit our Help Center: https://www.google.com/adsense/support/bin/answer.py?answer=1342779&stc=aspe-ai4-en.
ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 22 Apr 2013

Wow but oh well, i only have shared buttons and and something else which is disabled. The banners i use are all on index page. I had a member ask me to please remove banners from their page so i did. Thank you for that alert good to know.

Everyday is a new beginning.
Quote · 22 Apr 2013

Add friends permission to it? How Do u mean in user, group, world? Just to give u a heads up i am a newbie.

Everyday is a new beginning.
Quote · 22 Apr 2013

In theory it seems possible, the coding you may have to get help with. But basically, what you are trying to do could possible be done with a left join query (I think) which would A. get id numbers of friends of member, and then only show messages that equal the id numbers of those friends.

caredesign.net
Quote · 23 Apr 2013

Ifigured I would play around with this thought, as I find it something that I can use myself. Thanks for the great idea, Dean. Please, anyone feel free to jump in and correct my mistakes, but it seems to be working for me.

In the BxShoutBoxDb.php page - under modules/boonex/shoutbox/classes - around line 61 through about line 86, I changed my code to this:


        function getLastMessageId()
        {
            $member2 = $_COOKIE['memberID'];
    /*     $sQuery     = "SELECT `ID` FROM `{$this -> sTablePrefix}messages` ORDER BY `ID` DESC LIMIT 1";
          */   $sQuery     = "SELECT `p`.*, `f`.`ID`    FROM (
                SELECT `ID` AS `ID` FROM `sys_friend_list` WHERE `ID` = '$member2' AND `Check` =1
                UNION
                SELECT `Profile` AS `ID` FROM `sys_friend_list` WHERE `Profile` = '$member2' AND `Check` =1
            ) AS `f`
            INNER JOIN `bx_shoutbox_messages` AS `p` ON `p`.`OwnerID` = `f`.`ID` ORDER BY `p`.`ID` DESC LIMIT 1";
              $iLastId    = $this -> getOne($sQuery);

            return ($iLastId) ? $iLastId : 0;
        }

        /**
         * Function will return array with messages;
         *
         * @param : iLastId (integer) - message's last id;
         * return : array();
                [OwnerID] - (integer) message owner's Id;
                [Message] - (string)  message text;
                [Date]    - (string)  message creation data;
         */
        function getMessages($iLastId)
        {
           
            $iLastId = (int) $iLastId;
            $member2 = $_COOKIE['memberID'];
            $sQuery = "SELECT `p`.*, `f`.`ID`    FROM (
                SELECT `ID` AS `ID` FROM `sys_friend_list` WHERE `ID` =  '$member2' AND `Check` =1
                UNION
                SELECT `Profile` AS `ID` FROM `sys_friend_list` WHERE `Profile` =  '$member2' AND `Check` =1
            ) AS `f`
            INNER JOIN `bx_shoutbox_messages` AS `p` ON `p`.`OwnerID` = `f`.`ID` WHERE `p`.`ID` > " . (int) $iLastId . " ORDER BY `p`.`ID`";
  /*          $sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " ORDER BY `ID`";
     */       return $this -> getAll($sQuery);
        }

 

Please keep in mind, this will totally change the function of the shoutbox, as I did this in the main module itself, instead of duplicating the module.So changing to what I have means you will ONLY see shoutbox messages from friends and noone else, regardless of where you put the shoutbox.

Hope this helps. I will continue testing this out in the AM, it's late and my bed is calling.

EDIT: I realized a minor error - forgot to add the ' ' around the $member2 variable, without it, a non logged in person will get a database error.

caredesign.net
Quote · 23 Apr 2013

OOPS, sorry - I messed up another thing so reposting new code. After playing around with it, this seems to work for me:


        function getLastMessageId()
        {
            $member2 = $_COOKIE['memberID'];
    /*     $sQuery     = "SELECT `ID` FROM `{$this -> sTablePrefix}messages` ORDER BY `ID` DESC LIMIT 1";
          */   $sQuery     = "SELECT `p`.*, `f`.`ID`    FROM (
                SELECT `ID` AS `ID` FROM `sys_friend_list` WHERE `Profile` = '$member2' AND `Check` =1
                UNION
                SELECT `Profile` AS `ID` FROM `sys_friend_list` WHERE `ID` = '$member2' AND `Check` =1
                UNION
                SELECT `ID` AS `ID` FROM `sys_friend_list` WHERE `ID` = '$member2' AND `Check` =1
            ) AS `f`
            INNER JOIN `bx_shoutbox_messages` AS `p` ON `p`.`OwnerID` = `f`.`ID` ORDER BY `p`.`ID` DESC LIMIT 1";
              $iLastId    = $this -> getOne($sQuery);

            return ($iLastId) ? $iLastId : 0;
        }

        /**
         * Function will return array with messages;
         *
         * @param : iLastId (integer) - message's last id;
         * return : array();
                [OwnerID] - (integer) message owner's Id;
                [Message] - (string)  message text;
                [Date]    - (string)  message creation data;
         */
        function getMessages($iLastId)
        {
           
            $iLastId = (int) $iLastId;
            $member2 = $_COOKIE['memberID'];
            $sQuery = "SELECT `p`.*, `f`.`ID`    FROM (
                SELECT `ID` AS `ID` FROM `sys_friend_list` WHERE `Profile` = '$member2' AND `Check` =1
                UNION
                SELECT `Profile` AS `ID` FROM `sys_friend_list` WHERE `ID` = '$member2' AND `Check` =1
                UNION
                SELECT `ID` AS `ID` FROM `sys_friend_list` WHERE `ID` = '$member2' AND `Check` =1
            ) AS `f`
            INNER JOIN `bx_shoutbox_messages` AS `p` ON `p`.`OwnerID` = `f`.`ID` WHERE `p`.`ID` > " . (int) $iLastId . " ORDER BY `p`.`ID`";
  /*          $sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " ORDER BY `ID`";
     */       return $this -> getAll($sQuery);
        }

caredesign.net
Quote · 23 Apr 2013

Yo how many times do i have to say, stop posting on my threads with foreign languages....LOL...thanks! Let me get back to you in a month once i am done replacing one character at a time. :)

Everyday is a new beginning.
Quote · 23 Apr 2013

Yo ProfessorSr so far so good. I am testing with different users and its working. Thanks!

Everyday is a new beginning.
Quote · 25 Apr 2013

After a few days of testing with DeanMonte We have made a few changes - but unfortunately, Icant figure out why the deletion and blocking of messages does not work with the edited code. Below I am attaching the 2 files that I had to change to get everything to at least show just shoutbox messages of friends. I hope one of you gurus can evaluate what I did and let me know what I did wrong.

Thanks in advance.

BxShoutBoxDb.php · 6.7K · 430 downloads
BxShoutBoxTemplate.php · 6.3K · 420 downloads
caredesign.net
Quote · 27 Apr 2013

Hey ProfessorSr, like i mentioned to u several days back bro, i applied it to my other site so far everything is ok. The deletion as mentioned still nothing. There has to be a way, however the one thing that i did is play with the, seconds before comment get deleted via admin panel. Yes like u mentioned i hope one of the others here can figure it out. Thanks for ur efforts also. I think this could really add an extra kick. Who knows.

Everyday is a new beginning.
Quote · 27 Apr 2013

Isn't it easier to use EVO-Wall for friends-interaction? Moreover, it imitates Facebook's newsfeed to a degree...

Quote · 15 May 2013

 

Isn't it easier to use EVO-Wall for friends-interaction? Moreover, it imitates Facebook's newsfeed to a degree...

That isn't the point of the topic, to use EVO-Wall.

Geeks, making the world a better place
Quote · 15 May 2013

Then, if I may ask, can be the Shoutbox re-engineered into a messaging system? :) Because messages with no thread or at least without a Re including the text that it'd been replied to is very user unfriendly.

Since you insist on mentioning only shoutbox here, lol, wink, could this be remade into a system, where inbox is only a place where to receive a notification of a friend reply with a link to his or her profile. Then once there, shoutbox would show the dialogue/message thread only between these friends A and B? :)

Just thinking aloud but if anyone is brave enough to tackle the message swamp, I'm all ears? (There you go, I again wandered away from the shoutbox topic!) :)

Quote · 15 May 2013

Here are those two shoutbox functions rewritten without the complex inner joins. And i tested the delete and it works fine.


        function getLastMessageId()
        {
            $iMemID = (int)$_COOKIE['memberID'];
            $aFriends = getMyFriendsEx($iMemID);
            $s = '';
            foreach ($aFriends as $iId => $aFriend) {
                $s .=  $iId . ',';
            }
            $s .= $iMemID;
            $sQuery     = "SELECT `ID` FROM `{$this -> sTablePrefix}messages` WHERE `OwnerID` IN (" . $s . ") ORDER BY `ID` DESC LIMIT 1";
            $iLastId    = $this -> getOne($sQuery);
            return ($iLastId) ? $iLastId : 0;
        }


        function getMessages($iLastId)
        {
            $iMemID = (int)$_COOKIE['memberID'];
            $aFriends = getMyFriendsEx($iMemID);
            $s = '';
            foreach ($aFriends as $iId => $aFriend) {
                $s .=  $iId . ',';
            }
            $s .= $iMemID;
            $iLastId = (int) $iLastId;
            $sQuery = "SELECT * FROM `{$this -> sTablePrefix}messages` WHERE `ID` > " . (int) $iLastId . " AND `OwnerID` IN (" . $s . ") ORDER BY `ID`";
            return $this -> getAll($sQuery);
        }

https://www.deanbassett.com
Quote · 15 May 2013

I don't know if its understood, but the original topic is or was if the Shout box can be set up that only friends of that member can see the conversation. ProfessorSr added and changed some coding to accomplish that, we tested it and it does work. Deano the coding you added here is that with the option of admin to delete the messages in the Shout box, cause that's what Professor and i were trying to resolve.

Everyday is a new beginning.
Quote · 15 May 2013

Yes. I understand it perfectly. My modification shows friends only. And yes. i did test to make sure admin can click the x and remove the message. It works.

My code is just a simpler way to pulling just friends posts without using that complex left join query that ProfessorSr was using.


https://www.deanbassett.com
Quote · 15 May 2013

ok thanks

Everyday is a new beginning.
Quote · 15 May 2013

Once again, Deanos - you are a genius. Thanks for taking the time to look at this and fix my screw-ups.

caredesign.net
Quote · 15 May 2013

Deano did you delete from line 75 to 83 which has this in there?

 

/**
         * Function will return array with messages;
         *
         * @param : iLastId (integer) - message's last id;
         * return : array();
                [OwnerID] - (integer) message owner's Id;
                [Message] - (string)  message text;
                [Date]    - (string)  message creation data;
         */

Everyday is a new beginning.
Quote · 15 May 2013

Yes. I just provided the functions. Not the comments above them. And thats what those are. Just comments.


https://www.deanbassett.com
Quote · 15 May 2013

Ok cool so i will delete them and test, thanks!

Everyday is a new beginning.
Quote · 15 May 2013

FriendsBox Module (Standalone Friends Only Shoutbox) for 7.1.2

Can be used side by side with the default public shoutbox.

FriendsBox is placed on homepage and profile page.

English only Langauge file.

Friends-Box-7-1-2.zip · 39.2K · 429 downloads
http://ModMyCMS.com --> Dolphin Hacks &Mods
Quote · 22 May 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.