smarty question regarding $urllinks
Posted: Wed Apr 23, 2008 1:59 pm
Hi!
I have a question regarding Smarty. There is a custom php script running on my server. I didn't write that but I'm trying to figure out how it works so i can implement another function. The person who made it used Smarty template engine and I can not quite figure out what happens.
This is the first part of the script, the comment on the first line says: load links from news feeds
// laad de links van de news feeds
$urllinks = array();
foreach($params['items'] as $item) {
$url = $item->link;
$title = strtolower($item->title);
// strip trailing "/somenumber" part
$url = ereg_replace("(/news/[0-9]*)/(.*)","\\1/", $url);
$urllinks[$title] = trim($url);
}
It makes an array of all the stuff in $urlinks but where can I figure out how $urllinks is made up?
Thanks in advance!
Struba
I have a question regarding Smarty. There is a custom php script running on my server. I didn't write that but I'm trying to figure out how it works so i can implement another function. The person who made it used Smarty template engine and I can not quite figure out what happens.
This is the first part of the script, the comment on the first line says: load links from news feeds
// laad de links van de news feeds
$urllinks = array();
foreach($params['items'] as $item) {
$url = $item->link;
$title = strtolower($item->title);
// strip trailing "/somenumber" part
$url = ereg_replace("(/news/[0-9]*)/(.*)","\\1/", $url);
$urllinks[$title] = trim($url);
}
It makes an array of all the stuff in $urlinks but where can I figure out how $urllinks is made up?
Thanks in advance!
Struba