Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 01-08-2009, 09:31 PM PHP & Lightbox
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
I'm not super familiar with PHP, but I know enough to get by on minor things. Right now I'm trying to implement lightbox on WP Photo Album.

This is the existing PHP:

PHP Code:
<div class="thumbs">
        <center>    
        <?php foreach (wppa_get_thumbs() as $tt) :  global $thumb$thumb $tt?>
                <a href="<?php wppa_photo_page_url(); ?>" class="img"><img src="<?php wppa_thumb_url(); ?>" alt="*" /></a>
        <?php endforeach; ?>
        </center>
    </div>
It made sense to me to do this:

PHP Code:
<div class="thumbs">
        <center>    
        <?php foreach (wppa_get_thumbs() as $tt) :  global $thumb$thumb $tt?>
                <a href="<?php wppa_photo_url(); ?>" class="img" rel="lightbox"><img src="<?php wppa_thumb_url(); ?>" alt="*" /></a>
        <?php endforeach; ?>
        </center>
    </div>
But it doesn't work. That is to say, it doesn't pull the photo and put it in the lightbox...It opens lightbox, but gets stuck and doesn't pull the photo.

http://triplemoonsdesign.com/demo/?page_id=13&album=1
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
 
Register now for full access!
Old 01-08-2009, 09:48 PM Re: PHP & Lightbox
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
You forgot the "{" and "{".
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Old 01-08-2009, 10:03 PM Re: PHP & Lightbox
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
Where? The only thing I changed was adding rel="lightbox" and removed _page from <?php wppa_photo_page_url(); ?>.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 01-09-2009, 10:25 AM Re: PHP & Lightbox
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
endforeach ????

PHP Code:
foreach (condition) {
     
// actions;

__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-09-2009, 10:34 AM Re: PHP & Lightbox
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
I don't understand. I only changed two things. The rest is just the code provided.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 01-09-2009, 10:44 AM Re: PHP & Lightbox
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
In other words:
PHP Code:
<div class="thumbs">
        <center>    
        <?php foreach (wppa_get_thumbs() as $tt) {  global $thumb$thumb $tt?>
                <a href="<?php wppa_photo_page_url(); ?>" class="img"><img src="<?php wppa_thumb_url(); ?>" alt="*" /></a>
        <?php ?>
        </center>
    </div>
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-09-2009, 12:55 PM Re: PHP & Lightbox
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
So are you saying the original code is wrong? Because that wouldn't open the image in Lightbox.

I tried adding rel="lightbox" and removed _page from your code and it didn't work either.

It does work if I use
<?php wppa_thumb_url(); ?> in the href, but the image is too small.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by TripleMoons; 01-09-2009 at 12:58 PM..
TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 01-09-2009, 02:01 PM Re: PHP & Lightbox
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Hmmm... I guess there is a foreach: endforeach... very unconventional though. Well, you learn something new...

What does the actual HTML that is being generated look like? That is all that matters to lightbox.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-09-2009, 02:10 PM Re: PHP & Lightbox
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
http://triplemoonsdesign.com/demo/?page_id=13&album=1

This is the whole theme file:

PHP Code:
<?php if (wppa_page('albums')) { // if is albums list page ?>
    <?php $alt ''?>
        <?php foreach (wppa_get_albums() as $ta) :  global $album$album $ta?>
<div class="album <?php echo $alt?>">
    <a href="<?php wppa_album_url(); ?>" title="View The <?php wppa_the_album_name(); ?> Album"><img src="<?php wppa_image_url(); ?>" alt="View The <?php wppa_the_album_name(); ?> Album" class="image" /></a>
    <h4 class="name"><a href="<?php wppa_album_url(); ?>" title="View The <?php wppa_the_album_name(); ?> Album"><?php wppa_the_album_name(); ?></a></h4> 
    <p class="description"><?php wppa_the_album_desc(); ?></p>
    <div class="clear"></div>        
</div>
        
<?php if ($alt == '') { $alt 'alt'; } else { $alt ''; } ?> 
<?php endforeach; ?>

<?php } else if (wppa_page('thumbs')) { // if is showing thumbs for an album ?>
    <h4 class="album_title"><?php wppa_album_name(); ?></h4>
    <?php wppa_breadcrumb(); ?><br />
    <br /><br />    
    <div class="thumbs">
        <center>    
        <?php foreach (wppa_get_thumbs() as $tt) {  global $thumb$thumb $tt?>
                <a href="<?php wppa_photo_page_url(); ?>" class="img"><img src="<?php wppa_thumb_url(); ?>" alt="*" /></a>
        <?php ?>
        </center>
    </div>
    

<?php } else if (wppa_page('single')) { // if is showing a specific photo ?>
    <?php wppa_breadcrumb(); ?><br />
    <br /><br />
    <div class="prevnext">
        <?php wppa_prev_next('<div class="prev">&laquo;<a href="%link%">Previous Photo</a></div>''<div class="next"><a href="%link%">Next Photo</a>&raquo;</div>'); ?>
    </div>
    <br /><br />
    <center>
        <a href="<?php wppa_photo_url(); ?>"><img src="<?php wppa_photo_url(); ?>" alt="<?php wppa_photo_name(); ?>" class="big" <?php echo wppa_get_fullsize(); ?> /></a>
    </center>
    <br />
    <h5 class="imagetitle"><?php wppa_photo_name(); ?></h5>
    <p class="imagedesc"><?php wppa_photo_desc(); ?></p>
<?php }  ?>
Like I said, my knowledge of PHP is extremely limited...I trip through it for the most part.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by TripleMoons; 01-09-2009 at 02:13 PM..
TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Old 01-09-2009, 02:32 PM Re: PHP & Lightbox
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Don't see a solution right away, but it should work if you can find a way to link to the image instead of the page which has the image on it. Try using the wppa_photo_url() function in the href...
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 01-09-2009 at 02:35 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-09-2009, 03:04 PM Re: PHP & Lightbox
TripleMoons's Avatar
Webmaster Talker

Posts: 614
Name: Stephanie Kunder
Location: Hanover, PA
Trades: 0
I did try that already.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

TripleMoons is offline
Reply With Quote
View Public Profile Visit TripleMoons's homepage!
 
Reply     « Reply to PHP & Lightbox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.13027 seconds with 12 queries