Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Change From Album To Pictures In Results From The AJAX Live Search  (Read 7691 times)

0 Members and 1 Guest are viewing this topic.

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263

Hi

I'm currently using the Album List PHP and AJAX Live Search but the search results only bring up the album that the pictures are stored in, is there a way of showing the pictures instead

Thanks ;D
« Last Edit: November 04, 2007, 11:45:06 am by GauGau »
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #1 on: May 19, 2007, 06:16:38 pm »

code for the livesearch.php is here

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
define('LOGIN_PHP'true);
require(
'include/init.inc.php');

$q=$_GET["q"];

if (strlen($q) > )
{
$hint "";

$searchword explode(" "$q);
for( $i 0$i sizeof($searchword); $i++ ){
$searchword[$i] = "{$CONFIG['TABLE_PICTURES']}.title LIKE '%" .$searchword[$i]. "%'";
//echo $searchword[$i] . "\n";
}
$ready implode(" AND "$searchword);

//echo $ready;

$result cpg_db_query("SELECT {$CONFIG['TABLE_ALBUMS']}.aid, {$CONFIG['TABLE_ALBUMS']}.title, COUNT({$CONFIG['TABLE_PICTURES']}.pid) FROM  {$CONFIG['TABLE_ALBUMS']}{$CONFIG['TABLE_PICTURES']} WHERE ({$CONFIG['TABLE_PICTURES']}.aid={$CONFIG['TABLE_ALBUMS']}.aid AND $ready) GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_ALBUMS']}.title ASC");
while ($row mysql_fetch_array($result)) {
if ( $hint == "" ){
$hint '<div><div style="width:85%;float:left;"><a href="thumbnails.php?album='$row[0].'">'$row[1]. '</a></div><div style="width:10%;float:right;text-align:right">'.$row[2].' files</div></div>';
}
else{
$hint $hint '<div><div style="width:85%;float:left;"><a href="thumbnails.php?album='$row[0].'">'$row[1]. '</a></div><div style="width:10%;float:right;text-align:right">'.$row[2].' files</div></div>';
}
}
mysql_free_result($result);
}

// Set output to "no suggestion" if no hint were found
// or to the correct values

if ($hint == ""){
$response "Try short one word name and then go from there";
}
else{
$response $hint;
}

//output the response
echo $response;

?>
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #2 on: May 19, 2007, 11:17:15 pm »

Right I've played around with the code to show the titles and I've got them to show, but when I click on the link to the file it gives me an error:

album/file does not exist

heres the code

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
define('LOGIN_PHP'true);
require(
'include/init.inc.php');

$q=$_GET["q"];

if (strlen($q) > 0)
{
$hint "";

$searchword explode(" "$q);
for( $i 0$i sizeof($searchword); $i++ ){
$searchword[$i] = "title LIKE '%" .$searchword[$i]. "%'";
//echo $searchword[$i] . "\n";
}
$ready implode(" AND "$searchword);

//echo $ready;

$result cpg_db_query("SELECT pid, title FROM {$CONFIG['TABLE_PICTURES']} WHERE $ready");
while ($row mysql_fetch_array($result)) {
if ( $hint == "" ){
$hint '<a href="thumbnails.php?album='$row['pid'] .'">'$row['title'] . '</a>';
}
else{
$hint $hint '<br /><a href="thumbnails.php?album='$row['pid'] .'">'$row['title'] . '</a>';
}
}
mysql_free_result($result);
}

// Set output to "no suggestion" if no hint were found
// or to the correct values

if ($hint == ""){
$response "Try short one word name and then go from there";
}
else{
$response $hint;
}

//output the response
echo $response;

?>

Can someone tell me where I'm going wrong

Thanks ;D
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #3 on: May 22, 2007, 11:15:36 pm »

anybody, I have a test gallery to show the problem I'm having

http://cdcoverhideout.com/x

If nobody can help after taking a look can a mod move this to the Paid Support forum

Thanks
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #4 on: May 23, 2007, 08:09:30 am »

Post your budget and all the other data that is suppossed to be posted along with paid support requests as suggested in "sub-board rules, read first!". If your posting is fit for the paid support board, it will be moved there.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #5 on: May 23, 2007, 02:26:27 pm »

Ok, If someone is willing to help me on this, I willing to pay $20.

The time schedule will be 1-2 weeks please has this will be a great mod to my site and I need it up and running within this time schedule.

A link is available further up this thread. Plus the code and the problem is too, if you need anymore details please ask here and I will post as much details has I can.

Thanks ;D
Logged

bowserbabe

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #6 on: May 24, 2007, 07:14:41 pm »

I'll do it. If nobody else has volunteered, I'll send you a PM.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #7 on: May 25, 2007, 12:31:37 am »

thank you, I look forward to your pm ;D
Logged

bowserbabe

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #8 on: May 26, 2007, 12:28:43 am »

Gah, sorry, forgot to have it send me e-mail notifications if anyone replied.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Change From Album To Pictures In Results From The AJAX Live Search
« Reply #9 on: June 15, 2007, 08:02:56 pm »

thank you for the PM but the coding you sent me still didn't change anything, still getting the error ???
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.