|
All times are UTC |
|
|
Page 1 of 3 |
[ 30 posts ] | Go to page 1, 2, 3 Next |
| Print view | Previous topic | Next topic |
| Author | Message |
|---|---|
|
Site Admin Joined: Wed Dec 12, 2007 9:34 pm Posts: 263 |
For the past few weeks i have been following a thread over at the pligg forums for the image upload module http://forums.pligg.com/pligg-mods/7114 ... lable.html. This is a module i really wanted to use on a new project but unfortunately it was broken with v9.9.0 of pligg, support was first requested on the 8th January for a fix that never appeared. I decided to take a look at the code and see what i could do to get this great module working on v9.9.0.
So after nearly a month of no replies or a fix i present Image Upload Module v1.02 for v9.9.0 of pligg. Some of the errors were caused within the image_upload_main.php, mostly $smarty that should have been $main_smarty within the preview function. New Version 1.03 released below http://socialcmsbuzz.com/community/image-upload-pligg-module-t56.html One edit you will have to make to get this module working with v9.9.0 of pligg is in your /modules/modules_libs.php this is more of a hack until a better solution appears. OPEN /modules/modules_libs.php FIND at line 87 Code: function check_actions($location, &$vars) { global $module_actions; $vars['location'] = $location; if($module_actions){ foreach ( $module_actions as $k => $v ) { if($k == $location){ foreach ( $v as $kk => $vv ) { call_user_func_array($kk, array(&$vars)); } } } } } REPLACE WITH Code: function check_actions($location, $vars="") { global $module_actions; $vars['location'] = $location; if($module_actions){ foreach ( $module_actions as $k => $v ) { if($k == $location){ foreach ( $v as $kk => $vv ) { call_user_func($kk, $vars); } } } } } All other edits are included in the modules readme.html file. Enjoy You do not have the required permissions to view the files attached to this post. |
| Fri Jan 25, 2008 2:10 pm |
|
|
Joined: Fri Jan 25, 2008 4:53 pm Posts: 13 |
Hi,
the mod work well so far, but the Image won't show up in step 3 of "Submit a new story" and in the "Link Summery" on the frontpage etc. only when I link on "read more" I can see the image. I would be great if you can tell me, how to optimize iz... Greets Olli |
| Mon Jan 28, 2008 9:16 am |
|
|
Site Admin Joined: Wed Dec 12, 2007 9:34 pm Posts: 263 |
mog wrote: Hi, the mod work well so far, but the Image won't show up in step 3 of "Submit a new story" and in the "Link Summery" on the frontpage etc. only when I link on "read more" I can see the image. I would be great if you can tell me, how to optimize iz... Greets Olli Hi Olli, I will have a look at this for you when i get a moment hopefully tomorrow |
| Tue Jan 29, 2008 4:06 pm |
|
|
Joined: Tue Jan 29, 2008 4:20 pm Posts: 2 |
great mod!
it would be better if pix showed in summary |
| Tue Jan 29, 2008 4:24 pm |
|
|
Joined: Fri Jan 25, 2008 4:53 pm Posts: 13 |
Thanks LincolnHawks!
It would be great if you can help. I'm planning to launch my project soon.. |
| Wed Jan 30, 2008 11:20 am |
|
|
Joined: Tue Feb 05, 2008 6:24 pm Posts: 5 |
I'm running v. 9.9 of Pligg and installed your module. Thanks a lot for taking the time to make it available, by the way. I added the modified code in /modules/modules_libs.php and followed the instructions for the rest of the file modifications.
I was able to upload and display an image successfully, then I moved the location of the: Code: {php} // START: Image Upload Module check_actions('image_upload_preview'); // END: Image Upload Module {/php} in link_summary.tpl to change the position of the displayed image. Since then, no image will display. When I set debug to true, I find the source of the problem is that none of the variables are making it through to the image_upload_preview_handler function so the code doesn't know the story ID to work with: Quote: START: image_upload_preview_handler Story ID = Image Path = /home/mydomain/public_html/images/image_upload/img_.jpg Possible Image File = img_.jpg Image Caption = No image found to display. END: image_upload_preview_handler I see that it works correctly; i.e., retrieves the variables on the stories page, but not on the summary page. So my problem is getting the correct variables for the summary page. TIA |
| Thu Feb 07, 2008 7:48 pm |
|
|
Site Admin Joined: Wed Dec 12, 2007 9:34 pm Posts: 263 |
hi Linux,
hmmm okies m8 i will take a look ASAP, added it to my todo list |
| Thu Feb 07, 2008 8:00 pm |
|
|
Joined: Tue Feb 05, 2008 6:24 pm Posts: 5 |
I found a way to get the story ID on both the summary and stories pages.
Just comment out this line (130 in image_upload_main.php): Code: $storyID = htmlentities($main_smarty->get_template_vars(link_id)); and instead use this: Code: $storyID = $link->id; You already have $link set as global. With that mod, you can display the image on both the summary page and the stories page. |
| Thu Feb 07, 2008 8:58 pm |
|
|
Site Admin Joined: Wed Dec 12, 2007 9:34 pm Posts: 263 |
Awesome Linux
|
| Thu Feb 07, 2008 9:08 pm |
|
|
Joined: Tue Feb 05, 2008 6:24 pm Posts: 5 |
You bet! Thanks for doing the hard part; making Image Upload work with 9.9.
|
| Thu Feb 07, 2008 9:19 pm |
|
|
|
Page 1 of 3 |
[ 30 posts ] | Go to page 1, 2, 3 Next |
|
All times are UTC |
Who is online |
Users browsing this forum: No registered users and 0 guests |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum |

