 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
drgrom Smarty n00b
Joined: 02 Feb 2009 Posts: 1
|
Posted: Mon Feb 02, 2009 9:26 am Post subject: perevesti kod v smarty |
|
|
Privet, vot etot kod pitayus' perevesti v smarty. Popravte plz:
| Code: |
$Page = $_POST['page'];
if($Page == '')
$Page = $_GET['page'];
if($Page == '')
$Page = 'categories';
$GetPath = $_GET['path'];
$Path = str_replace("x", "/", $GetPath);
$AbsPath = str_replace('/page02.php', '', $_SERVER['PHP_SELF']);
if($AbsPath != '')
$AbsPath .= '/';
$AbsPath = $Down.'cat2';
$AbsPath .= "{$Path}";
if(strlen($Path) != 3)
$PrevPath = substr($GetPath, 0, strlen($Path)-3);
$Name = LoadFromFile($AbsPath."/name.txt");
$UpAnchor = "<div align=center><a href='page02.php?path={$PrevPath}'><span class=mustred>up</span></a></div>";
$myKeyWords = LoadFromFile($AbsPath.'/meta_keywords.txt');
$myDescr = LoadFromFile($AbsPath.'/meta_descr.txt'); |
smarty:
| Code: |
$smarty->assign('$Page', '$smarty.post.page');
{if $Page == ''}
$smarty->assign('$Page', '$smarty.get.page');
{/if}
{if $Page == ''}
$smarty->assign('$Page', 'categories');
{/if}
$smarty->assign('$GetPath', '$smarty.get.path'); |
kak prodolzhit' str_replace? ya pravil'no delayu? |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|