cotonti.com : Minichat https://www.cotonti.com Laatste forum onderwerpen Cotonti en Fri, 30 Jan 2026 00:52:28 -0000 Twiebie Thanks in advance, esclkm!

Added 1 month later:

#31216 esclkm:

I will try after  2.11

Bump.

Any updates on this?

]]>
Wo, 02 Nov 2011 19:45:23 -0000
esclkm I will try after  2.11

]]>
Vr, 28 Okt 2011 13:57:15 -0000
Twiebie I've got a few problems with the Siena version of Minichat.

  • The pagination in the minichat panel (on index.tpl) doesn't work. When you click on it, it goes to the main minichat page instead of refreshing the minichat panel to the next page.
  • Another thing that doesn't seem to work is an error message when somebody enters too much (or not enough) text. When the limit is set in the config it blocks the input but doesn't show an error message.
  • Also Markup parser doesn't work in the Minichat when set to HTML. It works when bbcode is selected but then HTML parsing won't work anymore on other parts of the website.

I've spend some time browsing through the code but can't figure it out, hopefully some of you can.

Tnx.

Added 1 week later:

Anyone? ^

Added 1 week later:

Hate to bump it again but i've spend hours trying to figure these problems out.

Maybe esclkm can shine some light on this?

]]>
Wo, 12 Okt 2011 08:30:18 -0000
esclkm write special plugin)))

]]>
Ma, 10 Okt 2011 19:52:57 -0000
alphaphoenix Is there a way to easily have a private chat with the admin initiated by the user?

]]>
Ma, 10 Okt 2011 19:31:21 -0000
Kingsley # esclkm : No... I think that it is not right... If you want I can do it optional

If you could, please.. I think desc is better]]>
Wo, 08 Apr 2009 04:51:05 -0000
esclkm Wo, 08 Apr 2009 01:49:04 -0000 DemptD
]]>
Wo, 08 Apr 2009 00:19:15 -0000
Kingsley
Could you embed DemptD changes in the next release?]]>
Wo, 08 Apr 2009 00:11:02 -0000
DemptD # esclkm : delete this string
           if (!isset($_GET['chatd']) && $totalitems!=0)  { $d = $perpage * (ceil($totalitems / $perpage)-1); }

Thank you! Worked great :)]]>
Di, 07 Apr 2009 05:19:27 -0000
esclkm
           if (!isset($_GET['chatd']) && $totalitems!=0)  { $d = $perpage * (ceil($totalitems / $perpage)-1); }
]]>
Di, 07 Apr 2009 04:59:08 -0000
DemptD
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=https://www.cotonti.com/\"".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=https://www.cotonti.com/\"".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=https://www.cotonti.com/\"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');
    }
}

?>

]]>
Di, 07 Apr 2009 04:50:21 -0000
esclkm Because I use in this plugin only standart cotonti scripts/]]> Wo, 01 Apr 2009 03:06:06 -0000 TwistedGA Wo, 01 Apr 2009 02:19:11 -0000 esclkm Wo, 01 Apr 2009 01:49:43 -0000 TwistedGA Wo, 01 Apr 2009 01:28:52 -0000 Kingsley # 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..]]>
Zo, 29 Mrt 2009 15:23:06 -0000
DemptD Zo, 29 Mrt 2009 02:43:41 -0000 esclkm Zo, 29 Mrt 2009 02:23:57 -0000 DemptD
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	-
]]>
Zo, 29 Mrt 2009 01:44:39 -0000
esclkm minichat_27.rar]]> Zo, 29 Mrt 2009 01:29:03 -0000 TwistedGA Zo, 29 Mrt 2009 00:20:08 -0000 esclkm Za, 28 Mrt 2009 23:58:30 -0000 DemptD # esclkm : yes I know this bug. i will update plugin tomorrow.

Thank you :)

Have you fixed it?]]>
Zo, 22 Mrt 2009 05:14:15 -0000
esclkm Zo, 22 Mrt 2009 05:12:38 -0000 DemptD
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]]>
Zo, 22 Mrt 2009 03:41:31 -0000