Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2017-06-09 18:43:17

alex43210
Member
Registered: 2017-05-14
Posts: 11

Problems with overring admin chat page

I'll need to get information about user by mine own software (and - in some cases I'll need to make it during conversation, not at start).

So I'm planing to make next:

  • create custom extension

  • add view that call mine software and return JSON with data to show (already maked)

  • override "adminchat.tpl.php"

  • add mine script to overriden "adminchat.tpl.php"

So mine extension have structure like next:

[== Undefined ==]
-extension
--loaduserinfo
---design
----loaduserinfotheme
-----tpl
------lhchat
-------adminchat.tpl.php
---doc
---js
----adminchat.js
---modules
----lhloaduserinfo
-----loaduserinfo.php
-----module.php
---settings
----settings.ini.php

I enabled this extension in settings.ini.php and cleaned cache (both "clean cache" and admin and removing cache/compiledtemplates content).
As I can see now - custom view works http://176.9.113.93/index.php/loaduseri … 9876707631 (just proof for enabled extension).

adminchat.tpl.php have next view:

[== PHP ==]
<div class="row">
    <div class="col-sm-7 chat-main-left-column" id="chat-main-column-<?php echo $chat->id;?>">
        <a title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chat','Show/Hide right column')?>" href="#" class="material-icons collapse-right" onclick="lhinst.processCollapse('<?php echo $chat->id;?>')">chevron_right</a>
        <?php include(erLhcoreClassDesign::designtpl('lhchat/part/above_messages_block.tpl.php')); ?>

        <div class="message-block">
            <div class="msgBlock msgBlock-admin" id="messagesBlock-<?php echo $chat->id?>">
                <?php
                $LastMessageID = 0;
                $messages = erLhcoreClassChat::getChatMessages($chat->id); ?>
                <?php include(erLhcoreClassDesign::designtpl('lhchat/syncadmin.tpl.php'));?>
                <?php if (isset($msg)) {	$LastMessageID = $msg['id'];} ?>

                <?php if ($chat->user_status == 1) : ?>
                    <?php include(erLhcoreClassDesign::designtpl('lhchat/userleftchat.tpl.php')); ?>
                <?php elseif ($chat->user_status == 0) : ?>
                    <?php include(erLhcoreClassDesign::designtpl('lhchat/userjoined.tpl.php')); ?>
                <?php endif;?>

            </div>

        </div>

        <?php include(erLhcoreClassDesign::designtpl('lhchat/part/above_textarea.tpl.php')); ?>

        <div class="user-is-typing" id="user-is-typing-<?php echo $chat->id?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chat','User is typing now...')?></div>

        <div class="message-container-admin">
            <textarea placeholder="<?php if ($chat->user_id != erLhcoreClassUser::instance()->getUserID()) : ?><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chat','You are not chat owner, type with caution')?><?php endif;?>" class="form-control form-group<?php if ($chat->user_id != erLhcoreClassUser::instance()->getUserID()) : ?> form-control-warning<?php endif;?>" rows="2" <?php if ($chat->status == erLhcoreClassModelChat::STATUS_CLOSED_CHAT) : ?>readonly="readonly"<?php endif;?> name="ChatMessage" id="CSChatMessage-<?php echo $chat->id?>"></textarea>
        </div>

        <?php include(erLhcoreClassDesign::designtpl('lhchat/part/after_text_area_block.tpl.php')); ?>

    </div>
    <div class="col-sm-5 chat-main-right-column" id="chat-right-column-<?php echo $chat->id;?>">
        <?php include(erLhcoreClassDesign::designtpl('lhchat/chat_tabs/chat_tabs_container.tpl.php')); ?>
    </div>
</div>

<script type="text/javascript">lhinst.addAdminChatFinished(<?php echo $chat->id;?>,<?php echo $LastMessageID?>,<?php echo json_encode($arg)?>);</script>
<script>alert("Hello, world!");</script>
<script src="/extension/loaduserinfo/js/adminchat.js"></script>

So - at admin chat page I must see "Hello, world!" message, but I see nothing (and no errors in console).
1497033773_.jpg

UPD. Silly problem - I just visited testing host, not development.

Last edited by alex43210 (2017-06-09 18:50:38)

Offline

#2 2017-06-09 18:57:00

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: Problems with overring admin chat page

Hi alex43210
thank you for your post. Please remember that this is an open source project... I do not have the knowledge for fix your specific issue.
Seems you are trying to customize deeply live helper chat as you are overriding admin page as for the title of your post.
Sorry I cannot help you with that. You can consider the commercial support: more info in my forum signature.


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

#3 2017-06-09 19:09:09

alex43210
Member
Registered: 2017-05-14
Posts: 11

Re: Problems with overring admin chat page

As I written in the update - it was my specific problem, and I solved it. I deployed code to one server, but tested in other :-)
So seems like it's better to close or remove this topic.

Sorry for the inconvenience.

Offline

#4 2017-06-09 19:26:24

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: Problems with overring admin chat page

Hi alex43210,
no inconvenience, users and you are welcome to use the forum for asking help.
I AM trying to do my best on what I can and I do this in my free time.

You are welcome and feel free to use the forum again if you need asking question:
if I can I will assist you, if I cannot do I will tell you  smile

Wish you all the best time.


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

Board footer