Image Upload -> Link Image to Story

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-20-2009, 01:37 AM
New Pligger
 
Join Date: Jan 2009
Posts: 2
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?
Reply With Quote
  #2 (permalink)  
Old 01-20-2009, 04:45 PM
New Pligger
 
Join Date: Jan 2009
Posts: 2
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!
Reply With Quote
  #3 (permalink)  
Old 01-20-2009, 06:33 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
Thanks for posting your solution.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #4 (permalink)  
Old 01-27-2009, 02:28 AM
Banned
Pligg Version: 9.5.5
 
Join Date: Jan 2009
Posts: 22
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
Reply With Quote
  #5 (permalink)  
Old 01-28-2009, 01:16 AM
Banned
Pligg Version: 9.5.5
 
Join Date: Jan 2009
Posts: 22
Is there other pliggers to help.
Reply With Quote
  #6 (permalink)  
Old 02-06-2009, 09:41 AM
New Pligger
Pligg Version: 1.0
 
Join Date: Feb 2009
Posts: 10
Hey, someone has to solve it, it's really important functionality...
Reply With Quote
  #7 (permalink)  
Old 02-22-2009, 08:16 PM
New Pligger
 
Join Date: Feb 2009
Posts: 6
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?

Last edited by eikum; 02-22-2009 at 08:25 PM.
Reply With Quote
  #8 (permalink)  
Old 02-25-2009, 10:06 AM
New Pligger
Pligg Version: 9.9.5
Pligg Template: yget
 
Join Date: Nov 2008
Posts: 10
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
Reply With Quote
  #9 (permalink)  
Old 02-25-2009, 12:33 PM
New Pligger
 
Join Date: Feb 2009
Posts: 6
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";
}

Last edited by eikum; 02-25-2009 at 12:40 PM.
Reply With Quote
  #10 (permalink)  
Old 04-11-2011, 07:30 PM
Banned
Pligg Version: 1.1.4
 
Join Date: Mar 2011
Posts: 43
Can someone tell me in which file I edit when I click to open the image with the URL of the story?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload Module (File and Image Attachment) Yankidank Free Modules 268 02-03-2012 12:19 PM
Image Upload Module -- Call for feature requests cent Questions and Comments 12 11-15-2008 01:13 PM
Image Upload - Make image link to story swese44 Questions and Comments 1 07-22-2008 10:07 PM
[SOLVED] When I upload a image when submitting a news story... gossipqueenie Questions and Comments 3 10-27-2007 12:44 PM
Image Upload / Image display with stories mod - Will pay for dev and share adampoots Questions and Comments 8 04-10-2007 08:22 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development