News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Tutorial: how to COMPLETELY integrate FlashChat into SMF so you have a cool CHAT

Started by marcnyc, October 09, 2004, 07:21:56 AM

Previous topic - Next topic

Ride

Quote from: Kindred on October 20, 2005, 01:00:28 PM
well, that is something beyond the scope of SMF... and actually, beyond the scope of FlashChat.

You would have to modify the Flash file in FlashChat, as well as some of the php functions and templates...

You'd also have to install a javascript-alert function in SMF and add a continual and regular refresh...  Which would be annoying for users who are trying to read things in the forum and would also increase bandwidth usage 10-fold.

Honestly, if you want IM, use an IM.

I disagree, you would not have to have a refresh.  SMF already uses this type of thing to alert members of new messages (if they chose to get alerts in their profile settings).  Of course I'd have to modify some files but I don't see it being as hard as you make it out to be. 

Kindred

the new messages note only pops up when you refresh or go to a new page....

So, if I am sitting online reading a message for 20 minutes, I do not get a notice of my new PM until I go to another page within the site or click refresh...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Ride

Quote from: Kindred on October 20, 2005, 05:09:34 PM
the new messages note only pops up when you refresh or go to a new page....

So, if I am sitting online reading a message for 20 minutes, I do not get a notice of my new PM until I go to another page within the site or click refresh...


Yeah, that would be true.  A drawback I guess.

nim

Hi. Thanks. Tutorial cool.

I have a problem.
I am trying to integrate smf user hidden with  flashchat spy_user. It does not work.
Could you say me like i do it?

Sorry my bad English. THANKS!  ;)

My code is:

$this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=?");
    $this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, realName AS login, ID_GROUP as status, showOnline as espia FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=?");
    $this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, realName as login FROM {$GLOBALS['db_prefix']}members");

    $this->userid = NULL;

    if (isset($_COOKIE[$GLOBALS['cookiename']])) {
      $cookieData = unserialize((get_magic_quotes_gpc() ? stripslashes($_COOKIE[$GLOBALS['cookiename']]) : $_COOKIE[$GLOBALS['cookiename']])) ;
      $this->userid = $cookieData[0];
     }

  }


  function isLoggedIn() {
    return $this->userid;
  }

  function getRoles($status) {
    $rv = NULL;
    if ($status == 1 || $status == 9 || $status == 11) {
             if ($espia == 1)
                     $rv = ROLE_SPY;
             else
                     $rv = ROLE_ADMIN; }                               
    else
      $rv = ROLE_USER;


    return $rv;
  }

  function getUserProfile($userid) {

if ($espia == 1) $rv = NULL;

    elseif ($user = $this->getUser($userid)) {
      $rv  = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;
    }

    return $rv;
  }


  function getUser($userid) {


    $rv = NULL;
    if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
      $rec['roles'] = $this->getRoles($rec['status']);
      $rv = $rec;
    }

    return $rv;
  }

Kindred

once you add a CMS in Flashchat, you lose the ability to log in as a guest or spy...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

nim

But I believe to ROLE_SPY is active.
I enter hidde but I cannot to write in chat. Or hidde or other rule, but both I cannot ability with "showOnline".
I will try it.

Thanks kindred!

Kindred

The SPY login can never type any messages in chat. The purpose is that it's a spy... watching but not responding
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jay T

I posted over at Flashchat but will do it here to.

QuoteI have SMF 1.1RC1 and FlashChat 4.4.2

Everything works fine, very nice! But I want it to open the chat in a new window but without all the address and toolbars at the top. I also want the chat to be smaller when it pops up. I was thinking something like a box about 6 inches wide x 6 inches high.

Any help is greatly appreciated.

houston

Getting this error when I edit the  the boardindex.template.php file

QuoteParse error: parse error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/BoardIndex.template.php on line 412

403:
404:    if ($context['show_who'])
405:       echo '
406:          <a href="', $scripturl, '?action=who">';
407:
408:    echo (empty($context['spiders']) ? '' : $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />
409:
410:
411:    // Handle hidden users and buddies.
412:    if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context[

Where do I need to put the suggested corrections

Thanks

houston

A small tip if you plan on installing the chat program.

Install it into the root of your forum and when running the install script chose to integrate it into an existing cms. There is an option for smf 1.1 choose that one and continue. Then edit the default index.template.php with the integration tutorial here.http://www.tufat.com/docs/flashchat/smf.html

Once that is done follow the tutorial give in the first post of this thread. Although I am getting a parse error in the Boardindex.template.php file that has yet to be rectified.

Hope that helps

Simplemachines Cowboy

Hey Houston,
Did you do the "SUB-TUTORIAL #2: add "Users in Chat" sentence in ALL pages" part?

I had no trouble (once I found exactly where to put it) with the board index, but the second part puts the notice all the way up at the top and breaks my XHTML compatibility. It really screws with IE. It's supposed to go down by the search & home etc. buttons.

http://www.theopenrange.net/forum/index.php
My SMF forum: The Open Range

houston

OK I had closer look at the boardindex.template.php file in 1.1 rc1.

The tutorial given in the first post of this thread says to look for this code

Quote<a href="', $scripturl, '?action=who">', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />

This is what is in the 1.1 rc1 file that is not quite the same.

Quote<a href="', $scripturl, '?action=who">';

   echo (empty($context['spiders']) ? '' : $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

   // Handle hidden users and buddies.
   if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
   {
      echo ' (';

      // Show the number of buddies online?
      if ($context['show_buddies'])
         echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

      // How about hidden users?
      if (!empty($context['num_users_hidden']))
         echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];

      echo ')';

It seems to be calling the same information but in a different way.  So where do I input this code.
Quote<a href="', $scripturl, '?action=who">', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />
as suggested in the tutorial.

Thanks

houston

One other ? The chat image lays right beside the logout image with no spacing in between. How would I change that so there is a few pixels between the two images.

Thanks

Gobo

 :D :) :-\ :o :( :'( EEEEKKKKK!!

reading that tutorial is gona make me faint!

Its JUST what I need but I am PHP illiterate  :'(

Isnt there any files I can just download and add to my server to make this work? I already purchased Flash Chat along with the cool integrated MP3 Player

HELP

Jay T



Uzbekistan

Quote from: houston on November 18, 2005, 04:35:55 PM
OK I had closer look at the boardindex.template.php file in 1.1 rc1.

The tutorial given in the first post of this thread says to look for this code

Quote<a href="', $scripturl, '?action=who">', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />
..................

Thanks

Yes, I am having problems integrating "Whos online block" as well. The block at the bottom looks empty :(


nightdreamer

i have checked my file on the index.template.php and i cannot find this line at all ??

Code:
<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">and change just that one bit of code (which is part of an entire line of code - you are NOT supposed to change or delete the rest of that line) it into this:
Copy to clipboardCode:
<a href="', $scripturl, '?action=chat">

snork13

Quote from: nightdreamer on January 11, 2006, 08:51:56 PM
i have checked my file on the index.template.php and i cannot find this line at all ??

Code:
<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">and change just that one bit of code (which is part of an entire line of code - you are NOT supposed to change or delete the rest of that line) it into this:
Copy to clipboardCode:
<a href="', $scripturl, '?action=chat">


find:

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


after add:

  if ($context['user']['is_logged'])
  echo '
                    <a href="', $scripturl, '?action=chat">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="Chat" style="margin: 2px 0;" border="0" />' : 'Chat'), '</a>', $context['menu_separator'];
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Advertisement: