Theme Switcher na pasku pod nagłówkiem
|
bartek124 |
Dodany dnia 20.07.2007 10:25:21
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Witam
Mam infusion theme switcher który się wyświetla jako panel o tak:
a chce żeby się wyświetlał tak:
Wiem że to trzeba robić w pliku theme.php i gdzieś w okolicy kodu daty (bo chce, żeby to było zamiast daty)
Tu jest kod thema
<?
$body_text = "#F2CEB8";
$body_bg = "#2C2C2C";
$theme_width = "100%";
$theme_width_l = "207";
$theme_width_r = "207";
function render_header($header_content) {
global $theme_width,$settings;
echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0'>
<tr>
<td class='lefter'><img width='45' src='".THEME."images/lefter.gif' height='1' alt=''></td>
<td class='mbody' align='right'><table width='100%' cellpacing='0' cellpadding='0' border='0'><tr><td class='toplogo'><img src='".THEME."images/logo.jpg' alt=''></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td class='menuss'>\n";
$separator = " </td><td class='sep'></td><td class='menuss'> ";
$result = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' ORDER BY link_order");
if (dbrows($result) != 0) {
echo "\n";
$i = 0;
while($data = dbarray($result)) {
if (checkgroup($data['link_visibility'])) {
if ($data['link_url']!="---") {
if ($i != 0) { echo " $separator \n"; } else { echo "\n"; }
$link_target = ($data['link_window'] == "1" ? " target='_blank'" : "");
if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) {
echo "<a href='".$data['link_url']."'".$link_target." class='white'>".$data['link_name']."</a>";
} else {
echo "<a href='".BASEDIR.$data['link_url']."'".$link_target." class='white'>".$data['link_name']."</a>";
}
}
$i++;
}
}
}
echo ($i == 0 ? " " : "")."</td><td class='sep'></td><td width='30%' class='pustka'> </td>
</td><td class='sep'></td>
<td class='menus' align='right'>".ucwords(showdate($settings['subheaderdate'], time()))."</td>
</tr>
</table>\n";
echo "<table width='100%' cellspacing='0' cellpadding='0' align='center'>\n<tr>\n";
}
function render_footer($license=false) {
global $theme_width,$settings;
echo "</tr>\n</table>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='footer' align='center'>".stripslashes($settings['footer'])."<br><b>".$settings['counter']."</b> Unikalnych Wizyt</td>
</tr>
</table>
</td>
<td class='righter'><img width='45' src='".THEME."images/righter.gif' height='1' alt=''></td>
</tr>
</table>\n";
}
function render_news($subject, $news, $info) {
global $settings,$locale;
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='tresc01'></td>
<td colspan='3' class='tresc02'></td>
<td class='tresc03'></td>
</tr>
<tr>
<td class='tresc04'></td>
<td colspan='3' class='tresc05'>$subject</td>
<td class='tresc06'></td>
</tr>
<tr>
<td class='tresc07'></td>
<td colspan='3' class='tresc08'></td>
<td class='tresc09'></td>
</tr>
<tr>
<td class='tresc10'></td>
<td colspan='3' class='tresc11'>$news<br><br>
<img src='".THEME."images/bullet.gif' width='10' height='10' alt='' > ".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a> ".$locale['041'].showdate("longdate", $info['news_date'])."
<br><img src='".THEME."images/bullet.gif' width='10' height='10' alt='' > ".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>".$locale['042']."</a> ·\n" : "")."
<a href='news.php?readmore=".$info['news_id']."'>".$locale['043']."</a> [ ".$info['news_comments']." ] · [ ".$info['news_reads']." ] ".$locale['044']." <a href='print.php?type=N&item_id=".$info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0'></a></td>
<td class='tresc12'></td>
</tr>
<tr>
<td class='tresc13'><img src='".THEME."images/tresc/tresc_13.gif' width='4' height='29' alt=''></td>
<td class='tresc14'><img src='".THEME."images/tresc/tresc_14.gif' width='22' height='29' alt=''></td>
<td class='tresc15' width='100%'></td>
<td class='tresc16'><img src='".THEME."images/tresc/tresc_16.gif' width='22' height='29' alt=''></td>
<td class='tresc17'><img src='".THEME."images/tresc/tresc_17.gif' width='4' height='29' alt=''></td>
</tr>
</table>\n";
}
function opentable($title) {
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='tresc01'></td>
<td colspan='3' class='tresc02'></td>
<td class='tresc03'></td>
</tr>
<tr>
<td class='tresc04'></td>
<td colspan='3' class='tresc05'>$title</td>
<td class='tresc06'></td>
</tr>
<tr>
<td class='tresc07'></td>
<td colspan='3' class='tresc08'></td>
<td class='tresc09'></td>
</tr>
<tr>
<td class='tresc10'></td>
<td colspan='3' class='tresc11'>\n";
}
function closetable() {
echo "</td>
<td class='tresc12'></td>
</tr>
<tr>
<td class='tresc13'><img src='".THEME."images/tresc/tresc_13.gif' width='4' height='29' alt=''></td>
<td class='tresc14'><img src='".THEME."images/tresc/tresc_14.gif' width='22' height='29' alt=''></td>
<td class='tresc15' width='100%'></td>
<td class='tresc16'><img src='".THEME."images/tresc/tresc_16.gif' width='22' height='29' alt=''></td>
<td class='tresc17'><img src='".THEME."images/tresc/tresc_17.gif' width='4' height='29' alt=''></td>
</tr>
</table>\n";
}
function openside($title) {
global $p_data;
echo "<table width='207' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='bok01'></td>
<td colspan='2' class='bok02'></td>
<td class='bok03'></td>
</tr>
<tr>
<td class='bok04'></td>
<td colspan='2' class='bok05'>$title</td>
<td class='bok06'></td>
</tr>
<tr>
<td class='bok07'></td>
<td colspan='2' class='bok08'></td>
<td class='bok09'></td>
</tr>
<tr>
<td class='bok10'></td>
<td colspan='2' class='bok11'>\n";
}
function closeside() {
global $p_data;
if ($p_data['panel_side'] == 1) {
echo "</td>
<td class='bok12'></td>
</tr>
<tr>
<td class='bok13'></td>
<td class='bok14'></td>
<td class='bok15'></td>
<td class='bok16'></td>
</tr>
</table>"; }
else {
echo "</td>
<td class='bok12'></td>
</tr>
<tr>
<td class='bok13'></td>
<td class='bok17'></td>
<td class='bok14'></td>
<td class='bok16'></td>
</tr>
</table>\n";
}
tablebreak();
}
function opensidex($title,$open="on") {
global $p_data;
$box_img = ($open=="on" ? "off" : "on");
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='tresc01'></td>
<td colspan='3' class='tresc02'></td>
<td class='tresc03'></td>
</tr>
<tr>
<td class='tresc04'></td>
<td colspan='3' class='tresc05'>$title<img onclick=\"javascript:flipBox('$title')\" name='b_$title' alt='$box_img' border='0' src='".THEME."images/panel_$box_img.gif'></td>
<td class='tresc06'></td>
</tr>
<tr>
<td class='tresc07'></td>
<td colspan='3' class='tresc08'></td>
<td class='tresc09'></td>
</tr>
<tr>
<td class='tresc10'></td>
<td colspan='3' class='tresc11'><div id='box_$title'".($open=="off" ? "style='display:none'" : "").">\n";
}
function closesidex() {
echo "</div></td>
<td class='tresc12'></td>
</tr>
<tr>
<td class='tresc13'><img src='".THEME."images/tresc/tresc_13.gif' width='4' height='29' alt=''></td>
<td class='tresc14'><img src='".THEME."images/tresc/tresc_14.gif' width='22' height='29' alt=''></td>
<td class='tresc15' width='100%'></td>
<td class='tresc16'><img src='".THEME."images/tresc/tresc_16.gif' width='22' height='29' alt=''></td>
<td class='tresc17'><img src='".THEME."images/tresc/tresc_17.gif' width='4' height='29' alt=''></td>
</tr>
</table>\n";
tablebreak();
}
function tablebreak() {
echo "<table width='100%' cellspacing='0' cellpadding='0'>
<tr>
<td height='2'></td>
</tr>
</table>\n";
}
?>
A tu kod panelu
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
if (file_exists(INFUSIONS."theme_switcher_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."theme_switcher_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."theme_switcher_panel/locale/English.php";
}
openside($locale['TS001']);
echo "<center><form name='theme_switcher' method='post' action='".FUSION_SELF."'>";
echo $locale['TS002']." <select class='textbox' name='ThemeSwitcher' onChange=\"location = '".FUSION_SELF."?theme=' + document.theme_switcher.ThemeSwitcher.options[document.theme_switcher.ThemeSwitcher.selectedIndex].value;\">";
if ($handle = opendir(THEMES)) {
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "/" && $file != "index.php") {
if ($file == THEME_SWITCH) {
$sel = "selected";
} else {
$sel = "";
}
echo "<option value='".$file."' ".$sel.">".$file."</option>\n";
}
}
closedir($handle);
}
echo "</select>";
echo "</form></center>";
closeside();
Prubowałem coś robić na "swój rozum" ale jeszcze nie jestem taki doświadczony w takich rzeczach ;) .
Jeśli ktoś wie jak to połączyć to prosze o pomoc.
Wiem, że to trzeba bedzie robić w każdych themach, ale z tym sobie poradze bo mam trzy themy zbudowane na takim samym kodzie (tylko grafika zmieniona).
Z góry dzięki |
|
|
|
Wścibski Gość |
Dodany dnia 14.01.2025 23:29:42
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
Pieka |
Dodany dnia 20.07.2007 10:47:53
|
Postów: 19885 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
Ponizej masz na przykladzie theme Similitude06, funkcja render_header:
function render_header($header_content) {
global $theme_width;
echo "<table align='center' cellspacing='0' cellpadding='0' width='$theme_width' class='outer-border'>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='full-header'>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td>$header_content</td>
</tr>
</table>
</td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td class='sub-header'>".showsublinks("·","white")."</td>
<td align='right' class='sub-header'>";
[color=red]echo "<form name='theme_switcher' method='post' action='".FUSION_SELF."'>";
echo $locale['TS002']." <select class='textbox' name='ThemeSwitcher' onChange=\"location = '".FUSION_SELF."?theme=' + document.theme_switcher.ThemeSwitcher.options[document.theme_switcher.ThemeSwitcher.selectedIndex].value;\">";
if ($handle = opendir(THEMES)) {
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "/" && $file != "index.php") {
if ($file == THEME_SWITCH) {
$sel = "selected";
} else {
$sel = "";
}
echo "<option value='".$file."' ".$sel.">".$file."</option>\n";
}
}
closedir($handle);
}
echo "</select>";
echo "</form>";[/color]
echo "</td>
</tr>
</table>\n";
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
}
Kod do wstawienia na czerwono. Oczywiscie mozesz sobie dodac napis ;)
Wyglad: http://pieka.lua.pl - dziala zmiana, tylko pomiedzy Similitude06, a Prime.
Edytowane przez Pieka dnia 20.07.2007 11:04:09
Jestem jaki jestem
|
|
|
|
bartek124 |
Dodany dnia 20.07.2007 11:47:02
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
function render_header($header_content) {
global $theme_width,$settings;
echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0'>
<tr>
<td class='lefter'><img width='45' src='".THEME."images/lefter.gif' height='1' alt=''></td>
<td class='mbody' align='right'><table width='100%' cellpacing='0' cellpadding='0' border='0'><tr><td class='toplogo'><img src='".THEME."images/logo.jpg' alt=''></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td class='menuss'>\n";
$separator = " </td><td class='sep'></td><td class='menuss'> ";
$result = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' ORDER BY link_order");
if (dbrows($result) != 0) {
echo "\n";
$i = 0;
while($data = dbarray($result)) {
if (checkgroup($data['link_visibility'])) {
if ($data['link_url']!="---") {
if ($i != 0) { echo " $separator \n"; } else { echo "\n"; }
$link_target = ($data['link_window'] == "1" ? " target='_blank'" : "");
if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) {
echo "<a href='".$data['link_url']."'".$link_target." class='white'>".$data['link_name']."</a>";
} else {
echo "<a href='".BASEDIR.$data['link_url']."'".$link_target." class='white'>".$data['link_name']."</a>";
}
}
$i++;
}
}
}
echo ($i == 0 ? " " : "")."</td><td class='sep'></td><td width='30%' class='pustka'> </td>
</td><td class='sep'></td>
<td class='menus' align='right'>[color=red][b]".ucwords(showdate($settings['subheaderdate'], time()))."[/b][/color]</td>
</tr>
</table>\n";
echo "<table width='100%' cellspacing='0' cellpadding='0' align='center'>\n<tr>\n";
}
jak wkleje w miejscu pogrubienia to wygląda to wtedy tak
mógłby mi ktoś to poprawić?? bo jestem na dobrym tropie ale jak wkleje wyżej czy niżej to się caly them rozwala :(
PS i na dodatek jeszcze się themy nie zmieniają :(
Edytowane przez Pieka dnia 20.07.2007 12:04:53
|
|
|
|
Pieka |
Dodany dnia 20.07.2007 11:51:21
|
Postów: 19885 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
Zle!! Po stokroc zle!
Pakujesz nie tam gdzie pokazalem, do tego wstawiasz na forum kod w cytowanie i rozwalasz temat.
Code wylacza automatycznie emotki, ale Ty nawet o tym nie pomyslales wstawiajac w niewlasciwe tagi.
Jestem jaki jestem
|
|
|
|
bartek124 |
Dodany dnia 20.07.2007 11:53:25
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
no to gdzie to mam wstawić?? nie ma u mnie podobnego kodu niż u ciebie |
|
|
|
Pieka |
Dodany dnia 20.07.2007 12:07:10
|
Postów: 19885 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
bartek124 napisał/a:
no to gdzie to mam wstawić?? nie ma u mnie podobnego kodu niż u ciebie
Co Ty opowiadasz?! Wszytko tam jest.
Napisales wyzej, ze chcesz switcher wstawic w miesce daty, wiec dlaczego pakujesz go pod belke nawigacji?
Zaznaczylem na czerwono miesce, w ktore ma przyjsc kod (zamiast tego czerwonego).
Edytowane przez Pieka dnia 20.07.2007 12:08:23
Jestem jaki jestem
|
|
|
|
bartek124 |
Dodany dnia 20.07.2007 12:18:22
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
function render_header($header_content) {
global $theme_width,$settings;
echo "<table align='center' width='$theme_width' cellspacing='0' cellpadding='0'>
<tr>
<td class='lefter'><img width='45' src='".THEME."images/lefter.gif' height='1' alt=''></td>
<td class='mbody' align='right'><table width='100%' cellpacing='0' cellpadding='0' border='0'><tr><td class='toplogo'><img src='".THEME."images/logo.jpg' alt=''></td></tr></table>
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
<tr>
<td class='menuss'>\n";
$separator = " </td><td class='sep'></td><td class='menuss'> ";
$result = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' ORDER BY link_order");
if (dbrows($result) != 0) {
echo "\n";
$i = 0;
while($data = dbarray($result)) {
if (checkgroup($data['link_visibility'])) {
if ($data['link_url']!="---") {
if ($i != 0) { echo " $separator \n"; } else { echo "\n"; }
$link_target = ($data['link_window'] == "1" ? " target='_blank'" : "");
if (strstr($data['link_url'], "http://") || strstr($data['link_url'], "https://")) {
echo "<a href='".$data['link_url']."'".$link_target." class='white'>".$data['link_name']."</a>";
} else {
echo "<a href='".BASEDIR.$data['link_url']."'".$link_target." class='white'>".$data['link_name']."</a>";
}
}
$i++;
}
}
}
[b]echo "<td class='menus' align='right'><form name='theme_switcher' method='post' action='".FUSION_SELF."'>";
echo $locale['TS002']." <td class='menus' align='right'><select class='textbox' name='ThemeSwitcher' onChange=\"location = '".FUSION_SELF."?theme=' + document.theme_switcher.ThemeSwitcher.options[document.theme_switcher.ThemeSwitcher.selectedIndex].value;\">";
if ($handle = opendir(THEMES)) {
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "/" && $file != "index.php") {
if ($file == THEME_SWITCH) {
$sel = "selected";
} else {
$sel = "";
}
echo "<option value='".$file."' ".$sel.">".$file."</option>\n";
}
}
closedir($handle);
}
echo "</select>";
echo "</form>";[/b]
echo ($i == 0 ? " " : "")."</td>
</td><td class='sep'></td>
</tr>
</table>\n";
echo "<table width='100%' cellspacing='0' cellpadding='0' align='center'>\n<tr>\n";
}
wyświetla się już dobrze, ale nie wyświetla się już ostatni "pasek" , który oddziela:
Edytowane przez bartek124 dnia 20.07.2007 12:18:53
|
|
|
|
Pieka |
Dodany dnia 20.07.2007 13:30:51
|
Postów: 19885 Pomógł: 767
v7.02.03 Data rejestracji: 23.02.2005 18:12
|
Przebywales dlugo na sloncu?
Chlopie, ja juz Ci to jak dziecku pokazuje i nawet koloruje, a Ty znowu swoje...
Nie mam na to czasu, baw sie sam po swojemu..
Edytowane przez Pieka dnia 20.07.2007 13:32:00
Jestem jaki jestem
|
|
|