Please use the forum's bbcode tags and indent your code to make it more readable:
Code:
for php code: [php]<?php /* code goes here */ ?>[/php]
for html: [html]<!-- markup goes here -->[/html]
for js/css/other: [code]code goes here[/code]
PHP Code:
<?php
if ($item->owner) {
$results .= "<li>";
if ($item->owner->url) {
$results .= t("By: <a href=\"%owner_url\">%owner_name</a>",
array("owner_name" => $item->owner->display_name(),
"owner_url" => $item->owner->url));
} else {
$results .= t("By: %owner_name",
array("owner_name" => $item->owner->display_name()));
}
$results .= "</li>";
}
There is a lot of context missing that makes this code hard to figure. For example, we don't know what the function t() does, how the object $item is used or the values it contains, and what output you want to end up with (beyond that it seems to be a list, and you mentioned photos).
This looks like it may be a part of a content management system...? If so, unless someone here happens to be familiar with it, you might get better advice from a forum that is oriented to that CMS specifically. Please give us more info.
Bookmarks