TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 298
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 133
  • Total: 133

SSI integration issue, Notice: Undefined offset: 1 ... in Sources/TPSubs.php on

Started by windsorlive, March 26, 2009, 08:27:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

windsorlive

I hope this is the correct place to post this question.

I have a fresh install of SMF 1.1.8 and installed TinyPortal v1.0 beta 3 and when I attempt to include the SSI into my website, forum is on sub domain, I am recieving the error below. I have searched here and SMF to no avail. I can't seem to get a result even close to one I am searching for.

Notice: Undefined offset: 1 in /xxxx/xxxx/xxxx/forum/Sources/TPSubs.php on line 184

This displays at the top of the page that I include the SSI code. It is same code that it says to use.
<?php require("/xxxx/xxxx/xxxx/forum/SSI.php"); ?>

Any suggestions?  ???

The forum is here: http://forum.windsorlive.com if you need to check it out
I am looking to include my forum calendar where the current one is located.

Thanks


Marked as Solved! Thanks everyone!


ZarPrime

That link the Ichbin gave you should give you everything you need, but additional info contained in this Doc may be helpful ---> http://docs.tinyportal.co.uk/index.php/topic,91.html

ZarPrime

windsorlive

Ok I think I may have confused myself or maybe what I the issue is.

My site is located here: http://windsorlive.com and the forum is here: http://forum.windsorlive.com

What I am doing is replacing the current calendar on the home page with my php calendar from the forum. I will be doing this by calling a php file that calls the content from the forum calendar. I notice there have been a few discussions about the calendar bloc on this forum. I have modified the one I have running on a differnet site/forum. On that site I include the SSI at the top of the page and then include the content where I want. I am not trying to take my portal block and import it I just want to have the SSI ready for whatever I want to add to the site pages. Right now I have the php calendar coded as a php include on the site but cannot call the SSI. If you visit the site you will see the error at the top. I am unsure why that error occurs.

Here are the actual SSI code I am using, I don't think there is an error but I am clueless:
<?php require("/xxxx/xxxx/xxxx/forum/SSI.php"); ?>
and I tried:
<?php require_once("/path/forum/SSI.php"); ?>
This is the error on the website:
Notice: Undefined offset: 1 in /path/forum/Sources/TPSubs.php on line 184

You can view the error here: http://forum.windsorlive.com/ssi_examples.php

btw I think I read all the docs you provided and about 50 others,  but really think my description is confusing things. Does this description help? I don't want to leave that error hanging so if someone can let me know if they have any suggestions as to where It is see what's broke?

btw (v2)There were no errors with any packages or mods when they were installed. I have posted the installed mods on my forum.

I will attach the TPSubs.php file

Ianedres

Is the SSI being loaded?

Try using a relative path, such as "../forum/SSI.php" instead and see if that helps.

windsorlive

Quote from: Ianedres on March 27, 2009, 01:22:23 AM
Is the SSI being loaded?

Yes it is, I can get everything to show up but the error still diplays, I have tried the following from the posts mentioned above:

http://windsorlive.com/beta.php has just the SSI at the top of the page

http://windsorlive.com/beta_a.php is using the following:
<?php
$ssi_theme 
1;
global 
$context;
require_once(
'/xxxx/xxxx/xxxx/forum/SSI.php');
TPortal_init();
template_main_above();

echo 
'
This is to show you the divine power of SMF and TP!!!'
;

ssi_shutdown();
?>


http://windsorlive.com/beta_b.php is using this code:
<?php
require('/xxxx/xxxx/xxxx/forum/SSI.php');
template_main_above();

//Site content goes here
include "/xxxx/xxxx/xxxx/index.php";

template_main_below();
?>



http://windsorlive.com/beta_c.php is using this code:
<?php

$ssi_gzip 
true;  //true--means gzip is turned on.
$ssi_ban true;  //true--means a banned forum user will be banned also in the SSI page.
//$ssi_theme = 2;  //uses the theme [images, buttons, colors] with ID=2, which usually is classic theme.  Specifiy theme ID to use.
//Leave as is to use the default theme or the member's theme.
ob_start();  //is needed not to get errors.

require('/xxxx/xxxx/xxxx/forum/SSI.php'); 

$context['page_title'] = 'test page'//needs to go above template_main_above(); to display Page Title

template_main_above();

//include('header.php'); //Contents of a custom header.php file.  Displayed immediately under the template_menu();  Uncomment to display.


//Page content goes here


//include('footer.php'): //Contents of a custom footer.php file.  Displayed above SMF copyright line.  You could put your own footer info here.  Uncomment to display.
template_main_below();

?>


It seems to work as intended but the error will not go away see:
http://forum.windsorlive.com/ssi_examples.php

windsorlive

Quote from: Ianedres on March 27, 2009, 01:22:23 AM
Try using a relative path, such as "../forum/SSI.php" instead and see if that helps.

I did this on this page: http://windsorlive.com/beta_d.php with the same results.

I also have uploaded the original TPSubs.php and it did not change a thing.

I must say thank you for passing those topics to me they have actually helped me understand "unlocking the powers of SSI"


ZarPrime

OPEN FILE:  $boarddir/SSI.php and make sure that the following change was made to that file.

Find:
require_once($sourcedir . '/Security.php');


Add After:
require_once($sourcedir . '/TPortal.php');


If that change isn't in there, put it in.  If that doesn't fix the error, then it does not make any sense that you are getting that error with /ssi_examples.php ...

... Unless you have edited that file.  Have you edited that file?  If not, then you need to to go SMF and ask them why you are getting that error.  They may tell you that it is a TP error because of the error you're getting, but it's not a TP error.

What you might have to do is download the 1.1.8 package and replace the /ssi_examples.php file on your site with the one in that package, then manually make the change above and see if that fixes the error.

ZarPrime

windsorlive

Thanks ZarPrime,

I have done the suggestions you have made and still have the same issue but the issue is Solved!

I found some help at SMF from Sarge.
I will post the solution to the error, here is the post: http://www.simplemachines.org/community/index.php?topic=301477

QuoteApparently it has something to do with permissions.

In TPSubs.php, find these 2 lines (184-185):
Code: [Select]
               if($pr[1]==1)
                  $context['TPortal']['adminlist'][$pr[0]] = 1;

and replace them with:
Code: [Select]
               if (isset($pr[1]) && $pr[1]==1)
                  $context['TPortal']['adminlist'][$pr[0]] = 1;

Save and upload; make sure the old file is overwritten by the new modified copy.

This should get rid of the error.

If you are going to search (instead of going to line 184), it's best to search for the code in line 185 (the second line above), because the code in line 184 is not unique -- i.e. it's present in more than one place in that file.

Hopefully this may help with some other issues others may be having since it is a permission issue?

Thank you everyone, you have been very helpful and thanks again for the quickie SSI tutorial.




ZarPrime

windsorlive,

I'm glad you got this sorted out.  I will go ahead and file this in the bugtracker as a possible bug so that Bloc can take a look at it (if nobody else has done so). :up:

ZarPrime

This website is proudly hosted on Crocweb Cloud Website Hosting.