[PHPBB3]How to add "Replied to thread" in AJAX chatbox

How-to's, little tricks, tutorials, code examples (snippets) and read-me's.

[PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby jooda » 02 Apr 2012, 09:17

My method:
includes/function_posting.php:
Add before function generate_smilies($mode, $forum_id)
Code: Select all
function sendChat($topic_id2,$topicname,$anon){

   global $auth, $db, $user, $config, $template;
    if($user->data['group_id'] == 34){
    $colour = "00CCFF";
    }else{
    $colour = "9F220D";
    }
   if($anon){
   $usars = "Anonymous";
   $usarsid = 0;
   $usarscol = "000000";
   }else{
   $usars = $user->data['username'];
   $usarsid = $user->data['user_id'];
   $usarscol = $user->data['user_colour'];
   }
      $uid = $bitfield = $options = '';
      $allow_bbcode = $allow_urls = $allow_smilies = true;
      $sql_ary = array(
         'chat_id'         => 2,
         'user_id'         => $usarsid,
         'username'         => $usars,
         'user_colour'      => $usarscol,
         'message'         => '<span style="font-family: system; size: 34px;"> has replied to the thread: <a style="color: #' . $colour . ';" href="'.$topic_id2.'&start=99999">'.$topicname.'</a> <img src="http://cris.hobo-studios.org/pixolart/favicon.png"></span>',
         'bbcode_bitfield'   => 1,
         'bbcode_uid'      => 1,
         'bbcode_options'   => 1,
         'time'            => 1,
      );
      $sql = 'INSERT INTO phpbb_chat ' . $db->sql_build_array('INSERT', $sql_ary);
      $db->sql_query($sql);



}



Add AFTER
'post_edit_locked' => $data['post_edit_locked']
);

Code: Select all
$topicurlz = generate_board_url() . "/viewtopic.php?f=" . $data['forum_id'] . "&t=" . $data['topic_id'] . "&p=" . $data['post_id'] . "#p" . $data['post_id'];
         if($data['topic_id'] != 0 && $data['forum_id'] != 169 && $data['forum_id'] != 194 && $data['forum_id'] != 193 && $data['forum_id'] != 191 && $data['forum_id'] != 186 && $data['forum_id'] != 172 && $data['forum_id'] != 173 && $data['forum_id'] != 187 && $data['forum_id'] != 199){
            if($data['forum_id'] == 171){
               sendChat($topicurlz, $subject, true);
            }else{
               sendChat($topicurlz, $subject, false);
            }
         }


AND BEFORE
break;
case 'edit_first_post':

The anon thing is because I made a forum anonymous and made all users who replied to the thread show up as anonymous on chat,
jooda    
Ensign
Ensign
 
Posts: 75
Joined: 08 Jul 2011, 08:33
Gender: Male
phpBB Knowledge: 4


Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby Sniper_E » 03 Apr 2012, 17:43

jooda wrote:No-one replied to my Tuts :(

Do you want a reply?

Handyman posted this addon back in Mar 11, 2010, 4:16 pm - Latest topics/posts in AJAX Chat

I'm going to stick with his edits for this... they work very well! :hello:
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7010
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby jooda » 04 Apr 2012, 14:56

Says im not authorized to read this post

[ Post made via Mobile Device] Image
jooda    
Ensign
Ensign
 
Posts: 75
Joined: 08 Jul 2011, 08:33
Gender: Male
phpBB Knowledge: 4

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby Apathy » 15 Apr 2012, 19:39

Also for this you might want to give credit to the rightful owner, which would be, 19/killa
Apathy    
Crewman
Crewman
 
Posts: 6
Joined: 14 Apr 2012, 21:43
Gender: Male
phpBB Knowledge: 3

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby jooda » 22 Apr 2012, 06:31

This isnt Killa LOL
jooda    
Ensign
Ensign
 
Posts: 75
Joined: 08 Jul 2011, 08:33
Gender: Male
phpBB Knowledge: 4

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby Apathy » 29 Apr 2012, 20:11

Sorry but it was killa, this was made by killa himself, Cris's one is a bit different.
Apathy    
Crewman
Crewman
 
Posts: 6
Joined: 14 Apr 2012, 21:43
Gender: Male
phpBB Knowledge: 3

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby jooda » 29 Apr 2012, 23:56

This is NOT Killas, hes also put new topic in cbox, test this one out and you will see it isnt his one

[ Post made via Mobile Device] Image
jooda    
Ensign
Ensign
 
Posts: 75
Joined: 08 Jul 2011, 08:33
Gender: Male
phpBB Knowledge: 4

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby Sniper_E » 30 Apr 2012, 12:53

If kills made one, he probably got the codes from Handyman anyways... from the topic I linked to in the second post. He wouldn't get the credit. The codes in the first post is Jodda's codes, they are different.

Show me killa's codes. We can settle this.

[ Post made via HTC Inspire] Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 7010
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby jooda » 18 Jun 2012, 11:22

could I see Handymans codes?
jooda    
Ensign
Ensign
 
Posts: 75
Joined: 08 Jul 2011, 08:33
Gender: Male
phpBB Knowledge: 4

Re: [PHPBB3]How to add "Replied to thread" in AJAX chatbox

Postby jooda » 27 Jul 2012, 12:17

can I see handymans?
jooda    
Ensign
Ensign
 
Posts: 75
Joined: 08 Jul 2011, 08:33
Gender: Male
phpBB Knowledge: 4

Next

Return to Tutorials and How-Tos

Who is online

Users browsing this forum: No registered users and 44 guests