forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: ohvictwr 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?
<?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 '\');';
?>
-
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.
-
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 (http://forum.coppermine-gallery.net/index.php/topic,78746.0.html)
-
You copied that custom script but forgot to update the table prefix
cpg_
Update all occurrences to your actual table prefix and it should work as expected.