<?php
/**
* @author Matej Krhin
* @copyright 2008
*/
function showForm($mode){
global $userdata, $zs, $aidlink, $locale;
if($mode){
if(!iUSER)
return "<td valign='top' class='logInForm'><table cellpadding='0' cellspacing='0' width='100%'><tr><td width='210px'>
<form name='loginform' method='post' action='".FUSION_SELF."'>
<input type='text' name='user_name' class='userbox' style='width:73px' />
<input type='password' name='user_pass' class='passbox' style='width:73px' /></td><td>
<input type='submit' name='login' value='' class='submitgumb' border='0px' />
</form></td></tr></table><p>
<a href='".BASEDIR."lostpassword.php'>Pamiršai slaptažodį?</a> <a href='".BASEDIR."register.php'>Registracija</a>
</td>";
if(iUSER)
return "<td valign='top' class='logInForm'>Jūsų profilis, <b><a href='".BASEDIR."edit_profile.php'>".$userdata['user_name']."</a>.</b>
<br>Turiš ".countMessages().($zs != 0 ? "!" : ".")."<br>
<a href='".BASEDIR."members.php' class='side'>".$locale['global_122']."</a><br>
".(iADMIN ? "<a href='".ADMIN."index.php".$aidlink."' class='side'>".$locale['global_123']."</a><br>" : "")."
<a href='".BASEDIR."setuser.php?logout=yes' class='side'>".$locale['global_124']."</a>
</td>";
}
else
return "";
}
function showBanner($mode) {
if($mode)
return "<td align='center'><!-- SoloFM - muzika gerai nuotaikai... <a href='http://www.solofm.too.lt' target='_blank'><span style='color:005C5B'>www.solofm.too.lt</span></a> -->
<script type='text/javascript'>
_iprom_s='qnphtoaioblqgicf';
_iprom_d='468x60';
</script>
<script type='text/javascript' src='http://solofm.too.lt/banner.js'>
</script>
<!-- SoloFM - muzika gerai nuotaikai... <a href='http://www.solofm.too.lt' target='_blank'><span style='color:005C5B'>www.solofm.too.lt</span></a> --></td>";
else return ""; //vrnemo prazno polje
}
function countMessages(){
global $userdata;
$zs = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
if($zs == 1) $zs .= " naują <a href='".BASEDIR."messages.php'>žinutę</a>";
if($zs == 2) $zs .= " naujas <a href='".BASEDIR."messages.php'>žinutes</a>";
if($zs == 3 || $zs == 4) $zs .= " naujas <a href='".BASEDIR."messages.php'>žinutes</a>";
if($zs >= 5 || $zs == 0) $zs .= " naujų <a href='".BASEDIR."messages.php'>žinučių</a>";
return $zs;
}
function showTools(){
return "<table cellpadding='0' cellspacing='0' class='tools'><tr>
<td width='50px'><a href='".THEME."settings.php?font=zmanjsaj' alt='Smaller font' title='Smaller font'><img src='".THEME."images/down.png' border='0'></a> <a href='".THEME."settings.php' alt='Reset font' title='Reset font'><img src='".THEME."images/reset.png' border='0'></a> <a href='".THEME."settings.php?font=povecaj' alt='Bigger font' title='Bigger font'><img src='".THEME."images/up.png' border='0'></a></td>
<td class='ozadjeiskanja'>
<form name='searchform' method='get' action='".BASEDIR."search.php'>
<input type='textbox' value='' name='stext' class='searchbox' width='90px'></td><td class='gumbiskanja'>
<input type='image' name='search' src='".THEME."images/najdi.png'> </td></tr>
</form></table>";
}
function hr(){
return "<table cellpadding='0' cellspacing='0' border='0px' width='100%'>
<tr>
<td height='13px' align='center'><img src='".THEME."images/hr.png' width='171px' height='11px' alt='' style='border: 0px;'></td>
</tr>
</table>";
}
function returnDate($stamp,$mode){
global $settings;
$dan = strftime("%d",$stamp+($settings['timeoffset']*3600));
$dant = strftime("%w",$stamp+($settings['timeoffset']*3600));
$mesec = strftime("%m",$stamp+($settings['timeoffset']*3600));
$leto = strftime("%y",$stamp+($settings['timeoffset']*3600));
$letow = strftime("%Y",$stamp+($settings['timeoffset']*3600));
switch ($dant){
case 0 : $dant = "Sekmadienis"; break;
case 1 : $dant = "Pirmadienis"; break;
case 2 : $dant = "Antradienis"; break;
case 3 : $dant = "Trečiadienis"; break;
case 4 : $dant = "Ketvirtadienis"; break;
case 5 : $dant = "Penktadienis"; break;
case 6 : $dant = "Šeštadienis"; break;
}
switch ($mesec){
case 01 : $mesec = "Sausis"; break;
case 02 : $mesec = "Vasaris"; break;
case 03 : $mesec = "Kovas"; break;
case 04 : $mesec = "Balandis"; break;
case 05 : $mesec = "Gegužė"; break;
case 06 : $mesec = "Birželis"; break;
case 07 : $mesec = "Liepa"; break;
case 08 : $mesec = "Rugpjūtis"; break;
case 09 : $mesec = "Rugsėjis"; break;
case 10 : $mesec = "Spalis"; break;
case 11 : $mesec = "Lapkritis"; break;
case 12 : $mesec = "Gruodis"; break;
}
if($mode == 1)
return "$dan. $mesec $leto";
if($mode == 2)
return "$dant, $dan. $mesec $letow";
}
function avtornovice($info) {
global $locale;
$res = "<i><a href='profile.php?lookup=".$info['user_id']."' class='avtor'>".$info['user_name']."</a>, ";
$res .= returnDate($info['news_date'],1)."</i>";
return "<!--news_poster-->".$res;
}
function opcijenovice($info) {
global $locale; $res = "";
if (!isset($_GET['readmore']) && $info['news_ext'] == "y") $res = "<a href='news.php?readmore=".$info['news_id']."'>".$locale['global_072']."</a> ".THEME_BULLET;
if ($info['news_allow_comments']) $res .= " <a href='news.php?readmore=".$info['news_id']."#comments'>".$info['news_comments'].($info['news_comments'] == 1 ? $locale['global_073b'] : $locale['global_073'])."</a> ".THEME_BULLET;
if ($info['news_ext'] == "y" || $info['news_allow_comments']) $res .= " ".$info['news_reads'].$locale['global_074']." ".THEME_BULLET."\n";
$res .= " <a href='print.php?type=N&item_id=".$info['news_id']."'><img src='".get_image("printer")."' alt='".$locale['global_075']."' style='vertical-align:middle;border:0;' /></a>\n";
return "<!--news_opts-->".$res;
}
function dodatno($item_type, $item_id) {
global $locale, $aidlink; $res = "";
if ($item_type == "N") {
if (iADMIN && checkrights($item_type)) { $res = "<!--article_news_opts--> ".THEME_BULLET." <a href='".ADMIN."news.php".$aidlink."&action=edit&news_id=".$item_id."'><img src='".get_image("edit")."' alt='".$locale['global_076']."' title='".$locale['global_076']."' style='vertical-align:middle;border:0;' /></a>\n"; }
} elseif ($item_type == "A") {
if (iADMIN && checkrights($item_type)) { $res .= "<!--article_admin_opts--> · <a href='".ADMIN."articles.php".$aidlink."&action=edit&article_id=".$item_id."'><img src='".get_image("edit")."' alt='".$locale['global_076']."' title='".$locale['global_076']."' style='vertical-align:middle;border:0;' /></a>\n"; }
}
return $res;
}
function navigacija(){
global $fusion_page_title, $locale;
$i = 0; $res = "";
$sres = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' ORDER BY link_order");
if (dbrows($sres) != 0) {
while($sdata = dbarray($sres)) {
if (preg_match("/\b".$sdata['link_name']."\b/i", $fusion_page_title)) $clas = "id='curent'";
//elseif( $sdata['link_name'] == "Domov" && )
else {
if($i == 0) $clas = "id=''";
elseif($i == 1) $clas = "id='pink'";
elseif($i == 2) $clas = "id='green'";
elseif($i == 3) $clas = "id='red'";
elseif($i == 4) $clas = "id='orange'";
elseif($i == 5) $clas = "id=''";
elseif($i == 6) $clas = "id='pink'";
elseif($i == 7) $clas = "id='green'";
elseif($i == 8) $clas = "id='red'";
elseif($i == 9) $clas = "id='orange'";
elseif($i == 10) $clas = "id=''";
elseif($i == 11) $clas = "id='pink'";
elseif($i == 12) $clas = "id='green'";
elseif($i == 13) $clas = "id='red'";
elseif($i == 14) $clas = "id='orange'";
}
if (checkgroup($sdata['link_visibility'])) {
if ($sdata['link_url']!="---") {
$link_target = $sdata['link_window'] == "1" ? " target='_blank'" : "";
if (strstr($sdata['link_url'], "http://") || strstr($sdata['link_url'], "https://")) {
$res .= "<li $clas><a href='".$sdata['link_url']."'><span>".$sdata['link_name']."</span></a></li>";
} else {
$res .= "<li $clas><a href='".BASEDIR.$sdata['link_url']."'><span>".$sdata['link_name']."</span></a></li>";
}
}
$i++;
}
}
}
if ($i != 0) { return "<div id='navigacija'><ul>$res</ul></div>"; } else { return "prazno"; }
}
function showFontTools(){
return "<div id='fonts'><a href='".THEME."settings.php?font=zmanjsaj' alt='Zmanjšaj pisavo' title='Zmanjšaj pisavo'><img src='".THEME."images/down.png' border='0'></a> <a href='".THEME."settings.php' alt='Resetiraj pisavo' title='Resetiraj pisavo'><img src='".THEME."images/reset.png' border='0'></a> <a href='".THEME."settings.php?font=povecaj' alt='Povečaj pisavo' title='Povečaj pisavo'><img src='".THEME."images/up.png' border='0'></a></div>";
}
?>