Community & Support

How to run a 3rd party script using within a Drupal page

Hi all, another new user: another new problem ;-)

I'm just getting to really like Drupal, it seems to be perfect for what I want but i'm stumbling on what I think may be a fairly simple thing for me to have working.

My site is www.cruelworld.co.uk and running Drupal 5X.

I want to run a quote databese similar to bash.org but just for my IRC channel. (I have over 4 years worth of quotes to paste over once this is done :S )
The address for this is http://www.cruelworld.co.uk/qdb and it's a script contained on the domain webspace made up of several folders and an index.php page etc much the same as a Drupal install.

What I want to do is create a Content Page and navigation link and run the script inside it so that it's seamless with the site rather than having it open in a seperate window.
Imagine Drupal being installed, and running another Drupal install inside a Page from a navigation link on the main install... If that makes any sense ;-)

If anyone can let me know if there is a way to do this i'd be gratefull.
Thanks in advance.
Mark.

Comments

I have no clue what you mean

I have no clue what you mean by "Imagine Drupal being installed, and running another Drupal install inside a Page ..." but why couldn't you just create a page, set the input type to "php" and put any script/code you want in there?

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

:D:D Right... You know what

:D:D

Right...

You know what a PAGE is in terms of Create Content.
So therefore you know that to create a Page you need to slap in some sort of PHP code, set it to type 'php' and bobs yer uncle...

Not here though... Not with what I want to do.

I have a script that i'm running for a quote database similar to bash.org.

I want to run this script WITHIN a page I create in my Drupal install so that it runs seamlessly with my site. (after I adapt the QDB css file of course...)

I have tried simply applying the main index.php code but as I feared it dosen't even think about touching it :)

Think of it this way....

You have a Drupal installation on your site...
Now create a PAGE called PHPBB so that you can have a 'clean URL' of yoursite.com/phpbb and have a phpbb forum running in the page you created all together with your sidebars and navigation menus. Essentially you have phpbb installed in a PAGE on your site...
Forget about user integration, this dosen't matter with what I need ...
I just want to run this script in a page.

The script im wanting to run is a complete install together with it's own mysql database and its own folders/template files... Basically it's a content management system in its own right... But I want to run it within a window of Drupal....

Hope this clears it up a lilttle ;-)

Regards.
Mark :)

Ah ok, I think I'm

Ah ok, I think I'm understanding better what you mean. As far as I know, to do something of that nature you'll have to create a wrapper module. Off the top of my head I know of 2 modules that do something similar if you want to check out how it's done: TNG Integration and phpbb integration.

It's not a trivial thing--- good luck.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Yup, thats pretty much what

Yup, thats pretty much what I want to do although I don't need the user integration as there will be no users, all I need is something to make the QDB Script sit inside a page like the phpbb module makes phpbb sit as if it was part of the site and looking at those modules I can't see any way of adapting them with my limited knowledge :)

And there was me thinking it could be a simple soloution like create a page and put the QDB Script index page in there... ;-)

So unless someone knows how or has done something similar with this idea then I may just have to leave it outside the main website.

I'm wondering if even an Iframe type soloution would work.
Search engines don't need access as they are disallowed from the QDB directory.

Thanks as always, your time is much appreciated.
Mark.

Well now... Iframe soloution

Well now...
Iframe soloution seems to work for what I want http://www.cruelworld.co.uk/quotes but if there is a better soloution i'd still like to hear it as quite a lot of people frown upon Iframes :)

Regards.
Mark

So give it a go!

I've written several 'wrapper' modules and emulaters and integration with external sources.

And there was me thinking it could be a simple soloution like create a page and put the QDB Script index page in there... ;-)

That's quite feasable.
Why haven't you tried it?

Or you can also just

<?php
include ('path/to/your/custom/index.php');
?>

Which is much less fuss when debugging!

But note - the php input format is run in an eval() context so
- don't use page-scope globals. If you want a var to be global, declare it, don't just assume it.
- To include() anything else, you'll want to push the right paths onto your include_path or use the full path, as they may not always work if you try to find them relatively.

- there a re a few other side effects, mostly obscure, but not impossible to work around.

Because, for whatever reason, you are describing keeping your own navigation and chrome nested inside a Drupal wrapper, I can't guess what you expect clicking buttons inside there to do - unless go to another page.
If however your existing navigation just passes parameters (page=3&results_per_page=50) you should actually be able to continue finding them in the $_GET string as usual.

Migrating your function into a stand-alone module is probably trivial, so you might want to look at that.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

Hi dman, sorry it's took so

Hi dman, sorry it's took so long to get back but i've been trying allsorts to get things working, no joy.

The closest I have got so far is with that Iframe. I'm guessing that this scripting thing really dosen't suit me because I simply just don't know what i'm doing :D
I did try just copying the index.php code straight into the page I created but that didn't work.

I also tried

    <?php
include (/home/www/qdb/index.php);
?>

on it's own but that didn't work.

I also tried creating a full html page with

<html>
<head>
    <title>Quote Database</title>
</head>
<body>
    <?php
include (/home/www/qdb/index.php);
?>

</body>
</html>

but no joy...

I wasn't sure what you meant by

But note - the php input format is run in an eval() context so
- don't use page-scope globals. If you want a var to be global, declare it, don't just assume it.
- To include() anything else, you'll want to push the right paths onto your include_path or use the full path, as they may not always work if you try to find them relatively.

either so this might have had something to do with it not working as well.

All I really want is for my Database script to run in a created page and to act like it's part of the site just as a page would if you created a simple static single page like a basic contact page where you would have a link in Navigation called Contact Us and when you clicked it it simply switched paged to show your contact info, all nice and neatly packaged in your Drupal site complete with your sidebars :)

I'd love to know how to go about creating one of these wrappers that people speak of specifically to display a script like the one I want to use.

Thanks again for all your help everyone.
Mark

Sorry. "It didn't work"

Sorry.
"It didn't work" isn't enough for me to offer any more clues.
Did you try starting simpler and just running a 'print' type result through those tests?
And you did switch input format to PHP, right?

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

...

Perhaps start with the bot module: http://drupal.org/project/bot
There is also a quotes module: http://drupal.org/project/quotes

And there a few import modules that can import content in a few different ways. Nothing concrete, just a few random possibilities for you.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

Hi Sepec, thanks for your

Hi Sepec, thanks for your reply.
The Bot module looks very interestion for another project that I may start I must say but I can't see it doing anything for this page I want.

The quote module is a little more like it but I really want to use the QDB script that i've already built upon and would also like it to appear in a Page of it's own rather than in a block so unless it can be adapted to do that then I don't think it will be what i'm looking for.

Thanks for your help though and i'll have a look through those quote module files to see if I can work out if I can adapt it :)

phpBB within drupal site ?

Yes, I have similar issue and have created the phpBB within the subdirectory like my earthsmate.com/discussnature/

Or how do I embed the directory so that it stays within earthsmate.com page rather than going to the directory ?? possible ????

How do I include that into my drupal front page menu such as the primary link ????

Not very technical so need to be pretty specific ...

Thanks
www.earthsmate.com
Bringing nature into your life :D

http://www.peacebids.com

Pacify the world through Peace wearable art and drupal :d