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

You are not logged in.

Announcement

#1 2015-05-17 10:56:52

Emsanator
Member
Registered: 2015-05-17
Posts: 4

Code edit with CSS

Hello!
I want to change the Chat link of design but It does not work properly
How can I do this?

opened_chats_js.tpl.php

Orginal Code:

[== PHP ==]
$chatsOpen = CSCacheAPC::getMem()->getArray('lhc_open_chats');
if (!empty($chatsOpen)){
	$chats = erLhcoreClassChat::getList(array('filterin' => array('id' => $chatsOpen)));

	// Delete any old chat if it exists
	$deleteKeys = array_diff($chatsOpen, array_keys($chats));
	foreach ($deleteKeys as $chat_id) {
		CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', $chat_id);
	}

	foreach ($chats as $chat ){
		if (erLhcoreClassChat::hasAccessToRead($chat)){
			echo "lhinst.startChat('$chat->id',$('#tabs'),'".erLhcoreClassDesign::shrt($chat->nick,10,'...',30,ENT_QUOTES)."');";
		} else {
			CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', $chat->id);
		}
	}
}

changed:

[== PHP ==]
$chatsOpen = CSCacheAPC::getMem()->getArray('lhc_open_chats');
if (!empty($chatsOpen)){
	$chats = erLhcoreClassChat::getList(array('filterin' => array('id' => $chatsOpen)));

	// Delete any old chat if it exists
	$deleteKeys = array_diff($chatsOpen, array_keys($chats));
	foreach ($deleteKeys as $chat_id) {
		CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', $chat_id);
	}

	foreach ($chats as $chat ){
		if (erLhcoreClassChat::hasAccessToRead($chat)){
			echo "lhinst.startChat('$chat->id',$('#tabs'),'<a class='button red' ".erLhcoreClassDesign::shrt($chat->nick,10,'...',30,ENT_QUOTES)." </a> ');";   /* THIS LINE */
		} else {
			CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', $chat->id);
		}
	}
}

Where am I doing wrong?
Thank you!

Offline

#2 2015-05-18 04:41:01

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Code edit with CSS

It won't work I can only say that. The thing you passed always must be a text. Try do not change a code but instead style it with css.

Offline

Board footer