Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Insert Row After X Amount?

    I'm still very new to php with the limited time I have so please bare with me. I have a gallery that will generate 3 images per row by using the break tag:

    $num++;
    $images.="<a href=\"$_url/image.php?u=galleries/$_GET[folder]/$file\" target='_blank'><img src=\"$_url.$gallery_path$_GET[folder]/tn-$file\"></a> \n";
    if($num==3){
    $images.="<br>";
    $num="0";
    I have 15 images total in each gallery so it'll generate 5 rows.

    I'm trying to insert a qoute/description between one of the rows like below:

    X X X
    X X X
    qoute
    X X X
    X X X
    X X X

    Thanks.

  2. #2
    Administrator chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    3,100
    Thanks
    29
    Thanked 176 Times in 167 Posts
    it's hard to tell exactly what you;re doing because there is not a lot of context code there to go by....can you show how you are looping through your image files (the code)?

    But maybe something like this?:

    PHP Code:
    $num++;
    $images.="<a href=\"$_url/image.php?u=galleries/$_GET[folder]/$file\" target='_blank'><img src=\"$_url.$gallery_path$_GET[folder]/tn-$file\"></a> \n";
    if(
    $num==3)
    {
        if (
    $file == "somefile.jpg")    
            
    $images.="<br>".$quote."<br>"// Insert HTML $quote here
        
    else
            
    $images.="<br>";
          
    $num="0"
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪


 

Posting Permissions

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