View previous topic :: View next topic |
Author |
Message |
Jules
Joined: 22 Aug 2003 Posts: 9
|
Posted: Sat Sep 13, 2003 8:53 pm Post subject: Smilies in comments hack? |
|
|
Can somebody point me to this hack, where the smilies are in the comments pop-up page... a'la http://www.local-girl.org? I followed the link in her blog... but only got to dodo's threaded comments hack. Thank you in advance  |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Sat Sep 13, 2003 11:35 pm Post subject: |
|
|
Paste this where you want the smilies to go.
Code: | <script language="JavaScript" type="text/javascript">
function emoticon(theSmilie) {
theSmilie = ' ' + theSmilie + ' ';
if (document.form.comment.createTextRange && document.form.comment.caretPos) {
var caretPos = document.form.comment.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? theSmilie + ' ' : theSmilie;
} else {
document.form.comment.value += theSmilie;
}
document.form.comment.focus();
theSmilie = '';
}
</script>
<?php
$newrow = 0;
$prev_val="";
asort($b2smiliestrans);
while (list ($key, $val) = each ($b2smiliestrans)) {
if($prev_val and $val==$prev_val) { }
else if(!$prev_val or ($prev_val and $val!=$prev_val)){
?>
<img src="<?php echo "$smilies_directory/$val"; ?>" alt="<?php echo $key; ?>" border="0" onclick="emoticon('<?php echo $key; ?>')" onmouseover="style.cursor='hand'" />
<?php
$newrow++;
if($newrow == 8) { //new row after specified number of smilies
echo '<br />';
$newrow = 0;
}
}
$prev_val = $val;
}
?> |
And change your Form Action for b2comments.php (and b2commentspopup.php) to
Code: | <form action="b2comments.post.php" method="post" name="form"> |
Make sure smilies are enabled in b2config.php with the correct URL. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1274 Location: Oregon
|
Posted: Sun Sep 14, 2003 5:31 pm Post subject: |
|
|
Hey, that's my revision... heh. _________________ Michael P.
 |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Mon Sep 15, 2003 1:25 am Post subject: |
|
|
Cyberian75 wrote: | Hey, that's my revision... heh. | LOL, yes it is. I've been using it for a while. _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
Jules
Joined: 22 Aug 2003 Posts: 9
|
Posted: Mon Oct 13, 2003 12:26 am Post subject: |
|
|
where do I put the stuff above? I'm really clueless at this stuff, lol! |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Mon Oct 13, 2003 12:51 am Post subject: |
|
|
In b2comments.php (or b2comments.popup.php). _________________ No more support from me. Goodbye!
Go upgrade to WordPress, you'll find better support there. |
|
Back to top |
|
 |
Elladora
Joined: 20 Jul 2003 Posts: 5 Location: Malaysia, South-East Asia
|
Posted: Sun Feb 01, 2004 10:36 am Post subject: |
|
|
How about a hack which list the smilies on your b2 login page? Then, all you have to do is click on the smilie and it will be on your entry box. So you don't have to type out the emoticon strokes yourself or memorize them.
Btw, is there a way for me to change the date of post to suit my time zone? |
|
Back to top |
|
 |
Miyu
Joined: 05 Nov 2002 Posts: 37
|
Posted: Sun Feb 01, 2004 10:37 pm Post subject: |
|
|
There is a hack for that, because I got it off this board. You'll have to dig around one of the older threads about smile hacks  |
|
Back to top |
|
 |
hazel
Joined: 20 Jan 2004 Posts: 38 Location: Philippines
|
Posted: Thu Feb 19, 2004 12:42 pm Post subject: |
|
|
the installation of the smilies are okay.. but it wouldn't show up in the comments.. click here: http://www.strawberryshake.net/sweet/b2.php?p=16&c=1#comments
HELP!!!!
Also, i see in some blog, if they are going to comment the "name", "email" and "url" disappear.. how is that? |
|
Back to top |
|
 |
Spack
Joined: 03 Mar 2004 Posts: 9 Location: Guadeloupe
|
Posted: Fri Mar 05, 2004 11:50 pm Post subject: |
|
|
Try this...Create a new file in b2-include/ ...I named it "b2quicktags.comments.php"
Code: | <script language="JavaScript" type="text/javascript">
function bbinsert(formObj, strIns, strInsClose ) {
theSelection = false;
if (document.selection)
{
formObj.content.focus();
theSelection = document.selection.createRange().text; // Get text selection
// Add tags around selection:
document.selection.createRange().text = strIns + theSelection + strInsClose;
formObj.comment.focus();
theSelection = false;
return;
}
formObj.comment.value += strIns + strInsClose;
formObj.comment.focus();
return;
}
</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="middle">
<td>
<img src="b2-img/smilies/icon_arrow.gif" title=":arrow:" class="middle" onClick="bbinsert(document.post,'', ' :arrow: ')" />
</td>
<td> </td>
<td>
<img src="b2-img/smilies/icon_biggrin.gif" title=":D" class="middle" onClick="bbinsert(document.post, '', ' :D ')" />
</td>
</tr>
<!-- put here your smiles picture as the example -->
<!-- open a new <tr> tag to create a new line of smilies -->
</table> |
In "b2comments.php" or "b2commentspopup.php", name the form "post" :
Code: | <form name="post" action="<?php echo $siteurl; ?>/b2comments.post.php" method="post"> |
and modify the textaera part as it :
Code: |
<p class="commentfield">
comment<br />
<?php if ($use_quicktags) include($b2inc.'/b2quicktags.comments.php'); ?>
<textarea cols="40" rows="4" name="comment" tabindex="4" wrap="virtual" id="comment"></textarea>
</p> |
If you have an error who says that you don't have enter your comment...Modify "b2comments.post.php"
Code: | if ($comment == "") {
echo "Error: You don't have enter your comment";
exit;
} |
Sorry for my english ...But I hope you understand... |
|
Back to top |
|
 |
|