Jump to content

[SOLVED] wan to know


bhavin12300

Recommended Posts

hi.

here is my problem.

 

 

as in this site  while creating a new topic we are given many feature like insert smliey,code tage bold tag etc.

 

 

i also wanted to insert this type of tags as i click on particular  tag.

how to do that?

 

??? ??? ??? ??? ??? ???

 

Link to comment
Share on other sites

I'm guessing he means when creating a new post for example on these forums you get the smiley buttons above the textbox to type your post. Then if you click a smiley it inserts code for that in the textbox for you.

 

Not sure of a way to do it exactly becuase I'm tired but I think it's all done with javascript, you could prolly find something from the source of the new post page :P Just wanted to post to hopefully make your question clearer.

Link to comment
Share on other sites

Mosi is right. Javascript is used to insert the actual symbols (chars) into the text box. If you look hard enough in the source you will find the code.

 

Then in your php code. When your going to put the post into a database or file just use a str replace...

 

$post = $_POST['message'];

$newpost = str_replace(":)", "<img src=images/smiley_Face.jpg>:)</img>", $post);

 

That will take all the :)'s in the post and replace them with a link to the image!

 

Andy

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.