aMule Forum
English => aMule Help => Topic started by: realtebo 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 ?
-
I'm afraid there is no real documentation available, only the source code of amuleweb.
-
Ok, i'll work to create more document about this topic.
-
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:
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 */
-
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?
-
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).
-
Eh... am I the only one seeing that dude's post with the functions, parameters and return values?
-
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.
-
Which means he's pretty awesome. Kudos, woutermense.
-
Thanks. I put it on the wiki (http://www.amule.org/wiki/index.php/AMuleWeb_PHP) for all to see/edit :)
-
Ok, that's simply GREAT !
-
This guy's a keeper.