aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Embedding amule webserver in the joomla cms.  (Read 6646 times)

guitoo

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 1
Embedding amule webserver in the joomla cms.
« on: October 08, 2008, 02:09:02 AM »

Hi,
I started to build a home web server, some days ago. I use joomla because i've already build several website with this cms. I wanted to provide a web interface for amule, torrent and other features which can be usefull in a home server.
I wanted to embed ( graphically and functionnaly) the amule webserver in the joomla site). I came across several difficulties and i think this may be usefull to share that with you.
I dont intend to explain how to use joomla or neither using php and css. So you'd better know what we are going to talk about.

The first thing is to use the joomla wrapper to embed the amule webserver. You have to build a wrapper menu item for any single amuleweb pages. So if your amules pages are servers.php, downloads.php... you create a wrapper for "my.ip.or.my.domain:4711/servers.php" and another one for "my.ip.or.my.domain:4711/servers.php"
Those pages may be different. It depends from the amuleweb template you use.

The first issue appears now. The auto height function doesnt work and thus a scrollbar appears. this happens because the navigator dont consider that my.ip.or.my.domain:4711 and my.ip.or.my.domain are from the same domain and prevent using javascript across two different domains.
You have to edit all of the php files  from the amule template and the index.php from the joomla template. Add the following lines somewhere between the head markups:

<script language"Javascript" href="text/Javascript">
 document.domain="my.ip.or.my.domain"
</script>

Delete the menu in your amule web php files.
Now you can access every features of the amule webserver using menu item from your joomla website.

But joomla still use its own template. copy the css file from your joomla template in your amuleweb template directory(usually /usr/share/amule/webserver/my-template). Delete the css rules in your different php pages and link the joomla stylesheet:

<link rel"stylesheet" href="style.css" type="text/css"/>

You may work on a copy of the default amuleweb template.
Copy all images from the joomla template in the root of your amule template. You cant access files in subdirectories. You have to edit php files to suit the joomla classes and ids and you're done. The .containt class may need some tweeking to remove some duplicated borders. this happens because there is two bodies and two containers.

What needs to be done now?
The php include doesnt work well with amule webserver, but it may be possible to build a joomla component that include some simplified php pages from amule webserver (without head and body markups). This way we should have a more maintanable template system. This way amule use the template from joomla (no need to copy). A single amule web template using joomla classes and ids need to be defined. Each function can be separated in its on php file and appears in containt or moduletables...
But i dont know yet if it is technically feaseable.

I hope i still have some readers at this point. I dont plan to going further for now. I may post some of my php files if your are interested.



Guitoo

« Last Edit: October 08, 2008, 02:20:26 AM by guitoo »
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Embedding amule webserver in the joomla cms.
« Reply #1 on: October 08, 2008, 06:54:25 AM »

Hello Guitoo,

a nice project you've been working on!

Quote
But i dont know yet if it is technically feaseable.
At least from the aMuleweb point of view, yes. You can create your own amuleweb template for this job. I don't know about joomla.
Logged

lfroen

  • Guest
Re: Embedding amule webserver in the joomla cms.
« Reply #2 on: October 08, 2008, 08:10:09 AM »

Wiki is better place for such info then forum. Other people may find this useful.
Logged