https://www.icyphoenix.com/viewtopic.php?f=26&t=1034 ----------------------------------- krisbfunk Sun 28 Jan, 2007 20:47 FAP CUSTOMIZATION - Image Upload While Posting ----------------------------------- Didn't want to lose track of this, I find it a pretty useful mod for linking new photos in a discussion without having to go to the album to upload first. Perhaps someone could pull it all over from both sites? It adds an 'upload pic' link to posting_body.tpl, when clicked it opens an album upload form allowing you to upload to permissable album categories. Once uploaded 'albumimg' tags are auto inserted into the post. Original Posting of Mod: http://www.mightygorgon.com/viewtopic.php?t=3180&highlight=upload+while+posting Author updates to Mod: http://www.welsolutions.com/viewtopic.php?t=10 ----------------------------------- lefty74 Sun 28 Jan, 2007 21:35 Re: Image Upload While Posting ----------------------------------- very nice, I had something similar that came already 'preinstalled' with my template FIBlack, however, not linked to FAP. ----------------------------------- Artie Mon 29 Jan, 2007 20:41 Re: Image Upload While Posting ----------------------------------- [quote user="krisbfunk" post="8168"]Perhaps someone could pull it all over from both sites? [/quote] Be my guest. :wink: ----------------------------------- Dogs and things Sun 18 Mar, 2007 13:38 Re: Image Upload While Posting ----------------------------------- Brillant Addon, it works perfectly, This thing makes it so easy to post an image. :P I had to adjust the script just a little, making these changes: [code linenumbers=false]#-----[ OPEN ]------------------------------------------ # posting_upload_mod_001.txt # #-----[ FIND ]------------------------------------------ # if( isset($HTTP_POST_VARS['user_id']) ) # #-----[ REPLACE WITH ]------------------------------------------ # if( isset($_POST['user_id']) ) # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # [/code] To get the MOD to work in private messages I added: [code linenumbers=false]# #-----[ OPEN ]------------------------------------------ # privmsg.php # #-----[ FIND ]------------------------------------------ # 'L_OPTIONS' => $lang['Options'], # #-----[ AFTER, ADD ]------------------------------------------ # // Start ewelin Posting Upload Mod 'L_POSTING_UPLOAD' => append_sid("album_upload.$phpEx?user_id=" . $userdata['user_id'] ."&mode=forum_upload"), // End ewelin Posting Upload Mod[/code] To see the full image in the post instead of thumbnails I changed: [code linenumbers=false]#-----[ OPEN ]------------------------------------------ # posting_upload_mod_001.txt # #-----[ FIND ]------------------------------------------ # ($mode == 'forum_upload') ? $bbcode_output .= "n[albumimg]" . $new_pic_id['pic_id'] . "[/albumimg]" : ''; # #-----[ REPLACE WITH ]------------------------------------------ # ($mode == 'forum_upload') ? $bbcode_output .= "n[fullalbumimg]" . $new_pic_id['pic_id'] . "[/fullalbumimg]" : ''; # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # [/code] The first change is necessary and the other two are optional. Thanks a lot to Ewelin for writing this MOD. :thanks: ----------------------------------- felix968 Tue 20 Mar, 2007 09:47 Re: Image Upload While Posting ----------------------------------- In this MOD ewlin says: #-----[ FIND ]------------------------------------------ # if( isset($HTTP_POST_VARS['user_id']) ) # #-----[ BEFORE, ADD ]------------------------------------------ # I checked album_upload.php and there is indeed no instance of a HTTP_POST_VARS, only HTTP_POST_FILES. My FAP version is 1.4.1 ----------------------------------- Dogs and things Thu 22 Mar, 2007 19:10 Re: Image Upload While Posting ----------------------------------- [quote user="felix968" post="10389"]In this MOD ewlin says: #-----[ FIND ]------------------------------------------ # if( isset($HTTP_POST_VARS['user_id']) ) # #-----[ BEFORE, ADD ]------------------------------------------ # I checked album_upload.php and there is indeed no instance of a HTTP_POST_VARS, only HTTP_POST_FILES. My FAP version is 1.4.1[/quote] That´s why ewelin recommended to make this change in his install.txt, [code linenumbers=false]#-----[ OPEN ]------------------------------------------ # posting_upload_mod_001.txt # #-----[ FIND ]------------------------------------------ # if( isset($HTTP_POST_VARS['user_id']) ) # #-----[ REPLACE WITH ]------------------------------------------ # if( isset($_POST['user_id']) ) # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ #[/code] ----------------------------------- HammerBe Mon 16 Apr, 2007 22:41 Re: Image Upload While Posting ----------------------------------- I have not find this [code linenumbers=false]# #-----[ OPEN ]------------------------------------------ # album_upload.php # #-----[ FIND ]------------------------------------------ # if( isset($HTTP_POST_VARS['user_id']) ) # #-----[ BEFORE, ADD ]------------------------------------------ # // Start ewelin Posting Upload Mod if( isset($HTTP_POST_VARS['mode']) ) { $mode = intval($HTTP_POST_VARS['mode']); } elseif( isset($HTTP_GET_VARS['mode']) ) { $mode = intval($HTTP_GET_VARS['mode']); } // End ewelin Posting Upload Mod # #-----[ FIND ]------------------------------------------ [/code] ----------------------------------- Dogs and things Tue 17 Apr, 2007 02:29 Re: Image Upload While Posting ----------------------------------- Read my last post before yours, You´re asking the same question felix968 asked and I´ve explained this point twice allready, in this six-post topic. :bb_attention: It says, Don´t look for [code linenumbers=false]if( isset($HTTP_POST_VARS['user_id']) )[/code]look for[code linenumbers=false]if( isset($_POST['user_id']) )[/code]instead. ----------------------------------- HammerBe Tue 17 Apr, 2007 16:04 Re: Image Upload While Posting ----------------------------------- Thanks I have problem, if I look for according to if if ($album_config['switch_nuffload'] == 1) have I with me 6 piece-take I first get I error message. Parse error: parse error, unexpected '}' in /srv/www/vhosts/myhome/httpdocs/album_upload.php on line 39 Line 39 is This } Thanks ----------------------------------- Dogs and things Tue 17 Apr, 2007 21:40 Re: Image Upload While Posting ----------------------------------- You must edit the last instance of that piece of code, on or near line 1440. :wink: Where you went wrong is that you started to look from the beginning but you should start looking from the place where you were in the album_upload.php after ahving made the last edit before this one that is giving you trouble. You understand what I try to explain? ----------------------------------- felix968 Tue 17 Apr, 2007 23:46 Re: Image Upload While Posting ----------------------------------- [quote user="Dogs and things" post="12327"]Read my last post before yours, You´re asking the same question felix968 asked and I´ve explained this point twice allready, in this six-post topic. :bb_attention: It says, Don´t look for [code linenumbers=false]if( isset($HTTP_POST_VARS['user_id']) )[/code]look for[code linenumbers=false]if( isset($_POST['user_id']) )[/code]instead.[/quote] I've done all, but when i modify posting_body.tpl and i click on new topic, I've a page without topic ...only the page with menu link and other in board, but no new topic: does it work with phpbb 2.0.21 and fap 1.4.1? ----------------------------------- Dogs and things Wed 18 Apr, 2007 08:29 Re: Image Upload While Posting ----------------------------------- [quote user="felix968" post="12383"]I've done all, but when i modify posting_body.tpl and i click on new topic, I've a page without topic ...only the page with menu link and other in board, but no new topic: does it work with phpbb 2.0.21 and fap 1.4.1?[/quote] Tell us exactly what [b]version of phpbb[/b] you are using, [b]what template[/b] and exactly [b]what edits you made to posting_body.tpl[/b]. Without this info nobody will be able to tell you anything, except for saying that you must have made a mistake somewhere and maybe even more then one. ----------------------------------- felix968 Wed 18 Apr, 2007 09:46 Re: Image Upload While Posting ----------------------------------- [quote user="Dogs and things" post="12398"][quote user="felix968" post="12383"]I've done all, but when i modify posting_body.tpl and i click on new topic, I've a page without topic ...only the page with menu link and other in board, but no new topic: does it work with phpbb 2.0.21 and fap 1.4.1?[/quote] Tell us exactly what [b]version of phpbb[/b] you are using, [b]what template[/b] and exactly [b]what edits you made to posting_body.tpl[/b]. Without this info nobody will be able to tell you anything, except for saying that you must have made a mistake somewhere and maybe even more then one.[/quote] Sorry, in my post before i've written I have phpbb 2.0.21 ad FAP 1.4.1 :roll: Anywhere, i use subsilver template and here is my posting_body.tpl: [codeblock]
{INBOX_IMG} {INBOX_LINK}   {SENTBOX_IMG} {SENTBOX_LINK}   {OUTBOX_IMG} {OUTBOX_LINK}   {SAVEBOX_IMG} {SAVEBOX_LINK}  

{POST_PREVIEW_BOX} {ERROR_BOX}
{L_INDEX} -> {FORUM_NAME}
{ATTACHBOX} {POLLBOX}
{L_POST_A}
{L_USERNAME}
{L_USERNAME}  
{L_SUBJECT}
{L_ICON_TITLE}
 {switch_icon_checkbox.row.cell.ICON_IMG}  
{L_MESSAGE_BODY}

{L_EMOTICONS}
{smilies_row.smilies_col.SMILEY_DESC}
{L_MORE_SMILIES}
Advanced BBCode Box v5.1.0
justifyrightcenterleftbolditalicunder linefadegradientRight to LeftLeft to RightMarque to downMarque to upMarque to leftMarque to right
CodeQuoteURLEmailWeb PageImageFlashVideoStreamReal MediaGoogleVidYoutubeListH-LineRemove BBcode
{L_OPTIONS}
{HTML_STATUS}
{BBCODE_STATUS}
{SMILIES_STATUS}		 Upload to our Photo Album
{L_DISABLE_HTML}
{L_DISABLE_BBCODE}
{L_DISABLE_SMILIES}
{L_ATTACH_SIGNATURE}
{L_NOTIFY_ON_REPLY}
{L_DELETE_POST}
{S_TYPE_TOGGLE}
{S_HIDDEN_FORM_FIELDS} 
{S_TIMEZONE}
{JUMPBOX}
{TOPIC_REVIEW_BOX}OPEN [b][/b] FIND [codeblock][/codeblock] REPLACE WITH [/codeblock] I attach here the others modified files (album_upload.php, posting.php, templates/subSilver/album_upload_body.tpl), to hpe... ----------------------------------- Dogs and things Wed 18 Apr, 2007 12:31 Re: Image Upload While Posting ----------------------------------- I don´t think the problem is in posting_body.tpl because the edit you made there seems to be correct. I put that file in a vanilla testboard I have and had a look, I get the posting page, with some errors because you have other MODs installed too, but I have been able to post a topic with your .tpl I could see there´s a few mistakes you made in other edits, like this at the end of the file: [code linenumbers=false]OPEN [b][/b] FIND [codeblock][/codeblock] REPLACE WITH[/code] Seeing how bad your editing is I guess it´s quite likely you made mistakes in other files you edited. Most likely it´s in posting.php, but I´m not going to check all your edits, check them yourselves. ----------------------------------- felix968 Wed 18 Apr, 2007 14:40 Re: Image Upload While Posting ----------------------------------- [quote user="Dogs and things" post="12403"]I don´t think the problem is in posting_body.tpl because the edit you made there seems to be correct. I put that file in a vanilla testboard I have and had a look, I get the posting page, with some errors because you have other MODs installed too, but I have been able to post a topic with your .tpl I could see there´s a few mistakes you made in other edits, like this at the end of the file: [code linenumbers=false]OPEN [b][/b] FIND [codeblock][/codeblock] REPLACE WITH[/code] Seeing how bad your editing is I guess it´s quite likely you made mistakes in other files you edited. Most likely it´s in posting.php, but I´m not going to check all your edits, check them yourselves.[/quote] Sure it's as you said (but the error before - [b][/b] FIND [codeblock][/codeblock] REPLACE WITH[/code] was attaching the file in this post), so I'm looking for mistakes, but I've another question about. I'm installed ip_20070405_101111_rc and I've modifies same files for ewelin mod (The only mod I have) Now I can see in posting.php ewelin link (upload to your album, see picture below): [img]http://www.oltrelafoto.com/icy_ewelin/icyewe1.gif[/img] and clicking on link open a new windows where setting attach file: [img]http://www.oltrelafoto.com/icy_ewelin/icyewe2.gif[/img] but, when I click on send, I've a blank page: below on the left of this windows there is "completed" [img]http://www.oltrelafoto.com/icy_ewelin/icyewe3.gif[/img] but i have no images in topic and album too! :x ----------------------------------- Dogs and things Wed 18 Apr, 2007 15:18 Re: Image Upload While Posting ----------------------------------- I have no idea, Hopefully someone who understands FAP better sees this and can help you out. ----------------------------------- felix968 Thu 19 Apr, 2007 00:02 Re: Image Upload While Posting ----------------------------------- Here I am again, I've re-edit all files for this mod (album_upload.php, posting.php, album_upload_body.tpl and posting_body.tpl, since my first phpbb 2.0.21 and fap 1.4.1 installation: a bad work, so I thing I have no mistakes in this files). Now, I can see link "upload to our photo album" in my new topic, but now when i click on link I've this error: "General error - no categories specified".... the mod maybe can't see fap categories...have you some suggest for me? I've another question: have I replace only "if( isset($HTTP_POST_VARS['user_id']) )" with "if( isset($_POST['user_id']) )", or any other instances of if $HTTP_POST_VARS replace it with $POST? Thanks again ----------------------------------- ewelin Fri 02 Nov, 2007 01:16 Re: Image Upload While Posting ----------------------------------- Hey guys, Thanks for keeping this alive. I must admit I haven't been keeping up with FAP as much as I had in the past. It's still running on one of my sites and unfortunately I have to admit its in need of upgrade. Hopefully I'll actually get around to it in the new few months. When do I upgrade it I'll take another look at my mod and see if there is anything that needs to be added. I noticed that it appears as though MG has gone to php5 syntax, but that's only a minor change in the install file. Glad to see it's still working though! BTW I'll now be watching this topic for replies, now that i know it exists. So I'll provide support here when I get the chance. ----------------------------------- Mighty Gorgon Mon 05 Nov, 2007 00:45 Re: Image Upload While Posting ----------------------------------- [quote user="ewelin" post="21024"]Hey guys, Thanks for keeping this alive. I must admit I haven't been keeping up with FAP as much as I had in the past. It's still running on one of my sites and unfortunately I have to admit its in need of upgrade. Hopefully I'll actually get around to it in the new few months. When do I upgrade it I'll take another look at my mod and see if there is anything that needs to be added. I noticed that it appears as though MG has gone to php5 syntax, but that's only a minor change in the install file. Glad to see it's still working though! BTW I'll now be watching this topic for replies, now that i know it exists. So I'll provide support here when I get the chance.[/quote] Thanks Eric. I've changed something in FAP with latest release... but now I'm waiting for phpBB 3 to be released before going on in developing FAP for phpBB 3. I've already developed a simple gallery system for phpBB 3, which has a simple upload feature while posting... but the whole system isn't based on the DB, so it is meant only for simple and small gallery. Anyway, when I will start again working on FAP for phpBB 3, I'll let you know if you wish. Thanks. ----------------------------------- HammerBe Mon 19 Nov, 2007 11:24 Re: Image Upload While Posting ----------------------------------- I took the finished file of @felix968, whom I would like to high-load picture get this warning. NO of categories specified ich habe die fertigen datei von @felix968 genommen, wen ich eine bild hochladen möchte bekomme dieser warnung. No categories specified ----------------------------------- sympatico Tue 12 Feb, 2008 21:43 Re: Image Upload While Posting ----------------------------------- hello! i would like to know if a solution has been found to upload multiple images while posting? the way it is now, is that only the first image is being uploaded while posting... thank you ----------------------------------- Dogs and things Wed 13 Feb, 2008 23:11 Re: Image Upload While Posting ----------------------------------- Just upload the pics one by one, doesn´t seem like a big problem to me, unless you want to post a big number of pics in the same topic. ----------------------------------- ninicoco Fri 29 Aug, 2008 07:37 Re: Image Upload While Posting ----------------------------------- I install this mod and i have a problem. When i upload a picture the window popup i choose the picture and when i send it he give me the link in the post but no picture as been uploaded. I have phpbb 2.022 with FAP 1.4.1 installed. I can't find the problem. Anyone please help. ----------------------------------- novice programmer Fri 29 Aug, 2008 16:40 Re: Image Upload While Posting ----------------------------------- This topic is too old. If you have a recent issue, open a new topic, but DO NOT bump older topics. Locking... PS: You got a warn because of this. ----------------------------------- Mighty Gorgon Fri 29 Aug, 2008 20:59 Re: Image Upload While Posting ----------------------------------- Please keep this topic open. Warn removed. ----------------------------------- xmenfile Sun 23 Nov, 2008 17:47 Re: Image Upload While Posting ----------------------------------- Hi all, I managed to install it work on latest IP 1.2.0.27C, but I can't figure out how to add a stroll bar on the pop up window or automatic open maximize window, because it missing couple lines and submit button. [img]http://www.icyphoenix.com/files/images/2591/uploadpic1.jpg[/img] Also, how can i make a button just like "Upload Image" button? [img]http://www.icyphoenix.com/files/images/2591/uploadpic.jpg[/img] Thank you so much for all your helps, xmenfile ----------------------------------- bloke Mon 24 Nov, 2008 09:26 Re: Image Upload While Posting ----------------------------------- [quote user="xmenfile" post="33978"]Hi all, I managed to install it work on latest IP 1.2.0.27C, but I can't figure out how to add a stroll bar on the pop up window or automatic open maximize window, because it missing couple lines and submit button. [img]http://www.icyphoenix.com/files/images/2591/uploadpic1.jpg[/img] Also, how can i make a button just like "Upload Image" button? [img]http://www.icyphoenix.com/files/images/2591/uploadpic.jpg[/img] Thank you so much for all your helps, xmenfile[/quote] i think it already comes out standard with 1.2.0.27C but has a submit button under where your page on you pic stops ----------------------------------- Mighty Gorgon Mon 01 Dec, 2008 18:29 Re: Image Upload While Posting ----------------------------------- I didn't look at the script... but I guess the new window is opened via JavaScript... so you need to add the [b]scrollbar=yes[/b] property. Example: [codeblock] smiles = window.open('{U_MORE_SMILIES}','_phpbbsmilies','height=' + height + ',width=' + width + ',resizable=yes,scrollbars=yes');[/codeblock] ----------------------------------- xmenfile Wed 03 Dec, 2008 02:01 Re: Image Upload While Posting ----------------------------------- That fixes it, works like a charm. Thank you Mr. MG :) ----------------------------------- Mighty Gorgon Wed 03 Dec, 2008 12:38 Re: Image Upload While Posting ----------------------------------- You are welcome.