1
irmtfan
any editor can show smilies at the bottom of page needed
  • 2007/1/15 4:36

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


is this can be done by tinyeditor or any other like dhtml?

2
fragttdg
Re: any editor can show smilies at the bottom of page needed
  • 2007/1/16 4:30

  • fragttdg

  • Just popping in

  • Posts: 34

  • Since: 2004/6/13


I wrote a simple textarea under class/xoopsform/ and have been using it throughout my site. FYI

<?php
if (!defined('XOOPS_ROOT_PATH')) {
    die(
"XOOPS root path not defined");
}
include_once(
XOOPS_ROOT_PATH.'/include/xoopscodes.php');

class 
XoopsFormSimpleTextArea extends XoopsFormElement {
    
/**
     * number of columns
     * @var    int 
     * @access  private
     */
    
var $_cols;

    
/**
     * number of rows
     * @var    int 
     * @access  private
     */
    
var $_rows;

    
/**
     * initial content
     * @var    string  
     * @access  private
     */
    
var $_value;

    
/**
     * Constuctor
     * 
     * @param    string  $caption    caption
     * @param    string  $name       name
     * @param    string  $value      initial content
     * @param    int     $rows       number of rows
     * @param    int     $cols       number of columns   
     */
    
function XoopsFormSimpleTextArea($caption$name$value=""$rows=5$cols=50$id ""){
        
$this->setCaption($caption);
        
$this->setName($name);
        
$this->_rows intval($rows);
        
$this->_cols intval($cols);
        
$this->setValue($value);
        
$this->setId($id);
    }

    
/**
     * get number of rows
     * 
     * @return    int
     */
    
function getRows(){
        return 
$this->_rows;
    }

    
/**
     * Get number of columns
     * 
     * @return    int
     */
    
function getCols(){
        return 
$this->_cols;
    }

    
/**
     * Get initial content
     * 
     * @return    string
     */
    
function getValue(){
        return 
$this->_value;
    }

    
/**
     * Set initial content
     * 
     * @param    $value    string
     */
    
function setValue($value){
        
$this->_value $value;
    }

    
/**
     * prepare HTML for output
     * 
     * @return    sting HTML
     */
    
function render(){
        return 
"<textarea name='".$this->getName()."' id='".$this->getId()."' rows='".$this->getRows()."' cols='".$this->getCols()."'".$this->getExtra().">".$this->getValue()."</textarea>".get_xoopsSmilies($this->getId());
    }
}
?>
Xoops Based site -http://www.xiubei.com

3
irmtfan
Re: any editor can show smilies at the bottom of page needed
  • 2007/1/23 7:43

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


i cant find get_xoopsSmilies function anywhere.
where is that?
i just find xoopsSmilies and use it like this:
xoopsSmilies($this->getName())

but it always shows at the top of topic perfix and not bottom of editor.

i put it where ever in the dhtmlext editor render function but still it persist to be on top:
function render()
    {
          
$ret '<script language="JavaScript" type="text/javascript" src="' $this->_url '/xoops.js"></script>';
        
$ret .= $this->_codeIcon()."<br />n";
        
$ret .= $this->_fontArray();
        
$ret .= "<input type='button' onclick="XoopsCheckLength('".$this->getName()."''".$this->_maxlength."''"._ALTLENGTH."''"._ALTLENGTH_MAX."');" value=' ? ' />";
        
$ret .= "<br /><br />nn".xoopsSmilies($this->getName());
        
        
$ret .= "<textarea id='".$this->getName()."' name='".$this->getName()."' onselect="xoopsSavePosition('".$this->getName()."');" onclick="xoopsSavePosition('".$this->getName()."');" onkeyup="xoopsSavePosition('".$this->getName()."');" cols='".$this->getCols()."' rows='".$this->getRows()."'".$this->getExtra().">".$this->getValue()."</textarea><br />n";
        
$ret .= xoopsSmilies($this->getName());
        return 
$ret;
    }

4
McDonald
Re: any editor can show smilies at the bottom of page needed
  • 2007/1/23 9:13

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Smilies are automatically added under the editor field in tinyeditor as long as you select the Emotions plugin from the toolbars setup. See page 10 of the tinyeditor manual.

5
irmtfan
Re: any editor can show smilies at the bottom of page needed
  • 2007/1/23 9:30

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


thank you for your reply McDonald
in tinyeditor i cant see "emotions" in the bottom of editing page.
it just shows an icon in the editor toolbar to select smilies.
could you show me a live demo?
also i want to add it in dhtmlext.

6
McDonald
Re: any editor can show smilies at the bottom of page needed
  • 2007/1/23 11:15

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Hello irmtfan,

Sorry, I was wrong about the smilies in tinyeditor.
My excuses for the confusion.
Maybe frankblack has a solution for this.
You can add your wish to the feature list of tinyeditor so the developpers can implement it in a later version.

Login

Who's Online

241 user(s) are online (167 user(s) are browsing Support Forums)


Members: 0


Guests: 241


more...

Donat-O-Meter

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

Latest GitHub Commits