Results 1 to 2 of 2

Thread: PHP Photo Album script v2.11 - info/help

  1. #1
    Join Date
    May 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Photo Album script v2.11 - info/help

    1) Script Title: PHP Photo Album script v2.11

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem:

    This is a great script! As far as getting the look I want, I have a few questions:

    - I am only going to have a set amount of pictures. Is there a way to remove the [page 1] link/ text when there is only 1 page?

    - I was putting the script in a table. I tried centering it within the table, but it never does. Is there a way to center this script? (Tried <center>, tried <div>center, tried adjusting the table properties...)

    - Is there a way to separate the page link from the album container. My thought is to put it somewhere else on the page and make the text links a graphic.

    Any ideas? In advanced, thanks for the input.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by designer_new View Post
    - I am only going to have a set amount of pictures. Is there a way to remove the [page 1] link/ text when there is only 1 page?
    Add to the ddphpalbum.css file:

    Code:
    .albumnavlinks{ /*CSS for DIV containing the navigational links*/
    display: none;
    }
    Quote Originally Posted by designer_new View Post
    - I was putting the script in a table. I tried centering it within the table, but it never does. Is there a way to center this script? (Tried <center>, tried <div>center, tried adjusting the table properties...)
    Generally center (be it the tag, or an attribute of another tag) is not the way to go. One can set the width of a containing division to the desired width and give that division:

    Code:
    margin: 0 auto;
    style. In IE this requires a valid URL DOCTYPE.

    Quote Originally Posted by designer_new View Post
    - Is there a way to separate the page link from the album container. My thought is to put it somewhere else on the page and make the text links a graphic.
    They are separate. You may position them via css. Their id is "phpphotoalbumvar_paginate". Where phpphotoalbumvar is the unique identifier you configured in the init.

    As for making them image instead of text links, here is where in the ddphpalbum.js code they are created:

    Code:
    	buildnav:function(){
    		var thisalbum=this
    		var navid=this.albumdivid + '_paginate'
    		document.write('<div id="' + navid +'" class="albumnavlinks">')
    		for (var i=1; i<Math.ceil(this.albumvar.images.length/this.photodivs.length)+1; i++){
    			document.write('<a href="#Page' + i+ '" rel="'+i+'">Page'+i+'</a> ')
    		}
    		document.write('</div>')
    		var navdiv=document.getElementById(navid)
    		phpimagealbum.routines.addEvent(navdiv, function(e){
    			var e=window.event || e
    			var target=e.srcElement || e.target
    			if (target.tagName=="A"){
    				thisalbum.gotopage(target.getAttribute('rel'))
    				if (e.preventDefault)
    					e.preventDefault()
    				else
    					return false
    			}
    		}, "click")
    		this.navlinks=navdiv.getElementsByTagName('a')
    		this.navlinks[0].className="current"
    	},
    The highlighted section is where the text seen is made, let's zoom in:

    Code:
    document.write('<a href="#Page' + i+ '" rel="'+i+'">Page'+i+'</a> ')
    Which produces Page1, Page2, etc. You could change that to:

    Code:
    document.write('<a href="#Page' + i+ '" rel="'+i+'"><img src="page'+i+'.gif" alt="" border="0"></a> ')
    As long as you have page1.gif, page2.gif, etc. it will work out.

    As layouts vary, if you want more help with any aspect of this:

    Please post a link to a page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •