dodam że tak nie działa
help !
{if $modul == ""} {/if} {if $modul != ""} {/if}
{$smarty.get.id} {if $smarty.get.id !=""} {include_php file="`$smarty.get.id`.php"} {/if}
{if $modul != ""} {/if}
<?php require('libs/Smarty.class.php'); require('cfg.php'); $smarty = new Smarty; $_GET['id']; $smarty->assign("site", $_GET['id']); $smarty->display('index.tpl'); ?>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="generator" content="pspad editor, www.pspad.com"> <link rel="stylesheet" type="text/css" href="templates/style.css" /> </head> <body> <div id="site"> <div id="head"> <div id="login"> {include_php file="login.php"} </div> </div> <div id="menu"> <div style="padding-left: 35px;"> </div> </div> <div> {if $site ==""} {$site} zmienna site jest pusta {include_php file="news.php"} {/if} {if $site !=""} {$site} zmienna site posiada wartosc {include_php file="`$site`.php"} {/if} </div> </div> </body> </html>
<?php require('cfg.php'); $smarty = new Smarty; $result = mysql_query("SELECT id, title, author, text, img, date, commnets FROM news ORDER BY id ASC") { $tablica[] = $news; } $smarty->assign('result',$tablica); $smarty->display('news.tpl'); ?>
<?php require('libs/Smarty.class.php'); require('cfg.php'); $smarty = new Smarty; switch($_GET['id']) { case 'news': require('news.php'); break; } $smarty->assign("site", $_GET['id']); $smarty->display('index.tpl'); ?>
<?php $result = mysql_query("SELECT id, title, author, text, img, date, commnets FROM news ORDER BY id ASC") { $tablica[] = $news; } $smarty->assign('result',$tablica); ?>
{if $site ==""} {$site} zmienna site jest pusta {/if} {if $site !=""} {$site} zmienna site posiada wartosc {/if}
<?php require('cfg.php'); $smarty = new Smarty; $login = $_POST['login']; $password = $_POST['password']; $sql = "SELECT id, login, password FROM users WHERE login='".$login."' and password='".$password."'"; $login_status= "SELECT id, login, password, level, points FROM users WHERE login='".$_POST['login']."'"; $_SESSION['zalogowany'] = $status_user['id']; $_SESSION['login2'] = $status_user['login']; $_SESSION['points'] = $status_user['points']; } else { $blad = 1; $smarty->assign('blad', $blad); } } if ($_GET['logout'] == "log") { $smarty->assign('destroy', $sdestroy); } $smarty->assign('points', $_SESSION['points']); $smarty->assign('id', $_SESSION['zalogowany']); $smarty->assign('login2', $_SESSION['login2']); $smarty->display('login.tpl'); return $return; ?>
Fatal error: Call to a member function assign() on a non-object in /home/edesing/public_html/login.php on line 50
<?php $login = $_POST['login']; $password = $_POST['password']; $sql = "SELECT id, login, password FROM users WHERE login='".$login."' and password='".$password."'"; $login_status= "SELECT id, login, password, level, points FROM users WHERE login='".$_POST['login']."'"; $_SESSION['zalogowany'] = $status_user['id']; $_SESSION['login2'] = $status_user['login']; $_SESSION['points'] = $status_user['points']; } else { $blad = 1; $smarty->assign('blad', $blad); } } if ($_GET['logout'] == "log") { $smarty->assign('destroy', $sdestroy); } $smarty->assign('points', $_SESSION['points']); $smarty->assign('id', $_SESSION['zalogowany']); $smarty->assign('login2', $_SESSION['login2']); //szablon już wyświetlasz w pliku index.php tu potrzebujesz tylko zmiennych do szablonu login.tpl //$smarty->display('login.tpl'); //return $return; ?>
$smarty->debugging = true;