Create a FREE account or Login
As a guest, you don't have access to our FULL navigation system.
Author
Message
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Wed Apr 20, 2005 2:04 am Post subject: Search on every Gallery page
Hi all,
Is it possible in Gallery 1 (I'm using within PHP Nuke), to have Search appear on EVERY page of the Gallery?
Or at least more than just the first page -- as if you want to search, you have to go back....
Hope this makes sense. I did a quick Archive search but couldn't find the answer.
Help appreciated!
Deb
Back to top
AdBot
Post subject: Search on every Gallery page
Back to top
dari Site Admin Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Wed Apr 20, 2005 6:24 am Post subject: Re: Search on every Gallery page
hmmm......yes, it's possible. you will want to edit these files:
view_album.php
view_photo.php
by adding:
PHP: › <?php if ( $numPhotos != 0 ) {
echo '<td valign="middle" align="right">' ;
echo makeFormIntro ( 'search.php' , array(
'name' => 'search_form' ,
'method' => 'post' ));
echo '<span class="search">' . _ ( "Search" ) . ': </span>' ;
echo '<input class="fineprint" type="text" name="searchstring" value="" size="25">' ;
echo '</form></td>' ;
} ?>
to them where you see fit.
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Back to top
dari Site Admin Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Wed Apr 20, 2005 8:48 pm Post subject: Re: Search on every Gallery page
yes, if you remove the if clause.
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Thu Apr 21, 2005 6:05 am Post subject: Re: Search on every Gallery page
Hi,
ok, I tried with the 'if clause' but it didn't work (cut & paste) (I think it was a parse error or something)
WHERE do I put it within the 2 files you mention?
Sorry, I'm not a PHP programmer!!!!
Many thanks for your patience,
Deb
Back to top
dari Site Admin Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Thu Apr 21, 2005 6:19 am Post subject: Re: Search on every Gallery page
in view_album.php, find:
PHP: › <?php echo '<table><tr><td valign="middle" align="right">' ;
echo makeFormIntro ( 'search.php' , array(
'name' => 'search_form' ,
'method' => 'post' ));
echo '<span class="search">' . _ ( "Search" ) . ': </span>' ;
echo '<input class="fineprint" type="text" name="searchstring" value="" size="25">' ;
echo '</form></td></tr></table>' ;
$adminText = '' ;
$albums_str = pluralize_n2 ( ngettext ( "1 sub-album" , "%d sub-albums" , $numAlbums ), $numAlbums , _ ( "No albums" ));
$imags_str = pluralize_n2 ( ngettext ( "1 image" , "%d images" , $numPhotos ), $numPhotos , _ ( "no images" ));
$pages_str = pluralize_n2 ( ngettext ( "1 page" , "%d pages" , $maxPages ), $maxPages , _ ( "0 pages" )); ?>
add it before there...it should look like this:
PHP: › <?php $adminText = '' ;
$albums_str = pluralize_n2 ( ngettext ( "1 sub-album" , "%d sub-albums" , $numAlbums ), $numAlbums , _ ( "No albums" ));
$imags_str = pluralize_n2 ( ngettext ( "1 image" , "%d images" , $numPhotos ), $numPhotos , _ ( "no images" ));
$pages_str = pluralize_n2 ( ngettext ( "1 page" , "%d pages" , $maxPages ), $maxPages , _ ( "0 pages" )); ?>
you might have to tweak the table a little so that it fits in your style.
it would be put in a similar place in view_photo.php; after the call to include the photo.header file, in a table.
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Thu Apr 21, 2005 6:23 am Post subject: Re: Search on every Gallery page
Thanks will give it a go next week & let you know.
Thanks again!
Deb
Back to top
dari Site Admin Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Thu Apr 21, 2005 6:28 am Post subject: Re: Search on every Gallery page
welcome
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Tue May 24, 2005 5:59 pm Post subject: Re: Search on every Gallery page
Wooooooowie,
I think it worked!
Now.... how can I add SEARCH at the top of the page when displaying every individual IMAGE in the database?
Our site is search crazy.
Many thanks!!!!!!!!
Deb
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Tue May 24, 2005 6:34 pm Post subject: Re: Search on every Gallery page
Hi again,
Ok, I tried the same thing in view_photo.php -- & the Search box appears, but doesn't work (e.g., doesn't find search results....
Help -- I've copied a bit of the code to below.. Did I put it in the right place? --- Thanks,
Deb
includeHtmlWrap("photo.header");
?>
<!-- Top Nav Bar -->
<form name="admin_form" action="view_photos.php">
<table border="0" width="<?php echo $mainWidth ?>" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
if ($numPhotos != 0) {
echo '<td valign="middle" align="right">';
echo makeFormIntro('search.php', array(
'name' => 'search_form',
'method' => 'post'));
echo '<span class="search">'. _("Search") .': </span>';
echo '<input class="fineprint" type="text" name="searchstring" value="" size="25">';
echo '</form></td>';
}
$adminCommands = '';
$page_url=makeAlbumUrl($gallery->session->albumName, $id, array("full" => 0));
if (!$gallery->album->isMovie($id)) {
print "<a id=\"photo_url\" href=\"$photoURL\" ></a>\n";
print '<a id="page_url" href="'. $page_url .'"></a>'."\n";
if ($gallery->user->canWriteToAlbum($gallery->album)) {
$adminCommands .= popup_link("[" . _("resize photo") ."]",
"resize_photo.php?index=$index", false, true, 500, 500, 'admin');
}
if ($gallery->user->canDeleteFromAlbum($gallery->album) ||
($gallery->album->getItemOwnerDelete() && $gallery->album->isItemOwner($gallery->user->getUid(), $index))) {
// determine index of next item (after deletion)
// we move to previous image if we're at the end
// and move forward if we're not
if ($index >= $numPhotos && $index > 1) {
$nextIndex = $index - 1;
}
elseif ($index + 1 <= $numPhotos) {
$nextIndex = $index + 1;
}
else {
$nextIndex = $index;
}
// make sure that the "next" item isn't an album
if ($gallery->album->isAlbum($nextIndex)) {
$nextId='';
} else {
$nextId = $gallery->album->getPhotoId($nextIndex);
}
$adminCommands .= ' ' . popup_link("[" . _("delete photo") ."]",
"delete_photo.php?id=$id&nextId=$nextId", false, true, 500, 500, 'admin');
}
Back to top
dari Site Admin Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Wed May 25, 2005 6:18 am Post subject: Re: Search on every Gallery page
can you edit your post and use either the "code" or "php" bbcodes for your code? the parser is, I think, removing some of the code you've posted.
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Wed May 25, 2005 6:09 pm Post subject: Re: Search on every Gallery page
Hi,
I don't know how to do what you asked..
I just copied the 'code' from Crimson Editor...???
Thanks,
Deb
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Posted: Thu May 26, 2005 6:25 am Post subject: Re: Search on every Gallery page
Hi,
I compared the code in Crimson Editor & what was included in my post -- I think the text is the same (indentation was removed)???
Again, the Search Box shows up, but the search doesn't work.... (on the page with an individual image)
(So close, but yet so far away!)
Search does work on each album page now.
Deb
Back to top
dari Site Admin Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Thu May 26, 2005 7:20 am Post subject: Re: Search on every Gallery page
can you post a link to your gallery so that i can see the html source?
Back to top
dzinn User Joined: Apr 09, 2005 Posts: 39
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
All times are GMT - 5 Hours
Powered by phpBB © phpBB Group