Error on last albums plugin! Error on last albums plugin!
 

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

Main Menu

Error on last albums plugin!

Started by ohvictwr, August 15, 2016, 04:03:16 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ohvictwr

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 '\');';



            
         ?>

Αndré

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.

ohvictwr

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

Αndré

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

Update all occurrences to your actual table prefix and it should work as expected.