Gallery category giving me Error!!!
Posted: 14 July 2008 10:29 PM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

Hi

I went to my gallery to view some more uploaded pics.

And i get this error.

I did make changes in the categories, Like change the category name and also the folder name it is in… and i think thats when it started happening.

Here is the site link.

www.amsterdam-sabotage.com

MySQL ERROR:

Error Number: 1064

Description
: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'title, e.entry_id title' at line 5

Query
: SELECT e.entry_id FROM exp_gallery_entries AS e LEFT JOIN exp_galleries AS p ON p.gallery_id = e.gallery_id LEFT JOIN exp_gallery_categories AS c ON c.cat_id = e.cat_id LEFT JOIN exp_members AS m ON e.author_id = m.member_id WHERE e.gallery_id = '1' AND e.status = 'o' AND e.entry_date < 1216088693 AND e.cat_id = '3' ORDER BY e.entry_date title, e.entry_id title

Thank you.

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 07:03 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23528
Joined  05-20-2002

What build and version are you running?  I couldn’t spot that exact query in the current code.  And what’s the url look like on the page that generates the error?  (Change the system name when you post- I just need the bits after index.php.)

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 July 2008 07:57 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

These are the URL that does it.
http://www.amsterdam-sabotage.com/index.php?/gallery/category/C3/
http://www.amsterdam-sabotage.com/index.php?/gallery/category/C4/
http://www.amsterdam-sabotage.com/index.php?/gallery/category/C2/

Version 1.6.3
Build 2008.04.21

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 08:06 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23528
Joined  05-20-2002

Odd- I still can’t find it in the code- though I am looking at the latest build of 1.6.4.  Can’t spot it in 1.6.3 either.  Let’s see- it only shows the error when you have a category indicator in the url?  And this is only on the frontend- correct?  Can you paste the contents of your gallery/category template?  Want to see if that gives me a hint.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 July 2008 08:15 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

WOW, what i just noticed that i went into the gallery template and everything is gone, the template group is there but no templates, i have no idea why thats not there….

In which folder can look for the template on the server, see if maybe they are there…
Or get the default once back.

Thank you.

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 08:20 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

Wait a minute now it came back, this is so messed up… I have no idea why it’s doing it.

Here is the code.

<div id="content">

{exp:gallery:entries gallery="main_photo_gallery" orderby="date" sort="title"columns="4" rows="10"}

<div id="header_gallery">

<
h1>{category}</h1>

<
div id="select_category">
<
form>
<
select class="select_box" name="URL">
<
option value=" ">Select Category</option>

{exp:gallery:category_list gallery="main_photo_gallery"}
<option value="{category_path=gallery/category} ">{category_name}</option>
{/exp:gallery:category_list}

</select>
</
form>
</
div>

</
div>

<
div id="breadcrumb">
<
a href="{path=">Gallery</a>{exp:gallery_breadcrumbs} > <a href="{category_path=">{category_name}</a>{/exp:gallery_breadcrumbs}
</div>

<
table class="photo_table" cellpadding="0" cellspacing="6">

{entries}

{row_start}
<tr>{/row_start}

{row}
<td class="photo_cell">
<
a href="{medium_url}" rel="lightbox[{category}]"><img src="{thumb_url}" width="{thumb_width}" height="{thumb_height}" alt="{title}" title="{title}"></a><br />
</
td>
{/row}

{row_blank}
<td>&nbsp;</td>{/row_blank}

{row_end}
</tr>{/row_end}

{
/entries}

</table>


{paginate}
<div class="paginate_gallery">
page {current_page} of {total_pages} pages {pagination_links}
</div>
{/paginate}


{
/exp:gallery:entries}


</div>

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 08:29 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23528
Joined  05-20-2002

Is that the full template?  If so- you have an open gallery entries tag- and the list is nested inside it.  See what I mean?  Still don’t know why the query is coming out like it is- but I’d expect that to goof things up a bit.  Is the gallery entries tag doing anything?  If not- take it out.  Otherwise- close the tag before the list.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 July 2008 08:33 AM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

I’ve update the code above…!!

Sorry for the bad posting.

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 09:00 AM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23528
Joined  05-20-2002

AHHHHH!  Man- that took me a while.  OK- problem is with your sort:

{exp:gallery:entries gallery="gallery" orderby="date" sort="title" columns="4" rows="10"}


The sort parameter only has two valid values- asc and desc- for ascending/descending.

You’re telling it to sort by title.  And the code needs a tweak to make sure you can’t inadvertantly cause a mysql error- like you just did:

$sort  = $TMPL->fetch_param('sort');
                
        if (
$sort == FALSE AND $sort != 'asc' AND $sort != 'desc')
        
{
            $sort
= 'desc';
        
}


Not sure why it’s checking for FALSE.

Anyway- I’ll put in a bug report because it really shouldn’t let you trigger an error so easily.  But basically- change the sort to asc/desc and it should be fine.

Make sense?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 July 2008 09:04 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

Sorry if i sound dumb, but where do i go to change that asc/dec thing.
I’m not got with PHP.

Thank you.

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 09:06 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23528
Joined  05-20-2002

Ah- sorry.  It’s in your template- your entries tag:

sort="title"
just remove it or replace it with
sort
="desc"


And- I still wouldn’t nest those other tags inside your entries tags- could have unintended consequences.  But the error is due to that sort parameter.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 July 2008 09:10 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Avatar
Rank
Total Posts:  45
Joined  04-20-2007

It works, thank you very very much… you are a life saver…

This is what i like the best from EE… THE SUPPORT

Thank you. Again

 Signature 

BONUSBALL KING
Paintball Apparel & Graphic Desiging.
http://www.bonusballking.com

Profile
 
 
Posted: 15 July 2008 09:28 AM   [ Ignore ]   [ # 12 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23528
Joined  05-20-2002

wink  Was an interesting problem, so I enjoyed poking it.  Glad you’re squared away- and closing this one out.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64939 Total Logged-in Users: 56
Total Topics: 81911 Total Anonymous Users: 51
Total Replies: 440322 Total Guests: 299
Total Posts: 522233    
Members ( View Memberlist )