Hooray, more embedding problems (In osCommerce)

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Hooray, more embedding problems (In osCommerce)

Post by MasterChief1517 »

I've been trying to embed s9y into osC for a while to be able to have easy to add and archival updates. Well, I have it in my store right now, here, and it looks great at first (minus some special css changes I'll make). But the problem is that if you click on any links from it, it will ditch the store and just go to the serendipity stuff (shop.xboxmoddingzone.com/serendipity/).

I'm not certain what is wrong, so I'm asking you guys now. :)

Wrapper:

Code: Select all

<?php
  ob_start();
  chdir("./serendipity/");
  require("index.php");
  chdir("../");
  $serendipity_contents = ob_get_contents();
  ob_end_clean();
?>
And the index is your basic require("includes/wrapper.php") before everything else and echo $serendipity_contents; down in the content.

Thanks for any and all help you guys can give!
"Remember to always be yourself. Unless you suck." - Joss Whedon
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Are the Serendipity configuration set to embedded mode, and is the indexFile option pointing at your store URL?

I'm betting the indexFile is the problem.

I'm also surprised OSCommerce doesn't have a plugin for this. Then again, it's been two years since I've worked with it, and as I recall, they were about to release a new version. Maybe it gummed up the works.
Judebert
---
Website | Wishlist | PayPal
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Just had another quick look, and I think that you'll need to turn off your URL rewriting, too. I tried the link without /serendipity/, like
which gave me a 404; but when I tried
and it brought up the post in your store sidebars.

Speaking of which, you may want to remove all the sidebar stuff. Serendipity is still printing its own sidebar, too.

To recap, I think Serendipity is not pointing to the appropriate indexFile (should be your shop URL), the Serendipity rewriting mode probably needs to be off, and I think the OSCommerce .htaccess might need to be rewritten so s9y gets the parameters it needs to figure out what it's supposed to do.
Judebert
---
Website | Wishlist | PayPal
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

Okay, that makes sense. I'm not sure how to point the indexFile over to my store URL, but I do know how to disable the url rewrite. So i'll see what the rewrite can do. Thanks.

EDIT:

I made sure the URL rewriting was disabled for s9y, no change. The only thing that made a difference was changing the relative path from /serendipity/ to /?/, which disabled images for s9y, which makes full sense. So, I don't know what to do. :/
"Remember to always be yourself. Unless you suck." - Joss Whedon
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

I think I can say this topic might just now be finished. That little lightbulb clicked on in my head about what you meant by "indexFile" So, I just changed "Index File" (Yes, I feel like an idiot for not seeing this before) to ../index.php to reroute it back to osC's index. It work beautifully now. Thanks for your help!

EDIT:

Not important, but the admin area doesn't work too awesomely. All images don't load in it, but it is easy to work with and it's not much of a problem. If you had a 10 second fix in your head for this, cool. But if not, it's not that important to me. :)
"Remember to always be yourself. Unless you suck." - Joss Whedon
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

w00t! Love it when a plan comes together!
Judebert
---
Website | Wishlist | PayPal
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

For the record, the blogging system works perfectly, and I fixed the admin by just enabling url rewrite (lol). But, I can't get the blog to display *properly.* So, Things are displaying in an odd order and just pretty much.....wrong.

I'm just trying to get it to look like MT Trendy right now to start off with (It's the closest style to what I'm seeking) and I'll mod it from there. My guess as to why it's not displaying correctly is there must be some weird CSS information where I do not know of. (I already took all but the general text and link css information from MT Trendy in the templates folder.)

So yeah, any help on this would be great. I would figure it all out myself with several hours of constants work, but I've been working on and off since Novemeber (Basically, knew nothing about php, html, or SQL when I started, so it's been several "do-overs") and I just want to get this launched.

And once again, thanks for any help you can give me! :)

EDIT: Oh yeah, if you see that sidebar come back in, it's only because I'm just snagging the links up when I'm making a "news" infobox for my site. ;) )
"Remember to always be yourself. Unless you suck." - Joss Whedon
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

That is... weird. It looks like there are entries within entries. The HTML structure supports this assumption, but... why is it happening?

Could you try the default template, and see if it makes any difference? Maybe it's a problem with MT - Trendy.
Judebert
---
Website | Wishlist | PayPal
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

Alright, I'll try that tomorrow.

Doesn't make too much sense to me, as the code was pulled directly from the template from the fresh install. Also, there's another fresh install for testing purposes produced from the same build and zip file that shows MT-Trendy fine. For your reference, it's http://xboxmoddingzone.com/serendipity (I know, I'm original, aren't I?)
"Remember to always be yourself. Unless you suck." - Joss Whedon
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

Alright, I find this weird CSS call for "#wrap" In my non-embedded test page, it has no call for this. Since this is the first item called for all of the serendipity items, I think this could be related to the problem. Any word on this? (By the way, I set up the default template and it still had similar defects, so I set it back to the MT-Trendy stuff.) My only major change since you last saw this is 1) I put all of the s9y stuff into its own CSS file, which is called in the osC index file 2) I added in a CSS entry "#mainpage { width: 100%; }" since no entry existed.
"Remember to always be yourself. Unless you suck." - Joss Whedon
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Okay, on the non-embedded page, I don't see a "wrap" div, and the entries appear separately, as expected.

On the embedded page, there is a wrap div, and the entries appear inside another entry's div, which is not expected.

The correct version's structure is:

Code: Select all

div.serendipity_Entry_Date
  h3.serendipity_date
[
  h4.serendipity_title (includes top and side outline)
  div.serendipity_entry (includes bottom and continuing side outline)
    div.serendipity_entry_body (text of entry)
    div.serendipity_entry_footer
]
[
  h4.serendipity_title (next entry)
  ...
]
Whereas the embedded version is:

Code: Select all

div.serendipity_Entry_Date
  h3.serendipity_date
div.serendipity_entry
  div.serendipity_entryFooter
  h4.serendipity_title
  div.serendipity_entry_body
[
  div.serendipity_Entry_Date
    h3.serendipity_date
  div.serendipity_entry
    div.serendipity_entryFooter
    h4.serendipity_title
    div.serendipity_entry_body
]
[
  div.serendipity_Entry_Date
  ...
]
This is the oddest output I have seen in my time supporting Serendipity. It looks like something is getting called recursively, and incorrectly. Possibly the database is fouled; possibly the code is corrupted. Either that, or it's a bug in Serendipity embedding.

I see you're using 1.2.1. It'll be easier to test this on 1.3.1, could you upgrade? In any case, I'd recommend reinstalling from scratch. Since your entries are all tests, it should be no big deal.

To test the bug scenario, I set my sandbox 1.4 (nightly version) to MT-trendy. It had the same structure as your non-embedded version, and looked correct. Then I changed the embedded option. I still had the same structure, although the CSS was gone. There is no wrap div, so I assume that's coming from your wrapper script.

Wait, wait... an idea just occurred to me. This might be similar to the output if your wrapper script was being called multiple times, or recursively. Can you show us your wrapper script as it appears now? I'd add an "echo "<div>Wrapper called</div>" just after the ob_start() call for debugging.

That seems a little far-fetched, though. More likely we messed up the index.php or entries.tpl while we were fooling around with this the first time. I'd try reinstalling Serendipity first.
Judebert
---
Website | Wishlist | PayPal
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

Upgrading - Easy. I planned to do that anyways.

This install is fresh, FYI. I had reinstalled it several times because I figured I messed it up somewhere. I'm going to try one of my own ideas before I go on with yours. I'm think I could just kill off the conflicting values in the MT-Trendy CSS and then run serendipity in non-embedded mode. Hopefully, it'll show it in my site properly. If not, full steam ahead on your idea. :) (I just figured mine is easier, if it works.)
"Remember to always be yourself. Unless you suck." - Joss Whedon
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

Okay, my idea *almost* worked. It all appears right, perfect, in fact. I can add comments to post and it works and all. But, that messed everything up. Now, it tries to download the php files when the user clicks the links, and when you do get through, it's just random characters. So, it looks like We're doing it your way. :lol:
"Remember to always be yourself. Unless you suck." - Joss Whedon
MasterChief1517
Regular
Posts: 9
Joined: Thu Feb 28, 2008 1:27 am
Contact:

Post by MasterChief1517 »

You might as well ignore my last post. Although my original fix didn't work, I fixed it....somehow. I don't really know how. All I did was just reenable embedded mode after the last attempted fix I tried and put the call back in for my custom CSS and it just started to work. :shock: That doesn't make ANY sense at all to me, as I've reinstalled it a dozen times, and I've deleted the SQL for it nearly as many times and let that reinstall, but just toggling and saving fixed it? O.o The only other change is that I deleted the body and a tags from the CSS it IS NOT supposed to be using inside the template folder. Maybe it actually called that CSS somehow and goofed with it? Either way, I don't care. It works. I won't mess with it. :P Now, I've tested with firefox 2.0.0.14 and Opera 9.24, would you mind testing it in any version of IE for me? I would myself, but IE doesn't run properly anymore on this computer. lol
"Remember to always be yourself. Unless you suck." - Joss Whedon
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Well, that's... not really comforting at all.

Perhaps the old settings were still in the database, and toggling *any* value and saving would have fixed it.

Embedding simply removes the <head> and <body> tags, and doesn't process CSS. The indexFile option is the big one to make embedding work.

I wish I could test on IE, but I'm an all-Linux shop now. I'd be willing to work on Windows if someone bought me a copy of their OS -- of course, I could only keep working until the next version came out, since they make you pay for upgrades.
Judebert
---
Website | Wishlist | PayPal
Post Reply