Jump to content


[CLOSED] New blocks


5 replies to this topic

#1 Paul

    Member

  • Members
  • PipPip
  • 16 posts

Posted 01 September 2009 - 05:16 AM

As anyone started creating any new blocks, converting old ones??

Need a gallery block creating :)

Paul

#2 jimbo

    Member

  • Members
  • PipPip
  • 13 posts

Posted 03 September 2009 - 11:37 AM

IPB gallery or some other gallery...?

#3 Paul

    Member

  • Members
  • PipPip
  • 16 posts

Posted 04 September 2009 - 04:39 AM

IPB gallery ;)

#4 Living In Cebu

    Newbie

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Cebu Province, Philippines

Posted 04 September 2009 - 02:29 PM

I don't know what you are looking for, Paul.

But, Steve and I had one on the Living In Cebu forum. It would show random images. The problem is, it would also show images from galleries that were private.

It wasn't that big of an issue for me, so I didn't really worry about it. Now that I am about to upgrade to v3.0, I think I will look into this again, though.

#5 Gerry

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • Gender:Male
  • Location:St Helens - UK -

Posted 15 September 2009 - 01:57 PM

Create a block called Gallery or whatever you want, and place this code inside it. Change the $to_show = 9 to whatever you want.

<table class='ipb_table' cellspacing="1">
    <tbody>
        <tr>
            <td class='row2'>
<?php
        /* Init */
        $return  = "";
        $to_show = 9;
        $per_row = 3;
        $count   = 0;
         /* Query */
        $this->DB->build( array( 'select'   => 'i.id AS picid, i.masked_file_name, i.directory, i.caption',
                                                         'from'     => array( 'gallery_images' => 'i' ),
                                                         'add_join' => array( 0 => array( 'select' => 'm.name as uname',
                                                                                          'from'   => array( 'members' => 'm' ),
                                                                                          'where'  => 'i.member_id=m.member_id',
                                                                                          'type'   => 'left' ) ),
                                                         'order'    => 'i.id DESC',
                                                         'limit'    => array( 0, $to_show ),
                                        )          );
        $this->DB->execute();
                /* Got some rows */
        if ( $this->DB->getTotalRows() )
        {
                $return .= "<div><table class='ipb_table'><tr>";
                while ( $row = $this->DB->fetch() )
                {
                        $count++;
                        $return .= <<<EOF
        <td class='short'>
                <a href="index.php?app=gallery&module=images&section=viewimage&img={$row['picid']}">
                        <img src="uploads/{$row['directory']}/tn_{$row['masked_file_name']}" alt="{$row['caption']}" />
                </a>

                Photo submitted by:

                <strong>{$row['uname']}</strong>
        </td>
EOF;                     
                        /* New row */
                        if ( $count && $count % $per_row == 0 )
                        {
                                $return .= "</tr><tr>";
                        }
                }
                 $return .= "</tr></table></div>";
        }
                /* Return */
        print $return;
?>
            </td>
        </tr>
    </tbody>
</table>


#6 Gerry

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • Gender:Male
  • Location:St Helens - UK -

Posted 17 September 2009 - 12:11 PM

As there has been no reply to this thread, I am going to class it as resolved.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users