schme16 Posted October 2, 2006 Share Posted October 2, 2006 hi all, this is my first or second post here, and i was wondering if anyone out there in teh interwebs was willing to add to a peice of code for me, its a posting system for me to add new update posts to my hompage....but i want to be able to use bb code in it as well as html...no luck so far...heres the code...entirely except of bbcode implementation (thought it'd be easier for you guys to start fro scratch ^_^.[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title></title><link href="css/editpage.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--.style6 { font-size: 24px; font-weight: bold;}--></style></head><body><p> <?phpob_start();// allows you to use cookiesinclude("configs/config.php");include("time.php");$userlvl = $logged[userlevel];if (($userlvl)==(2)){//gets the config pageif ($_POST[post]) {// the above line checks to see if the html form has been submitted$username = $logged[username];$message = $_POST[message];$realname = $logged[realname];$email = $logged[email];//the above lines set variables with the user submitted informationif($message==NULL) {//checks to make sure no fields were left blankecho "Type a damned message ya idiot!.";}else{//Everything seems good, lets insert.$query = mysql_query("INSERT INTO posts (title, realname, username, message, email, date) VALUES('$title','$realname','$username','$message','$email','$date')");// inserts the information into the database.echo "You have successfully posted! Now redirecting you to you to view your post";echo ("<meta http-equiv=Refresh content=2;URL=\"posts.php\" />");}}else{ echo ("<form method=\"POST\"><br /><div align=center><span class=header>Hello $logged[realname]! </span><br /><br /> <span class=dingbat>Type the title of your post:</span> <input type=\"text\" size=60 name=\"title\" maxlength=\"45\" /><br /><br /> <span class=dingbat>Type the body of your post:</span><br /> <textarea name=\"message\" cols=\"80\" rows=\"15\" class=\"Viner-Pargraph\"></textarea><br /> *Note that Full Html may be used and is most casses encouraged until the BBCode system has been implemented! <br /><input name=\"post\" type=submit class=title value=\"post\"> </div><br /> </form>");}}else{echo'Sorry but you are not authorized to enter this area!';}?> </p></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/22741-can-anyone-add-bbcode-or-bbtag-whichever-you-prefer-to-call-it-to-this-code/ Share on other sites More sharing options...
wildteen88 Posted October 2, 2006 Share Posted October 2, 2006 Therre are plenty of posts about bbcode systems in the Regex board. Take a look at [url=http://www.phpfreaks.com/forums/index.php/topic,101566.msg402102.html#msg402102]this post[/url].Also we are not here to write scripts for you. We'll provide code snippets but not full scripts. If you want someone to build a fully fledged bbcode system then ask in the freelance forum. Quote Link to comment https://forums.phpfreaks.com/topic/22741-can-anyone-add-bbcode-or-bbtag-whichever-you-prefer-to-call-it-to-this-code/#findComment-102310 Share on other sites More sharing options...
schme16 Posted October 2, 2006 Author Share Posted October 2, 2006 it would hardly be building the entire script, and i'd be just as happy with a detailed explanation as to where the preg-something function goes and how to actually make it work...most of the tutorials out their are comprehensive...but never show you where in the code it has to sit and what the variables should be set to..... Quote Link to comment https://forums.phpfreaks.com/topic/22741-can-anyone-add-bbcode-or-bbtag-whichever-you-prefer-to-call-it-to-this-code/#findComment-102430 Share on other sites More sharing options...
obsidian Posted October 2, 2006 Share Posted October 2, 2006 [quote author=schme16 link=topic=110233.msg445335#msg445335 date=1159804761]i'd be just as happy with a detailed explanation as to where the preg-something function goes and how to actually make it work...[/quote]then, you should be very pleased with the thread that wildteen pointed you to ;)it's a very detailed explanation, and it also includes the code needed to make it work.good luck Quote Link to comment https://forums.phpfreaks.com/topic/22741-can-anyone-add-bbcode-or-bbtag-whichever-you-prefer-to-call-it-to-this-code/#findComment-102434 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.