aMule Forum
English => aMule Help => Topic started by: Eberk89 on September 22, 2009, 12:21:13 PM
-
Hi everyone.
I'm trying to change the amuleweb ed2k links functionality to solve a problem with my links.
I take ed2k links from a site, that adds "+[nameOfTheSite.com] " at the end of every file name: i don't really like it, so I wanted to change the code in this way, adding a simple str_replace function in the code...
if (($HTTP_GET_VARS['cmd'] == 'download' ) && ($_SESSION["guest_login"] == 0)) {
$link = $HTTP_GET_VARS['ed2klink'];
$target_cat_idx = cat2idx($HTTP_GET_VARS['cat']);
if ( strlen($link) > 0 ) {
[b] $link = str_replace ( "nameOfTheSite.com", "", $link);[/b]
amule_do_ed2k_download_cmd($link, $target_cat_idx);
}
}
but it doesn't run!! Are only a small set of functions available in amuleweb? How can I use str_replace in the code? Is there another way?
I hope this is the right section! :)
-
Are only a small set of functions available in amuleweb?
Yes.
Is there another way?
What about using JavaScript?
Something like the following should work:
<head>
<script type="text/javascript">
function remove_site_name() {
var el = document.getElementById('ed2klink');
el.value = el.value.replace("nameOfTheSite.com", "");
}
</script>
</head>
<body>
<form onsubmit="remove_site_name()">
<input type="text" name="ed2klink" id="ed2klink" value="ed2klink with nameOfTheSite.com in the name">
<input type="submit">
</form>
</body>
-
How can I use str_replace in the code?
Post a feature request and hope somebody will eventually implement it ;)
-
thank you!!
I'll try to use javascript and/or to implement it in amule... it would be a good way to start contribute and know amule structure :P