Site Integration Mod

Started by live627, April 29, 2008, 07:45:20 PM

Previous topic - Next topic

xyber9

Hey! Check out my site!!! I've used the Site Integration Mod on my site and it has made my site what it is today,

2 LIVE ONLINE!!! [nofollow]

Nathaniel

@xyber9,
It looks good. Its great to see that you have successfully used this mod to help build your website. :D
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

dwd2000

Hello. Me again.
I'm using nneonneo's Shoutbox as a chat room via your integration mod. (works like a charm)
I have one request:
Is there any way of showing who is actually viewing it?
I noticed in the Gallery, as well as the boards, it shows who is viewing them.
I have already asked nneonneo's Shoutbox, but they said that it depends on Site Integration.
Personally, I think there should be a way to put the code anywhere you want.

Any ideas?
30 years ago I was young and foolish.
Now I'm just young.

DAMMIT JIM...I'M A TWEAKER...NOT A CODER!!!

Dave's Games

Nathaniel

@dwd2000,
As nneonneo said that is related to this mod, you will have to add some code to the included 'chat/shoutbox' file. The topic below discusses doing something similar:
http://www.simplemachines.org/community/index.php?topic=256079.msg1688278#msg1688278

Although for your needs the code below should work, just remember to replace 'test' with the correct action that you need to view the list for. ;)
<?php
    
global $scripturl$db_prefix$user_info;

    
$action 'test';
    
    
// Load the users online right now.
    
$result db_query("
        SELECT
            lo.ID_MEMBER, lo.url, mem.realName, mg.onlineColor
        FROM 
{$db_prefix}log_online AS lo
            LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
            LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
        WHERE mem.showOnline != 0
            AND mem.realName != ''"
__FILE____LINE__);

    
$total_count 0;
    
$users = array();
    
    
//    Go through each user
    
while ($row mysql_fetch_assoc($result))
    {
        
$total_count++;
        
// Some basic color coding...
        
if (!empty($row['onlineColor']))
            
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '" style="color: ' $row['onlineColor'] . ';">' $row['realName'] . '</a>';
        else
            
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '">' $row['realName'] . '</a>';

        
// Bold any buddies.
        
if (!empty($user_info['buddies']) && in_array($row['ID_MEMBER'], $user_info['buddies']))
        {
            
$link '<b>' $link '</b>';
        }

        
$data = @unserialize($row['url']);
        if(
$data['action']==$action)
            
$users[$total_count] = $link;
    }
    
mysql_free_result($result);
    
    foreach(
$users as $pos => $user)
        echo 
$user, ($total_count==$pos) ? '' ', ';
?>
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

dwd2000

Quote from: LHVWB on September 26, 2008, 12:56:19 AM
@dwd2000,
As nneonneo said that is related to this mod, you will have to add some code to the included 'chat/shoutbox' file. The topic below discusses doing something similar:
http://www.simplemachines.org/community/index.php?topic=256079.msg1688278#msg1688278

Although for your needs the code below should work, just remember to replace 'test' with the correct action that you need to view the list for. ;)
<?php
    
global $scripturl$db_prefix$user_info;

    
$action 'test';
    
    
// Load the users online right now.
    
$result db_query("
        SELECT
            lo.ID_MEMBER, lo.url, mem.realName, mg.onlineColor
        FROM 
{$db_prefix}log_online AS lo
            LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
            LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
        WHERE mem.showOnline != 0
            AND mem.realName != ''"
__FILE____LINE__);

    
$total_count 0;
    
$users = array();
    
    
//    Go through each user
    
while ($row mysql_fetch_assoc($result))
    {
        
$total_count++;
        
// Some basic color coding...
        
if (!empty($row['onlineColor']))
            
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '" style="color: ' $row['onlineColor'] . ';">' $row['realName'] . '</a>';
        else
            
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '">' $row['realName'] . '</a>';

        
// Bold any buddies.
        
if (!empty($user_info['buddies']) && in_array($row['ID_MEMBER'], $user_info['buddies']))
        {
            
$link '<b>' $link '</b>';
        }

        
$data = @unserialize($row['url']);
        if(
$data['action']==$action)
            
$users[$total_count] = $link;
    }
    
mysql_free_result($result);
    
    foreach(
$users as $pos => $user)
        echo 
$user, ($total_count==$pos) ? '' ', ';
?>


Okay. Now I'm just a little confused, instead of totally confused.

When you said,  "included 'chat/shoutbox' file" I'm thinking of the file that Site Integration points to, to call the action.

This is all that's in that file:

<?php
shoutbox
();
?>


If I understand correctly, this file should now look like this:
(test changed to shoutbox and "shoutbox();" on the last line before ?>)

<?php
    
global $scripturl$db_prefix$user_info;

    
$action 'shoutbox';
    
    
// Load the users online right now.
    
$result db_query("
        SELECT
            lo.ID_MEMBER, lo.url, mem.realName, mg.onlineColor
        FROM 
{$db_prefix}log_online AS lo
            LEFT JOIN 
{$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
            LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
        WHERE mem.showOnline != 0
            AND mem.realName != ''"
__FILE____LINE__);

    
$total_count 0;
    
$users = array();
    
    
//    Go through each user
    
while ($row mysql_fetch_assoc($result))
    {
        
$total_count++;
        
// Some basic color coding...
        
if (!empty($row['onlineColor']))
            
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '" style="color: ' $row['onlineColor'] . ';">' $row['realName'] . '</a>';
        else
            
$link '<a href="' $scripturl '?action=profile;u=' $row['ID_MEMBER'] . '">' $row['realName'] . '</a>';

        
// Bold any buddies.
        
if (!empty($user_info['buddies']) && in_array($row['ID_MEMBER'], $user_info['buddies']))
        {
            
$link '<b>' $link '</b>';
        }

        
$data = @unserialize($row['url']);
        if(
$data['action']==$action)
            
$users[$total_count] = $link;
    }
    
mysql_free_result($result);
    
    foreach(
$users as $pos => $user)
        echo 
$user, ($total_count==$pos) ? '' ', ';
shoutbox();
?>


I did it that way.

I show up on my screen, my son shows up on his screen, but both don't show up on either, even after refreshing.

I then moved shoutbox(); to the top, just under the globals. Same thing, but now shows on the bottom.

I'm assuming it's not live, meaning it won't show someone entering or leaving until the page is refreshed. I can probably live with that, if we can get the original idea to work properly.

It's a lot closer now than before.
30 years ago I was young and foolish.
Now I'm just young.

DAMMIT JIM...I'M A TWEAKER...NOT A CODER!!!

Dave's Games

Nathaniel

Thats odd, I don't seem to be having any issues with viewing other people looking at the same page. That code uses the SMF user logging table, so you have to remember that its not up-to-date and it actually doesn't get refreshed that often, so you may have to wait for the cache to be cleared before it will show new users added in the list.

For what you want, its probably better to have a list that interacts with the actual chat/shoutbox so that it will give you a current list that updates along with the shoutbox itself. I am sure that I have seen these around on SMF websites, although I can't remember exactly which mod was being used, it probably wasn't nneonneo's shoutbox...
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

dpwren

The mod sounds like a great thing if I can get it working   ::). I have a few question about the mod.     Mod Name     Version     
1.    SMF 1.0.14 / 1.1.6 Update    1.0

After running the install I have an error in the test on the index.php file. Should I go ahead complte the install or try to see what the hangup is in the code first on the index.php file and run the test again?



Nathaniel

It depends on the error, which edit isn't working?

You should be able to install it anyway and then manually perform the edit that didn't work, I can help you with that if you post that file as an attachment and tell me the error. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

draggy

Thanks for this great mod LHVWB, it was just what I was looking for.

I've read through a lot of this thread and found some great fixes, but I am wondering if you know of a way to fix this problem:

I am running SMF 1.1.6 I have the site integration mod installed and working. I have a forum button setup at the top. And when I click on it, the action changes to forum and the forum tab is highlighted, etc.

But when I go into a board or a topic, the address changes to ?board=3.0 or ?topic=5.0, etc. and the forum tab at the top is no longer highlighted because forum is no longer the action, but it highlights the home button instead. Do you know of a way to make it so the forum tab stays highlighted through the rest of the forum areas?

I noticed that this is the same behavior on your demo forums, so it must be something that's just not fixed yet. If you posted the solution somewhere, I apologize, but I did not see it, and would be grateful if you could share. Thanks.

jeddi

This looks good but I havnt got a clue how to use it. I have read your instructions and I cant find a way to use this mod.
Could you give me an example how to use it?
I want to integrate my website, so I have installed this mod, so what do I do now.
Do I create a folder/
What do I put in it
Please explain the steps I should take.
Say my website is "mywebsite.com" it has an index.php but what exactly do I do?

dwd2000


Quote from: draggy on October 06, 2008, 11:35:15 AM
Thanks for this great mod LHVWB, it was just what I was looking for.

I've read through a lot of this thread and found some great fixes, but I am wondering if you know of a way to fix this problem:

I am running SMF 1.1.6 I have the site integration mod installed and working. I have a forum button setup at the top. And when I click on it, the action changes to forum and the forum tab is highlighted, etc.

But when I go into a board or a topic, the address changes to ?board=3.0 or ?topic=5.0, etc. and the forum tab at the top is no longer highlighted because forum is no longer the action, but it highlights the home button instead. Do you know of a way to make it so the forum tab stays highlighted through the rest of the forum areas?

I noticed that this is the same behavior on your demo forums, so it must be something that's just not fixed yet. If you posted the solution somewhere, I apologize, but I did not see it, and would be grateful if you could share. Thanks.

Go to your index.template.php.

Find lines that look like this:

if ($context['current_action'] == 'shop')
      $current_action = 'shop';


Add another that says what you need.
(Change shop to what you need.)
30 years ago I was young and foolish.
Now I'm just young.

DAMMIT JIM...I'M A TWEAKER...NOT A CODER!!!

Dave's Games

draggy

Thanks for the reply dwd2000

I assumed I needed to change something in there, but topic and board are not actions.

What variable do I need to check to see if the address string is index.php?board=x.x or ndex.php?topic=x.x?

dwd2000

Quote from: draggy on October 06, 2008, 05:40:25 PM
Thanks for the reply dwd2000

I assumed I needed to change something in there, but topic and board are not actions.

What variable do I need to check to see if the address string is index.php?board=x.x or ndex.php?topic=x.x?

I'm not sure about that one.


Make sure this line is in your index.template:

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';


30 years ago I was young and foolish.
Now I'm just young.

DAMMIT JIM...I'M A TWEAKER...NOT A CODER!!!

Dave's Games

draggy

Quote from: dwd2000 on October 06, 2008, 05:53:48 PM
Make sure this line is in your index.template:

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';

Thanks, that did the trick nicely :)

dpwren

Hello
I got everything installed but I can't see where its working right. Maybe I just don't understand your directions to the fullest. For example How would I wrap something like this using your actions. hxxp:www.empireofthesun.net/forum/index.php?action=demo [nonactive]. I created a basic page and placed in the file_includes but I don't see it loading in or around the forum.

Nathaniel

@dpwren,
Have you setup the settings in the admin panel? If they are setup correctly and you have added files into one of the folders that you have listed in the 'File/Action Include Folders' setting, then there should be a list of included files/actions in the 'Manage Included Files/Actions:' list.

Also, make sure that your files are '.php' files or that you have added their type extension to the 'Extra "File/Action Include" File Extensions' setting.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

dpwren

Thanks that gives me something to go on. I will take a look at those things at see what happens.

David

legend 1234

heyy

well when i go to the tab i get this error

Unable to load the 'SiteIntegrationSettings' template.

wat do i do to fix it plz

Nathaniel

@legend 1234,
That function should be located in your 'SiteIntegration.template.php' file, which is added to your forum when the mod is installed. Something must have gone wrong with the installation. Try uninstalling and then reinstalling the mod.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Nathaniel

For jkrlvgn:

I have split your support request into another topic and moved it to the 'SMF 1.x Support' board. The topic is located below:
http://www.simplemachines.org/community/index.php?topic=269255
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Advertisement: