Nipid

Asendada keelefailis tekst pildiga

Asendage failis en.php, et.php vmm koodilõik:

$tx['menu']['mailform']="Mailform";
$tx['menu']['print']="Print view";
$tx['menu']['sitemap']="Sitemap";

selle koodilõiguga

$tx['menu']['mailform']="<img border='0' alt='Mail' src='images/email.png' />";
$tx['menu']['print']="<img border='0' alt='Print' src='images/print.png' />";
$tx['menu']['sitemap']="<img border='0' alt='Sitemap' src='images/sitemap.png' />";

 

Asendada .gif lipufaili tüüp .png failitüübiga (CM Simple XH 1.5.6)

Asendage failis cms.php koodilõik:

function languagemenu() {
global $pth, $cf, $sl;
if(!file_exists('./cmsimplesubsite.htm')){ // for subsites
$t = '';
$r = array();
$fd = @opendir($pth['folder']['base']);
while (($p = @readdir($fd)) == true ) {
if (@is_dir($pth['folder']['base'].$p)) {
if (preg_match('/^[A-z]{2}$/', $p)
&& !file_exists($pth['folder']['base'] . $p . '/cmsimplesubsite.htm'))
{
$r[] = $p;
}
}
}
if ($fd == true)closedir($fd); if(count($r) == 0)return ''; if($cf['language']['default'] != $sl)$t .= '<a href="'.$pth['folder']['base'].'">'.tag('img src="'.$pth['folder']['flags'].$cf['language']['default'].'.gif" alt="'.$cf['language']['default'].'" title="&nbsp;'.$cf['language']['default'].'&nbsp;" class="flag"').'</a> '; $v = count($r); for($i = 0;
$i < $v;
$i++) {
if ($sl != $r[$i]) {
if (is_file($pth['folder']['flags'].'/'.$r[$i].'.gif')) {
$t .= '<a href="'.$pth['folder']['base'].$r[$i].'/">'.tag('img src="'.$pth['folder']['flags'].$r[$i].'.gif" alt="'.$r[$i].'" title="&nbsp;'.$r[$i].'&nbsp;" class="flag"').'</a> ';
} else {
$t .= '<a href="'.$pth['folder']['base'].$r[$i].'/">['.$r[$i].']</a> ';
}
}
}
return ''.$t.'';

selle koodilõiguga

// Muudetud kood
function languagemenu() {
global $pth, $cf, $sl;
if(!file_exists('./cmsimplesubsite.htm')){ // for subsites
$t = '';
$r = array();
$fd = @opendir($pth['folder']['base']);
while (($p = @readdir($fd)) == true ) {
if (@is_dir($pth['folder']['base'].$p)) {
if (preg_match('/^[A-z]{2}$/', $p)
&& !file_exists($pth['folder']['base'] . $p . '/cmsimplesubsite.htm'))
{
$r[] = $p;
}
}
}
if ($fd == true)closedir($fd); if(count($r) == 0)return ''; if($cf['language']['default'] != $sl)$t .= '<a href="'.$pth['folder']['base'].'">'.tag('img src="'.$pth['folder']['flags'].$cf['language']['default'].'.png" alt="'.$cf['language']['default'].'" title="&nbsp;'.$cf['language']['default'].'&nbsp;" class="flag"').'</a> '; $v = count($r); for($i = 0;
$i < $v;
$i++) {
if ($sl != $r[$i]) {
if (is_file($pth['folder']['flags'].'/'.$r[$i].'.png')) {
$t .= '<a href="'.$pth['folder']['base'].$r[$i].'/">'.tag('img src="'.$pth['folder']['flags'].$r[$i].'.png" alt="'.$r[$i].'" title="&nbsp;'.$r[$i].'&nbsp;" class="flag"').'</a> ';
} else {
$t .= '<a href="'.$pth['folder']['base'].$r[$i].'/">['.$r[$i].']</a> ';
}
}
}
return ''.$t.'';
}

 

Asendada nupp Otsi pildiga (CM Simple XH 1.5.6)

Asendage failis cms.php:

function searchbox() {
global $sn, $tx;
return '<form action="' . $sn . '" method="get">' . "\n"
. '<div id="searchbox">' . "\n"
. tag('input type="text" class="text" name="search" size="12"') . "\n"
. tag('input type="hidden" name="function" value="search"') . "\n" . ' '
. tag('input type="submit" class="submit" value="' . $tx['search']['button'] . '"') . "\n"
. '</div>' . "\n" . '</form>' . "\n";
}

selle koodilõiguga

// Muudetud kood
function searchbox() {
global $sn, $tx;
return '<form action="' . $sn . '" method="GET">' . "\n"
. '<div id="searchbox">' . "\n"
. tag('input type="text" class="searchbox_submit" name="search" size="12"') . "\n"
. tag('input type="hidden" name="function" value="search"') . "\n" . ' '
. tag('input type="image" class="submit" value="Go" src = "images/search.png"') . "\n"
. '</div>' . "\n" . '</form>' . "\n";
}

 

Kuidas kuvada väikest ikooni vastavalt faili/lingi tüübile

Lisage koodilõik malli stiililehe faili stylesheet.css.

Uues aknas avanev link

a[target="_blank"] {
line-height:16px; /* vastavalt pisipildi kõrgusele */
padding-right:18px; /* siin saad määrata kaugust tekstist */
background:url(../../images/pilt.png) center left no-repeat; /* siin saad määrata pisipildi asukohta */
}

Lisada võib veel

display:inline-block;

Kui link sisaldab target="_blank", siis selle lingi kõrvale kuvatakse pilt.

Pisipilt failiformaatide kõrval

a[href$='.pdf'] {
line-height:16px;
padding-right:18px;
background: transparent url(../../images/pilt.png) center left no-repeat;
}

Lisada võib veel

display:inline-block;

Näiteks veel failitüüpe

a[href$='.txt'], a[href$='.docx'], a[href$='.xlsx'], a[href$='.doc'], a[href$='.xls'], a[href$='.swf'], a[href$='.fla']

Välisele ja e-posti lingile

a[href^='http:'] {
line-height:16px;
padding-left:18px;
background:transparent url(../../images/pilt.png) center left no-repeat;
}

a[href^='mailto:'] {
line-height:16px;
padding-left:18px;
background:transparent url(../../images/pilt.png) center left no-repeat;
}

Lisada võib veel

display:inline-block;

 

Last Update / Viimati uuendatud

Kui leht näitab viimati uuenduse kuupäeva ingliskeelsena, siis asenda cms.php failis:

function lastupdate($br = NULL, $hour = NULL) { // changed by LM CMSimple_XH 1.1
global $tx, $pth;
$t = $tx['lastupdate']['text'] . ':';
if (!(isset($br)))
$t .= tag('br'); // else
$t .= ' ';
return $t . date($tx['lastupdate']['dateformat'], filemtime($pth['file']['content']) + (isset($hour) ? $hour * 3600 : 0));
}

selle koodilõiguga

function lastupdate($br) {global $tx, $pth;
$t = $tx['lastupdate']['text'].':';
if (!(isset ($br)))$t .= tag('br');
else $t .= ' ';
$date_de = $t;
$date_de .= date("j. ", filemtime($pth['file']['content']));
$monate_de = array(1=>"jaanuar",2=>"veebruar",3=>"märts",4=>"aprill",5=>"mai",6=>"juuni",
7=>"juuli",8=>"august",9=>"september",10=>"oktoober",11=>"november",
12=>"detsember");
$monat = date("n", filemtime($pth['file']['content']));
$date_de .= $monate_de[$monat];
$date_de .= date(" Y H:i:s", filemtime($pth['file']['content']));return $date_de;
}

 

 

 
 
 
 
 
Alo Tänavots