Problem with external php application

Creating and modifying plugins.
hans_olo
Posts: 3
Joined: Fri Jun 08, 2007 3:54 pm

Problem with external php application

Post by hans_olo »

Hi,
I already searched the forum but could not find a solution to my problem.
As i am a new s9y user i hope that im not boring.
I tried to use the "liga manager online" via the external php application plugin, but i always get the error message:
Fatal error: Cannot use string offset as an array in D:\PHP\xampp\htdocs\serendipity\plugins\serendipity_event_nl2br\serendipity_event_nl2br.php on line 137
as you can see its a local installation (i hope thats not the problem) for testing purpose. Serendipity Version 1.12 / plugin Version 1.3
Im not that familiar with php, so any hint would be helpful.

Thanks in advance,
hans_olo
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problem with external php application

Post by garvinhicking »

Hi!

Do you get this error message only on the page where your externalPHP application should be?

It's strange, because the markup plugin there should not be involved.

The 'external php' plugin actually only executes a PHP 'include' command with your target script.That target script must work when being called from a Class construct. Some scripts will not work if they issue their own database connections without caring about existing ones, or if they use global variables that are not really global.

When you create a simple application file called "test.inc.php" with this content:

<?php echo "Here I am!"; ?>
and use that as your external PHP application, do you get the same error??

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hans_olo
Posts: 3
Joined: Fri Jun 08, 2007 3:54 pm

Post by hans_olo »

Hi,
and thanks a lot for the quick response.
I tried the "test.inc.php"-file and it works fine. So it seems to be some problem with lmo. Hmmm, according to the lmo help file "include" should be possible, but maybe i am doing something wrong.
Do you have any idea what the problem is, or do you know any alternative league manager that is already working with serendipity ?

Greets,
hans_olo
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Sadly my time is already limited supporting serendipity, so sadly I have little time to inspect other applications to see how they might interact...

Another idea to "embed" it to your site would be using the "wrapurl" plugin that wraps a foreign page into an iframe, have you tried that?

Bestregards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hans_olo
Posts: 3
Joined: Fri Jun 08, 2007 3:54 pm

Post by hans_olo »

garvinhicking wrote:...
Another idea to "embed" it to your site would be using the "wrapurl" plugin that wraps a foreign page into an iframe, have you tried that?
Not yet, but i´ll try.

Thanks for helping,

hans_olo
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Post by Timbalu »

Hi

I experienced the same problem using a own plugin after submit.
I could not find out, why the nl2br plugin was parsing my submit.
So I disabled the line 137 and now everything seems ok.

Could someone tell me, what could break now by doing this?

Code: Select all

                foreach ($this->markup_elements as $temp) {
                    if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) &&
//                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
                            !in_array($this->instance, (array)$serendipity['POST']['properties']['disable_markups']) &&
                            !$eventData['properties']['ep_no_nl2br'] &&
                            !isset($serendipity['POST']['properties']['ep_no_nl2br'])) {
Ian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Timbalu!

Did you maybe check the option to disable nl2br for your posting? This:

Code: Select all

//                            !$eventData['properties']['ep_disable_markup_' . $this->instance] &&
should only avaluate, when the ep_dislable_markup_ property is sent, which you need to have checked in the advanced options section of the entryproperties plugin when creating an entry.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Post by Timbalu »

Hi Garvin

Not really, sadly! Its not a matter of creating an entry. It is my old eventvalendar plugin, which suddenly throws this error, without letting me know, why it is nl2br parsed.
So I can just guess that ep_dislable_markup_ property is always set to true, even without writing an entry. Is that the problem?

Regards, Ian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Make a dump of your $eventData['properties'] and see what keys/values are contained in there?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Post by Timbalu »

Hi Garvin

A dump of your $eventData['properties'] said nothing. I followed debugging and discovered nl2br parsing is on because there is a html_nugget in the sidebar. Now I inserted a hidden input value inside the eventcal form fields and added a nomarkup question in the nl2br plugin; in the moment there is no need to disable line 137 any more. Its just a quick hack. Not real understanding what is going on....

Ian
jamesmusic
Regular
Posts: 46
Joined: Thu Jun 28, 2007 6:50 pm
Contact:

Post by jamesmusic »

not sure if the answer to this question has been answered on here, but
i installed the phpBB2 external app and intregrated it with Serendipity. Now any articles and comments posted are mirrored in the forum.
everything seems to be working fine, but when someone leaves a comment on the blogs, they are taken to the forum directly and away from the blog. Does anyone know how can i stop this from happening?
Thanks
James
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi James!

But that's the intention of the plugin. :-)

If you don't want people in the forums, you shouldn't take their comments to a forum?

It's like saying "I want a to drink a hot chocolate" and then asking, if they can serve it cold, and without milk, please. ;-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jamesmusic
Regular
Posts: 46
Joined: Thu Jun 28, 2007 6:50 pm
Contact:

Post by jamesmusic »

umm hehe perhaps i worded that the wrong way!

please have a look and try for yourself...
here's an article, try and post a comment and see what happens...

http://www.musflashtv.com/shows/index.p ... l#extended
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Ah, okay, there's an error in the plugin file. Search for "viewtopic.php?t=" inside the serendipty_event_forum.php and replace that with "viewtopic.php?p=" so that you'll get routed to the right entry.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jamesmusic
Regular
Posts: 46
Joined: Thu Jun 28, 2007 6:50 pm
Contact:

Post by jamesmusic »

garvin, your a star. thank you thats done the trick.

is there any way to make that page open in a new window?
Post Reply