convert these tpl tags to php

I am porting a site for a Vanilla Member .. and the default.master file is tpl.
Ive done most of the conversion, but a little stumped with this ...
{if $User.SignedIn} {$User.Name} {if $User.CountNotifications} {$User.CountNotifications} {/if} Inbox {if $User.CountUnreadConversations} {$User.CountUnreadConversations} {/if} {if CheckPermission('Garden.Settings.Manage')} Dashboard {/if} {/if} {link path="signinout"} {if !$User.SignedIn} Apply for Membership {/if} Download Hosting Documentation Community Addons Blog Home
I need to make this current with new vb versions ( 2.0.18.4 )
Plus its for the default.master.php version ...
Any ideas.. merely swapping out {if with <?php if .... etc ???
There was an error rendering this rich post.
0
Answers
Here's one
{if $User.Signedin }== if ($Session->IsValid())
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Okies awesome.. Gonna have to go thru it a line at a time lol.
There was an error rendering this rich post.
if i free up some time i can give it a run through.. i have all of that code in plguins already written..
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Would appreciate tat thankyou
no rush.
There was an error rendering this rich post.
no warranties, guarantees or attribution for what snippets were stolen from where...
i assumed that all of the tpl was trying to shove stuff into the menu bar... so i called addlink on urrything.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
If hbf wouldn't have solved it, I would have given this advice:
In the Smarty Cache directory is all templates converted to PHP maybe it uses a lot of custom PHP in those PHP files, but still... :-) Luckily the code of hbf looks great, as always... :-)
Normally the {/if} of Smarty are shorthand for the code
and the normal {if} statements are normal if's in PHP. Lots of other things is shortened PHP code, for example {link} is a custom function, so it's tougher to figure out :-)
There was an error rendering this rich post.
hmm still working my way thru it lol.
There was an error rendering this rich post.
this is driving me bonkers.
There was an error rendering this rich post.
Do it in steps
{/if} = endif;
{if !$User.SignedIn} = if ($Session->IsValid())
{link path=...} = $this->Menu->AddLink(...)
Let's see what you have left afterwards...
The CheckPermissions functions is stuffed in the AddLink function, so that's the final step.
There was an error rendering this rich post.
Right will have another go in the mornin. Cheers guys.
There was an error rendering this rich post.