News:

Wondering if this will always be free?  See why free is better.

Main Menu

YA SSI / WordPress conflict...

Started by elkaintmoose, June 15, 2006, 11:01:06 PM

Previous topic - Next topic

elkaintmoose

Trying to use SSI's on a WordPress front page, but I'm getting an error I haven't seen in the forums:


Fatal error: Cannot redeclare is_admin() (previously declared in /home/username/public_html/wp/wp-includes/functions.php:1590) in /home/username/public_html/forum/Sources/Security.php on line 866


I've tried jiggering the include line around, and moving it to different places, but no luck.

I *did* have recentPosts() working by doing this, right in the <body>:


<?php include('http://www.ferrellweb.com/forum/SSI.php?ssi_function=recentPosts'); ?>


but now I'm trying to add welcome(), and if I do it that way, it doesn't seem to pick up on the session data. Even though I'm logged in to the board, the front page still calls me a guest.

Anyone have any ideas what to try next?

Thanks!

silverdragonrs

what is the code you are using for welcome() ?



Code:
<?php include('http://www.ferrellweb.com/forum/SSI.php?ssi_function=welcome'); ?>

or



Code:
<?php include('http://www.ferrellweb.com/forum/SSI.php?ssi_function=welcome()'); ?>


cause the first works perfectly for me...
i used several of the above codes for the diffeent tables on my front page.. and they all work.. perhaps it is just a typo i suggest simply rechecking your coding....

if you still can't figure it out then enter all involved code and somebody will be able to better help you..
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

elkaintmoose

Good point, sorry; I didn't write that as clearly as I could.  :-\  I am using

Code:
<?php include('http://www.ferrellweb.com/forum/SSI.php?ssi_function=welcome'); ?>

on the front page. It's not that it doesn't work at all...it definitely does something...it's just that whether or not I'm logged in to the forum, the script still produces:

Welcome, Guest. Please login or register.
Did you miss your activation email?

I was wondering if maybe I used the include in the <head> section, it would be able to see the cookie, or whatever it ought to be doing. I can't test that, though, because putting the code in the <head> section evidently conflicts with something in the WordPress code...


silverdragonrs

i have the same problem actually just hadnt tied it to the code yet... i think perhaps it has to do with the manner in wich you access the ssi.php .... you are accessing it using the url and i do not think this works for the login or welcome functions... is your site and the forum on the same server? if so use the setup that is displayed in the ssi_exsamples.php ... where you call the ssi.php before anything else in the document and then simply include the function where it needs incerted.... example would be (note the local addy instead of the url)


<?php require("C:\\directory\\directory\\directory\\forums\\SSI.php"); ?>
<head></head>

<body>
<?php ssi_welcome(); ?>
</body>

but the ssi call (the first part) has to be the very first line in the document...

the second part can be put anywhere you need the info to show..  and a number of settings and variables can be set in this part as well from what i understand..

this way to call the ssi functions is only if the document and the forum are on the same server though and will not work otherwise... as far as i know...

I am currently trying to find away around the external server ssi call problem .. they say it can't be done... but ill figure it out... :P
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

elkaintmoose

Yeah, that's what I mean...if I put the require(.....SSI.php); at the top of my page, I get no page, only an error:

Fatal error: Cannot redeclare is_admin() (previously declared in /home/username/public_html/wp/wp-includes/functions.php:1590) in /home/username/public_html/forum/Sources/Security.php on line 866

I'm assuming that both the WordPress code and the SSI code are trying to define an is_admin() function at the same time, and nobody's happy. Would there be a way to get around that, somehow? (I guess one way would be to rename one of the functions, but that's probably not too smart... ;) )

Other than that, everything's on the same server and what-not, and should play happily together...it's just WordPress and SMF trying to grab that same function name, I believe...


silverdragonrs

this is round about but i dont see why this would not work for you....

create another php file... name it say... logininclude.php k?

in the logininclude.php call the ssi and then the function...


then on your site just include the logininclude.php and all should be well.... (i think... ;D )
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

elkaintmoose

*Sigh* Thanks for all your help, silverdragonrs -- that last bit was sneaky, but I don't think it's making it. I'm still getting the standard "Welcome, Guest" message. Here's what I did, so you can see if I got the idea right:

I made a new file, called ssi_workaround.php. It looks like this:

<?php
require("/home/username/public_html/forum/SSI.php");
ssi_welcome();
?>



Then, I included ssi_workaround.php on the page where I wanted it to show up. That's where I get the "Welcome, Guest" message, so it MUST be parsing, I suppose...

Just to MAKE SURE things weren't totally crazy, I made a blank page:

<?php require("/home/username/public_html/forum/SSI.php"); ?>
<html>
<head>
<title>SSI Welcome Test</title>
</head>
<body>
<?php ssi_welcome(); ?>
</body>
</html>

uploaded it to my server, and loaded it in the browser. THAT ONE worked correctly...my username showed up, along with my message count. (I was almost HOPING it would say "Welcome, Guest"...then at least I'd know I was doing something wrong somewhere else... :()

silverdragonrs

" i tink you underestemate de sneeakiness, sir.. :)" - amelio (big daddy the movie) love that part...


ok.. i really don't know what to say from here.... it works that way on my site...

my understanding of how the cokkie works is that it is domain specific..

so if you are hosting multiple domains and you are trying to call the ssi.php from one domain and incert the functions into the pages of another domain it will not work... example...

domain1.com/forum/SSI.php

will not work on

domain2.com/index.php

even if they are on the same server.. 

i am not sure if this is your case but it seems to be the only thing i can see that could cause this... the method you tried that i listed in my last messege is the method i use... since i have a number of funtions that must be called "first" in the document...

have you tried removing the wordpress or disabling it momentarily to see if the ssi call is even going to work in that document..?

you say it worked in the blank page... try including the blank page then..:( ..

also try directing your browser directly to the ssi_workaround.php and see if it was set up right.. if it was then it will work.. as is..

not sure what else to say... maybe one of the pro's can help here... i am at the end of my sneakiness..

sorry i couldn't help any more... 
danny
I'd like to quote my idol. Homer Simpson. "Press any key now!... Any Key? Where's the any key?!... Doh!" ---- One day I'll be that good with computers..... ~ danny ~ feel free to IM me about anything!

elkaintmoose

No problem, man. I appreciate the ideas; I sure didn't have any of my own! I'll keep poking at it a little. Thanks for the help!  :D

Advertisement: