Results 1 to 10 of 10
  1. #1
    New Pligger MikeF's Avatar
    Joined
    Jan 2009
    Posts
    2
    Thanks
    Received:0
    Given: 0

    Image Upload -> Link Image to Story

    Although this has been mentioned numerous times in the forums, I haven't come across a clear solution.

    I am using Image Upload (V 1.03), allowing users to upload their own image with each submission (see i Bored). However, the uploaded image links to the image's URL.

    I'd like each image to link directly to the associated page's story -- each image should have the same link configuration as the corresponding title.

    Can anyone help me figure this out?

  2. #2
    New Pligger MikeF's Avatar
    Joined
    Jan 2009
    Posts
    2
    Thanks
    Received:0
    Given: 0
    Alright, figured this all out. The guy from Notimega.Com helped me out on this one, so a big thanks goes out to him.

    In the modules/image_upload folder, open image_upload_main.php and change the following lines in the image_upload_preview_handler() function:

    if (module_imageupload_use_thickbox)
    {
    // Use Thickbox method
    echo module_imageupload_thickbox_pre1 . getmyurl("outtitle", urlencode($link->title_url)) ... etc;
    echo module_imageupload_legendtext;
    } else {
    // Use Direct link method
    echo module_imageupload_directlink_pre1 . $link->url ... etc;
    echo module_imageupload_legendtext;
    }

    You can then fix up the pre1 statement in your settings by taking out the image directory and changing '/' to ''

    Hope that helps!

  3. #3
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,513
    Thanks
    Received:85
    Given: 14
    Site
    http://pligg.com/demo/
    Thanks for posting your solution.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  4. #4
    Banned Many's Avatar
    Joined
    Jan 2009
    Posts
    22
    Thanks
    Received:0
    Given: 0
    Quote Originally Posted by MikeF View Post
    Alright, figured this all out. The guy from Notimega.Com helped me out on this one, so a big thanks goes out to him.

    In the modules/image_upload folder, open image_upload_main.php and change the following lines in the image_upload_preview_handler() function:

    if (module_imageupload_use_thickbox)
    {
    // Use Thickbox method
    echo module_imageupload_thickbox_pre1 . getmyurl("outtitle", urlencode($link->title_url)) ... etc;
    echo module_imageupload_legendtext;
    } else {
    // Use Direct link method
    echo module_imageupload_directlink_pre1 . $link->url ... etc;
    echo module_imageupload_legendtext;
    }

    You can then fix up the pre1 statement in your settings by taking out the image directory and changing '/' to ''

    Hope that helps!
    Verry nice looking your site with the images.

    Can you please share your tpl php files to us. Maby copy of the files for upload to ouwer pligg maps.

    It wood be verry nice.

    Many

  5. #5
    Banned Many's Avatar
    Joined
    Jan 2009
    Posts
    22
    Thanks
    Received:0
    Given: 0
    Is there other pliggers to help.

  6. #6
    New Pligger jirihrabakne's Avatar
    Joined
    Feb 2009
    Posts
    10
    Thanks
    Received:0
    Given: 0
    Hey, someone has to solve it, it's really important functionality...

  7. #7
    New Pligger eikum's Avatar
    Joined
    Feb 2009
    Posts
    6
    Thanks
    Received:0
    Given: 0
    Whats wrong here?
    -----------------------
    if (module_imageupload_use_thickbox)
    {
    // Use Thickbox method
    echo module_imageupload_thickbox_pre1 . getmyurl("outtitle", urlencode($link->title_url)) $imageFile . module_imageupload_thickbox_pre2 . $imageCaption . module_imageupload_thickbox_pre3 . module_imageupload_preview_pre . module_imageupload_thumb_generator . module_imageupload_thumb_generator_pre . $imageFile . module_imageupload_thumb_generator_post . module_imageupload_preview_post . module_imageupload_thickbox_post;
    echo module_imageupload_legendtext;
    } else {
    // Use Direct link method
    echo module_imageupload_directlink_pre1 . $link->url $imageFile . module_imageupload_directlink_pre2 . $imageCaption . module_imageupload_directlink_pre2 . module_imageupload_preview_pre . module_imageupload_thumb_generator . module_imageupload_thumb_generator_pre . $imageFile . module_imageupload_thumb_generator_post . module_imageupload_preview_post . module_imageupload_directlink_post;
    echo module_imageupload_legendtext;
    }
    -----------------------

    Thanks, great! I need this.. Can I ask one quest about this script?
    I dont know if this is the right place to ask this question.
    But how can I make a dafult photo? If the user dosnt have any photo to upload, I would like the script to use my deafult photo. Anyone that can help me?

  8. #8
    New Pligger Notimega's Avatar
    Joined
    Nov 2008
    Posts
    10
    Thanks
    Received:0
    Given: 0
    Good idea, I'll implement that in my site too.

    I would recommend to check if the $imageFile var is empty and then assign the one you want as default somewhere in the code where we get the $imageFile value from the database.

    Code:
    if($imageFile==""){ $imageFile="/img/mydefault.jpg"; }
    HTH

  9. #9
    New Pligger eikum's Avatar
    Joined
    Feb 2009
    Posts
    6
    Thanks
    Received:0
    Given: 0
    If you know how I can do this, can you say where I have to past in that code? would be great pal!

    Tryd this, didt work:
    // Get Image filename
    if ($main_smarty->get_template_vars(module_imageupload_filename_fie ld) == "")
    {
    $imageFile = module_imageupload_fullsize_prefix.$storyID.".jpg" ;
    } else {
    $imageFile = "lal.jpg";
    }

  10. #10
    Banned nolieenotrue's Avatar
    Joined
    Mar 2011
    Posts
    43
    Thanks
    Received:0
    Given: 0
    Can someone tell me in which file I edit when I click to open the image with the URL of the story?

Similar Threads

  1. Add Image to Comments - using Image Upload Module
    By Evgolas in forum Questions & Comments
    Replies: 2
    Last Post: 04-11-2012, 01:04 AM
  2. simple "image upload -> link image" module
    By jirihrabakne in forum Questions & Comments
    Replies: 1
    Last Post: 02-09-2009, 10:12 PM
  3. Image Upload - Make image link to story
    By swese44 in forum Questions & Comments
    Replies: 1
    Last Post: 07-22-2008, 06:07 PM
  4. Miising loading image in image upload/thickbox module
    By Peter in forum Questions & Comments
    Replies: 5
    Last Post: 12-05-2007, 11:24 PM
  5. Replies: 8
    Last Post: 04-10-2007, 04:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg