Hi,
iam trying to implement a second button near the normal upload button for use
with rembrandts email upload mod:
http://www.4homepages.de/forum/index.php?topic=23681.0...but i have a problem, variable $user_name not working in categories.php but in categories.html...
Thats the original source part from categories.php:
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload", $cat_id)) {
$upload_url = "";
$upload_button = "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
$upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&".URL_CAT_ID."=".$cat_id);
$upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"\" /></a>";
}
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),
"cat_description" => format_text($cat_cache[$cat_id]['cat_description'], 1, 0, 1),
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
"upload_url" => $upload_url,
"upload_button" => $upload_button,
"random_cat_image" => $random_cat_image
));
unset($random_cat_image);
i have added the following lines:
if {
$eupload_url = "";
$eupload_button = "<img src=\"".get_gallery_image("eupload_off.png")."\" border=\"0\" alt=\"\" />";
}
else {
$eupload_url = "mailto:emailadress?subject=$user_name*upload*$cat_id&body=Attach your png icons!";
$eupload_button = "<a href=\"".$eupload_url."\"><img src=\"".get_gallery_image("eupload.png")."\" border=\"0\" alt=\"\" /></a>";
}
"eupload_url" => $eupload_url,
"eupload_button" => $eupload_button,
}
the complete changed part:
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
if (!check_permission("auth_upload", $cat_id)) {
$upload_url = "";
$eupload_url = "";
$upload_button = "<img src=\"".get_gallery_image("upload_off.gif")."\" border=\"0\" alt=\"\" />";
$eupload_button = "<img src=\"".get_gallery_image("eupload_off.png")."\" border=\"0\" alt=\"\" />";
}
else {
$upload_url = $site_sess->url(ROOT_PATH."member.php?action=uploadform&".URL_CAT_ID."=".$cat_id);
$eupload_url = "mailto:emailadress?subject=$user_name*upload*$cat_id&body=Attach your png icons!";
$upload_button = "<a href=\"".$upload_url."\"><img src=\"".get_gallery_image("upload.gif")."\" border=\"0\" alt=\"\" /></a>";
$eupload_button = "<a href=\"".$eupload_url."\"><img src=\"".get_gallery_image("eupload.png")."\" border=\"0\" alt=\"\" /></a>";
}
$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars(array(
"categories" => get_categories($cat_id),
"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),
"cat_description" => format_text($cat_cache[$cat_id]['cat_description'], 1, 0, 1),
"cat_hits" => $cat_cache[$cat_id]['cat_hits'],
"upload_url" => $upload_url,
"eupload_url" => $eupload_url,
"upload_button" => $upload_button,
"eupload_button" => $eupload_button,
"random_cat_image" => $random_cat_image
));
unset($random_cat_image);
The Problem is that the variable $user_name is not working it's empty,
if i use this: mailto:emailadress?subject=$user_name*upload*$cat_id&body=Attach your png icons!
as a normal a href in categories.html variable $user_name is filled, where is the problem?
Can someone help me please?
EDIT:Ich habe einen funktionierenden ich nenne es mal Workaround hinbekommen, alle änderungen
in der categories.php habe ich rückgängig gemacht und in der categories.html folgendes hinzugefügt:
<table border="0" cellspacing="0" cellpadding="0" id="eupload">
<td align="left"><p>{cat_name} ~ (Hits: {cat_hits}) </p></td>
<td background="{template_url}/images/eupload.png" width="21"></td>
<td align="left"><a href="mailto:emailaddress?subject={user_name}*upload*{cat_id}&body=Attach your {cat_name} icons!">eUpload</a></td>
</table>
Ich bin mit der Lösung aber ehrlich gesagt unzufrieden, ich halte die umsetzung nicht für sauber und eigentlich soll der button so
integriert werden wie der reguläre upload button, hat das jemand von euch mit was ähnlichem gemacht und kann mich evtl.
unterstützen?
EDIT2:Mist, ich stell gerade fest das für $user_name scheinbar der letzte User der in einer Galerie etwas hochgeladen hat eingesetzt wird,
obwohl ich angemeldet bin steht der name des user in der variablen der den letzten upload getätigt hat (nehme ich an).
Falsche variable?
Greetz X23