News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Site Integration Mod

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

Previous topic - Next topic

lindaf

ahh ok!!

Thank you very much for all your help!!!  You really are nice!! ;D :D 8)

Have a wonderful evening!  Maybe you can catch a nice or good llama tonight!

I learned some good things tonight!!!  Still have a lot more to learn, but made a good dent tonight, thanks to you!!

Thanks again!   :) :D ;D

Nathaniel

Glad I could help. :D

I've been catching lots of Llamas but I keep on getting evil ones so my Karma is only about 20.

Anyway this thread should probably go back on topic.... ;)
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.

lindaf

oops  :( found one problem..  the navagation links don't take me to the correct spot on the forum instead it takes me to the home page.

ie. Main board/category/board name

clicking on any of the above takes the user to the home page and not the respective board.

any ideas? :D

Nathaniel

You mean the link tree, like "Home > Category > Board > Topic"?

The home and category links won't work, I should really try to fix that, gimme a sec... ;)
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.

lindaf

yeah!! ;D :D  You said it exactly! Someday I will learn how to talk efficiently!  8)

Nathaniel

Okay, here are some instructions for fixing that problem. I will think about updating the mod sometime to fix this issue, although its not a priority.

Open up your 'Load.php' file from your 'sources' directory.

This edit will make the category link work properly.
Replace this code (line 656):
        // Build up the linktree.
        $context['linktree'] = array_merge(
            $context['linktree'],
            array(array(
                'url' => $scripturl . '#' . $board_info['cat']['id'],
                'name' => $board_info['cat']['name']
            )),
            array_reverse($board_info['parent_boards']),
            array(array(
                'url' => $scripturl . '?board=' . $board . '.0',
                'name' => $board_info['name']
            ))
        );


With this:
        // Build up the linktree.
        $context['linktree'] = array_merge(
            $context['linktree'],
            array(array(
                'url' => $scripturl . '?action=forum#' . $board_info['cat']['id'],
                'name' => $board_info['cat']['name']
            )),
            array_reverse($board_info['parent_boards']),
            array(array(
                'url' => $scripturl . '?board=' . $board . '.0',
                'name' => $board_info['name']
            ))
        );


Only perform the edit below, if you want the first linktree element to point to your forum instead of your Site Integration Home.

Replace this code (line 1360):
    // Set the top level linktree up.
    array_unshift($context['linktree'], array(
        'url' => &$scripturl,
        'name' => &$context['forum_name']
    ));


With this:
    // Set the top level linktree up.
    array_unshift($context['linktree'], array(
        'url' => $scripturl . '?action=forum',
        'name' => &$context['forum_name']
    ));;
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.

lindaf

it was at line 713 in my load.php... hoping that is ok, I went ahead and made the changes.

and Yes!  It works!  Thank you again!! ;D :D


Nathaniel

That was definitely the right thing to do, you might have installed some mods so that's probably the reason for the different locations, as I had checked it on a clean version of SMF.

Edit: Woot! This mod reached 1000 total downloads. :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.

lindaf

cool!! 8)  Congratulations! 

ipoco

This is a terrific mod.

One little question . . .

One of the php pages I need to use this on includes an swf (flash) which requires:

<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>



<script language="javascript">
   if (AC_FL_RunContent == 0) {
      alert("This page requires AC_RunActiveContent.js.");
   } else {
      AC_FL_RunContent(
         'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', [nofollow]
         'width', '1000',
         'height', '1000',
         'src', 'ipocoapp',
         'quality', 'high',
         'pluginspage', 'http://www.macromedia.com/go/getflashplayer', [nofollow]
         'align', 'middle',
         'play', 'true',
         'loop', 'true',
         'scale', 'showall',
         'wmode', 'window',
         'devicefont', 'false',
         'id', 'ipocoapp',
         'bgcolor', '#f3e7cd',
         'name', 'ipocoapp',
         'menu', 'true',
         'allowFullScreen', 'false',
         'allowScriptAccess','sameDomain',
         'movie', 'ipocoapp',
         'salign', ''
         ); //end AC code
   }
</script>

The above code is already in the php page I want to open - as above - however when I open it using: ...index.php?action=ipocoapp I get the "this page requires AC_RunActiveContent.js" message ( which I don't get if I open the page outside of smf.)

If I want to run this page (which I do), where do I put the above code?

Thanks!

C

Nathaniel

@ipoco,
I am glad that you like it. In terms of getting your javascript script to work, I am not totally sure because I haven't worked with much javascript, but you could try to add something like the code below to your 'template_main_above()' function in your 'index.template.php' file.


if($context['current_action'] == 'ipocoapp')
echo '
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>';
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.

ipoco

 ;D  I added the below to index.template.php along with the other js calls that were there and it works perfectly.

   <script language="javascript">AC_FL_RunContent = 0;</script>
   <script src="AC_RunActiveContent.js" language="javascript"></script>

sinnie

#172
Ok I am having some issues with the mod. I did all the changes listed here:
http://custom.simplemachines.org/mods/index.php?action=parse

and I uploaded the loadfile.php and the SiteIntegration.template.php

When I go to the main page it says
An Error Has Occurred!
Unable to load the 'main' template.

I also have no idea how to include MY sites header and footer. Please help.

This is also the link to the site, so you can see the error in real time.
hxxp:writerslair.net/smf/index.php [nonactive]

Also I just noticed that all the links for the forums are completely messed up. Ugh I guess I completely ruined something  >:(

Nathaniel

Okay, something has gone really wrong. Do you have any other mods on your site?

Firstly, did you try to automatically install this mod through the package manager? Because it should work, especially on a new install of SMF. If you hadn't tried to install it through the package manager, then I recommend that you copy clean versions of the files that you edited from an uninstalled copy of SMF, and copy them over the ones that you made changes to.
You will then be able to use the package manager to upload and install the mod.
Package Manager

Secondly if that is not an option, then can you please post your index.php file so that I can check that you have made the changes to that file correctly?
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.

ipoco

Another quick question.

When I open an "outside" php page using this mod - it is placed in a nice css? box with a hairline boarder around it.  The background color of the box defaults to white.  I'd like to set it to the grey used in the default template.  I 'think' the setting is somewhere in style.css but am not sure where.

Thanks again in advance

C

[unplugged]

The way I did mine to make it "integrate" more to my liking was to open SiteIntegration.template.php and change:
function template_SiteIntegration()
{
global $context;
// Show a display box for the included page.
echo'
<div class="tborder" style="margin-top: 1ex;">
<div style="padding: 2ex;" id="helpmain">
';

// Include the page.
require_once($context['file_include']);

// End the display box.
echo '
</div>
</div>
';
}


to this:
function template_SiteIntegration()
{
global $context;

// Show a display box for the included page.
echo'<div>';

// Include any of the language files, that need including, doing it here allows the admin to do some kind of dodgy stuff if they really want to.

foreach($context['language_includes'] as $file)

require_once($file);

// Include the page.
require_once($context['file_include']);

// End the display box.
echo '</div>';
}


Then I added some stylings to the beginning of my include files to incorporate the current theme.
I think it just makes this great mod look better. You can see what I mean by CLICKING HERE.

I've also attached the "template" I use for my include files to achieve this. Hope this helps.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



Kylezz

Why do i post alot? I am not a leecher.

sinnie

LH, I don't have any other mods. I did what I guess is manual install because I wasn't aware of a package manager.

I just reinstalled SMF and used the package manager and installed it correctly. Now how do I edit the header and footers and/or implement it with my site exactly??

Nathaniel

@ipoco,
Like SunKing suggested, you can open up and change the 'SiteIntegration.template.php' file, as I have said before, I am not particularly good with making templates look good, so its relatively easy to change how it looks through that template file.

@Kylezz,
Thanks, I'm glad you like it! :D

@sinnie,
Like I said to ipoco, if you just want to change the box which it contains your pages in, then you can do that in the 'SiteIntegration.template.php' file, if you want to change the actual headers and footers for your entire website then you need to edit the 'template_main_above()' and 'template_main_below()' functions from your themes 'index.template.php' file.

As a note, the 'SiteIntegration.template.php' file, will only be in your default themes, if you change that template it will change it for all themes. If you wish to change it differently for each theme, then you can make a copy of that file in your custom theme's folders and then edit it.
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.

sinnie

#179
So if I edit index.template.php will that make the changes for each page for the forum?

I've been playing around with the CSS stuff, changing colors but I can't seem to find a way to get rid of the last bit of blue-ness. Anyone know where this stuff is??

Here's a link so you can see.

hxxp:www.writerslair.net/smf [nonactive]

Until then I guess I'm stuck with some blue. If you look closely when you reload it it IS the correct color, but then it reverts back to blue somehow. Any clue on how to fix it?

Thanks for the mod though!

Advertisement: