Page 4 of 4 FirstFirst 1234
Results 61 to 67 of 67

Thread: Upload image with link

  1. #61

    Default Re: Upload image with link

    Quote Originally Posted by Lionel View Post
    to delete existing image

    in template ADV_LINKS_ADD_EDIT

    put this where you have the upload input right before

    </div>
    </fieldset>

    PHP Code:
    <if condition="$show['editlink']"><div>
    <
    input type="checkbox" name="deleteimage" value="1">&nbspCheck this box to delete current image.
    </
    div>
    </if> 
    in addlinks.php

    in the routine: // ##### Do Edit Link
    put

    PHP Code:
     $deleteimage=$vbulletin->input->clean_gpc('p''deleteimage'TYPE_UINT); 
    below (it's at the beginning of routine)
    $newlink = $vbulletin->input->clean_gpc('p', 'link', TYPE_ARRAY);

    still in the same routine, locate


    and add below it

    PHP Code:
    else if(isset($deleteimage))
    {
      
    $imagedata "";
      
    $imagetype "";
      
    $imagesql ", imagedata = '', imagetype = ''";

    now, you can delete existing image
    By doing this edit will the picture used previously automatically be deleted when another picture is uploaded?

    Or will the user have to delete first and then upload a new picture?

    Wouldn't it be better to have the "delete checkbox" appear only if there is an image present, while the "upload box" is not? Once deleted, or if there is no image, only the "upload" box would be present.

    Another way of doing it would be to automatically check the "delete box" if the upload box is used. Causing the previous picture to automatically be removed.

    Perhaps I am just not understanding? By default, do images get deleted if a new one is uploaded? (without this hack) In other words, is this hack only for those who wish to not have an image?

    Please explain.
    Last edited by dcuellar; 05-07-2008 at 10:18 PM.

  2. #62
    Join Date
    May 2004
    Posts
    10

    Default Re: Upload image with link

    Be nice if this was standard

  3. #63
    Join Date
    Nov 2007
    Posts
    87

    Default Re: Upload image with link

    Quote Originally Posted by Mr Peabody View Post
    Be nice if this was standard
    ----------------------

    With vba Links Directory 3 beta 2, did this become standard? and if not, is this mod still good?

  4. #64
    Join Date
    Mar 2004
    Location
    Okanagan Centre, B.C. Canada
    Posts
    61

    Default Re: Upload image with link

    Does anyone have the image showing in the ADV_LINKS_SHOWLINK template? Got the hack installed but cant figure out where would be the best place to place the code into the template. Would like to if possible see some samples of where you have placed it and what it looks like.

    Thanks!

    <if condition="!empty($link[imagedata])">
    <img style="padding: 0px" src="showlink.php?$session[sessionurl]do=getimage&linkid=$link[linkid]" />
    </if>

    Cancelled - decided to stick with the latest beta.
    Last edited by kyle; 07-19-2008 at 11:54 PM.

  5. #65
    Join Date
    Jul 2005
    Location
    Twin Cities, MN
    Posts
    71

    Default

    Lionel,

    Would you be willing to make an update to this tutorial to upload an image with links for v3?

    This is one of the last pieces to the puzzle for my new site.

    Thank you.
    Last edited by Chani; 10-11-2008 at 02:31 AM.

  6. #66
    Join Date
    Jul 2005
    Location
    Twin Cities, MN
    Posts
    71

    Default

    Whoo Hoo!!! I figured it out!

    Well, mostly. It's a little buggy, but I got this working with Links v3!

    I'll try to cobble what I did together and post what I did.

    Chani
    Last edited by Chani; 01-17-2009 at 01:52 AM.

  7. #67
    Join Date
    Jul 2005
    Location
    Twin Cities, MN
    Posts
    71

    Default

    Sorry I never posted what my solution was. I need to figure it out again as when I upgraded to 3.1, it broke.

Page 4 of 4 FirstFirst 1234

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •