forum.coppermine-gallery.net

Support => Looking for Freelancers / Paid help => Topic started by: will on May 19, 2007, 06:15:23 pm

Title: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will on May 19, 2007, 06:15:23 pm
Hi

I'm currently using the Album List PHP and AJAX Live Search (http://forum.coppermine-gallery.net/index.php?topic=42180.0) 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
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will 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;

?>
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will 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
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will 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
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: Joachim Müller 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! (http://forum.coppermine-gallery.net/index.php?topic=8170.0)". If your posting is fit for the paid support board, it will be moved there.
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will 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
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: bowserbabe on May 24, 2007, 07:14:41 pm
I'll do it. If nobody else has volunteered, I'll send you a PM.
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will on May 25, 2007, 12:31:37 am
thank you, I look forward to your pm ;D
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: bowserbabe on May 26, 2007, 12:28:43 am
Gah, sorry, forgot to have it send me e-mail notifications if anyone replied.
Title: Re: Change From Album To Pictures In Results From The AJAX Live Search
Post by: will 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 ???