Uutiset:

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

Main Menu
Advertisement:

Using the SSI

Aloittaja eddie1973, lokakuu 22, 2013, 02:48:50 AP

« edellinen - seuraava »

eddie1973

I am trying to show my latest post on my main page. It is a .php. When I add it, my page gets all whacked and I have a error

Fatal error: Call to undefined function ssi_recentPosts() in /home/flyakaco/public_html/lib/skins/flyalaska_1.0/frontpage_main.php on line 263

I put the SSI line on top of the <html>

and I am using <?php ssi_recentPosts(); ?> for the recent post. Any help would be appreciated.

Colin

Hello!

Did you add <?php require("/path/to/forum/SSI.php"); ?> above your function call?
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Kindred

specifically WHAT line did you place at the top of the file?

and where is your frontpage_main.php file location, with relation to SSI.php?
In other words, I see that frontpage_main.php is in /home/flyakaco/public_html/lib/skins/flyalaska_1.0/
where is SSI.php?
Сл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."

eddie1973

#3
Lainaus käyttäjältä: Kindred - lokakuu 22, 2013, 02:52:07 AP
specifically WHAT line did you place at the top of the file?

and where is your frontpage_main.php file location, with relation to SSI.php?
In other words, I see that frontpage_main.php is in /home/flyakaco/public_html/lib/skins/flyalaska_1.0/
where is SSI.php?

It's in the layout.php, same file as all the js and css lines go. I have this on the top of the <html>.

<?php require("/home/flyakaco/public_html/forums/SSI.php"); ?>

The layout.php is outside the foums table

/public_html/lib/skins/flyalaska_1.0/layout.php

/public_html/forums/SSI.php

margarett

But, looking at your error, it comes from "frontpage_main.php" and not from "layout.php"...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

eddie1973

Yes, layout.php is the file that has all the css and js, jquery, etc. frontpage_main in the actual content.

It's a template based CMS

margarett

OK, and does "frontpage_main.php" features the require SSI.php line also?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

eddie1973

No, there is no <html> the <html> is only in layout.php

margarett

But if you are calling that function in that file, you *have* to let PHP know where it comes from...
And you can use SSI functions in the "array" output method, in which the functions will return the data in an array of content, instead of printing it out directly. This way you can fetch your data in one file and show it in another file (like SMF, itself, does)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

See....   you are requiring SSI into layout.php - but you are calling the function from frontpage_main.php

and why would it matter if frontpage_main.php had an html tag?
Сл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."

eddie1973

same problem when I put it in frontpage_main.php

margarett

At this point, you would have to share with us which CMS are you using and, most likely, what are you doing within the code.
I'm guessing you are using some king of OOP-based CMS and, in that case, you probably have to require the file in several places or, at least, in the adequate places...

BTW, moving to Coding ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

emanuele

Likely it's enough to use require_once instead of require.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: