• [Mod] Mini-Top 5 0 5 1
Currently:  

Author Topic: [Mod] Mini-Top  (Read 235633 times)

0 Members and 1 Guest are viewing this topic.

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: DB error: bad SQL querry
« Reply #150 on: December 26, 2009, 02:50:50 PM »
Thanks for your answering...

When i reinstalled gallery, and make new tables with names 4images_ have a same problem:

 DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name FROM 4images_images i, 4images_categories c LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (0) ORDER BY i.image_hits DESC, i.image_name ASC
Unknown column 'i.user_id' in 'on clause'


But some days ago it worked normally!!

Rembrandt

  • Guest
Re: DB error: bad SQL querry
« Reply #151 on: December 26, 2009, 02:59:54 PM »
but the errors described here ://www.4homepages.de/forum/index.php?topic=22668.msg123709#msg123709

replace:
FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
with:
FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)

mfg Andi


Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: DB error: bad SQL querry
« Reply #152 on: December 26, 2009, 03:11:17 PM »
Yes, i`m not to do that, becouse i have  this ( ) symbols yet.. but problem active

Look at this part of my categories.php:

$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
        ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
        LIMIT $offset, $perpage";

Maybe replace from:
FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)

to

FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c

???

Rembrandt

  • Guest
Re: DB error: bad SQL querry
« Reply #153 on: December 26, 2009, 03:26:16 PM »
...
Maybe replace from:....
i think not...

and you've checked all your mod?

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: DB error: bad SQL querry
« Reply #154 on: December 26, 2009, 03:38:12 PM »
Yes, of course!!! I`m installed new 4images, and new tables. Then installed only one mod mini_top and have the same error:

xxx: drandrew. jino. ru/4images/index. php

Sir, help me please

and else, can you give me working link to this file: fadeslideshow.js???

Rembrandt

  • Guest
Re: DB error: bad SQL querry
« Reply #155 on: December 26, 2009, 03:45:52 PM »
no problem,  wait  a moment

so.... i have installed the mod from the first post and its works, ist very easy.

if you want to give me FTP login details by PM.


EDIT:
so.. i say:
replace:
FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
with:
FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)

and you did not do it !   now it works..

the other mod, have i the download link edited..

mfg Andi
« Last Edit: December 26, 2009, 04:46:26 PM by Rembrandt »

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: DB error: bad SQL querry
« Reply #156 on: December 26, 2009, 05:16:04 PM »
Rembrandt, THANK YOU VERY, VERY MUCH SIR!!!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Mini-Top
« Reply #157 on: December 26, 2009, 05:21:50 PM »
Fixed version is attached to the first post now.

P.S.
* V@no confused how is this discussion also exists as a separate topic in programming section?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Mini-Top
« Reply #158 on: December 26, 2009, 07:35:37 PM »
V@no thank you for fix..

i merged that one and this one here.
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline tennis-ecards

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [Mod] Mini-Top
« Reply #159 on: January 23, 2010, 12:33:08 AM »
Hi guys, here is the new idea -

to avoid duplications and to draw more attention to different photos i suggest we make a variation of this MOD to show different photos. Now there is a possibility that one photo could be a leader in some areas like most commented and most viewed and most rated...  

What I suggest is to make the following system:

photo a = leader max votes
photo b = leader max comments
if a=b then in place of photo show next one down (i.e photo with max comments - 1)

etc...

the idea is to have this block with different pictures and avoid the possibility to have duplications... The TRUE ratings would still be shown in TOP images section...



I would also love to have different MINI TOPs...

MINI TOP of the DAY
MINI TOP of the WEEK
MINI TOP of the MONTH

I guess that would involve duplicating the MOD three times??

EDIT
Nevermind.. solved...

Das würde mich auch sehr interessieren. Hat jemand eine Idee und kann helfen?

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [Mod] Mini-Top
« Reply #160 on: January 23, 2010, 12:38:22 PM »
Das würde mich auch sehr interessieren. Hat jemand eine Idee und kann helfen?

hi there! no problem. I am willing to share my solution with the world!

I have reworked the entire mini-top mod...

attached is my version (place the files in the root of your 4images)

in your template home.html include the following code:
Code: [Select]
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td valign="top">
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_day}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_day}</td>
</tr>

</table><br/>
</td>

</tr>

<tr>
<td valign="top">
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_week}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_week}</td>
</tr>

</table><br/>
</td>
</tr>

<tr>
<td valign="top">
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_month}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_month}</td>
</tr>

</table><br/>
</td>
</tr>

<!--<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_title}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_images}</td>
</tr>
</table><br/>
</td>
</tr>-->
</table>

of course the language variables have to be set as well....

maybe this is not the most elegant solution, but it works for me.... please note, the system removes duplications in each rating, so that for example in the mini-top of the day, no identical images will be shown...

now, if somebody will make a separate module to use this code but so that user can select a date and the code would show ratings for this date, that would be great )))

Offline tennis-ecards

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [Mod] Mini-Top
« Reply #161 on: January 23, 2010, 05:17:30 PM »
Quote
hi there! no problem. I am willing to share my solution with the world!

I have reworked the entire mini-top mod...

attached is my version (place the files in the root of your 4images)

in your template home.html include the following code:
Code: [Select]
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td valign="top">
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_day}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_day}</td>
</tr>

</table><br/>
</td>

</tr>

<tr>
<td valign="top">
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_week}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_week}</td>
</tr>

</table><br/>
</td>
</tr>

<tr>
<td valign="top">
<table width="100%" valign="top" border="0" cellspacing="0" cellpadding="1">
<tr>
<td class="head1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_month}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_month}</td>
</tr>

</table><br/>
</td>
</tr>

<!--<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="head1" valign="top">{lang_mini_top_title}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="row1">{mini_top_images}</td>
</tr>
</table><br/>
</td>
</tr>-->
</table>

of course the language variables have to be set as well....

maybe this is not the most elegant solution, but it works for me.... please note, the system removes duplications in each rating, so that for example in the mini-top of the day, no identical images will be shown...

now, if somebody will make a separate module to use this code but so that user can select a date and the code would show ratings for this date, that would be great )))

Danke, das geht absolut in die richtige Richtung. Ich bräuchte für meine Seite jedoch eine kleine Änderung, da ich den ursprünglichen Code geändert hatte.
Ich möchte gerne die Motive mit den meisten Hits, den meisten verschickten Postkarten, den meisten Downloads und der besten Bewertung einbauen. Für den "alten Code" hatte ich das so geändert, aber hier bekomme ich das nicht hin. Was muss ich tun?

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [Mod] Mini-Top
« Reply #162 on: August 22, 2010, 07:42:07 PM »
4images 1.7.8
Quote
Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name
        FROM 4images_images i,  4images_categories c
        LEFT JOIN 4images_users u ON (u.user_id = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (0, 1)
        ORDER BY i.image_rating DESC, i.image_votes DESC
Unknown column 'i.user_id' in 'on clause'
Wo liegt das Problem?

In der Datei sieht das so aus:
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN ("
.get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."
        ORDER BY i.image_"
.$selection[$cnt]." DESC, i.image_".$selection_alt[$cnt];

Rembrandt

  • Guest

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [Mod] Mini-Top
« Reply #164 on: August 25, 2010, 04:51:48 PM »
@VANO,

HEllo ur link is dead. Can u please re-update, so i can see you demo site please sir. Thank u VANO,