Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 07-05-2007, 02:07 PM
cent's Avatar
Constant Pligger
 
Join Date: Jan 2007
Location: New York, NY
Posts: 183
Thanks: 24
Thanked 65 Times in 26 Posts
You'll need to add that to your CSS file for your template (see: main.css). Alternatively, you can edit the image_upload_settings.php file and look for:

define('module_imageupload_img_css_pre', '<div style="width: '.module_imageupload_thumb_width.'px; margin: 5px 10px 10px 10px;">');

and change it to:

define('module_imageupload_img_css_pre', '<div style="width: '.module_imageupload_thumb_width.'px; float: left; clear: left; margin: 0px 10px 0px 0px;">');

...if you didn't want to edit your main.css file but wanted to use the example from Floryn. That's what that particular setting is there for. If you did update your main.css file, you could also use:

define('module_imageupload_img_css_pre', '<div class="imgLeft">');

Best,
Cent
__________________
All of my modules are developed for free to help support the Pligg community. If you use or feel my modules were helpful to your site and want to thank me, please support the Pligg development team by donating.

Modules: Welcome Private Message (v0.1), Welcome Email (v0.1), Thickbox Module (v0.3), Image Upload (v1.0) & MP3 Upload Module (v0.9)
Reply With Quote
  #22 (permalink)  
Old 07-06-2007, 03:30 AM
New Pligger
 
Join Date: Jul 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
hi cent... can you help me change the link of the thumbnail from what it is now to the story link ? ...

I meen if someone clicks the thumbnail now it will take him to the picture in full size, i want to change this and when someone clicks the thumbnail to take him to the story page or to the site were the story is...

Thanks
Floryn
Reply With Quote
  #23 (permalink)  
Old 07-06-2007, 07:25 AM
Constant Pligger
 
Join Date: Oct 2006
Posts: 227
Thanks: 56
Thanked 22 Times in 18 Posts
The image upload module has a setting -- module_imageupload_usesmarty -- that outputs smarty variables instead of displaying the image so that you can have complete freedom of how you want to display your images in link_summary.tpl.

In image_upload_settings.php set module_imageupload_usesmarty to true. This will then create 3 variables: module_imageupload_thumbnail_src, module_imageupload_image_filename, and module_imageupload_image_caption.

In link_summary.tpl after the image upload preview code insert:

Code:
<a href="{$story_url}"><img src="{$module_imageupload_thumbnail_src }/{$module_imageupload_image_filename}" /></a>
This will create a thumbnail image that links to your story page instead of displaying the full size image.

If you want the full size image to still be displayed on the story page you could probably use this:

Code:
<a href="{$story_url}"><img src="{if $pagename neq "story"}{$module_imageupload_thumbnail_src }/{/if}{$module_imageupload_image_filename}" /></a>
Reply With Quote
  #24 (permalink)  
Old 07-06-2007, 11:26 AM
Constant Pligger
 
Join Date: Feb 2007
Posts: 236
Thanks: 20
Thanked 29 Times in 15 Posts
Quote:
Originally Posted by revolver View Post
The image upload module has a setting -- module_imageupload_usesmarty -- that outputs smarty variables instead of displaying the image so that you can have complete freedom of how you want to display your images in link_summary.tpl.

In image_upload_settings.php set module_imageupload_usesmarty to true. This will then create 3 variables: module_imageupload_thumbnail_src, module_imageupload_image_filename, and module_imageupload_image_caption.

In link_summary.tpl after the image upload preview code insert:

Code:
<a href="{$story_url}"><img src="{$module_imageupload_thumbnail_src }/{$module_imageupload_image_filename}" /></a>
This will create a thumbnail image that links to your story page instead of displaying the full size image.

If you want the full size image to still be displayed on the story page you could probably use this:

Code:
<a href="{$story_url}"><img src="{if $pagename neq "story"}{$module_imageupload_thumbnail_src }/{/if}{$module_imageupload_image_filename}" /></a>
did these smarty variables work for you? because they didn't for me. and yes, I set module_imageupload_usesmarty to true.
Reply With Quote
  #25 (permalink)  
Old 07-06-2007, 12:15 PM
Constant Pligger
 
Join Date: Oct 2006
Posts: 227
Thanks: 56
Thanked 22 Times in 18 Posts
Yeah that code works ...

A couple of things you can try ...
1 - in the code i posted there is an extra space at the end of {$module_imageupload_thumbnail_src } ... it should be {$module_imageupload_thumbnail_src}

2 - make sure you are still including the image upload module action in link_summary.tpl before you use the smarty variables.

{php}
// START: Image Upload Module
check_actions('image_upload_preview');
// END: Image Upload Module
{/php}


If this doesn't work, post a link to your site so we can see what's going on.
Reply With Quote
  #26 (permalink)  
Old 07-06-2007, 01:01 PM
Constant Pligger
 
Join Date: Feb 2007
Posts: 236
Thanks: 20
Thanked 29 Times in 15 Posts
are you using the variables on your own site? because I've tried everything, and it ain't workin'.

so I just stuck with using a static URL added by img_{$link_id}.jpg
Reply With Quote
  #27 (permalink)  
Old 07-06-2007, 01:23 PM
Constant Pligger
 
Join Date: Oct 2006
Posts: 227
Thanks: 56
Thanked 22 Times in 18 Posts
Is this just a problem with the smarty variables? Is the image upload module working properly when you turn off smarty variables?

Do you have a link to your site?
Reply With Quote
  #28 (permalink)  
Old 07-13-2007, 12:36 PM
Constant Pligger
 
Join Date: Oct 2006
Posts: 125
Thanks: 3
Thanked 1 Time in 1 Post
Hi, I installed it and everything its ok, the only thing is that thickbox its not working, when clicking an image it takes you to a blank page with the image.

Any idea what can I have wrong ?

Is there a way to implement a URL image below the choose file, so users can send directly or just paste the URL ?

I'm using Pligg 9.7

Thanks.

Last edited by Peter; 07-13-2007 at 12:50 PM..
Reply With Quote
  #29 (permalink)  
Old 07-13-2007, 11:35 PM
not2serious's Avatar
Pligg Donor
Pligg Version: v0.96 w/modifications
Pligg Template: Yget w/modifications
 
Join Date: Apr 2007
Location: East Coast, USA
Posts: 226
Thanks: 16
Thanked 16 Times in 15 Posts
Peter,

I had the same problem. I made the modification indicated in Cent's notes on v9.6in the Mod, and it fixed the problem.

Check this link out: http://forums.pligg.com/downloads.php?do=file&id=34
__________________
My Pligg Site: Critique My Art
My Arts Directory: Links 2 Arts
Reply With Quote
  #30 (permalink)  
Old 07-14-2007, 01:02 PM
Constant Pligger
 
Join Date: Oct 2006
Posts: 125
Thanks: 3
Thanked 1 Time in 1 Post
Quote:
Originally Posted by not2serious View Post
Peter,

I had the same problem. I made the modification indicated in Cent's notes on v9.6in the Mod, and it fixed the problem.

Check this link out: http://forums.pligg.com/downloads.php?do=file&id=34
Thanks, but I tried that also, changing "tpl_pligg_pre_title" to "tpl_pligg_pre_title_thickbox" in thickbox_init.php but its not working.

Any other idea what can be wrong ?

Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Upload Module -- Call for feature requests cent Modification Tutorials 12 11-15-2008 12:13 PM
About the image upload module rockxie Module Support 3 08-05-2008 05:41 PM
Image Upload 0.4 Module ziadchatila Module Support 3 08-05-2008 04:40 PM
[MOD] Image Upload Module (v0.93) -- Please test cent Modification Tutorials 48 05-16-2008 08:08 PM
[MOD] File Upload Module -- seeking requests for features cent Modification Tutorials 3 08-11-2007 04:39 AM


Search Engine Friendly URLs by vBSEO 3.2.0