What's new? | Help | Directory | Sign in
Google
glossword
a dictionary management system
  
  
  
    
Search
for
Updated May 06 (5 days ago) by dmitry.shilnikov
KB749120513eng  
Modification: Colorful abbreviations

Colorful abbreviations

mod-version

mod-level:

product-version:

installation:

Open
/inc/query_storage_global-mysql410.php
Find
'get-abbr-code' => 'SELECT a.id_abbr, b.abbr_short, b.abbr_long
			FROM gw_abbr AS a, gw_abbr_phrase AS b
			WHERE a.id_abbr = b.id_abbr
			AND a.is_active = "1"
			AND b.id_lang = "%s"
			%s
		',
Replace with
'get-abbr-code' => 'SELECT a.id_group, a.id_abbr, b.abbr_short, b.abbr_long
			FROM gw_abbr AS a, gw_abbr_phrase AS b
			WHERE a.id_abbr = b.id_abbr
			AND a.is_active = "1"
			AND b.id_lang = "%s"
			%s
		',
Open
/lib/class.render.php
Find
while (list($k, $arV) = each($arSql))
{

	if ($arDictParam['is_abbr_long'])
	{
		$tmp['abbr0'][sprintf('%03d', $arV['id_abbr'])] = $arV['abbr_long'];
		$tmp['abbr1'][sprintf('%03d', $arV['id_abbr'])] = $arV['abbr_short'];
	}
	else
	{
		$tmp['abbr1'][sprintf('%03d', $arV['id_abbr'])] = $arV['abbr_long'];
		$tmp['abbr0'][sprintf('%03d', $arV['id_abbr'])] = $arV['abbr_short'];
	}

}
Replace with
/* Color by default */
$ar_abbr_groups = array('' => 1);
while (list($k, $arV) = each($arSql))
{
	$id_abbr = sprintf('%03d', $arV['id_abbr']);
	if ($arDictParam['is_abbr_long'])
	{
		$tmp['abbr0'][$id_abbr] = $arV['abbr_long'];
		$tmp['abbr1'][$id_abbr] = $arV['abbr_short'];
	}
	else
	{
		$tmp['abbr1'][$id_abbr] = $arV['abbr_long'];
		$tmp['abbr0'][$id_abbr] = $arV['abbr_short'];
	}
	$ar_abbr_groups[$id_abbr] = $arV['id_group'];
}
Find
if (($tmp['str'] != '') || $tmp['attributes'][$chK] != '--')
{
	$tagname = 'tag_'.$tag;
	$tmp['ar_compiled'][$i] = ($tmp['str_title'] != '') ? '<'.$this->$tagname.$tmp['str_title'].'>' : '';
	$tmp['ar_compiled'][$i] .= $tmp['str_acronym'];
	$tmp['ar_compiled'][$i] .= ($tmp['str_title'] != '') ? '</'.$this->$tagname.'>' : '';
	$tmp['ar_compiled'][$i] .= ($tmp['str'] != '') ? $postlang_name. '<span class="'.$tag.'">' . $tmp['str'] . '</span>' : '';
}
Replace with
if (($tmp['str'] != '') || $tmp['attributes'][$chK] != '--')
{
	$tagname = 'tag_'.$tag;
	$class_name = $tag.'-'.$ar_abbr_groups[$tmp['attributes'][$chK]];
	$tmp['ar_compiled'][$i] = ($tmp['str_title'] != '') ? '<'.$this->$tagname.$tmp['str_title'].'>' : '';
	$tmp['ar_compiled'][$i] .= $tmp['str_acronym'];
	$tmp['ar_compiled'][$i] .= ($tmp['str_title'] != '') ? '</'.$this->$tagname.'>' : '';
	$tmp['ar_compiled'][$i] .= ($tmp['str'] != '') ? $postlang_name. '<span class="'.$class_name.'">' . $tmp['str'] . '</span>' : '';
}
Open
/gw_temp/t/{theme name}/style.css
Find
.abbr  { margin: 0em; padding: 0; color: #777; background: transparent; font: bold 100% sans-serif; }
.trns { color: #b9906e; background: transparent; font: bold 100% "arial unicode ms",arial,sans-serif; }
Replace with
.abbr-1,.abbr-2,.abbr-3,.abbr-5  { margin: 0; padding: 0; font: bold 100% sans-serif; }
.abbr-1 { color: #e30700; }
.abbr-2 { color: #9b67c7; }
.abbr-3 { color: #5bbf3f; }
.abbr-5 { color: #47a7a3; }
.trns-4 { color: #b9906e; background: transparent; font: bold 100% "arial unicode ms",arial,sans-serif; }

The end.