WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Custom Link Attachments

Version: 4.1.16
printPrint


Custom Link Attachments
sportrow
Member
Avatar

Usergroup: Customer
Joined: Feb 14, 2005
Location: Iowa
Total Topics: 18
Total Posts: 41

Last Blog:

Posted 11/25/07 - 09:20 PM:
quote post
#1
Hello- I have been struggling with the instructions for custom file attachment fields. I have been able to get the files to upload but with quirky outcomes. Understand that I would like to offer both type of upload options when submitting or editing a link. So I am seeking help on some advice here. Also I am having troubles deleting the files once added. The original code below. I have added a tag called {LINKATTACHCOUPONS}



My modified try
<tr>
<td class="labelscolumn" width="20%"><span class="labels">Attach Coupon(s):</span>
<br />Allowed file types: {ALLOWEDEXTENSIONS}</td>
<td class="optionscolumn" width="80%">
<IF {LINKNUMATTACHMENTS} is less than {THISMEMBERGROUPATTACHPERLINK}><input type="file" name="attachcoupons" /> <input type="submit" name="uploadattachment" value="Attach" class="button" /></IF>
<IF {LINKNUMATTACHMENTS}>

<br />Coupon:<br/>
<!-- BEGIN MENU ATTACHMENTS -->
<input type="checkbox" name="attachcouponsdelete[]" value="{ATTACHID}" /> {LINKATTACHCOUPONSTITLE} ({LINKATTACHCOUPONSKB} KB)<br />
<!-- END MENU ATTACHMENTS -->
<input type="submit" name="attachdeletion" value="Delete Selected" class="button" />

</IF>
</td>
</tr>


Orignal Code
<tr>
<td class="labelscolumn" width="20%"><span class="labels">Attach Menu(s):</span>
<br />Allowed file types: {ALLOWEDEXTENSIONS}</td>
<td class="optionscolumn" width="80%">
<IF {LINKNUMATTACHMENTS} is less than {THISMEMBERGROUPATTACHPERLINK}><input type="file" name="filefield" /> <input type="submit" name="uploadattachment" value="Attach" class="button" /></IF>
<IF {LINKNUMATTACHMENTS}>

<br />Menus:<br />
<!-- BEGIN LINK ATTACHMENTS -->
<input type="checkbox" name="attachdelete[]" value="{ATTACHID}" /> {ATTACHFILETITLE} ({ATTACHKB} KB)<br />
<!-- END LINK ATTACHMENTS -->
<input type="submit" name="attachdeletion" value="Delete Selected" class="button" />

</IF>
</td>
</tr>

Edited by sportrow on 11/27/07 - 11:02 AM

it is all about the tortilla
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6175
Posted 11/27/07 - 10:15 PM:
quote post
#2
The upload attachment button is meant for the grouped, generic attachment. With custom file fields, you just specify the file and it'll be submitted when you submit the link. This can be a problem if you also use the generic attachments, since someone could upload one of those which would cause the custom file field's attachment to be lost. I don't have a solution for that though, they were really meant as exclusive options.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
sportrow
Member
Avatar

Usergroup: Customer
Joined: Feb 14, 2005
Location: Iowa
Total Topics: 18
Total Posts: 41

Last Blog:

Posted 11/28/07 - 12:37 PM:
quote post
#3
Hey Paul- I am digging that. What you are explaining was exactly happening to me. I could really benefit from having a solution to upload 2 seperate files each with their own user permissions. However I am guessing most people using WSNlinks would not have a need for that. Thanks for your info on this.

it is all about the tortilla
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.