Owners name

tenaki

Joined: 2003-04-08
Posts: 106
Posted: Sat, 2003-04-26 21:53

Hi
I like the look of Joans script for adding the owners name.

Is there instructions as to where to ftp them too

http://www.mcgalliard.org/content/gallery/itemowner.zip

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3473
Posted: Sun, 2003-04-27 08:02

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
beckett's picture

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
joan's picture

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:

<!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=485&amp;1996" TARGET="_blank">album owner name</A><!-- BBCode End -->

 
tenaki

Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 13:45

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&amp;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
joan's picture

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?

any ideas

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sun, 2003-04-27 15:30

What's your URL?

 
tenaki

Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 16:51
 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sun, 2003-04-27 17:35

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

 
tenaki

Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 18:32

:oops: embarrassed

Thank you Joan, sorted

One question now though, is it possible to remove the email function that comes with it?

 
tenaki

Joined: 2003-04-08
Posts: 106
Posted: Sun, 2003-04-27 20:50

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;

 
skicrave

Joined: 2002-10-25
Posts: 89
Posted: Sun, 2003-04-27 22:11

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.

Thanks in advance
Shane