In news,newbb,mylink,message,blocksadmin module, when you send or edit something, the window may be to much wide if the smileys is visible to much.
It make inconvenient.
I have known how to hack for news,newbb and message, but blocksadmin and mylink. since the blocksadmin is link to \class\xoopsform\formdhtmltextarea.php and use smarty. I try but fail. so for help.
other is easy as it is HTML.
Below is the hack way.
1,messages:xoops/pmlite.php
echo "<tr valign='top'><td class='head' width='25%'>"._PM_MESSAGEC."</td>";
echo "<td class='even' [color=0000FF]width='540'[/color]>";
xoopsCodeTarea("message",37,8);
xoopsSmilies("message");
echo "</td>";
echo "</tr>";
the “width='540'” it is.
2,newbb:/modules/newbb/includes/forumform.inc.php
<tr align='left'>
<td class='head' valign='top' nowrap='nowrap'>". _MD_MESSAGEC ."
</td>
<td class='odd' width='540'>";
xoopsCodeTarea("message");
if ( !empty($isreply) && isset($hidden) && $hidden != "" ) {
echo "<input type='hidden' name='isreply' value='1' />";
echo "<input type='hidden' name='hidden' id='hidden' value='$hidden' />
<input type='button' name='quote' class='formButton' value='"._MD_QUOTE."'
onclick='xoopsGetElementById("message").value=xoopsGetElementById("message").value +
xoopsGetElementById("hidden").value; xoopsGetElementById("hidden").value="";' /><br />";
}
xoopsSmilies("message");
echo "</td></tr>
same add a "width='540'".
3,news:/modules/news/admin/storyform.inc.php
// ------------------------------------------------------------------------ //
if ( !preg_match("/index.php/", $HTTP_SERVER_VARS['PHP_SELF']) ) {
exit("access denied");
}
include XOOPS_ROOT_PATH."/include/xoopscodes.php";
if(!isset($submit_page)){
$submit_page = $HTTP_SERVER_VARS['PHP_SELF'];
}
?>
<table><tr><td width=540>
<form action='<?php echo $submit_page;?>' method='post' name='coolsus'>
<?php
echo "<p>[b]"._AM_TITLE."[/b]<br />";
echo "<input type='text' name='title' id='title' value='";
if(isset($title)){
echo $title;
}
echo "' size='70' maxlength='80' /><br />";
echo "<a href='javascript: justReturn()' onclick='xoopsCodeSmilie("hometext", "[picnews@index]
");'>";
another width=540;
4, but for blocksadmin,
\class\xoopsform\formdhtmltextarea.php
Quote:
/**
* prepare HTML for output of the smiley list.
*
* @return string HTML
*/
function _renderSmileys()
{
$myts =& MyTextSanitizer::getInstance();
$smiles =& $myts->getSmileys();
$ret = '';
if (empty($smileys)) {
$db =& Database::getInstance();
if ($result = $db->query('SELECT * FROM '.$db->prefix('smiles').' WHERE display=1')) {
while ($smiles = $db->fetchArray($result)) {
$ret .= "<img onclick='xoopsCodeSmilie(\"".$this->getName()."\", \" ".$smiles['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".htmlspecialchars($smiles['smile_url'], ENT_QUOTES)."' alt='' />";
}
}
} else {
$count = count($smiles);
for ($i = 0; $i < $count; $i++) {
if ($smiles[$i]['display'] == 1) {
$ret .= "<img onclick='xoopsCodeSmilie(\"".$this->getName()."\", \" ".$smiles[$i]['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".$myts->oopsHtmlSpecialChars($smiles['smile_url'])."' border='0' alt='' />";
}
}
}
$ret .= " [<a href='#moresmiley' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&type=smilies&target=".$this->getName()."\",\"smilies\",300,475);'>"._MORE."</a>]";
return $ret;
}
}
?>
I try to add "\n" if it shows 15 smileys. as below but fail.
Quote:
for ($i = 0; $i < $count; $i++) {
if ($smiles[$i]['display'] == 1) {
$ret .= "getName()."\", \" ".$smiles[$i]['code']." \");' onmouseover='style.cursor=\"hand\"' src='".XOOPS_UPLOAD_URL."/".$myts->oopsHtmlSpecialChars($smiles['smile_url'])."' border='0' alt='' />";
$iii++;
$ret .= "\n";
}
if ($i%15==14) $ret .="\n";//add a line
if ($iii == 15 ) {
$ret .="\n"; //add a empty line (another hack way)
$ret .= "\n\n";
}
}
}
$ret .= "\n";
// * $ret .= "
\n\n";
$ret .= " [getName()."\",\"smilies\",300,475);'>"._MORE."]";
return $ret;
}
}
?>
I try two way to hack, but fail.
Any comment? Thanks.