WordPress.org

Ready to get started?Download WordPress

Forums

uploading pictures/photos with the P2 theme? (22 posts)

  1. Rodney
    Member
    Posted 4 years ago #

    The P2 theme is great!

    For a team that is working on a more image focused project, is there an easy to way upload photos from the front page posting interface?

  2. noel
    Member
    Posted 4 years ago #

    Not yet. But we're hoping to integrate this feature soon.

  3. dlopeman
    Member
    Posted 4 years ago #

    Please hurry!! LOL

    I've been doing my best to hack apart the QuickPress... learned a little about the TinyMCE that WordPress uses... And now my brain hurts. Been working on this for about a week.

    I hope you have made some progress.

    And, noel - THANKS DUDE! You ROCK.

  4. dlopeman
    Member
    Posted 4 years ago #

    Guess what?? I got "something" like this working!!! Woooo hoooo. After a long time of playing and learning... and yet so much more to learn!!!!

    It's a bit of a hack and I haven't released it into my production site yet. Want to clean it up a bit. I'll post back here when I'm ready to show it off!!! LOL... and will probably have to anwer a LOT of questions for you guys!

    The jist of it: I found a php upload/resize script (actually about 20 of them and played with each and took the best parts of them). I found a Javascript onclick and rewrote to update the TEXTAREA with the <img src....> once a picture is chosen. After you choose a picture (providing the right extension (jpeg,gif, png,etc) it automatically uploads it and renames it to a random name, to the designated folder (whose link is what gets put in the TEXTAREA)... that was tricky, passing variables between PHP JS and PHP again.... pretty cool, though. Oh, and it resizes it, too, maintaining aspect ratio... it's all code I found all over the place, but I modified it a TON... but I will try to keep all their names on it...

    So - now that I got a "working" thing.... I would like to present some better ideas about it... or upgrades to it already... Yeah - I'm already upgrading it!

    * Choose a file, but if you decide to choose a different picture after seeing your litte thumbnail preview (oh yeah, i have that working, too!) it needs to delete the file that got uploaded (automatically) or you could potentially fill up space if ppl choose the wrong pictures a lot... I have someone's code that already do this, but need to adapt it to mine.

    * So, I don't like how the PICTURE is added... i don't like the <img src...blah blah> added in the TEXTAREA. The TEXTAREA should be where you might have a description of the picture or something... I don't ppl to see HTML code!!! YUK --- How about a new field? I mentioned this in a previous posting somewhere. TITLE, PICTURE, TEXTAREA, TAGS, CATAGORY, etc. (and let them have a CHOICE as to what fields they want! I just want PICTURE and TEXTAREA.. and maybe TITLE)

    * Also, I can't allow for ppl to start typing in the TEXTAREA before they add the picture, or the JS onclick won't update it! Sux. Of course, if the previous idea is implemented, this problem goes away. Right now, i get around it by not DISPLAYing the TEXTAREA DIV. So all you can do is add a picture, with no description/text. I cannot expect "normal" ppl to understand the <img src....> piece and they could mess it up...

    * put the resized picture in the DB? Maybe... There's some ppl that have already written that code, too. I just need to learn more about MYSQL... and then adapt the DB for WordPress, and figure out the previous items, and drink a lot of beer.......

  5. ToreGu
    Member
    Posted 4 years ago #

    Sounds amazing!

  6. ToreGu
    Member
    Posted 4 years ago #

    Some forums lets people add pictures and files and these gets added at the very bottom of the post. Either just a thumbnail or a link to the file. You can't edit it that much and would fit with not showing the HTML side of it.

    The bad thing about it is that you can't have text picture text. You'll just have to accept that the file/picture goes to the bottom.

    I could live with that. :)

    Keep it up!

  7. dlopeman
    Member
    Posted 4 years ago #

    OK - DONE:
    http://www.womendrinkingbeer.com

    Create a user and give it a try.

    I'm going to look into "combining" textareas at submit... somehow...

    I would REALLY just like to have "image" as a separate field... and the textarea would be a description. Then I could format the description around the picture, below, above, or whatever... as a separate DIV.

  8. dlopeman
    Member
    Posted 4 years ago #

    Hmmm... seems to have an issue with IE6... will have to resolve later, or encourage users to upgrade to a modern browser made in this decade!!

  9. ToreGu
    Member
    Posted 4 years ago #

    Sorry to upload a non-drinking-woman-picture. :) Just had to try it out.

    It's very cool but perhaps not super-intuitive for non-techies. If you could have a regular P2-postbox and add a picture/file next to tags that would be fantastic. I'm not sure of the limitations to your model. But this seems to be very picture-posting-centric.

    Thanks for showing that it's possible!

    Tore

  10. dlopeman
    Member
    Posted 4 years ago #

    Tore - Takk for å prove!
    (ja - jeg prate litt Norsk! ... men vet jeg at du er Svensk...)

    SO, yes... there's a LOT of work left... I'm huge on making things intuitive and user friendly. That's mainly why I put BETA in the title...

    I actually don't like the way it works right now, but just wanted to throw it out there to spark some interest. It should be changing a lot in the next week or so.

  11. ToreGu
    Member
    Posted 4 years ago #

    Sounds fantastic!

    (Haha! Roligt! Är du från USA?)

  12. dlopeman
    Member
    Posted 4 years ago #

    Jeg er Amerikansk. Mor min er Norske. Jeg har snakket litt hele livet og har bodde in Norge mange ganger, og gikk på norske skole et året der... 20 år siden!! Så har jeg glemte masse!!!

  13. ToreGu
    Member
    Posted 4 years ago #

    (Ah! Då förstår jag. Vad kul att du bott i Norge. Ändå imponert att du behållit så mycket av ditt modersmål! Själv är jag nog ändå inte alls lika bra på att förstå norska som du. Det har sina likheter med svenskan men en hel del andra ord. Särskilt att läsa norska är svårt.

    :))

  14. dlopeman
    Member
    Posted 4 years ago #

    OK Everyone. I have a FULL working Prototype... with one caveat - it doesn't exactly work in Firefox!!! Yeah yeah, I know. That's a real problem!

    The caveat: well it DOES work in FF if you access the form itself directly. I have the link on my webpage, in the top.

    Oh - and it's BETA, so still needs to be pretty-fied!

    WomenDrinkingBeer.com

  15. Dwarshak
    Member
    Posted 4 years ago #

    dlopeman that's impressive. Now the question is how can I get this on my p2 themed blog?

  16. dlopeman
    Member
    Posted 4 years ago #

    Dwarshak - it looks like we have 2 threads of the same topic going on here... I'm trying to keep the other one on top!! But that's cool - here we are.

    Yes - Since my last post up above I have made quite a bit of progress. My effort has been going for a few months now. That FF issue above is resolved... in fact I pretty much have it all working in FF, IE6&8, Opera 10, Safari ?, and Google Chrome.

    Also, you should know, that Noel (theme author) has also been making progress and announced that he will be releasing this feature in the next version, with the WP 2.9 release. Just glancing at his code, I think he's going to use the backend media links/engine already in WP... which is smart. I tried that first, but had no luck. So I re-invented the wheel. It also gave me the freedom to modify how it acts. I eventually want to REMOVE the backend completely from public view.

    My work has really just been HEAVY modifications of the P2 theme and a culmination of several upload, resize, ajax-like scripts... and then hacking the crap out of them to make them as cross-browser as possible. I don't know what the GPL GNU or whatever licensing stuff is or what I have to do to make it "right." I think I left everone's names intact except for one guy who had funky characters in his name which I removed in case it was playing havoc with stuff I was doing. Purely a troubleshooting tactic on my part.

    I mentioned to Noel in another post that I could sent him my stuff. I could probably do the same for anyone.

  17. dlopeman
    Member
    Posted 4 years ago #

    OH - and I should mention that my modifications are currently ONLY for picture uploads. I have no need for other media, yet... unless, of course, maybe video clips of woman drinking beer!!

    Hmmmmmmmmm.... That's and IDEA! Doesn't someone have a YouTube plugin for WP somewhere? I think I saw that....... I could make it work with P2.......

    Another think I found is that other plugins have a tough time playing nice with P2. I modified the functions.php file to actually CALL the entry.php file, where Noel had basically writen all of it back in. I know why he did - for the styling fade in thing for a new post... I just took the top few lines out of entry.php and put them in the function before I called in entry.php. I also had to modify all the other files that called entry.php, too.

    I don't care who you are, now that's just another topic, right there!
    Git 'er done!!!

  18. lpdea86
    Member
    Posted 4 years ago #

    Hi dlopean,

    I would like to know if you could write what's in your file http://www.womendrinkingbeer.com/wp-content/themes/p2/uploadImage.php

    Thank man, amazing integration job you've done !

  19. Dwarshak
    Member
    Posted 4 years ago #

    Yea dlopeman its looking unreal. Where is the other thread? ...I would like to apply this concept to my blog, let me know if you can help me out.

  20. Dwarshak
    Member
    Posted 4 years ago #

    Ok ok after two full nights of no sleep, starting with ZERO knowledge of wordpress I have created the back end to my blog. Its a simple website searching for cool college pads around the world. No need to register or log in to post, what I call Collective Contribution Social Media or in other words hassle free blogging. The upload scheme right now is a little cumbersome, but I have a roommate who will help me with the design. Thanks to dlopeman for giving me hope. Come take a look...

  21. Dwarshak
    Member
    Posted 4 years ago #

  22. Nodnarboen
    Member
    Posted 4 years ago #

    Hey dlopeman,

    Great stuff! Which version of P2 did you edit from? Could you share with me your igenious work? Would love to implement it on my site too..

Topic Closed

This topic has been closed to new replies.

About this Topic