UBB.Dev
Posted By: ExcelsiorDDZ Clickable Icons in body HACK v2 - 02/25/2002 6:58 PM
Its all re-written, and even works with the new Calendar 2.2 in place! []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

IE only!

And I have not added the $uubtlang part as suggested yet. See the other thread for that.

Attached File
Posted By: SwedeB Re: Clickable Icons in body HACK v2 - 03/11/2002 7:01 AM
Unfortunately the link to the attachment doesn't work .... Anywhere else I can get this hack?

/Björn
Posted By: ExcelsiorDDZ Re: Clickable Icons in body HACK v2 - 03/12/2002 2:50 AM
reposting it now. It seems the uploads are not working here.....


READ IT HERE ----------

CLICK ON ICONS
---------------------------------------
(Line numbers for ubbt v5.5 are in brackets.)

This is a rewritten hack from an old WWWThreads Perl version that I needed to add to this version. The original
was Eileen's and I don't claim that my code is perfect since I am sitll new to all of this.

Note, it only works in IE browsers.



In includes/header.php
----------------------
1. Add these lines to the very top.
<script language="Javascript">
<!--
function addImage(imgCode) {
var txtBoxVal = kgp.Body.value
txtBoxVal += imgCode
kgp.Body.value = txtBoxVal
}
// -->
</script>

The above lines allow for the header to take care of the Javascript values for your other PHP files.



In newpost.php
-------------
1. Find (166):
echo "<form method=POST enctype='multipart/form-data' action="{$config['phpurl']}/addpost.php">";

and replace with:
echo "<form method=POST enctype='multipart/form-data' action="{$config['phpurl']}/addpost.php" name="kgp">";

2. Find (169):
echo "<form method=POST action ="{$config['phpurl']}/addpost.php">";

and replace with:
echo "<form method=POST action ="{$config['phpurl']}/addpost.php" name="kgp">";


3. *** Find (262):
echo "
{$ubbt_lang['POST_TEXT']}<br>
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" wrap="soft" name="Body"></textarea>
<p>
";

and replace with:
echo "
{$ubbt_lang['POST_TEXT']}<br>
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" wrap="soft" name="Body"></textarea>
<p>
Insert an image:<br>  
<a href="javascript:addImage('[]/forum/images/icons/blush.gif[/] ');"><img alt="{$ubbt_lang['ICON_BLUSH']}" width="15" height="15" border="0" src="{$config['images']}/icons/blush.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/cool.gif[/] ');"><img alt="{$ubbt_lang['ICON_COOL']}" width="15" height="15" border="0" src="{$config['images']}/icons/cool.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/crazy.gif[/] ');"><img alt="{$ubbt_lang['ICON_CRAZY']}" width="15" height="15" border="0" src="{$config['images']}/icons/crazy.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/frown.gif[/] ');"><img alt="{$ubbt_lang['ICON_FROWN']}" width="15" height="15" border="0" src="{$config['images']}/icons/frown.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/laugh.gif[/] ');"><img alt="{$ubbt_lang['ICON_LAUGH']}" width="15" height="15" border="0" src="{$config['images']}/icons/laugh.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/mad.gif[/] ');"><img alt="{$ubbt_lang['ICON_MAD']}" width="15" height="15" border="0" src="{$config['images']}/icons/mad.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/shocked.gif[/] ');"><img alt="{$ubbt_lang['ICON_SHOCKED']}" width="15" border="0" height="15" src="{$config['images']}/icons/shocked.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/smile.gif[/] ');"><img alt="{$ubbt_lang['ICON_SMILE']}" width="15" height="15" border="0" src="{$config['images']}/icons/smile.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/tongue.gif[/] ');"><img alt="{$ubbt_lang['ICON_TONGUE']}" width="15" height="15" border="0" src="{$config['images']}/icons/tongue.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/wink.gif[/] ');"><img alt="{$ubbt_lang['ICON_WINK']}" width="15" height="15" border="0" src="{$config['images']}/icons/wink.gif"></a>
<p>
";

In newreply.php
---------------
1. Find (200):
echo "<form method=POST enctype='multipart/form-data' action="{$config['phpurl']}/addpost.php">";

and replace with:
echo "<form method=POST enctype='multipart/form-data' action="{$config['phpurl']}/addpost.php" name="kgp">";

2. Find (203):
echo "<form method=POST action ="{$config['phpurl']}/addpost.php">";

and replace with:
echo "<form method=POST action ="{$config['phpurl']}/addpost.php" name="kgp">";

3. *#* Find (302):
echo "
{$ubbt_lang['POST_TEXT']}<br>
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" wrap="soft" name="Body"></textarea>
<p>
";

and replace with:
echo "
{$ubbt_lang['POST_TEXT']}<br>
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" wrap="soft" name="Body"></textarea>
<p>
Insert an image:<br>  
<a href="javascript:addImage('[]/forum/images/icons/blush.gif[/] ');"><img alt="{$ubbt_lang['ICON_BLUSH']}" width="15" height="15" border="0" src="{$config['images']}/icons/blush.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/cool.gif[/] ');"><img alt="{$ubbt_lang['ICON_COOL']}" width="15" height="15" border="0" src="{$config['images']}/icons/cool.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/crazy.gif[/] ');"><img alt="{$ubbt_lang['ICON_CRAZY']}" width="15" height="15" border="0" src="{$config['images']}/icons/crazy.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/frown.gif[/] ');"><img alt="{$ubbt_lang['ICON_FROWN']}" width="15" height="15" border="0" src="{$config['images']}/icons/frown.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/laugh.gif[/] ');"><img alt="{$ubbt_lang['ICON_LAUGH']}" width="15" height="15" border="0" src="{$config['images']}/icons/laugh.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/mad.gif[/] ');"><img alt="{$ubbt_lang['ICON_MAD']}" width="15" height="15" border="0" src="{$config['images']}/icons/mad.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/shocked.gif[/] ');"><img alt="{$ubbt_lang['ICON_SHOCKED']}" width="15" border="0" height="15" src="{$config['images']}/icons/shocked.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/smile.gif[/] ');"><img alt="{$ubbt_lang['ICON_SMILE']}" width="15" height="15" border="0" src="{$config['images']}/icons/smile.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/tongue.gif[/] ');"><img alt="{$ubbt_lang['ICON_TONGUE']}" width="15" height="15" border="0" src="{$config['images']}/icons/tongue.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/wink.gif[/] ');"><img alt="{$ubbt_lang['ICON_WINK']}" width="15" height="15" border="0" src="{$config['images']}/icons/wink.gif"></a>
<p>
";


In addpost.php (this is here for now till I fix it so it works)
---------------------------------------------------------------
1. Find (313):
echo "<form method=POST enctype='multipart/form-data' action="{$config['phpurl']}/addpost.php">";

and replace with:
echo "<form method=POST enctype='multipart/form-data' action="{$config['phpurl']}/addpost.php" name="kgp">";


2. Find (316):
echo "<form method=POST action ="{$config['phpurl']}/addpost.php">";

and replace with:
echo "<form method=POST action ="{$config['phpurl']}/addpost.php" name="kgp">";

3. #*# Find (474):
echo "
<p>
{$ubbt_lang['POST_TEXT']}<br>
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" wrap="soft" name="Body">$Body</textarea>
<p>

and replace with:
echo "
<p>
{$ubbt_lang['POST_TEXT']}<br>
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" wrap="soft" name="Body">$Body</textarea>
<p>
Insert an image:<br>  
<a href="javascript:addImage('[]/forum/images/icons/blush.gif[/] ');"><img alt="{$ubbt_lang['ICON_BLUSH']}" width="15" height="15" border="0" src="{$config['images']}/icons/blush.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/cool.gif[/] ');"><img alt="{$ubbt_lang['ICON_COOL']}" width="15" height="15" border="0" src="{$config['images']}/icons/cool.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/crazy.gif[/] ');"><img alt="{$ubbt_lang['ICON_CRAZY']}" width="15" height="15" border="0" src="{$config['images']}/icons/crazy.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/frown.gif[/] ');"><img alt="{$ubbt_lang['ICON_FROWN']}" width="15" height="15" border="0" src="{$config['images']}/icons/frown.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/laugh.gif[/] ');"><img alt="{$ubbt_lang['ICON_LAUGH']}" width="15" height="15" border="0" src="{$config['images']}/icons/laugh.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/mad.gif[/] ');"><img alt="{$ubbt_lang['ICON_MAD']}" width="15" height="15" border="0" src="{$config['images']}/icons/mad.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/shocked.gif[/] ');"><img alt="{$ubbt_lang['ICON_SHOCKED']}" width="15" border="0" height="15" src="{$config['images']}/icons/shocked.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/smile.gif[/] ');"><img alt="{$ubbt_lang['ICON_SMILE']}" width="15" height="15" border="0" src="{$config['images']}/icons/smile.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/tongue.gif[/] ');"><img alt="{$ubbt_lang['ICON_TONGUE']}" width="15" height="15" border="0" src="{$config['images']}/icons/tongue.gif"></a>
<a href="javascript:addImage('[]/forum/images/icons/wink.gif[/] ');"><img alt="{$ubbt_lang['ICON_WINK']}" width="15" height="15" border="0" src="{$config['images']}/icons/wink.gif"></a>
<p>







ADD MORE SMILEYS
----------------
edit showicons.php and Find (56):
add your own image code after this line

languages\english\generic.php starting at (60) add your new ones there. (keep in alphabetical order)

Add more lines to:
newpost.php (see *** line above in instructions)
newreply.php (see *#* line above in instructions)
addpost.php (see #*# line above in instructions)

All those are instructions 3 under each filename.


Kevin G. Podszebka
-Excelsior
-DDZ

[][email protected][/]



or download it here... http://www.theddz.com/files/Clickable_Icons_In_Body_v2.txt


Attached File
Posted By: omegatron Re: Clickable Icons in body HACK v2 - 03/12/2002 11:19 PM
Okay I uncovered a bug between this hack and autoquote. I posted it over in that thread.

Great Hack however you left one step out for adding more images.

I coded more into mine you just need to make sure you also put the coding in UBBT.inc.php otherwise it will not display them []/forum/images/icons/smile.gif[/]
Posted By: ExcelsiorDDZ Re: Clickable Icons in body HACK v2 - 03/13/2002 12:15 PM
Ahh, thank you. What I really need to do is auto-feed them into an array from a directory, then display the array. []/forum/images/icons/frown.gif[/] Time is not my strong point right now.
Posted By: AllenAyres Re: Clickable Icons in body HACK v2 - 03/13/2002 5:14 PM
that would be perfect []/forum/images/icons/smile.gif[/]
Posted By: JoshPet Re: Clickable Icons in body HACK v2 - 05/08/2002 4:02 AM
I Love this hack and have been using it for quite a while.

I just tried to make it work for Private Messages as well... but couldn't quite figure it out.

I know I need to modify the sendprivate.php and mess_handler.php

And I can make the smiley's appear in the HTML.. but can't quite figure out what else to modify to get them to go into the message box when clicked.

Any ideas? I'm sure it's very simple.
Help is appreciated.
Posted By: JustDave Re: Clickable Icons in body HACK v2 - 05/08/2002 4:09 AM
I think I understand what your saying so I'll just offer this in hopes it is correct:

The form tag around the message box needs to be named replier (I think)

It is the same name of the form around the post message area.

<form name="replier"


Hope that was the right answer
Posted By: ExcelsiorDDZ Re: Clickable Icons in body HACK v2 - 05/08/2002 4:32 AM
v6 will have this included (in sorts). What version are you running now?? I have not looked at this code and will not be able to assist that well if you are still on 5
Posted By: JoshPet Re: Clickable Icons in body HACK v2 - 05/08/2002 5:05 AM
I'm on 5.5.1 now. Probably will eventually end up on 6. I've been playing.
Didn't know if this would be really easy or not.
Posted By: JoshPet Re: Clickable Icons in body HACK v2 - 05/08/2002 6:10 AM
Didn't seem to work Dave. It's odd that it works in the post screen.. just can't seem to see much of a difference between the 2 in the structure of the form.

V6 Doesn't have the clickable stuff in the Private Message screen. Maybe it'll be easy to add with templates and all. I haven't played too much with 6 yet.
© UBB.Developers