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 ""._PM_MESSAGEC."";
  echo 
"";
  
xoopsCodeTarea("message",37,8);
  
xoopsSmilies("message");
  echo 
"";
  echo 
"";

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'];
}
?>

echo $submit_page;?>' method='post' name='coolsus'>
echo "

[b]"._AM_TITLE."[/b]";
echo 
";
if(isset(
$title)){
    echo 
$title;
}
echo 
"' size='70' maxlength='80' />";
echo 
"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 .= "";
}
}
} else {
$count = count($smiles);
for ($i = 0; $i < $count; $i++) {
if ($smiles[$i]['display'] == 1) {
$ret .= "";
}
}
}
$ret .= " ["._MORE."]";
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
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 .= "";

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

}
}
} else {
$count = count($smiles);
for ($i = 0; $i < $count; $i++) {
if ($smiles[$i]['display'] == 1) {
$ret .= "";
}
}
}
$ret .= " ["._MORE."]";
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"
"
."
";
echo "\n";
echo "

"._MD_ADDNEWLINK."


\n";
echo "\n";
echo "";
echo "\n";

Login

Who's Online

342 user(s) are online (225 user(s) are browsing Support Forums)


Members: 0


Guests: 342


more...

Donat-O-Meter

"._MD_SITETITLE."";
echo "";
echo "
"._MD_SITEURL."";
echo "";
echo "
"._MD_CATEGORYC."";
$mytree->makeMySelBox("title", "title");
echo "
"._MD_DESCRIPTIONC."
width=540>\n";
xoopsCodeTarea("description",60,8);
xoopsSmilies("description");
//echo "\n";
echo "
Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits