Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 2nd, 2003, 02:37 PM
cscartman cscartman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 307 cscartman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
useing javascript to pharse text?

instead of useing php i want to use a javasctipt to take text thats in a mysql database thats called with php but the javascript will take and make it a image so it doesnt store any img tags but im not all that great at php so does anyone know were i can get something like this?

Reply With Quote
  #2  
Old June 2nd, 2003, 02:41 PM
cscartman cscartman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 307 cscartman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: useing javascript to pharse text?

= : ) without a space

Reply With Quote
  #3  
Old June 2nd, 2003, 02:59 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: useing javascript to pharse text?

I'm not sure I understand.
You can use PHP to create javascript, than you can create HTML with that javascript (for instance using the document.write() method).
But why not just use PHP to create the HTML?
Javascript cannot communicate with a database since it's clientside.

Reply With Quote
  #4  
Old June 2nd, 2003, 03:03 PM
cscartman cscartman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 307 cscartman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: useing javascript to pharse text?

what i mean is say i have :d in a database i select it with php/mysql but then when i print the data it takes :d and returns a image so i dont have to store img tags in a database..

Reply With Quote
  #5  
Old June 2nd, 2003, 03:55 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: RE: useing javascript to pharse text?

Quote:
what i mean is say i have :d in a database i select it with php/mysql but then when i print the data it takes :d and returns a image so i dont have to store img tags in a database..

like a smiley-code parser?

you can do that in PHP:

$text = str_replace(':d', '<img src="smiley.gif" alt="" />', $text);


Reply With Quote
  #6  
Old June 2nd, 2003, 04:04 PM
cscartman cscartman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 307 cscartman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: useing javascript to pharse text?

i have this code but on insert it fails and i include it on the veiw it still doesnt work...

ive been trying with this code for about 2 weeks now...

http://powerclan.net/azura/apforums/bbcodes.phps

Reply With Quote
  #7  
Old June 2nd, 2003, 08:43 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: useing javascript to pharse text?

You don't want to include this code before your insert, because you will never be able to parse it back to the original UBB codes when you want to edit a message.
You need to insert this before you echo the message to your HTML. This code is assuming your databasefield is called 'msg' and that you do a $list = mysql_fetch_object to get the message contents from your database.

To be quite honest, this isn't the best UBB code parser I have seen sofar, there are better ones out there, and even I have written some better expressions to handle certain tags.

You may want to built it up step by step, starting with one UBB code and trying if it works before you insert the whole bunch.
Put your error_level to E_ALL to trap any possible errors.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > useing javascript to pharse text?


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 4 hosted by Hostway