Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

RESOLVED: Hello


Tricky

Rekomendowane odpowiedzi

Well, i hope ur not mad at me, but i need some help again..

i haven't modified the code i got from you, it works great!

But, i wanna have both Gallery Images + Downloads files screenshots in same code, so i dont have them separated!

(i really wanna have the rating stars there, + comments..

Gallery images


<table class='ipb_table' cellspacing="100">
   <tbody>
       <tr>
           <td class='row1'>
<?php
       /* Init */
       $return  = "";
       $to_show = 36;
       $per_row = 6;
       $count   = 0;

       /* Query */
       $this->DB->build( array( 'select'   => 'i.id AS picid, i.masked_file_name, i.directory, i.caption, i.member_id, i.ratings_count, i.ratings_total, i.comments ',
                                                        'from'     => array( 'gallery_images' => 'i' ),
                                                        'add_join' => array( 0 => array( 'select' => 'g.rate AS number',
                                                                                         'from'   => array( 'gallery_ratings' => 'g' ),
                                                                                         'where'  => 'i.id=g.img_id',
                                                                                         'type'   => 'left' ) ),
                                                        'add_join' => array( 1 => 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>";

               while ( $row = $this->DB->fetch() )
               {
                       $count++;
                       $row['rate']['id'] = intval( $row['picid'] );
                       $row['rate']['number'] = intval( $row['number'] );
                       $row['rate']['canrate']         = 1;
                       $row['rate']['_rate_int'] = $row['ratings_count'] ? round( $row['ratings_total'] / $row['ratings_count'], 0 ) : 0;

                       $row['number'] = $this->registry->output->getTemplate( 'gallery_imagelisting' )->rate_form( $row['rate'] );

                       $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><br />
               <i>By:</i><a href='index.php?app=gallery&module=user&user={$row['member_id']}'><b> {$row['uname']}</b></a></strong><br />{$row['number']}
               <br />
               <a href="index.php?app=gallery&module=images&section=viewimage&img={$row['picid']}">Comments:</a> <a href="index.php?app=gallery&module=post&section=comment&do=postcomment&img={$row['picid']}"><b>{$row['comments']}</b></a>

      </td>
EOF;

                       /* New row */
                       if ( $count && $count % $per_row == 0 )
                       {
                               $return .= "</tr><tr>";
                       }
               }

               $return .= "</tr></table></div>";
       }

       /* Return */
       print $return;
?>

Download images(screenshots)

<?php
       /* Init */
       $return  = "";
       $to_show = 18;
       $per_row = 6;
       $count   = 0;

       /* Query */
       $this->DB->build( array( 'select'   => 'f.file_id, f.file_name, f.file_ssname',
                                                        'from'     => array( 'downloads_files' => 'f' ),
                                                        'add_join' => array( 0 => array( 'select' => 'm.name as uname',
                                                                                                                         'from'   => array( 'members' => 'm' ),
                                                                                                                         'where'  => 'f.file_submitter=m.member_id',
                                                                                                                         'type'   => 'left' ) ),
                                                        'order'    => 'f.file_id DESC',
                                                        'limit'    => array( 0, $to_show ),
                                       )          );
       $this->DB->execute();

       /* Got some rows */
       if ( $this->DB->getTotalRows() )
       {
               $return .= "<div><table><tr>";

               while ( $row = $this->DB->fetch() )
               {
                       $count++;
                       $return .= <<<EOF
<td class='short'>
       <a href="index.php?app=downloads&showfile={$row['file_id']}">
EOF;

                       if ( $row['file_ssname'] )
                       {
                               $return .= <<<EOF
               <img src="index.php?app=downloads&module=display&section=screenshot&id={$row['file_id']}" width='128' height='100'  alt="{$row['file_name']}" />
EOF;
                       }
                       else
                       {
                               $return .= <<<EOF
               <em>No Screenshot Available</em>
EOF;
                       }

                       $return .= <<<EOF
       </a><br />
       <i>By:</i> <strong>{$row['uname']}</strong><br> In <a href="http://wallbase.org/index.php?app=downloads"> Skins & Themes</a>
</td>
EOF;

                       /* New row */
                       if ( $count && $count % $per_row == 0 )
                       {
                               $return .= "</tr><tr>";
                       }
               }

               $return .= "</tr></table></div>";
       }

       /* Return */
       print $return;
?>
           </td>
       </tr>
   </tbody>
</table>


Edytowane przez Tricky
Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

So you mean each upload on your board is in downloads ( zip file ) and in gallery ( screens )? :)

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Those two uploads ( to downloads and gallery ) are making by human, so i think anyone can't merge these two different ID's to one. Sorry. :)

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

I really want help you but how 'merge' different ID's without any new, advanced (really) code? :)

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

mhm, hehe, i dont know, i had a code before to have Gallery images + download files in same code.. mhm but i cant find it anymore..!!

But, is it possible to make same info as Gallery images, with stars and comments instead? ^^,) so i have it the same on both :)^^,)

Im plaing to have a menu inside the codes to, but i dont know if its hard or to do, something like this:

post-1023-1256299543,0398_thumb.png

Edytowane przez Tricky
Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.