Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
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.
Attachments
44920-Clickable_Icons_In_Body_v2.txt (0 Bytes, 194 downloads)


Silly ricer.. Wings are for airplanes!
Sponsored Links
Joined: Mar 2002
Posts: 2
Lurker
Lurker
Offline
Joined: Mar 2002
Posts: 2
Unfortunately the link to the attachment doesn't work .... Anywhere else I can get this hack?

/Björn

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
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
Attachments
45105-Clickable_Icons_In_Body_v2.txt (0 Bytes, 69 downloads)

Last edited by ExcelsiorDDZ; 03/11/2002 8:02 PM.

Silly ricer.. Wings are for airplanes!
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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[/]

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
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.


Silly ricer.. Wings are for airplanes!
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
that would be perfect []/forum/images/icons/smile.gif[/]


- Allen wavey
- What Drives You?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
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

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
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


Silly ricer.. Wings are for airplanes!
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)