Przedszkolak
Postów: 87
Data rejestracji: 22.04.2006 22:51
|
jantom napisał/a:
Wyeliminuj znacznik center, a zacznij korzystać z CSS, np.
GeSHi: CSS body {margin:0 auto;}
Zinterpretowano w sekund: 0.002, wykorzystano GeSHi 1.0.8.10
Wyeliminowałem z theme.php ale strona uciekła na lewo, a ostatnie artykuły oraz ostatnio na forum dalej jest wycentrowane. Losowa grafika tak ma zostać.
infusions.php :
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: infusions.php
| Author: Nick Jones (Digitanium)
| Co-Author: Christian Damsgaard Jřrgensen (PMM)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES."templates/admin_header.php";
include LOCALE.LOCALESET."admin/infusions.php";
if (!checkrights("I") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
$inf_title = ""; $inf_description = ""; $inf_version = ""; $inf_developer = ""; $inf_email = ""; $inf_weburl = "";
$inf_folder = ""; $inf_newtable = ""; $inf_insertdbrow = ""; $inf_droptable = ""; $inf_altertable = "";
$inf_deldbrow = ""; $inf_sitelink = "";
if (!isset($_POST['infuse']) && !isset($_POST['infusion']) && !isset($_GET['defuse'])) {
$temp = opendir(INFUSIONS);
$file_list = array();
while ($folder = readdir($temp)) {
if (!in_array($folder, array("..", "."))) {
if (is_dir(INFUSIONS.$folder) && file_exists(INFUSIONS.$folder."/infusion.php")) {
include INFUSIONS.$folder."/infusion.php";
$result = dbquery("SELECT * FROM ".DB_INFUSIONS." WHERE inf_folder='".$inf_folder."'");
if (dbrows($result)) {
$data = dbarray($result);
if (version_compare($inf_version, $data['inf_version'], ">")) {
$file_list[] = "<option value='".$folder."' style='color:blue;'>".ucwords(str_replace("_", " ", $folder))."</option>\n";
} else {
$file_list[] = "<option value='".$folder."' style='color:green;'>".ucwords(str_replace("_", " ", $folder))."</option>\n";
}
} else {
$file_list[] = "<option value='".$folder."' style='color:red;'>".ucwords(str_replace("_", " ", $folder))."</option>\n";
}
$inf_title = ""; $inf_description = ""; $inf_version = ""; $inf_developer = ""; $inf_email = ""; $inf_weburl = "";
$inf_folder = ""; $inf_newtable = ""; $inf_insertdbrow = ""; $inf_droptable = ""; $inf_altertable = "";
$inf_deldbrow = ""; $inf_sitelink = "";
}
}
}
closedir($temp);
sort($file_list);
opentable($locale['400']);
echo "<div style='text-align:center'>\n<form name='infuseform' method='post' action='".FUSION_SELF.$aidlink."'>\n";
echo "<select name='infusion' class='textbox' style='width:200px;'>\n";
for ($i = 0; $i < count($file_list); $i++) { echo $file_list[$i]; }
echo "</select> <input type='submit' name='infuse' value='".$locale['401']."' class='button' />\n";
if (isset($_GET['error'])) { echo "<br /><br />\n".($_GET['error'] == 1 ? $locale['402'] : $locale['403'])."<br /><br />\n"; }
echo "<br /><br />\n".$locale['413']." <span style='color:red;'>".$locale['414']."</span> ::\n";
echo "<span style='color:green;'>".$locale['415']."</span> ::\n";
echo "<span style='color:blue;'>".$locale['416']."</span>\n";
echo "</form>\n</div>\n";
closetable();
}
if (isset($_POST['infuse']) && isset($_POST['infusion'])) {
$error = "";
$infusion = stripinput($_POST['infusion']);
if (file_exists(INFUSIONS.$infusion."/infusion.php")) {
include INFUSIONS.$infusion."/infusion.php";
$result = dbquery("SELECT * FROM ".DB_INFUSIONS." WHERE inf_folder='".$inf_folder."'");
if (dbrows($result)) {
$data = dbarray($result);
if ($inf_version > $data['inf_version']) {
if (isset($inf_altertable) && is_array($inf_altertable) && count($inf_altertable)) {
for ($i = 1; $i < (count($inf_altertable) + 1); $i++) {
$result = dbquery("ALTER TABLE ".$inf_altertable[$i]);
}
}
$result2 = dbquery("UPDATE ".DB_INFUSIONS." SET inf_version='".$inf_version."' WHERE inf_id='".$data['inf_id']."'");
}
} else {
if (isset($inf_adminpanel) && is_array($inf_adminpanel) && count($inf_adminpanel)) {
for ($i = 1; $i < (count($inf_adminpanel) + 1); $i++) {
$error = 0;
$inf_admin_image = ($inf_adminpanel[$i]['image'] ? $inf_adminpanel[$i]['image'] : "infusion_panel.gif");
if (!dbcount("(admin_id)", DB_ADMIN, "admin_rights='".$inf_adminpanel[$i]['rights']."'")) {
$result = dbquery("INSERT INTO ".DB_ADMIN." (admin_rights, admin_image, admin_title, admin_link, admin_page) VALUES ('".$inf_adminpanel[$i]['rights']."', '".$inf_admin_image."', '".$inf_adminpanel[$i]['title']."', '".INFUSIONS.$inf_folder."/".$inf_adminpanel[$i]['panel']."', '4')");
$result = dbquery("SELECT user_id, user_rights FROM ".DB_USERS." WHERE user_level='103'");
while ($data = dbarray($result)) {
$result2 = dbquery("UPDATE ".DB_USERS." SET user_rights='".$data['user_rights'].".".$inf_adminpanel[$i]['rights']."' WHERE user_id='".$data['user_id']."'");
}
} else {
$error = 1;
}
}
}
if (!$error) {
if (isset($inf_sitelink) && is_array($inf_sitelink) && count($inf_sitelink)) {
for ($i = 1; $i < (count($inf_sitelink) + 1); $i++) {
$link_order = dbresult(dbquery("SELECT MAX(link_order) FROM ".DB_SITE_LINKS),0) + 1;
$result = dbquery("INSERT INTO ".DB_SITE_LINKS." (link_name, link_url, link_visibility, link_position, link_window, link_order) VALUES ('".$inf_sitelink[$i]['title']."', '".str_replace("../","",INFUSIONS).$inf_folder."/".$inf_sitelink[$i]['url']."', '".$inf_sitelink[$i]['visibility']."', '1', '0', '".$link_order."')");
}
}
if (isset($inf_newtable) && is_array($inf_newtable) && count($inf_newtable)) {
for ($i = 1; $i < (count($inf_newtable) + 1); $i++) {
$result = dbquery("CREATE TABLE ".$inf_newtable[$i]);
}
}
if (isset($inf_insertdbrow) && is_array($inf_insertdbrow) && count($inf_insertdbrow)) {
for ($i = 1; $i < (count($inf_insertdbrow) + 1); $i++) {
$result = dbquery("INSERT INTO ".$inf_insertdbrow[$i]);
}
}
$result = dbquery("INSERT INTO ".DB_INFUSIONS." (inf_title, inf_folder, inf_version) VALUES ('".$inf_title."', '".$inf_folder."', '".$inf_version."')");
}
}
}
redirect(FUSION_SELF.$aidlink);
}
if (isset($_GET['defuse']) && isnum($_GET['defuse'])) {
$result = dbquery("SELECT * FROM ".DB_INFUSIONS." WHERE inf_id='".$_GET['defuse']."'");
$data = dbarray($result);
include INFUSIONS.$data['inf_folder']."/infusion.php";
if (isset($inf_adminpanel) && is_array($inf_adminpanel) && count($inf_adminpanel)) {
for ($i = 1; $i < (count($inf_adminpanel) + 1); $i++) {
$result = dbquery("DELETE FROM ".DB_ADMIN." WHERE admin_rights='".($inf_adminpanel[$i]['rights'] ? $inf_adminpanel[$i]['rights'] : "IP")."' AND admin_link='".INFUSIONS.$inf_folder."/".$inf_adminpanel[$i]['panel']."' AND admin_page='4'");
$result = dbquery("SELECT user_id, user_rights FROM ".DB_USERS." WHERE user_level>='102'");
while ($data = dbarray($result)) {
$user_rights = explode(".", $data['user_rights']);
if (in_array($inf_adminpanel[$i]['rights'], $user_rights)) {
$key = array_search($inf_adminpanel[$i]['rights'], $user_rights);
unset($user_rights[$key]);
}
$result2 = dbquery("UPDATE ".DB_USERS." SET user_rights='".implode(".", $user_rights)."' WHERE user_id='".$data['user_id']."'");
}
}
}
if (isset($inf_sitelink) && is_array($inf_sitelink) && count($inf_sitelink)) {
for ($i = 1; $i < (count($inf_sitelink) + 1); $i++) {
$result2 = dbquery("SELECT * FROM ".DB_SITE_LINKS." WHERE link_url='".str_replace("../", "", INFUSIONS).$inf_folder."/".$inf_sitelink[$i]['url']."'");
if (dbrows($result2)) {
$data2 = dbarray($result2);
$result = dbquery("UPDATE ".DB_SITE_LINKS." SET link_order=link_order-1 WHERE link_order>'".$data2['link_order']."'");
$result = dbquery("DELETE FROM ".DB_SITE_LINKS." WHERE link_id='".$data2['link_id']."'");
}
}
}
if (isset($inf_newtable) && is_array($inf_newtable) && count($inf_newtable)) {
for ($i = 1; $i < (count($inf_newtable) + 1); $i++) {
$result = dbquery("DROP TABLE ".$inf_droptable[$i]);
}
}
if (isset($inf_deldbrow) && is_array($inf_deldbrow) && count($inf_deldbrow)) {
for ($i = 1; $i < (count($inf_deldbrow) + 1); $i++) {
$result = dbquery("DELETE FROM ".$inf_deldbrow[$i]);
}
}
$result = dbquery("DELETE FROM ".DB_INFUSIONS." WHERE inf_id='".$_GET['defuse']."'");
redirect(FUSION_SELF.$aidlink);
}
$result = dbquery("SELECT * FROM ".DB_INFUSIONS." ORDER BY inf_title");
if (dbrows($result)) {
$i = 0;
opentable($locale['404']);
echo "<table cellpadding='0' cellspacing='1' width='500' class='tbl-border center'>\n<tr>\n";
echo "<td class='tbl2'><strong>".$locale['405']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['406']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['407']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['408']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2'> </td>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
$row_color = ($i % 2 == 0 ? "tbl1" : "tbl2");
if (@include INFUSIONS.$data['inf_folder']."/infusion.php") {
echo "<tr>\n";
echo "<td class='".$row_color."'><span title='".$inf_description."' style='cursor:hand;'>".$inf_title."</span></td>\n";
echo "<td align='center' width='1%' class='".$row_color."' style='white-space:nowrap'>".$inf_version."</td>\n";
echo "<td align='center' width='1%' class='".$row_color."' style='white-space:nowrap'>".$inf_developer."</td>\n";
echo "<td align='center' width='1%' class='".$row_color."' style='white-space:nowrap'><a href='mailto:".$inf_email."'>".$locale['409']."</a> / <a href='".$inf_weburl."'>".$locale['410']."</a></td>\n";
echo "<td align='center' width='1%' class='".$row_color."' style='white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&defuse=".$data['inf_id']."' onclick='return Defuse();'>".$locale['411']."</a></td>\n";
echo "</tr>\n";
$i++;
}
$inf_title = ""; $inf_description = ""; $inf_version = ""; $inf_developer = ""; $inf_email = ""; $inf_weburl = "";
$inf_folder = ""; $inf_newtable = ""; $inf_insertdbrow = ""; $inf_droptable = ""; $inf_altertable = "";
$inf_deldbrow = ""; $inf_sitelink = "";
}
echo "</table>\n";
closetable();
}
echo "<script type='text/javascript'>
function Defuse() {
return confirm('".$locale['412']."');
}
</script>\n";
require_once THEMES."templates/footer.php";
?> Kliknij i zaczekaj na załadowanie kodu ...
oraz style.css (nie wiem jak zawinąć te tabele z kodem)
/* Comment element properties */
a {
color: #04688d;
text-decoration: none;
}
a:hover {
color: #04688d;
text-decoration: underline;
}
a.side {
color: #555;
text-decoration: none;
}
a:hover.side {
color: #f6a504;
text-decoration: underline;
}
a.white, li.white a {
color: #fff;
text-decoration: none;
}
a:hover.white, li.white a:hover {
color: #fff;
text-decoration: underline;
}
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000;
background-image:url(images/tlo.jpg);
margin: 5px;
}
hr {
height: 1px;
border: 1px solid #eee;
}
hr.side-hr {
height: 1px;
border: 1px solid #eee;
}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
}
pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
}
.alt {
color: #04688d;
}
.spacer {
margin-bottom: 5px;
}
.admin-message {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
text-align: center;
color: #555;
background-color: #f6f6f6;
border: 1px solid #e1e1e1;
padding: 3px 4px 5px 4px;
margin-bottom: 5px;
}
/* Form element properties */
form {
margin: 0px;
}
.button {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #fff;
background-color: #f6a504;
background-image: url(images/button.gif);
height: 20px;
border: 1px solid #000;
margin-top: 2px;
}
.bbcode {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000;
background-color: #eee;
border: 1px solid #ccc;
margin-top: 2px;
}
.textbox {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #555;
background-color: #f8f8f8;
border: 1px solid #ccc;
}
/* Header and footer properties */
.sub-header {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #fff;
background-color: #555;
background-image: url(images/subheader-mid.gif);
padding: 7px 5px 8px 5px;
}
.sub-header-left {
width: 3px;
height: 28px;
background-color: #555;
background-image: url(images/subheader-left.gif);
}
.sub-header-right {
width: 3px;
height: 28px;
background-color: #555;
background-image: url(images/subheader-right.gif);
}
.sub-header ul{
margin: 0;
padding: 0;
}
.sub-header ul li{
display: inline;
}
.sub-header ul li.first-link .bullet{
display: none;
}
.full-header {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #000;
background-color: #fff;
padding: 5px 0 10px 0;
}
.main-footer {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #555;
background-image:url(images/tlostopka.jpg);
padding: 5px;
}
.bottom-footer {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
color: #fff;
background-color: #555;
padding: 4px 4px 5px 4px;
}
.main-body {
font-size: 11px;
color: #555;
background-color: #fff;
border: 1px solid #ddd;
padding: 4px;
}
/* Side-Panel properties */
.side-left .side-border-right {display: none;}
.side-right .side-border-left {display: none;}
.side-border-left {
color: #777;
background-color: #fff;
padding: 10px 10px 10px 0;
width: 175px;
}
.side-border-right {
color: #777;
background-color: #fff;
padding: 10px 0 10px 10px;
width: 175px;
}
.scapmain {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
color: #fff;
background-color: #555;
background-image: url(images/side.gif);
background-repeat: repeat-x;
padding: 6px 4px 6px 4px;
}
.scapmain-left {
width: 3px;
height: 24px;
background-color: #555;
background-image: url(images/side-left.gif);
}
.scapmain-right {
width: 3px;
height: 24px;
background-color: #555;
background-image: url(images/side-right.gif);
}
.side-body {
font-size: 10px;
color: #555;
background-color: #fff;
background-image: url(images/gradient.gif);
background-repeat: repeat-x;
border: 1px solid #ddd;
padding: 4px;
}
/* Center-Panel properties */
.news-category {
border: 0;
margin: 3px 5px 0 0;
float: left;
}
.news-footer {
font-size: 10px;
color: #555;
background-color: #f1f1f1;
border-width: 0 1px 1px 1px;
border-color: #ddd;
border-style: solid;
padding: 3px 4px 4px 4px;
}
.capmain {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #fff;
background-color: #555;
background-image: url(images/cap.gif);
background-repeat: repeat-x;
padding: 6px 4px 6px 4px;
}
.capmain-left {
width: 3px;
height: 25px;
background-color: #555;
background-image: url(images/cap-left.gif);
}
.capmain-right {
width: 3px;
height: 25px;
background-color: #555;
background-image: url(images/cap-right.gif);
}
.main-bg {
color: #555;
background-color: #fff;
padding: 10px 0 5px 0;
}
/* General table properties */
.center {
margin: 0 auto;
}
.tbl-border {
border: 1px solid #e1e1e1;
}
.tbl {
font-size: 11px;
color: #555;
background-color: #fff;
padding: 4px;
}
.tbl1 {
font-size: 11px;
color: #555;
background-color: #fff;
padding: 4px;
}
.tbl2 {
font-size: 11px;
color: #555;
background-color: #f1f1f1;
padding: 4px;
}
.forum-caption {
font-size: 11px;
font-weight: bold;
color: #888;
background-color: #f1f1f1;
padding: 2px 4px 4px 4px;
}
.quote {
font-size: 11px;
color: #555;
background-color: #f8f8f8;
padding: 4px;
margin: 0px 20px 0px 20px;
border: 1px solid #bbb;
}
.poll {
height: 12px;
border: 1px solid #bbb;
}
.comment-name {
font-weight: bold;
color: #04688d;
}
.shoutboxname {
font-weight: bold;
color: #04688d;
}
.shoutbox {
color: #777;
}
.shoutboxdate {
font-size: 10px;
color: #888;
}
.small {
font-size: 10px;
font-weight: normal;
}
.small2 {
font-size: 10px;
font-weight: normal;
color: #555;
}
.side-small {
font-size: 10px;
font-weight: normal;
color: #555;
}
.side-label {
color: #555;
background-color: #f1f1f1;
margin: 2px 0 2px 0;
padding: 2px 2px 3px 2px;
}
/* Vertical Navigation */
#navigation h2 {
font-size: 10px;
font-weight: normal;
background-color: #f1f1f1;
margin: 0;
padding: 4px;
}
#navigation ul {
margin: 0;
padding: 0;
list-style-type: none;
}
* html #navigation ul li{
height: 1%;
}
#navigation a {
display: block;
color: #555;
padding: 2px;
text-decoration: none;
}
#navigation a:hover {
color: #fff;
background-color: #f6a504;
}
/* Page Navigation */
.pagenav {
padding: 4px;
}
.pagenav span {
color: #fff;
background-color: #f6a504;
border: 1px solid #ddd;
padding: 2px 4px 2px 4px;
margin: 2px;
}
.pagenav a {
color: #555;
background-color: #f1f1f1;
border: 1px solid #ddd;
padding: 2px 4px 2px 4px;
margin: 2px;
text-decoration: none;
}
.pagenav a:hover {
color: #fff;
background-color: #f6a504;
margin: 2px;
text-decoration: none;
}
table.awec_calendar td.content {
background-color: #ffff66; /* current day */
font-weight: bold;
}
table.awec_calendar td.current {
font-weight: bold;
}
Kliknij i zaczekaj na załadowanie kodu ...
PW od moderatora:
- Ogólna Uwaga - chemix 09.03 - 11:45
Edytowane przez Chemikpil dnia 09.03.2009 11:42:20
|