The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#2
|
|||
|
|||
You don't need a "hack" for this. You can do this in your templates. Simply edit the templates for the different forms and add javascript to add the different codes and smilies into the message when clicked on.
|
#3
|
|||
|
|||
Thanks wluke
would you mind tel me what javascript code should I use? I am not that good in javascripts ! Thanks again |
#4
|
|||
|
|||
Ok,I got the javascript for that
If I wanna add the script to the template "newthread" under the options.I need to add buttons and php code of course ! How can I do this without missing up my forums? Any help is greatfull |
#5
|
|||
|
|||
Just stick it right in there and see what happens really. Backup the template to be safe and it something goes wrong, restore the backed up template right away.
|
#6
|
|||
|
|||
Care to post the Javascript for the rest of us ?
Have you had any luck getting it working yet ? |
#7
|
|||
|
|||
Ok,here is what I did:
First,I created a small table where I want my buttons and smili faces to be in the template "newthread",then,I added this javascript in the table: Code:
<a href="javascript: x()" onClick="DoSmilie(' :!) ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="smile"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!( ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="frown"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!o ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="redface"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!D ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="biggrin"></a> ? <a href="javascript: x()" onClick="DoSmilie(' ;!) ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="wink"></a> <br> <a href="javascript: x()" onClick="DoSmilie(' :!p ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="tongue"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!cool: ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="cool"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!rolleyes: ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="rollyeyes"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!mad: ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="mad"></a> ? <a href="javascript: x()" onClick="DoSmilie(' :!eek: ');"><img width="15" height="15" src="YourSmilieURLHere" border="0" alt="eek"></a> <br> <a href="javascript: x()" onClick="DoSmilie(' :!confused: ');"><img width="15" height="22" src="YourSmilieURLHere" border="0" alt="confused"></a> ? </TD><TD valign="top" align="right"><a href="javascript: x()" onClick="DoPrompt('url');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Add URL"></a> ? <a href="javascript: x()" onClick="DoPrompt('email');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Add e-mail address"></a> <br> <a href="javascript: x()" onClick="DoPrompt('bold');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Bold"></a> ? <a href="javascript: x()" onClick="DoPrompt('italics');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Italic"></a> <br> <a href="javascript: x()" onClick="DoPrompt('quote');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Quote"></a> ? <a href="javascript: x()" onClick="DoPrompt('code');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Code"></a> <br> <a href="javascript: x()" onClick="DoPrompt('liststart');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="list_start"></a> ? <a href="javascript: x()" onClick="DoPrompt('listitem');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="list_items"></a> <br> <a href="javascript: x()" onClick="DoPrompt('listend');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="list_end"></a> ? <a href="javascript: x()" onClick="DoPrompt('image');"><img src="YourButtonURLHere" width="75" height="20" border="0" alt="Add image"></a> NOTE: please take the exclamation marks off from the tags above --------- |
#8
|
|||
|
|||
Then added this javascript at the top of the template right after the </title> tag :
Code:
<script language="JavaScript"><!-- function x () { return; } function DoSmilie(addSmilie) { var addSmilie; var revisedMessage; var currentMessage = document.REPLIER.MESSAGE_BODY.value; revisedMessage = currentMessage+addSmilie; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } function DoPrompt(action) { var revisedMessage; var currentMessage = document.REPLIER.MESSAGE_BODY.value; if (action == "url") { var thisURL = prompt("Type Full URL", "http://"); var thisTitle = prompt("Type a word to present the URL", "web page"); var urlvBCode = ""+thisTitle+""; revisedMessage = currentMessage+urlvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "email") { var thisEmail = prompt("Type Full e-maill address", ""); var emailvBCode = ""+thisEmail+""; revisedMessage = currentMessage+emailvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "bold") { var thisBold = prompt("Type the text you want it Bold", ""); var boldvBCode = ""+thisBold+""; revisedMessage = currentMessage+boldvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "italics") { var thisItal = prompt("Type the text you want it Italic", ""); var italvBCode = ""+thisItal+""; revisedMessage = currentMessage+italvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "image") { var thisImage = prompt("Type the Full URL for your image", "http://"); var imagevBCode = "[IMG!]"+thisImage+"[/IMG!]"; revisedMessage = currentMessage+imagevBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "quote") { var quotevBCode = "[QUOTE!] [/QUOTE!]"; revisedMessage = currentMessage+quotevBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "code") { var codevBCode = "[CODE!] [/CODE!]"; revisedMessage = currentMessage+codevBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "liststart") { var liststartvBCode = "[LIST!]"; revisedMessage = currentMessage+liststartvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "listend") { var listendvBCode = "[/LIST!]"; revisedMessage = currentMessage+listendvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } if (action == "listitem") { var thisItem = prompt("Type the "list_items" here and make sure you close the code with"list_end"", ""); var itemvBCode = "[*]"+thisItem; revisedMessage = currentMessage+itemvBCode; document.REPLIER.MESSAGE_BODY.value=revisedMessage; document.REPLIER.MESSAGE_BODY.focus(); return; } } //--></script> NOTE: please take off the exclamation marks from the tags above ! ------------- Everything went fine so far.However,when I clicked on the smili face or any of the buttons it give me this script error : ---------------- Internet Explorer Script Error ------------------------- An error has occurred in the script on this page. Error: 'document.REPLIER.MESSAGE_BODY'is not an object ----------------- How can I get rid of this now?? |
#9
|
|||
|
|||
Does some one have a url where I can see this.
Thanks, Brian |
#10
|
|||
|
|||
Has anyone got this up and running yet ?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|