PHP Fusion 6.01 w swoim theme.php w funkcji render_news dodałem linię która wyświetla mi ołówek dodający możliwość edycji newsa ze strony głównej
if (iADMIN && checkrights("N")) echo " | <form style='display:inline' name='editnews".$info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$info['news_id']."'><input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$info['news_id'].".submit();'><img src='".IMAGES."edit.gif' style='vertical-align:middle;border:0px;'></a>\n</form>";
jednak po kliknięciu link przenosi mnie na stronę której nie ma.
np.
/administration/news.php&news_id=293
zamiast na
/administration/news.php?aid=d475ec7a7c8dea87&news_id=293
kod mojego render_news wygląda tak:
function render_news($subject, $news, $info) {
global $locale;
echo "<table cellSpacing='0' cellPadding='0' width='100%'><tr><td class='blue_top_left_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='blue_top_mid_block' width='100%'>$subject</td>";
echo "<td class='blue_top_right_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td></tr></table>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'><tr><td class='block-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='main-body'>
<div style='vertical-align: top; width: 100%'>$news</div>";
echo "<div style='margin-top: 5px'>";
echo "<hr>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='sfooter' >";
echo "<img src='".THEME."images/bullet.gif' width='4' height='6'> ".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a> ";
echo "".$locale['041'].showdate("shortdate", $info['news_date'])."</td>";
echo "<td class='sfooter' align='right'>";
echo "".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>".$locale['042']."</a> \n" : "")."";
if ($info['news_allow_comments'])
echo "<a href='news.php?readmore=".$info['news_id']."'>".$info['news_comments'].$locale['043']."</a> ";
echo "<a href='print.php?type=N&item_id=".$info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
if (iADMIN && checkrights("N")) echo " | <form style='display:inline' name='editnews".$info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$info['news_id']."'><input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$info['news_id'].".submit();'><img src='".IMAGES."edit.gif' style='vertical-align:middle;border:0px;'></a>\n</form>";
echo "</td></tr></table></div></td>";
echo "<td class='block-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='block-bleft'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='block-bmain'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='block-bright'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td></tr></table>\n";
}
cały plik themes.php to
<?
//************************************************************************************************************************//
// Theme Name: Astral Theme for PHP-Fusion 6.00
// Theme Design: by: PHP-Fusion Themes (http://phpfusion.org)
// version 2.0
//
// PHP-Fusion Themes and/or Lorkan is a Registered Organization and holds a copyright with CIPO
// Original Author of file: PHP-Fusion Themes [Shedrock]
// Developed by: PHP-Fusion Themes - Bringing Your Portal To Life
// Copyright 2005 by PHP-Fusion Themes - All Rights Reserved
// ----------------------------------------------------------------------
// THEME MODIFICATION
// Users may alter or modify this theme at their own risk,
// but only for their own use. They may also hire PHP-Fusion Themes to modify their own copy of the theme.
// Although users may modify the code for their use,
// modified code may not be resold or distributed,
// without express written permission from PHP-Fusion Themes.
//
// DISPLAY OF COPYRIGHT NOTICES REQUIRED
// All copyright notices used within the scripts that the scripts generate,
// MUST remain intact. Furthermore, these notices must remain visible.
//
// SUPPORT
// PHP-Fusion Themes provides free support on all their theme designs.
// (includes consulting, troubleshooting and fixing problems).
// For Support, please visit us at: http://www.phpfusion.org/forum/viewforum.php?forum_id=2
//
// PHP-Fusion Themes is not liable for any products or services offered by means of the theme.
// The user must assume the entire risk of using the program.
//************************************************************************************************************************//
// theme settings
$body_text = "#202020";
$theme_width = "950";
$theme_width_l = "180";
$theme_width_r = "180";
require_once INCLUDES."theme_functions_include.php";
function render_header($header_content) {
global $theme_width,$settings,$userdata,$aidlink,$loginerror;
echo "<table cellSpacing='0' cellPadding='0' width='$theme_width' align='center'>";
echo "<tr><td class='head-tleft'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='head-tmain' colSpan='2'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='head-tright'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='14'></td></tr>";
echo "<tr><td class='head-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='header' colSpan='2'>";
// Start banner code
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<td width='764' height='178' background-color:#00000; anchor : 'center', align : 'center' style='background-image:url(".THEME."images/logonew.jpg)') >";
echo "</td>";
echo "<td background-color:#579ecc; >";
echo "<div align='right'>";
if (iMEMBER) {
opensidel();
if ($userdata['user_avatar'] != "") {
echo "<center><img src='".BASEDIR."images/avatars/".$userdata['user_avatar']."' width='50' hight='50' alt='".$data['user_name']."'></center><br>\n";
} else {
echo "<center><img src='".INFUSIONS."user_info_panel/images/brak.gif' width='50' hight='50'></center><br>\n";
}
$msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."edit_profile.php' class='side'>Edytuj Profil</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."messages.php' class='side'>Twoje Wiadomosci</a><br>
<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."members.php' class='side'>Lista Uzytkownikw</a><br>\n";
if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
echo "<img src='".THEME."images/bullet.gif' alt=''><a href='".ADMIN."index.php".$aidlink."' class='side'> Administracja</a><br>\n";
}{echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."setuser.php?logout=yes' class='side'>Wyloguj</a>\n";
if ($msg_count) echo "<br><center><b><a href='".BASEDIR."messages.php' class='side2'>".sprintf('Masz %u PW' , $msg_count)."</a></b></center>\n";
}
tablebreak();
} else {
opensidel();
echo "<div align='center'>".(isset($loginerror) ? $loginerror : "")."
<form name='loginform' method='post' action='".FUSION_SELF."'>
Login
<input type='text' name='user_name' class='textbox' value='' onBlur=\"if(this.value=='') this.value='';\" onFocus=\"if(this.value=='') this.value='';\" style='width:100px'><br><br>
Hasło
<input type='password' name='user_pass' class='textbox' onBlur=\"if(this.value=='') this.value='';\" onFocus=\"if(this.value=='haslo') this.value='';\" style='width:100px'><br>
<input type='checkbox' name='remember_me' value='y' title='Zapamietaj mnie' style='vertical-align:middle;'> <p1>Pamitaj mnie</p1><br><br>
<input type='submit' name='login' value='Zaloguj' class='button'>
</form>
<br>\n";
if ($settings['enable_registration']) {
echo "<a href='".BASEDIR."register.php' class='side'>Rejestracja</a><br>\n";
}
echo "<a href='".BASEDIR."lostpassword.php' class='side'>Zapomniaem Hasa</a>
</div>\n";
}
closesidel();
echo "</div>";
echo "</td>";
echo "</tr></td></tr></table>\n";
echo "<table width='100%' cellspacing='0' cellpadding='0'>\n<tr>
<td>
<table width='100%' cellspacing='0' cellpadding='0'>
<tr>
<td class='full-header' style='padding:0px;'>
<table width='100%' cellspacing='0' cellpadding='0'>
<tr>
</tr>
</table>
</td>
</tr>
</table>\n";
echo "<table align='center' cellpadding='0' cellspacing='0' width='$theme_width'>\n<tr>\n";
}
function opensidel() {
echo "<table cellpadding='0' cellspacing='0' width='130' class='border'>
<tr>
<td class='side-bodylog'></td>
</tr>
<tr>
<td class='side-bodylog'>\n";
}
function closesidel() {
echo "</td>
</tr>
</table>\n";
tablebreak();
echo "</tr></table></td>";
// End banner code
echo "<td class='head-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td></tr>";
echo "<tr><td class='head-bot-left'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='14'></td>";
$result = dbquery("SELECT * FROM ".DB_PREFIX."site_links WHERE link_position>='2' ORDER BY link_order");
if (dbrows($result) != 0) {
echo "<td class='head-bot-main'>\n";
$i = 0;
while($data = dbarray($result)) {
if (checkgroup($data['link_visibility'])) {
if ($data['link_url']!="---") {
if ($i != 0) { echo " •\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>\n";
echo "<td class='head-bot-main' align='right'>";
echo "<div id='Clock'></div>";
echo "<script type='text/javascript'>
<!--
var DayNam = new Array(
'Niedziela,','Poniedziałek,','Wtorek,','¦roda,','Czwartek,','Pi±tek,','Sobota,');
var MnthNam = new Array(
'Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','PaĽdziernik','Listopad','Grudzień');
//-->
</script>";
echo "<script type='text/javascript' src='".THEME."/clock.js'></script></div></div></span>";
echo "</td>";
echo "<td class='head-bot-right'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='14'></td></tr></table>";
echo "<table width='980' cellspacing='0' cellpadding='0' align='center'>\n<tr>\n";
}
function render_footer($license=false) {
global $theme_width,$locale,$settings;
echo "</tr>\n</table>\n";
echo "<table cellSpacing='0' cellPadding='0' width='$theme_width' align='center'>";
echo "<tr>";
echo "<td>".stripslashes($settings['footer'])."</td></tr></table><br>";
echo "<table cellSpacing='0' cellPadding='0' width='$theme_width' align='center' border='0'><tr>";
echo "<td class='head-tleft'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='head-tmain' colspan='3'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='head-tright'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='14'></td></tr>";
echo "<tr><td class='head-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td width='35%' align='left' class='header'>";
echo "Render time: ".substr((get_microtime() - START_TIME),0,4)." sekundy";
echo "</td>";
echo "<td align='center' class='header'><b></b> ";
echo "Copyright © ZSG nr 5 ".date("Y");
echo "</td>";
echo "<td width='35%' align='right' class='header'>".$settings['counter']." </b></font>".($settings['counter'] == 1 ? $locale['140']."\n" : $locale['141']."\n");
echo "</td>";
echo "<td class='head-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='head-bot-left'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='head-bot-main' align='center' colspan='3' >";
echo "</td>";
echo "<td class='head-bot-right'>";
echo "<img height='25' alt src='".THEME."images/pixel.gif' width='9'></td>
</tr></table>\n";
}
function render_news($subject, $news, $info) {
global $locale;
echo "<table cellSpacing='0' cellPadding='0' width='100%'><tr><td class='blue_top_left_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='blue_top_mid_block' width='100%'>$subject</td>";
echo "<td class='blue_top_right_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td></tr></table>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'><tr><td class='block-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='main-body'>
<div style='vertical-align: top; width: 100%'>$news</div>";
echo "<div style='margin-top: 5px'>";
echo "<hr>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='sfooter' >";
echo "<img src='".THEME."images/bullet.gif' width='4' height='6'> ".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a> ";
echo "".$locale['041'].showdate("shortdate", $info['news_date'])."</td>";
echo "<td class='sfooter' align='right'>";
echo "".($info['news_ext'] == "y" ? "<a href='news.php?readmore=".$info['news_id']."'>".$locale['042']."</a> \n" : "")."";
if ($info['news_allow_comments'])
echo "<a href='news.php?readmore=".$info['news_id']."'>".$info['news_comments'].$locale['043']."</a> ";
echo "<a href='print.php?type=N&item_id=".$info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
if (iADMIN && checkrights("N")) echo " | <form style='display:inline' name='editnews".$info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$info['news_id']."'><input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$info['news_id'].".submit();'><img src='".IMAGES."edit.gif' style='vertical-align:middle;border:0px;'></a>\n</form>";
echo "</td></tr></table></div></td>";
echo "<td class='block-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='block-bleft'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='block-bmain'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='block-bright'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td></tr></table>\n";
}
function render_article($subject, $article, $info) {
global $locale;
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='top_left_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='top_mid_block' width='100%'>$subject</td>";
echo "<td class='top_right_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td></tr></table>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='block-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='main-body'>
<img src='".THEME."images/bullet.gif' width='4' height='6'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."";
echo "<div style='vertical-align: top; WIDTH: 100%'>$news</div>";
echo "<div style='margin-top: 5px'>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr>";
echo "<hr>";
echo "<td class='sfooter' >";
echo "<img src='".THEME."images/bullet.gif' width='4' height='6'> ";
echo "".$locale['040']."<a href='profile.php?lookup=".$info['user_id']."'>".$info['user_name']."</a> ";
echo "".$locale['041'].showdate("shortdate", $info['article_date'])."</td>";
echo "<td class='sfooter' align='left'>";
if ($info['article_allow_comments']) echo $info['article_comments'].$locale['043']." ";
echo "".$info['article_reads'].$locale['044']." ";
echo "<a href='print.php?type=A&item_id=".$info['article_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' border='0' style='vertical-align:middle;'></a>";
echo "</td></tr></table></div></td>";
echo "<td class='block-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='block-bleft'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='block-bmain'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='block-bright'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td></tr></table>\n";
}
function opentable($title) {
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='blue_top_left_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='blue_top_mid_block'>$title</td>";
echo "<td class='blue_top_right_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='1'></td></tr></table>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='block-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='side-body'>";
}
function closetable() {
echo "</td>";
echo "<td class='block-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='block-bleft'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='block-bmain'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='block-bright'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td></tr></table>";
}
function openside($title) {
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='top_left_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='top_mid_block' width='100%'>$title</td>";
echo "<td class='top_right_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td></tr></table>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='block-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='side-body'>";
}
function closeside() {
echo "</td>";
echo "<td class='block-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='block-bleft'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='block-bmain'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='block-bright'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td></tr></table>";
tablebreak();
}
function opensidex($title,$open="on") {
if($open=="on"){$box_img="off";}else{$box_img="on";}
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='top_left_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='top_mid_block' width='100%'><img align='right' style='cursor:hand' onclick=\"javascript:flipBox('$title')\" name='b_$title' border='0' src='".THEME."images/panel_$box_img.gif'>$title</td>";
echo "<td class='top_right_block'>";
echo "<img height='20' alt src='".THEME."images/pixel.gif' width='14'></td></tr></table>";
echo "<table cellSpacing='0' cellPadding='0' width='100%'>";
echo "<tr><td class='block-left'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='14'></td>";
echo "<td class='side-body'>";
echo "<div id='box_$title'"; if($open=="off"){ echo "style='display:none'"; } echo ">\n";
}
function closesidex() {
echo "</td>";
echo "<td class='block-right'>";
echo "<img height='1' alt src='".THEME."images/pixel.gif' width='9'></td></tr>";
echo "<tr><td class='block-bleft'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td>";
echo "<td class='block-bmain'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='1'></td>";
echo "<td class='block-bright'>";
echo "<img height='13' alt src='".THEME."images/pixel.gif' width='9'></td></tr></table>";
tablebreak();
}
function tablebreak() {
echo "<table width='100%' cellspacing='0' cellpadding='0'>";
echo "<tr><td height='5'></td></tr></table>\n";
}
?>
może ktoś pomoże ? |