Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Error on last albums plugin!  (Read 11618 times)

0 Members and 1 Guest are viewing this topic.

ohvictwr

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Error on last albums plugin!
« on: August 15, 2016, 04:03:16 pm »

Hello, I am using a plugin which displays the last albums uploaded in the gallery on your website.

But it displays this following message:

No album is found with query

Below, the following code. Can anyone save me?


Quote
<?php
   require_once('include/config.inc.php');
   header("Content-type: application/x-javascript");
   
   
      
   $connect = mysql_connect($CONFIG['dbserver'],$CONFIG['dbuser'],$CONFIG['dbpass'])
      or die('Erro ao conectar ao servidor');
   $connect_db = mysql_select_db($CONFIG['dbname'], $connect)
      or die ('Erro ao conectar ao banco de dados');
         
            
            $resultado = mysql_query("SELECT * FROM `cpg_albums` ORDER BY `cpg_albums`.`aid` DESC LIMIT 0 , 12", $connect)

               or die('Nenhum album encontrado com esta query');
                                       
               echo 'document.write(\'';
               
               if(mysql_num_rows($resultado) == 0){
                  echo 'Nenhum álbum cadastrado';
               } else {
echo '<div class="galeriaalbuns">';
                  while($row = mysql_fetch_array($resultado)){
                     echo ' ';
                        $album_id = $row['aid'];
                        $subresult = mysql_query("SELECT * FROM `cpg_pictures` where aid=$album_id order by pid DESC LIMIT 0, 12");
                        
                        if(mysql_num_rows($subresult) == 0){
                           $album_img = "http://ashleybensonbrasil.com/teste/fotos/thumbs/thumb_nopic.png";
                        } else {
                           while($subrow = mysql_fetch_array($subresult)){
                              $album_img = "http://ashleybensonbrasil.com/teste/fotos/albums/".$subrow['filepath'].'thumb_'.$subrow['filename']  .$subrow['datebrowse'];
                                                                               
                           }
                        }
                        
                        echo '<div class="album"><a href="http://ashleybensonbrasil.com/teste/fotos/thumbnails.php?album='.$album_id.'"><img src="'.$album_img.'" alt="" /></a> <div class="nsdsds"><div class="visisd">visite o album</div><a href="http://ashleybensonbrasil.com/teste/fotos/thumbnails.php?album='.$album_id.'">'.$row['title'].'</a></div> </div>';   
                               

                     echo '';
                  }
               }

echo '</tr></div>';
               echo '\');';



            
         ?>
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Error on last albums plugin!
« Reply #1 on: August 15, 2016, 04:37:29 pm »

If you need help with your custom script, please give us more information how it is used.

Alternatively, try CPMFetch to display content from Coppermine on external websites.
Logged

ohvictwr

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Error on last albums plugin!
« Reply #2 on: August 16, 2016, 02:29:01 am »

it is used to display the latest albums in the blog page in wordpress, functions as the same plugin http://forum.coppermine-gallery.net/index.php/topic,78746.0.html
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Error on last albums plugin!
« Reply #3 on: August 16, 2016, 11:10:57 am »

You copied that custom script but forgot to update the table prefix
Quote
cpg_

Update all occurrences to your actual table prefix and it should work as expected.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.