1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Linkwords was adding spaces before words. Added some basic css.

This commit is contained in:
Cameron
2015-04-05 12:29:53 -07:00
parent 722ffccc7d
commit bb5b34b15d
3 changed files with 20 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
<?php
if(USER_AREA === true) // Don't include in admin area.
{
e107::css('linkwords','linkwords.css');
}

View File

@@ -92,7 +92,7 @@ class e_tohtml_linkwords
if (!vartrue($temp)) if (!vartrue($temp))
{ // Either cache disabled, or no info in cache (or error reading/processing cache) { // Either cache disabled, or no info in cache (or error reading/processing cache)
$link_sql = new db; $link_sql = new db;
if($link_sql -> db_Select("linkwords", "*", "linkword_active!=1")) if($link_sql ->select("linkwords", "*", "linkword_active!=1"))
{ {
$this->lw_enabled = TRUE; $this->lw_enabled = TRUE;
while ($row = $link_sql->db_Fetch()) while ($row = $link_sql->db_Fetch())
@@ -217,12 +217,12 @@ class e_tohtml_linkwords
if ($this->lwAjaxEnabled) if ($this->lwAjaxEnabled)
{ {
$linkrel[] = 'linkwordID::'.$this->LinkID[$first]; $linkrel[] = 'linkwordID::'.$this->LinkID[$first];
$lwClass[] = 'lw_ajax'; $lwClass[] = 'lw_ajax lw-ajax';
} }
else else
{ {
$tooltip = " title='{$this->tip_list[$first]}' "; $tooltip = " title='{$this->tip_list[$first]}' ";
$lwClass[] = 'lw_tip'; $lwClass[] = 'lw_tip lw-tip';
} }
} }
if ($this->link_list[$first]) if ($this->link_list[$first])
@@ -232,7 +232,7 @@ class e_tohtml_linkwords
{ {
$linkwd = " href='".$newLink."' "; $linkwd = " href='".$newLink."' ";
if ($this->ext_list[$first]) { $linkrel[] = 'external'; } // Determine external links if ($this->ext_list[$first]) { $linkrel[] = 'external'; } // Determine external links
$lwClass[] = 'lw_link'; $lwClass[] = 'lw_link lw-link';
} }
} }
if (!count($lwClass)) if (!count($lwClass))
@@ -243,9 +243,11 @@ class e_tohtml_linkwords
{ {
$linkwd .= " rel='".implode(' ',$linkrel)."'"; $linkwd .= " rel='".implode(' ',$linkrel)."'";
} }
// This splits the text into blocks, some of which will precisely contain a linkword // This splits the text into blocks, some of which will precisely contain a linkword
$split_line = preg_split('#\b('.$lw.')\b#i'.$this->utfMode, $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); // *utf (selected) $split_line = preg_split('#\b('.$lw.')\b#i'.$this->utfMode, $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); // *utf (selected)
$class = "class='".implode(' ',$lwClass)."' "; $class = "class='".implode(' ',$lwClass)."' ";
foreach ($split_line as $sl) foreach ($split_line as $sl)
{ {
if ($tp->uStrToLower($sl) == $lw) // We know the linkword is already lower case // *utf if ($tp->uStrToLower($sl) == $lw) // We know the linkword is already lower case // *utf

View File

@@ -0,0 +1,4 @@
a.lw-tip { cursor: help }