General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 18th, 2003, 10:42 AM
assemblage assemblage is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: North Augusta, SC
Posts: 13 assemblage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Inserting images in stories??

I wrote a PHP script that allows me to write multipage articles and store them in a mySQL db.

I wrote a PHP script that allows me to upload images, resize them, rename them, thumbnail them and store the name and location info in a mySQL db.

I would like to bring these two together.
  1. I want to type my story in a form and when
  2. I want to add an image at that point in the story
  3. I'll go over to the side of the page and pick the image
    by clicking on a button that pops up a directory
  4. When I've finished picking, I click upload
  5. The picture is uploaded, renamed, thumbnailed and it's location and story reference is stored in the db
  6. The proper image html tag will be inserted in the text box where the story is being typed

The last part I can't figure out. How would I do that? Is that a Javascript type of thing?

Also, I have no idea how to edit something like that. Which makes me think, is this a poor way to do this? Is PHP a poor language to do something like this? How do sites like this or xbitlabs.com imbed their pictures in their articles?

Thanks

Reply With Quote
  #2  
Old December 18th, 2003, 12:56 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Have you considered using one of the WYSIWYG HTML editors? You could accomplish what you're wanting to do by using javascript to add the tag at the end of the contents of the textarea, but if the user screws it up somehow, the page is screwed. It's often harder to screw up such things in a WYSIWYG editor.

Reply With Quote
  #3  
Old December 18th, 2003, 01:57 PM
assemblage assemblage is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: North Augusta, SC
Posts: 13 assemblage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I use HTML-kit. I'm comfortable and would rather use the text based editor when I write/code pages.

I am game to trying new things though. Do you have an editor you would recommend?

A script from somewhere like hotscripts or freshmeat that does this would be helpful as well.

Thanks

Reply With Quote
  #4  
Old December 18th, 2003, 02:15 PM
assemblage assemblage is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: North Augusta, SC
Posts: 13 assemblage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was thinking that maybe you were talking about a CMS. I started with PostNuke and then tried out Envolution about a year and a half ago. I needed to modify them some, but found my PHP knowledge was to small. I didn't know enough to pick them apart to see how they functioned so I could make the modifications I needed. So I started learning. This site, Devshed, Sitepoint and Melonfire were very helpful. With some effort I may be able to pick apart much of the open source PHP scripts out there.

I notice DevArticles uses Mambo Open Source. According to the Mambo site,
Quote:
Inline WYSIWYG content editors. Mambo Open Source uses HTMLArea. There is now support for the latest BETA of HTMLArea3.


When you say WYSIWYG editor, I think Frontpage, or that awful NetObjects Fusion. I guess that you are talking about these kind of editors?

Reply With Quote
  #5  
Old December 18th, 2003, 02:46 PM
assemblage assemblage is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: North Augusta, SC
Posts: 13 assemblage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hmmm, I remember coming across an article and I thought, why would anyone want to build a WYSIWYG editor. Now I know. Mitchell Harper's Building a WYSIWYG HTML Editor might teach me what I need to know.

I'm still interested in recommendations on these type editors or a way to do this that isn't browser dependent.

Thanks

Reply With Quote
  #6  
Old December 18th, 2003, 02:48 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Right, I actually meant something like HTMLArea that you could use in place of a plain textarea in your site itself. It may not be the best solution for you, especially as the best of these things aren't cross-platform, but you might consider one of these as a way of allowing your users to insert pictures and screw with the content of their articles. Otherwise, the solution you proposed seems ok, if not ideal.

Reply With Quote
  #7  
Old December 18th, 2003, 03:23 PM
assemblage assemblage is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: North Augusta, SC
Posts: 13 assemblage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm looking at HTML Area. It could be helpful. It'll definately give me something to tinker around with for a while. I'll have to test out Mambo Open Source and see how they use HTML Area. I might be able to learn something from Mambo's script.... if I've learned enough to actually follow it.

I think this probably the route I want to take.

Thanks

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Inserting images in stories??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT