Log in

View Full Version : Small tweak required



theremotedr
11-27-2011, 05:12 PM
Hello
If possible i would like some help if i may
I have a small script that is located inside a php file of which it needs a small tweak.
To be honest i have looked for the solution but did not find it or it did not work for me due to my lack of this field.
Basically the script puts my name under EVERY photo i have on my site,this is a bit odd i think.
I did not want to put the script here as not sure if allowed so i will await a reply.

Thanks for your time.

traq
11-27-2011, 06:29 PM
well, you won't get any help if you don't post the script.

Are you looking for advice, so you can do it on your own, or are you asking for paid help (http://dynamicdrive.com/forums/forumdisplay.php?f=28)?

theremotedr
11-27-2011, 06:32 PM
I was not sure if i could put it here so i asked first.

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>";
}

traq
11-27-2011, 06:58 PM
Please use the forum's bbcode tags and indent your code to make it more readable:


for php code:
<?php /* code goes here */ ?>
for html:
<!-- markup goes here -->
for js/css/other:
code goes here

<?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.