Форумы / Cotonti / Extensions / Minichat

12>>>

DemptD
#1 22.03.2009 03:41
Just installed minichat plugin

But the date on the post the user sends on it never changes the time or date.

Could someone fix it?

http://www.cotonti.com/downloads/plugins/miscellaneous/57?highlight=CHAT
esclkm
#2 22.03.2009 05:12
yes I know this bug. i will update plugin tomorrow.
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
DemptD
#3 22.03.2009 05:14
# esclkm : yes I know this bug. i will update plugin tomorrow.

Thank you :)

Have you fixed it?
Отредактировано: DemptD (28.03.2009 23:23, 15 лет назад)
esclkm
#4 28.03.2009 23:58
sorry/ I have not enough time yet. I will remake it today...
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
TwistedGA
#5 29.03.2009 00:20
I get hung with an error about the date or timezone integer(cant remember which for sure) everytime I try this thing.
[color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]
esclkm
#6 29.03.2009 01:29
I fix some errors - please test plugin! minichat_27.rar
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
DemptD
#7 29.03.2009 01:44
Didnt work at all...

Made my whole index disappear.

Plugin doesnt load.

Admin is broken:

Code:	minichatNameMinichatDescriptionMinichat for cotontiVersion0.0.4Updated2009-jan-29AuthoresclkmCopyrightNotesConfigSQLAuth_guestsRLock_guestsW12345AAuth_membersRWLock_members12345
Parts :
	Fil	Hooks	Bestill	Status	Action
#1		.php			Not installed	-
#2		.php			Not installed	-
#3		.php			Not installed	-
esclkm
#8 29.03.2009 02:23
I reupload plugin - please retest/ I fast test plug on my pc - it work now cottectly
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
DemptD
#9 29.03.2009 02:43
Thanks, now everything works :)
Kingsley
#10 29.03.2009 15:23
# esclkm : I fix some errors - please test plugin! minichat_27.rar

Works fine.. date now shows..

I was wondering, could you make it so that in the admin panel you can set if the chat should auto-scroll or not?
thx..
TwistedGA
#11 01.04.2009 01:28
It's finally in a state of working for me, also I'm get a 'mini' is undefined javascript error(not effecting functionality that I can tell, but its an error nonetheless).
[color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]
Отредактировано: TwistedGA (01.04.2009 01:48, 15 лет назад)
esclkm
#12 01.04.2009 01:49
I dont understand, please explain
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
TwistedGA
#13 01.04.2009 02:19
There is a javascript error reported in IE8. This error simply states "'mini' is undefined. Line 165607"
[color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]
esclkm
#14 01.04.2009 03:06
This error is only use minichat? or in adminbanlist this error exists?
Because I use in this plugin only standart cotonti scripts/
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
DemptD
#15 07.04.2009 04:50
How can i make it so that the pagination starts on page 1 and not the last page?

because i have set the sortorder to DESC instead of ASC because it looks more chatlike then and the members liked that better.

But i have 4 pages with chat messages now and it opens on page 4 with the oldest messages first.

How do i make it so that the pagination opens on page 1 always?

minichat.functions.php:

<?PHP
/**
 * Minichat (Shoutbox) on index with jQuery
 *
 * @package Cotonti
 * @version 0.0.4
 * @author esclkm
 * @copyright Copyright (c) Mikulik Pavel 2008-2009
 * @license BSD
 */


if ( !defined('SED_CODE') ) { die("Wrong URL."); }

/**
 * Builds minichat_box
 *
 * @param string $temlate Use temlate for minichat.
 * @param bool $ajax Use If loaded by ajax.
 * @param bool $jaxpagination Use If ajax paginated.
 * @return string
 */

function minichat_build($template, $ajax=false, $ajaxpagination=false)
{

    global $usr, $d, $error_string, $cfg, $db_com, $L, $minichatt, $shoutbox;
    $mskin = sed_skinfile('minichat', true);
    $minichatt = new XTemplate($mskin);
    list($usr['auth_read_com'], $usr['auth_write_com'], $usr['isadmin_com']) = sed_auth('plug', 'minichat');
    $issetpage=isset($_GET['chatd']);
    $d = sed_import('chatd','G','INT');

    if (!$usr['auth_read_com'])
    {
        $error_string.=$L['minichat_noreadrights']."<br />";
    }

    if (!empty($error_string))
    {
        $minichatt->assign("MINICHAT_ERROR",$error_string);
        $minichatt->parse("MINICHAT".$template.".MINICHAT_ERRORBLOCK");
    }
    if ($usr['auth_read_com'])
    {
        $sql = sed_sql_query("SELECT COUNT(*) FROM $db_com WHERE com_code='chat' ");
        $totalitems = mysql_result($sql,0,"COUNT(*)");
        if(empty($d) || $d<=0 || $d>$totalitems) $d = 0;
        if ($template!='_MAIN')
        {
            $perpage = $cfg['plugin']['minichat']['minichat_recent'];
            $sortorder = "ASC";
            $panelchat     = "&panel=1";
        }
        else
        {
            $perpage = $cfg['plugin']['minichat']['minichat_maxperpage'];
            if (!isset($_GET['chatd']) && $totalitems!=0)  { $d = $perpage * (ceil($totalitems / $perpage)-1); }
            $sortorder = "DESC";
            $panelchat     = "";
        }
        $sql = sed_sql_query("SELECT * FROM $db_com WHERE com_code='chat' ORDER BY com_id $sortorder LIMIT  $d, $perpage ");

        if (sed_sql_numrows($sql)>0)
        {
            while ($row = sed_sql_fetcharray($sql))
            {
                $minichat_author    = sed_cc($row['com_author']);
                $minichat_text      = sed_cc($row['com_text']);
                $minichat_date      = @date($cfg['dateformat'], $row['com_date'] + $usr['timezone'] * 3600);
                $minichat_date_short= @date($cfg['formatmonthday'], $row['com_date'] + $usr['timezone'] * 3600);
                $minichat_admin     = ($usr['isadmin_com']) ? " &nbsp;".$L['Delete'].": <u>[<a href=\"".sed_url("plug", "e=minichat&a=delete&".sed_xg()."&delitem=".$row['com_id'])."\" onclick=\"return ajaxSend({url: 'plug.php?r=minichat".$panelchat."&pag=1&a=delete&".sed_xg()."&delitem=".$row['com_id']."', divId: 'minichatajaxpagination', errMsg: '".$L['ajaxSenderror']."'});\">x</a>]</u>" : '' ;
                $minichat_admin_lite= ($usr['isadmin_com']) ? " &nbsp;[<a href=\"".sed_url("plug", "e=minichat&a=delete&".sed_xg()."&delitem=".$row['com_id'])."\" onclick=\"return ajaxSend({url: 'plug.php?r=minichat".$panelchat."&pag=1&a=delete&".sed_xg()."&delitem=".$row['com_id']."', divId: 'minichatajaxpagination', errMsg: '".$L['ajaxSenderror']."'});\">x</a>]" : '' ;
                $minichat_authorlink= sed_build_user($row['com_authorid'], $row['com_author']);
                $minichatt-> assign(array(
                 "MINICHAT_ROW_ID"         => $row['com_id'],
                 "MINICHAT_ROW_AUTHOR"     => $minichat_authorlink,
                 "MINICHAT_ROW_TEXT"       => sed_parse($minichat_text, $cfg['plugin']['minichat']['minichat_bbcode'], $cfg['plugin']['minichat']['minichat_bbcode'], 1),
                 "MINICHAT_ROW_DATE"       => $minichat_date,
                 "MINICHAT_ROW_DATE_SHORT" => $minichat_date_short,
                 "MINICHAT_ROW_ADMIN"      => $minichat_admin,
                 "MINICHAT_ROW_ADMIN_LITE" => $minichat_admin_lite,
                    ));
                $minichatt->parse("MINICHAT".$template.".MINICHAT_ROW");
            }
            $pagnav = sed_pagination(sed_url('plug','e=minichat'), $d, $totalitems, $perpage, 'chatd', 'ajaxSend', "url: 'plug.php?r=minichat&pag=1".$panelchat."', divId: 'minichatajaxpagination', errMsg: '".$L['ajaxSenderror']."'");
            list($pagination_prev, $pagination_next) = sed_pagination_pn(sed_url('plug','e=minichat'), $d, $totalitems, $perpage, TRUE, 'chatd', 'ajaxSend', "url: 'plug.php?r=minichat&pag=1".$panelchat."', divId: 'minichatajaxpagination', errMsg: '".$L['ajaxSenderror']."'");
            $minichatt-> assign(array(
            "MINICHAT_PAGENAV" => $pagnav,
            "MINICHAT_PREV"    => $pagination_prev,
            "MINICHAT_NEXT"	   => $pagination_next,
                ));
            $minichatt->parse("MINICHAT".$template.".MINICHAT_PNAV");
        }
        else
        {
            $minichatt-> assign("MINICHAT_EMPTYTEXT", $L['minichat_empty']);
            $minichatt->parse("MINICHAT".$template.".MINICHAT_EMPTY");
        }
        if ($usr['auth_write_com'] && !$ajaxpagination)
        {
            $minichatt->assign(array(
            "MINICHAT_FORM_SEND"        => "action=\"plug.php?e=minichat\" id=\"minichat_form\" onSubmit=\"return ajaxSend({method: 'POST', formId: 'minichat_form', url: 'plug.php?r=minichat".$panelchat."', divId: 'minichatajax', errMsg: '".$L['ajaxSenderror']."'});\"",
            "MINICHAT_FORM_TXT"         => "name=\"shoutbox\"",
            "MINICHAT_FORM_TEXT"        => $shoutbox,
                ));
            $minichatt->parse("MINICHAT".$template.".MINICHAT_FORM");
       }

        if(!$ajax && !$ajaxpagination)
        {
            $minichatt->assign(array(
                "MINICHAT_DIV_AJAX_BEGIN" => "<div id=\"minichatajax\">",
                "MINICHAT_DIV_AJAX_END"   => "</div>",
                "MINICHAT_LINK"           => "<a href=\"plug.php?e=minichat\">".$L['minichat_history']."</a>",
                ));
        }
        if ($ajax && !$ajaxpagination)
        { $minichatt->assign("MINICHAT_DIV_AJAX_BEGIN", '<script type="text/javascript">
//<![CDATA[
mini.previewAutorefresh = false;
mini.previewParserPath = "plug.php?r=markitup&x=CAB73666";
$(document).ready(function() {$("textarea.minieditor").markItUp(mini);});
//]]></script>');
        }
        if(!$ajaxpagination)
        {
            $minichatt->assign(array(
                "MINICHAT_DIV_AJAXPAGINATION_BEGIN" => "<div id=\"minichatajaxpagination\">",
                "MINICHAT_DIV_AJAXPAGINATION_END"   => "</div>",
                ));
        }
        if($template!='_MAIN')
        {$autoreloadtime = $cfg['plugin']['minichat']['minichat_recenttimer'];}
        else
        {$autoreloadtime = $cfg['plugin']['minichat']['minichat_timer'];}
        if(!isset($_GET['chatd']) && $autoreloadtime && !$ajax)
        {
            $autoreload="<script type=\"text/javascript\">
             var time=".$autoreloadtime."*1000;
             var interval;
            interval = setInterval(\"ajaxSend({url: '".sed_url('plug', 'r=minichat')."', data: '&pag=1".$panelchat."', divId: 'minichatajaxpagination', errMsg: '".$L['ajaxSenderror']."'})\", time);
            </script>";
            $minichatt->assign("MINICHAT_TIMER", $autoreload);
        }
        if(isset($_GET['chatd']))
        {
            $autoreload="<script type=\"text/javascript\">clearInterval(interval);</script>";
            $minichatt->assign("MINICHAT_TIMER", $autoreload);
        }
    }
    $minichatt->parse("MINICHAT".$template);
}
/**
 * ckeck for errors minichat message
 * add mew message or delete old message
 *
 * @return nothing
 */
function minichat_action()
{
    global $usr, $error_string, $cfg, $db_com, $L, $shoutbox, $sys;
    list($usr['auth_read_com'], $usr['auth_write_com'], $usr['isadmin_com']) = sed_auth('plug', 'minichat');

    $shoutbox = trim(sed_import('shoutbox','P','HTM'));

    if (!empty($shoutbox) && $usr['auth_write_com'])
    {
        sed_shield_protect();
        $poster_name = $usr['name'];
        $poster_id = $usr['id'];
        $error_string .= (mb_strlen($shoutbox)<$cfg['plugin']['minichat']['minichat_minchars']) ? $L['minichat_short_message']."<br />" : '';
        $error_string .= (mb_strlen($shoutbox)>$cfg['plugin']['minichat']['minichat_maxchars']) ? $L['minichat_long_message']."<br />" : '';
        $error_string .= ($poster_id==0) ? $L['minichat_nouser_message']."<br />" : '';
        $error_string .= (!$usr['auth_write_com'])  ? $L['minichat_nowriterights']."<br />" : '';
        if (empty($error_string))
        {
            $sql = sed_sql_query("INSERT INTO $db_com (com_code, com_author, com_authorid, com_text, com_date,com_isspecial) VALUES ('chat', '".sed_sql_prep($poster_name)."', '".(int)$poster_id."', '".sed_sql_prep($shoutbox)."', '".$sys['now_offset']."', '1')");
            sed_shield_update(20,"New minichat message");
            $shoutbox='';
        }
    }

    $a = sed_import('a','G','TXT');
    if ($a=='delete' && $usr['isadmin_com'])
    {
        sed_check_xg();
        $deleteitem = sed_import('delitem','G','INT');
        $sql = sed_sql_query("DELETE FROM $db_com WHERE com_id='$deleteitem'");
        sed_log("Deleted minichat message #".$deleteitem."",'adm');
    }
}

?>

12>>>