Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 67

Thread: Upload image with link

  1. #21
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    There is a nice hack in the forums that will put a screenshot of website as a thumb for you. Do a search for thumbshots.

    If it is the uploaded image that you want, then in browselinks.php locate

    // Get Links
    and add after links.catid,
    links.imagedata,
    (with the comma) after

    then in your adv_links_linkbit

    <img style="padding: 0px" src="showlink.php?$session[sessionurl]do=getimage&linkid=$link[linkid]" />
    where you want it to display. It will display everywhere that link is called.

    If I were you, I would further improve it by resizing image in the same browselinks.php in the while loop, and if there are no image, display a generic image for consisitency. Remember image is stored in database, so you would need to fake printing it first so you could use the GD image resize functions. Otherwise the uploaded image must be very small or that will throw off your layout.

    I am about to post another neat modification. If you can be a couple of days patient, I'll do the resizing for you.
    Last edited by Lionel; 03-04-2007 at 10:26 PM.

  2. #22

    Default Re: Upload image with link

    omg thank you you are my savor.. cool another mod .. thanks . do you think you can add a fix to deleting images.. because all the images uploaded. can't be deleted.. you will have to delete a whole thread.. Plus the Administrator Panel Dosen;t have the upload feature.. i think those features you should add on to for your next mod..

  3. #23
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    Yeah you are right. I will add that.

    here is another mod for you

  4. #24

    Default Re: Upload image with link

    cool thanx.. tell me when you updated your mod..

  5. #25
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    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
    if (!empty($imagedata) AND !empty($imagetype))
    {
    $imagesql = ", imagedata = '" . addslashes($imagedata) . "', imagetype = '$imagetype'";
    }
    }
    and add below it

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

    now, you can delete existing image

  6. #26

    Default Re: Upload image with link

    wow man you got some skills man works perfectly.. Thanx Again

  7. #27

    Default Re: Upload image with link

    but it got some bugs though.. it could delete the image.. but when i upload another image up.. a different image.. it went back .. to the original one.. try it out your self

  8. #28
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    not for me. The image is stored in database. Once you delete it in there, it can never comeback

  9. #29
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    if you want the current image to display when you are editing the link, add this in your ADV_LINKS_ADD_EDIT somewhere above the upload in put. I put mine right below

    <div style="padding:$stylevar[formspacer]px">

    <if condition="$link[imagedata]!=''">
    <img src="showlink.php?do=getimage&linkid=$link[linkid]">
    </if>
    <br />
    Your other problem comes from the cache. refresh browser and it will disappear.

    P.S. I also moved up the delete condition below the image display. No need to show it if there are no image :-)
    Last edited by Lionel; 04-19-2007 at 05:18 PM.

  10. #30
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    next, i am going to make the guys who pay rotate their banner in the listings in same category with no banner, LOL

  11. #31

    Default Re: Upload image with link

    oh it is cache .... my bad.. thanx

  12. #32

    Default Re: Upload image with link

    Quote Originally Posted by Lionel View Post
    should not be a problem. I have thousands of images stored in my gallery db.
    hey is there anywayz for this? http://www.vbadvanced.com/forum/showthread.php?t=20778

  13. #33

    Default Re: Upload image with link

    hey i want to put a screen shot of the link also.. how would you change the codes? i tried thumbshots.. but they are too small..and quality is really bad.. can you help thanx.

  14. #34
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Upload image with link

    I want to install this but I didn't understand the very first part, about adding tables in Phpadmin.

    Exactly what tables am I adding? I see the adv_links table, but I don't see a table_prefix table. Yes, I'm a little slow with coding.

    Also, all my tables are prefixed with vbb_ so I am seeing vbb_adv_links. I am not sure if I am waaay off or what. Please help.

  15. #35

    Default Re: Upload image with link

    Alter table_prefix adv_links (use phpadmin to add those 2 new columns)

    `imagedata` mediumblob NOT NULL,
    `imagetype` varchar(100) NOT NULL default '',
    Where is this located??

    I have done everything else but this

    Thanks,
    RON

  16. #36
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    Quote Originally Posted by rknight111 View Post
    Where is this located??

    I have done everything else but this

    Thanks,
    RON
    (use phpadmin to add those 2 new columns)

  17. #37

    Default Re: Upload image with link

    What program do I add these tables
    Alter table_prefix adv_links
    Im not sure where I can find these, could you let me know where to find these. Every thing else is done

  18. #38
    Join Date
    Jan 2004
    Location
    Miami
    Posts
    1,040

    Default Re: Upload image with link

    use phpadmin to add those 2 new columns
    if you don't know what this is, don't mess up with your forums and uninstall this hack. Misusing it can hurt you big time

  19. #39

    Default Re: Upload image with link

    Sorry, Im not a computer programmer, I will find someone to add this part to my links. Thanks, I wouldnt want to toast by board. This hack is very good though. I have added all the other coding allready and will not open my links page untill I can finish this part.

    RON

  20. #40

    Default Re: Upload image with link

    I got some help from a coder on vbulletin, Nice Mod.

    Now Im just playing around with the ADV_LINKS_SHOWLINK where is the best place to put that coding that works the best. Any help would be great. He left that to me. Im just moving around and mabie I'll find a good spot but Im sure you have all done this allready.

    Thanks
    RON

Page 2 of 4 FirstFirst 1234 LastLast

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
  •