There are two files there. You should place photo_owner.php in your gallery directory.
The other is a patch file. If you have shell access, you should be able to put the file in your gallery directory and from there run:
% patch -p0 < itemowner.patch
If that's not working, you'll need to make the changes by hand. Open the patch files and read each of the file changes. Joan tends to make "context-style" patches, which means: First comes what the file looks like before you make the changes, followed by what it should be changed to:
*** line start, line end in original file ****
a few
lines of
context go here
- you'll remove lines with a "minus" sign
! you'll change lines with a "!" sign
more lines
of context go here
after the changes
--- line start, line end in changed version of file ---
a few
lines of
context go here
! you'll change this line to new text
+ you'll add this brand new line with a "+" sign
more ines
of context go here
after the changes
******
Does someone want to add a "patch" and "patch-by-hand" tutorial to the User Guide perhaps? Include info about normal, context, and unified diffs.
Hope that gets you closer!
-Beckett (
)
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 12:06
Thanks Beckett I have ftp access though not shell, what difference will that make
beckett
Joined: 2002-08-16
Posts: 3473
Posted: Sun, 2003-04-27 12:17
Then you'll probably have to edit the files by hand.
We could probably write a quick PHP script to try and run patch that way, but it'll be hard to explain. Best work your way carefully through the patch file.
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 12:28
Thanks Beckett, I have had a look at the file and it is beyond my experience to alter,change, understand! :smile:
I think I will have to wait until someone comes up with something simple to show who's album it is
joan
Joined: 2002-10-21
Posts: 3473
Posted: Sun, 2003-04-27 13:20
Quote:
I think I will have to wait until someone comes up with something simple to show who's album it is
Album owner? Then you have the wrong patch. That is for adding an owner to individual images within an album.
What you need is this much simpler fix, straight from Bharat:
Thank you Joan, what a star. sorry Beckett if I mislead you there "Doh"
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 14:00
Joan before i stick on site would this addition be ok
<?php
// This is the default thumb photo footer (for the gallery photo
// page: view_album.php). It's companion is inline_albumthumb.header.default.
//
// To override this header, create a file called inline_albumthumb.footer
// in this directory.
//
// NOTE: This footer gets inserted below each photo.
//
// Some tips:
// $GLOBALS['index'] is the index of the photo
// $gallery->album is the current album
// $gallery->album->getPhotoId($GLOBALS['index']) is the id of the current photo
?>
<?
$i = $GLOBALS['i'];
if ($gallery->album->isAlbumName($i)) {
$myAlbumName = $gallery->album->isAlbumName($i);
$myAlbum = new Album();
$myAlbum->load($myAlbumName);
$owner = $myAlbum->getOwner();
$username = $owner->getFullName();
echo "<center>";
echo "<span class='caption'>";
echo "Owned By: <a
href=user.php?op=userinfo&uname=".$username.">".$username."</a>";
echo "</span>";
echo "</center>";
}
?>
I have literally copied and pasted the mod into the inline_albumthumb.footer, should I remove some of the < tags
joan
Joined: 2002-10-21
Posts: 3473
Posted: Sun, 2003-04-27 14:06
That looks absolutely fine - but just test it. If there's a problem fix it or remove the file again. It won't break anything in your albums.
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 14:27
Joan, all done but it doesn't show the owners name, nothing seems to have changed?
To modify it so that the owners name is not a link to their email, open albums.php and find around line 242:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <span class="desc">
Owner: <a href=mailto:<?php echo $owner->getEmail()?>><?php echo $owner->getFullName()?></a>
</span> </TD></TR></TABLE><!-- BBCode End -->
change that to:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <span class="desc">
Owner: <?php echo $owner->getFullName()?>
</span> </TD></TR></TABLE><!-- BBCode End -->
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Mon, 2003-04-28 18:59
Ta :smile:
Joker
Joined: 2002-11-14
Posts: 1
Posted: Wed, 2003-05-28 21:56
The mod works great thankyou very much!
Where and what file do I need to edit to add the text Posted or Added by - before the username? I'm assuming it is in the view_photo.php, but haven't found anything that looks like what I'm looking to edit.
Posts: 3473
There are two files there. You should place photo_owner.php in your gallery directory.
The other is a patch file. If you have shell access, you should be able to put the file in your gallery directory and from there run:
% patch -p0 < itemowner.patch
If that's not working, you'll need to make the changes by hand. Open the patch files and read each of the file changes. Joan tends to make "context-style" patches, which means: First comes what the file looks like before you make the changes, followed by what it should be changed to:
*** line start, line end in original file ****
a few
lines of
context go here
- you'll remove lines with a "minus" sign
! you'll change lines with a "!" sign
more lines
of context go here
after the changes
--- line start, line end in changed version of file ---
a few
lines of
context go here
! you'll change this line to new text
+ you'll add this brand new line with a "+" sign
more ines
of context go here
after the changes
******
Does someone want to add a "patch" and "patch-by-hand" tutorial to the User Guide perhaps? Include info about normal, context, and unified diffs.
Hope that gets you closer!
-Beckett (
)
Posts: 106
Thanks Beckett I have ftp access though not shell, what difference will that make
Posts: 3473
Then you'll probably have to edit the files by hand.
We could probably write a quick PHP script to try and run patch that way, but it'll be hard to explain. Best work your way carefully through the patch file.
Posts: 106
Thanks Beckett, I have had a look at the file and it is beyond my experience to alter,change, understand! :smile:
I think I will have to wait until someone comes up with something simple to show who's album it is
Posts: 3473
Album owner? Then you have the wrong patch. That is for adding an owner to individual images within an album.
What you need is this much simpler fix, straight from Bharat:
<!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=485&1996" TARGET="_blank">album owner name</A><!-- BBCode End -->
Posts: 106
Thank you Joan, what a star. sorry Beckett if I mislead you there "Doh"
Posts: 106
Joan before i stick on site would this addition be ok
<?php
// This is the default thumb photo footer (for the gallery photo
// page: view_album.php). It's companion is inline_albumthumb.header.default.
//
// To override this header, create a file called inline_albumthumb.footer
// in this directory.
//
// NOTE: This footer gets inserted below each photo.
//
// Some tips:
// $GLOBALS['index'] is the index of the photo
// $gallery->album is the current album
// $gallery->album->getPhotoId($GLOBALS['index']) is the id of the current photo
?>
<?
$i = $GLOBALS['i'];
if ($gallery->album->isAlbumName($i)) {
$myAlbumName = $gallery->album->isAlbumName($i);
$myAlbum = new Album();
$myAlbum->load($myAlbumName);
$owner = $myAlbum->getOwner();
$username = $owner->getFullName();
echo "<center>";
echo "<span class='caption'>";
echo "Owned By: <a
href=user.php?op=userinfo&uname=".$username.">".$username."</a>";
echo "</span>";
echo "</center>";
}
?>
I have literally copied and pasted the mod into the inline_albumthumb.footer, should I remove some of the < tags
Posts: 3473
That looks absolutely fine - but just test it. If there's a problem fix it or remove the file again. It won't break anything in your albums.
Posts: 106
Joan, all done but it doesn't show the owners name, nothing seems to have changed?
any ideas
Posts: 3473
What's your URL?
Posts: 106
http://www.touringandtenting.com/gallery/albums.php
Posts: 3473
Um, you just wanted the owner name to display on the front page?
Open config.php. Change
$gallery->app->default["showOwners"] = "no";
to
$gallery->app->default["showOwners"] = "yes";
Posts: 106
:oops: embarrassed
Thank you Joan, sorted
One question now though, is it possible to remove the email function that comes with it?
Posts: 106
To remove the email function, could I edit this section maybe?
modify_user.php
}
$fullname = $tmpUser->getFullname();
$email = $tmpUser->getEmail();
$canCreateChoices = array(1 => "yes", 0 => "no");
$canCreate = $tmpUser->canCreateAlbums() ? 1 : 0;
Posts: 89
To modify it so that the owners name is not a link to their email, open albums.php and find around line 242:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <span class="desc">
Owner: <a href=mailto:<?php echo $owner->getEmail()?>><?php echo $owner->getFullName()?></a>
</span> </TD></TR></TABLE><!-- BBCode End -->
change that to:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <span class="desc">
Owner: <?php echo $owner->getFullName()?>
</span> </TD></TR></TABLE><!-- BBCode End -->
Posts: 106
Ta :smile:
Posts: 1
The mod works great thankyou very much!
Where and what file do I need to edit to add the text Posted or Added by - before the username? I'm assuming it is in the view_photo.php, but haven't found anything that looks like what I'm looking to edit.
Thanks in advance
Shane