PDA

View Full Version : Reload Profile page after uploading a logo


Mike
03-19-2006, 04:42 PM
Originally posted by Waterpilo
When I want to add attachment after I close attachment window page is not refreshed so I can't see my attachments. But when I refresh this page manually (F5) I see new gif. This should be fixed somehow. It happens everywhere. My exmplae is profile logo.

----------------------------------------------------------------------

Here is a temporary fix for now..

Open upload_attachment.html in the templates folder.

Add this under the {js} tag:

<script language="javascript">
function reLoad()
{

if(opener.location == "http://www.mysite.com/selling.php?cmd=profile")
{
opener.location.reload();
}

window.close();
}

</script>
Change mysite to your website name!

Search for this window.close(); (note: not the one above, but the one at the bottom of the document).

replace it with reLoad();

Save your file, and the parent window should reload when the user click the close button

Or here is the full upload_attachment.html file: Remember replace mysite with yours


{js}
<script language="javascript">
function reLoad()
{

if(opener.location == "http://www.mysite.com/selling.php?cmd=profile")
{
opener.location.reload();
}

window.close();
}

</script>

<form enctype="multipart/form-data" action="{ilpage[upload]}" name="attachment" method="post" style="margin: 0px;">
<input name="crypted" type="hidden" value="{crypted}" />
<input name="cmd" value="_do-upload-now" type="hidden" />
<table class="tableborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr>
<td align="left" class="td_attachment_hdr"> <span class="header">{_upload_attachments}</span> <span id="uploading" style="display:none; font-color: {template_alt2}" class="header"><strong>Uploading ..</strong></span><br /><br /></td>
</tr>
<tr>
<td align="center" class="panelbackground">
<div class="panel">
<div align="left">
<if name="notice">

<fieldset class="fieldset">
<legend><strong><font color="blue">{_moderation_notice}&nbsp;</font></strong>
</legend>
<table cellpadding="0" cellspacing="3" border="0" width="100%">
<tr valign="bottom">
<td valign="middle">{notice_message}</td>
</tr>
</table>
</fieldset>
</if name="notice">

<if name="error">

<fieldset class="fieldset">
<legend><strong><font color="red">{_errors_detected}&nbsp;</font></strong>
</legend>
<table cellpadding="0" cellspacing="3" border="0" width=100%>
<tr valign="bottom">
<td valign="middle">{error_message}</td>
</tr>
</table>
</fieldset>
</if name="error">

<fieldset class="fieldset">
<legend><strong>{_find_attachment} <font color="red" size="3">*</font>&nbsp;</strong>
</legend>
<table cellpadding="0" cellspacing="3" border="0" width=100%>
<tr valign="bottom">
<td><input type="file" name="upload" /> </td>
<td> </td>
</tr>
</table>

</fieldset>

<if name="portfolio_manage">
<!-- portfolio image management -->
<br />
<fieldset class="fieldset">
<legend><strong>{_portfolio_information} <font color="red" size="3">*</font> </strong></legend>
<table cellpadding="0" cellspacing="3" border="0" width="100%">
<tr valign="bottom">
<td align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>{_category}</td>
</tr>
<tr>
<td>{search_category_pulldown}</td>
</tr>
<tr>
<td>{_caption}</td>
</tr>
<tr>
<td><input type="text" name="caption" value="" maxlength="49" size="22" style="width: 95%"></td>
</tr>
<tr>
<td valign="middle">{_description}</td>
</tr>
<tr>
<td valign="middle"><input type="text" name="description" value="" maxlength="49" size="22" style="width: 95%"></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<!-- portfolio image management -->
</if name="portfolio_manage">


<br />
<fieldset class="fieldset">
<legend><strong>{_manage_attachments}&nbsp;</strong></legend>
<table cellpadding="0" cellspacing="3" border="0" width="100%">
<tr valign="bottom">
<td valign="middle"> <div align="left">{attachment_list}</div></td>
<td align="right" valign="bottom"><input type="submit" name="removeattachments" value="{_remove}" width="60" class="buttons" /></td>
</tr>
</table>
</fieldset>
<br />
<fieldset class="fieldset">
<legend><strong>{_upload_limits}&nbsp;</strong></legend>
<table cellpadding="0" cellspacing="3" border="0" width=100%>
<tr valign="bottom">
<td width="51%" valign="middle">{_maximum_files_can_attach}
<strong>{maximum_files}</strong></td>
<td width="26%" align="right" nowrap>{_upload_space}:
<strong>{attach_user_max}</strong></td>
<td width="23%" align="right" nowrap>{_used}:
<strong>{attach_usage_total}</strong></td>
</tr>
<if name="ifextensions">
<tr valign="bottom">
<td colspan="3" valign="middle" wrap><div style="word-spacing:-1px"> <strong>{extensions}</strong></div></td>
</tr>
</if name="ifextensions">
</table>

<if name="ifprofile"> </if name="ifprofile">
</fieldset>
<br />
<fieldset class="fieldset">
<legend><strong>{_image_limits}&nbsp;</strong></legend>
<table cellpadding="0" cellspacing="3" border="0" width="100%">
<tr valign="bottom">
<td width="51%" valign="middle">{_maximum_width} <strong>{max_width} px</strong></td>
<td width="49%" align="right"> {_maximum_height} <strong>{max_height} px</strong></td>
</tr>
<tr valign="bottom">
<td valign="middle">{_maximum_filesize}: <strong>{max_size} </strong></td>
<td align="right">&nbsp;</td>
</tr>
</table>
</fieldset>

</div>
</div>

<div style="margin-top:6px"><input type="submit" name="upload" value="{_upload}" onclick="return check_upload(this.form);" class="buttons" {upload_style} /> &nbsp;&nbsp; <input type="button" class="buttons" value="{_close}" onclick="reLoad();" /></div></td>
</tr>
</table>
</form>

wterpilo
03-20-2006, 01:32 PM
Working fine, thanks. You could also add on the profile page button to delete this picture. It would be easier not to go into attachment.

Ps. My nick is wterpilo (Wojciech Terpilowski) Just for you to know :)