1
Rou4cn
If smiley is too much, how to hack? ---everything done
  • 2003/12/3 18:18

  • Rou4cn

  • Just popping in

  • Posts: 16

  • Since: 2003/5/3 1


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 .= "&nbsp;[<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.

2
techgnome
Re: If smiley is too much, how to hack?
  • 2003/12/3 20:44

  • techgnome

  • Module Developer

  • Posts: 51

  • Since: 2002/8/9 5


GOOD Gravy man! How many smilies are you displaying? You do know that it is possible to limit the number of smilies listed (that's why there is the "[more...]" link).
But as for your code....
displaying \n doesn't make HTML go to the next line.... just the resulting code thats written out....
Try <br> instead....

TG

3
CBlue
Re: If smiley is too much, how to hack?

Go to system admin, click on smilies admin and uncheck the boxes of all smilies except the few you want to keep showing. You don't need to have all your smilies showing on your pages.

4
Rou4cn
Re: If smiley is too much, how to hack?
  • 2003/12/4 4:11

  • Rou4cn

  • Just popping in

  • Posts: 16

  • Since: 2003/5/3 1


Thanks.

I have 88 smileys, diaplay 57.

I try again and done.

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='' />";

[color=0000FF]$ret .= "\n"; /color]

}
}
} 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 .= "&nbsp;[<a href='#moresmiley' onclick='javascript:openWithSelfMain(\"".XOOPS_URL."/misc.php?action=showpopups&type=smilies&target=".$this->getName()."\",\"smilies\",300,475);'>"._MORE."</a>]";
return $ret;
}
}
?>


the blue color one need to be added

I don't know why it is done. but it is there.
Since the process of this function is out of my mind.

5
Rou4cn
Re: If smiley is too much, how to hack?
  • 2003/12/4 4:22

  • Rou4cn

  • Just popping in

  • Posts: 16

  • Since: 2003/5/3 1


and for mylinks, done.

/modules/mylinks/admin/index.php

add width=540 below:

Quote:

// If there is a category, add a New Link

echo"<table width='100%' border='0' cellspacing='1' class='outer'>"
."<tr class=\"odd\"><td>";
echo "<form method=post action=index.php>\n";
echo "<h4>"._MD_ADDNEWLINK."</h4><br />\n";
echo "<table width=\"80%\"><tr>\n";
echo "<td align=\"right\">"._MD_SITETITLE."</td><td>";
echo "<input type=text name=title size=50 maxlength=100>";
echo "</td></tr><tr><td align=\"right\" nowrap>"._MD_SITEURL."</td><td>";
echo "<input type=text name=url size=50 maxlength=250 value=\"http://\">";
echo "</td></tr>";
echo "<tr><td align=\"right\" nowrap>"._MD_CATEGORYC."</td><td>";
$mytree->makeMySelBox("title", "title");
echo "<tr><td align=\"right\" valign=\"top\" nowrap>"._MD_DESCRIPTIONC."</td><td

width=540>\n";
xoopsCodeTarea("description",60,8);
xoopsSmilies("description");
//echo "<textarea name=description cols=60 rows=5></textarea>\n";
echo "</td></tr>\n";

Login

Who's Online

172 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits