Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 10-12-2002, 02:17 PM imitating vB code
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Trades: 0
Does anyone have an example of the kind of thing that vb code does in forums like this. ie. Changes all instances of [ url=http://mypage.com] into < a href="http://mypage.com" >
I know it uses regular expressions and have done it in ASP using StrReplace but don't want to code it all in php if someone already has it. Thanks,
-dk
__________________
Did I help you? If so, be nice and throw me some
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
dk01 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-12-2002, 03:03 PM
ghettocars's Avatar
Defies a Status

Posts: 1,738
Name: Josh
Location: Miami, FL
Trades: 0
hmm that would be great to know, anyone knows how?
__________________

Please login or register to view this content. Registration is FREE
ghettocars is offline
Reply With Quote
View Public Profile
 
Old 10-12-2002, 04:24 PM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
Hmm.... probably not how its done by VB but you could do something like this with str_replace.

For example, on my CMS I enclose titles in [title][/title]. Then have code to change it to HTML, for example:
PHP Code:
$content=str_replace('[title]','<font face="Arial" color="#000099"><big><b>',$content); 
So to do something like the VB code, you could have:
PHP Code:
$stringname=str_replace('[ url=','<a href="',$stringname);
$stringname=str_replace(']','">',$stringname); 
There's probably a better way, though
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile
 
Old 10-12-2002, 07:48 PM
AhmedF's Avatar
Left for Better Places

Posts: 258
Trades: 0
I suggest you look up and learn how to do 'regex' [regular expressions]
AhmedF is offline
Reply With Quote
View Public Profile
 
Old 10-13-2002, 04:07 AM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Trades: 0
Alright thanks everyone. I know it has to be done with regex. Just figured I'd look and see if someone already had some code for it. Thanks anyways.
-dk
__________________
Did I help you? If so, be nice and throw me some
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
dk01 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to imitating vB code
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54397 seconds with 12 queries