aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Where to find documentations about webserver PHP macro ?  (Read 3574 times)

realtebo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 45
Where to find documentations about webserver PHP macro ?
« on: May 22, 2009, 09:58:02 AM »

I'd like to start a new theme for amuleweb.but i need the FULL LIST of avaiable html/php macro to insert in HTML code of my template...  I tryed to learn from other templates, ok, but default doesn't use some template macro used insted in other templates, and every template use some macro but not all, so no template is complete.

Is that docs avaiable somewhere?

I know this Wiki Page very well : http://www.amule.org/wiki/index.php/AMuleWeb_PHP

But what is the function parameter list for all of this ?

amule_do_server_cmd': amule_do_add_server_cmd': amule_do_download_cmd': amule_do_shared_cmd': amule_do_reload_shared_cmd': amule_do_search_download_cmd': amule_do_search_start_cmd': amule_do_ed2k_download_cmd': amule_get_log

And what about data returned by them ?
« Last Edit: May 22, 2009, 10:40:03 AM by realtebo »
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Where to find documentations about webserver PHP macro ?
« Reply #1 on: May 22, 2009, 11:05:57 AM »

I'm afraid there is no real documentation available, only the source code of amuleweb.
Logged

realtebo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 45
Re: Where to find documentations about webserver PHP macro ?
« Reply #2 on: May 22, 2009, 12:45:26 PM »

Ok, i'll work to create more document about this topic.
Logged

woutermense

  • Full Member
  • ***
  • Karma: 18
  • Offline Offline
  • Posts: 154
Re: Where to find documentations about webserver PHP macro ?
« Reply #3 on: May 22, 2009, 02:05:14 PM »

I had a nice long look in these two files in the source:  /src/webserver/src/WebServer.cpp and /src/webserver/src/php_amule_lib.cpp

This is what I could understand out of the source:

Code: [Select]
amule_do_shared_cmd($file_hash, "command", $optional_arg)
/* Change priority on a shared file
/* command is one of: prioup, priodown, prio
 * command prio needs a value
 */
 
amule_do_reload_shared_cmd()
/* Reloads the share list
 */

amule_do_download_cmd($file_hash, "command", $optional_arg)
/* Change parameter of a file in the download
 * command is one of: pause, resume, cancel, prio, prioup, priodown
 * command prio needs a value
 */

amule_kad_connect($bootstrap_ip, $bootstrap_port)
/* Connects to the Kad network
 */

amule_do_add_server_cmd($server_addr, $server_port, $server_name)
/* Adds a server to the server list
 */

amule_do_server_cmd($server_ip, $server_port, "command")
/* Connects/disconnects or removes a server
 * command is one of: connect, disconnect, remove
 */

amule_get_stats()
/* Query amule status. Return hash containing stats values
 * keys: id, serv_addr, serv_name, serv_users, kad_connected, kad_firewalled,
 *       speed_up, speed_down, speed_limit_up, speed_limit_down
 */

amule_get_categories()
/* Returns the categories
 */

amule_get_options()
/* Return hash of amule options.
 * keys: nick, connection, files, webserver, coretweaks
 * connection subkeys: max_line_up_cap, max_line_down_cap, max_up_limit,
 *                     max_down_limit, slot_alloc, tcp_port, udp_port, udp_dis,
 *   max_file_src, max_conn_total, autoconn_en, reconn_en
 * files subkeys: ich_en, aich_trust, new_files_paused, new_files_auto_dl_prio,
 *                preview_prio, new_files_auto_ul_prio, upload_full_chunks,
 *  first_last_chunks_prio, start_next_paused, resume_same_cat,
 *  save_sources, extract_metadata, alloc_full, check_free_space,
 *  min_free_space
 * webserver subkeys: use_gzip, autorefresh_time
 * coretweaks subkeys: max_conn_5sec
 */
 
amule_set_options($options_hash)
/* Set amule options from given array. Argument looks like "amule_get_options" result
 */

amule_do_search_download_cmd($file_hash, $cat)
/* Download 1 of search results. Params: hash, category (default=0)
 */

amule_do_search_start_cmd($search, $ext, $filetype, $type, $avail, $min_size, $max_size)

amule_get_log($rst)
/* returns log if rst = 0, resets log otherwise
 */

amule_get_serverinfo($rst)
/* Request contents of server info if rst = 0, resets contents otherwise
 */

amule_do_ed2k_download_cmd($link, $cat)
/* Download ed2k link. Params: link, category (default=0)
 */

amule_load_vars($varname)
/* loads variables.
 * varname is one of: downloads, uploads, shared, searchresult, servers,
 *  stats_graph, stats_tree
 *
 * "downloads" returns an array with for each download these key/value pairs:
 *  - name, short_name, hash, progress, link, category, status, size,
 *    size_done, size_xfer, speed, src_count, src_count_not_curr,
 *  src_count_a4af, src_count_xfer, prio, prio_auto, last_seen_complete
 *
 * "uploads" returns an array with for each download these key/value pairs:
 *  - name, short_name, xfer_up, xfer_down, xfer_speed
 *
 * "shared" returns an array with for each download these key/value pairs:
 *  - name, short_name, hash, size, link, xfer, xfer_all, req, req_all, accept,
 *    accept_all, prio, prio_auto
 *
 * "searchresult" returns an array with for each search result these
 * key/value pairs:
 *  - name, short_name, hash, size, sources, present
 * "servers" returns an array with for each server these key/value pairs:
 *  - name, desc, addr, users, ip, port, maxusers, files
 * "stats_graph" returns stats graphs images
 * "stats_tree" returns stats ??tree??
 */

amule_get_version()
/* Returns version string */
« Last Edit: May 22, 2009, 02:07:52 PM by woutermense »
Logged

realtebo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 45
Re: Where to find documentations about webserver PHP macro ?
« Reply #4 on: May 22, 2009, 05:22:08 PM »

I've this file opened in my desktop since 3-4 hours, but. ... where is this text !? I downloaded the full source code from sourgeforge, from the stable 2.25 version.

Must i dl some other files?
Logged

lfroen

  • Guest
Re: Where to find documentations about webserver PHP macro ?
« Reply #5 on: May 22, 2009, 08:36:07 PM »

Unfortunately there's no comprehensive docs. The best you can do is to use examples from templates and add some var_dump() calls to your code (output will be send to console you run amuleweb from).
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Where to find documentations about webserver PHP macro ?
« Reply #6 on: May 22, 2009, 08:53:29 PM »

Eh... am I the only one seeing that dude's post with the functions, parameters and return values?
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Where to find documentations about webserver PHP macro ?
« Reply #7 on: May 23, 2009, 12:06:36 AM »

Yes, you are. Others probably don't believe their eyes.

@realtebo: This text isn't in the source code. It's a preliminary documentation written by woutermense, just by studying the source.
Logged
concordia cum veritate

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Where to find documentations about webserver PHP macro ?
« Reply #8 on: May 23, 2009, 04:41:38 AM »

Which means he's pretty awesome. Kudos, woutermense.
Logged

woutermense

  • Full Member
  • ***
  • Karma: 18
  • Offline Offline
  • Posts: 154
Re: Where to find documentations about webserver PHP macro ?
« Reply #9 on: May 23, 2009, 05:28:09 PM »

Thanks. I put it on the wiki for all to see/edit :)
Logged

realtebo

  • Approved Newbie
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 45
Re: Where to find documentations about webserver PHP macro ?
« Reply #10 on: May 24, 2009, 07:30:13 AM »

Ok, that's simply GREAT !
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Where to find documentations about webserver PHP macro ?
« Reply #11 on: May 24, 2009, 08:07:21 AM »

This guy's a keeper.
Logged