News:

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

Main Menu

Creating messed up URLs

Started by gdorfer, February 06, 2008, 10:21:39 AM

Previous topic - Next topic

gdorfer

Hi out there,

im using Joomla 1.0.12 with SMF 1.1.3 using Orstios bridge. Actually i dont know which version the bridge is, downloaded it in januar 2007 i guess. in the meantime my community was working fine but since some weeks i see some problems.

some URLs look like this:
Quotehttp://www.myurl.com/index.php?option=com_smf&Itemid=43/index.php?action=dlattach;attach=191;type=avatar [nofollow]

this is the caseat some particular URLs, i noticed the following to problems:
- captcha-image
- user-images

I dont know what happend to my installation... i've upgraded to smf 1.1.4 some time ago - maybe this is the problem. in the meantime i deinstalled 1.1.4 but this didn't solve the problem.

do you have any idea where this problem could come from? are there missing conversions of URLs in the smf.php of the bridge?

thank you,
gdorfer

ps:
ive found the following code not working in my smf.php:
Quote// Don't forget attachments and CAPTCHA
   $buffer = str_replace($myurl . 'action=dlattach', $boardurl . '/index.php?action=dlattach', $buffer);
   $buffer = str_replace($myurl . 'action=verificationcode', $boardurl . '/index.php?action=verificationcode', $buffer);


gdorfer

ok, got it to fix the urls like this:
Quotehttp://www.myurl.org/index.php?option=com_smf&Itemid=43&action=dlattach;attach=191;type=avatar [nofollow]

with the following code in smf.php

$buffer = str_replace($myurl . 'action=dlattach', $boardurl . '&action=dlattach', $buffer);
   $buffer = str_replace($myurl . 'action=verificationcode', $boardurl . '&action=verificationcode', $buffer);


where i've replaced this one:
   // Don't forget attachments and CAPTCHA
   $buffer = str_replace($myurl . 'action=dlattach', $boardurl . '/' . basename($_SERVER['PHP_SELF']) . '?action=dlattach', $buffer);
   $buffer = str_replace($myurl . 'action=verificationcode', $boardurl . '/' . basename($_SERVER['PHP_SELF']) . '?action=verificationcode', $buffer);


it some kind of weird, because the code in MY smf.php looked like the one above, wherelse the code from my post #1 was from the current version of the bridge i've downloaded today.

whats not working now?
the image doesn't show up at the moment, when i directly go the url it tells me the following:

"grahpic can not be displayed because it contains errrors."

Orstio

Quoteit some kind of weird, because the code in MY smf.php looked like the one above, wherelse the code from my post #1 was from the current version of the bridge i've downloaded today.

From where did you download my bridge today?

gdorfer

ok, i've got it...

the code from the new version of the bridge (december 2007) was written to point directly to the image, not using the joomla variables. but there was a error in it, because the rewrite went wrong.

the $boardurl was the url for the joomla component, not directly to the forum. i've fixed it by kicking the $boardurl and writing the correct url by hand.

here's the code:
   $buffer = str_replace($myurl . 'action=dlattach', '/forum/index.php?action=dlattach', $buffer);
   $buffer = str_replace($myurl . 'action=verificationcode', '/forum/index.php?action=verificationcode', $buffer);


seems to me that joomla smf component can't display images throught it at all. dont know. would be happy for a more working bugfix.

at orstio:
i've downloaded it from simplemachines.org at http://www.simplemachines.org/download/?bridges
ah, i see. i've downloaded the mambo version of the bridge, didn't noticed that joomla version isn't allowed to be contributed any more. can't unterstand this from the joomla team - you did a great work orstio. sad there won't be any updates for it.

Orstio

There is no way that the Mambo 4.6.x bridge is going to work for Joomla.  All Joomla-specific code was removed, and there is a lot of Mambo-specific code in place.  You might get the URL rewriting correct, but there is a lot more that will be broken.

gdorfer

oh, im not using the mambo bridge. i just downloaded it today to see which files came with it.
i use the joomla bridge i've downloaded a year before. and it was working very fine up to now.

there was only a little bug: when saving the configuration of com_smf:
the joomla status arranged with the smf status can only be saved at the first time. when saving a new configuration the entries in the sql-table didn't get updated - the entries had been insert in the table after the existing configuration. at this point joomla could not assign the right status.

to configure it again i hat to clear the assignment-table of com_smf.

Advertisement: