4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Vraxor on November 05, 2002, 10:08:02 AM
-
Yesterday I started changing the code of 4 images for the first time and with succes. I altered the Toplist to show a top 10 of Most commented images.
I also added some lines to the top.php file to show the thumbnails, this last edit took me many hours since I do not have any programming skills yet, I'm a quick learner so I will be able to mange soon enough I think ;-)
Feel free to take a look and if enough people love the way I changed the toplist I might write a tutorial here.
to view the toplist: http://haunter.student.utwente.nl/Terrarevolution/galleries/top.php
Cheers,
Vraxor
-
very cool!!! please tell how you did this !! i'm very intrested in your modification. Can you please email the source?
Or tell how you did this?
Dutch :)
Zou je kunnen vertellen hoe je dit hebt gedaan? Ik heb er echt heel veel belangstelling voor. Is dit ook mogelijk om op andere pagina's weer te geven?
-
Hi Xippix,
I will keep this in english although I know you are Dutch too.
I have absolutely no knowledge of coding (whatever language) so I just tried and tried and succeeded. Now comes the problem I guess and that is that I use version 1.6.1 instead of 1.7
This is because I had some problems with gettig the 1.7 version to work a 100% correct. I do not yet know if the toplist code is the same or not, but we can always try. if you have some basic knowlegde of php I will just hand over some of the code I added to the top.php file and maybe you can check if this works for 1.7 too.
Cheers,
Vraxor
-
Hi Vraxor,
Ok we will keep it in english :)
I can't test it, i use 1.6 to :)
I have the same probs with 1.7.
Please send the code or share it with us.
Regards,
Bas
info@xippix.nl
-
Ok,
I'm at work right now, but I will see if I can find some time later, maybe this evening to post the code. I will also write a tutorial later on in how to edit the toplist to your own liking, it isn't really hard to do and maybe one of the best pages to edit if you like to see direct results of your actions.
Cheers,
Vraxor
-
ok i'm looking forward
if you have time, please mail the script to me
info@xippix.nl i can take a closer look at it.
-
Here I post the Top.php code I altered. You should be able to create the needed changes in the Top template and add a new line in the English and german language main.php file.
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_rating DESC, i.image_votes DESC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_votes DESC, i.image_name ASC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_votes_'.$i] = "--";
$register_array['image_votes_user_'.$i] = "--";
$register_array['image_votes_cat_'.$i] = "--";
$register_array['image_votes_number_'.$i] = "--";
$register_array['image_votes_thumb_'.$i] = "--";
}
}
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_hits, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
$register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_hits_'.$i] = "--";
$register_array['image_hits_user_'.$i] = "--";
$register_array['image_hits_cat_'.$i] = "--";
$register_array['image_hits_number_'.$i] = "--";
$register_array['image_hits_thumb_'.$i] = "--";
}
}
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_downloads, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_downloads DESC, i.image_name ASC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
$register_array['image_downloads_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_downloads_'.$i] = "--";
$register_array['image_downloads_user_'.$i] = "--";
$register_array['image_downloads_cat_'.$i] = "--";
$register_array['image_downloads_number_'.$i] = "--";
$register_array['image_downloads_thumb_'.$i] = "--";
}
}
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_comments DESC, i.image_votes DESC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
$register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_comments_'.$i] = "--";
$register_array['image_comments_user_'.$i] = "--";
$register_array['image_comments_cat_'.$i] = "--";
$register_array['image_comments_number_'.$i] = "--";
$register_array['image_comments_thumb_'.$i] = "--";
}
}
As you can see I copied almost the entire Top.php file and I leave it up to you to find the things I changed.
Note that this is only a part of the code from top.php and I do not know if this will be compatible with 4images 1.7 since I use 1.6.1
If there are any questions, please feel free to ask me and I will see if I can help.
Cheers,
Vraxor
http://Http://Terra.2ya.com
-
well, what i need to do?
paste the code in a php document and call it top.php?
i have do that, and replace it but i get this error:
Fatal error: Call to a member function on a non-object in /home/zippie/HTML/top.php on line 8
what can i do to fix it?
-
I already said that this was only part of the top.php file, so you have to past this code inside the top.php file, but only replace the code covered by the code I posted above. In this case I will send you my top.php file so that you can see what I did.
to see any difference you also need to edit the top.html template to let it use the new comments top and show the thumbnails.
Cheers,
Vraxor
-
thx, i will wait for the mail. Plz send the top.html file to.
-
mm i install it, but i get some errors
Parse error: parse error in /home/zippie/HTML/top.php on line 61
do you know what it is?
-
This should be the line on row 61:
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
Please compare
-
Here I post the Top.php code I altered. You should be able to create the needed changes in the Top template and add a new line in the English and german language mail.php file.
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file,
As you can see I copied almost the entire Top.php file and I leave it up to you to find the things I changed.
Note that this is only a part of the code from top.php and I do not know if this will be compatible with 4images 1.7 since I use 1.6.1
I just tried this myself and found adding the thumbs to top.html in this manner works perfectly with 4images 1.7
Bravo! Thanks for a super mod. It's just so much better to have the thumbnails in the top list as it makes using the top list more appealing. Hopefully Jan will take this up as a feature in the next release.
-
Thanks Chris,
I thought so too, but it would be even better if seperated thumbnail where made for the top. At this moment I use the already existing thumbnails. Those have a width of 100x*, but I resize them in html to 48x36. This only effects the way the top looks, but everybody is still loading the entire range of thumbnails.
I was at first planning to just let te toplist show more then 10 images. For example I wanted a top 50. I soon figured out that each section of top.php was seperate so it was possible to create a top 50 of best rankings and a top 100 of most hits. the only thing needed to change in order to show more images in the top is to change the following values in each section:
ORDER BY i.image_rating DESC, i.image_votes DESC
LIMIT 20";
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
If you change the value (in the example I have made a top 20, so change the 20 in both lines)
I plan about explaining the way you can edit the toplist more in a tutorial so that everybody can edit the toplist him/herself and of course it would be great if Jan implemented the changes I made in the 1.8 version.
Cheers,
Vraxor
-
mm strange? why it doesn't work here?
i get some line errors. see post above
-
Hey It is really great idea..can you please help me and tell me what you ad to the top.html template
what I need to ad to the every line in the top.html ?
<tr>
<td valign="top" class="row1" align="center"><b>1</b></td>
<td valign="top" class="row1">{image_rating_1}</td>
<td valign="top" class="row1">{image_rating_user_1}</td>
<td valign="top" class="row1">{image_rating_cat_1}</td>
<td valign="top" class="row1" nowrap="nowrap">{image_rating_number_1}</td>
</tr>
I try but this don't show anything and the top.php was reworked correct.
Thank you for your help
Groetjes!
-
ok, this should help you on your way:
{image_comments_thumb_1}
I kep the same style as the original files I just created my own top for comments and by using the template call above you show the first thumbnail in the Comments top.
The rest of the template should be altered using similar strings.
Cheers,
Vraxor
-
thank you very much!!!
I got this now :)
Hugs!
-
I use 4images 1.7 und want to add this feature.
I add the following code:
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_comments DESC, i.image_votes ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
$register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_comments_'.$i] = "--";
$register_array['image_comments_user_'.$i] = "--";
$register_array['image_comments_cat_'.$i] = "--";
$register_array['image_comments_number_'.$i] = "--";
$register_array['image_comments_thumb_'.$i] = "--";
}
}
But I have this error:
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.username FROM 4images_images i, 4images_categories c LEFT JOIN phpbb_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id ORDER BY i.image_comments DESC, i.image_votes ASC LIMIT 10
The table 'SQL1e2ee38_0' is full
You can check this:
http://www.brinkmann-online.de/umleitung/4images/top3.php
Where is the fault, can yomebody help me
Thanks Daniel
-
try replacing the code you gave by this:
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_comments DESC, i.image_votes DESC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
$register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_comments_'.$i] = "--";
$register_array['image_comments_user_'.$i] = "--";
$register_array['image_comments_cat_'.$i] = "--";
$register_array['image_comments_number_'.$i] = "--";
$register_array['image_comments_thumb_'.$i] = "--";
}
}
-
Sorry, but it didn´t work.
May be another solution?
Thanks Daniel
-
then the error is probably not in the code you gave,
sorry but I use version 1.6.1 so I do not know about any differences
Hope someone else could help you out.
-
I use 1.7 and all works as well without any problems..
I see from you message that your MQSL have little problem:
( LIMIT 10 The table 'SQL1e2ee38_0' is full ) so this have nothing to do with the bad code only your MQSL
-
Man,
It worked right ou of the box!!!! no plug and pray :wink: . Fantastic mod and for sure it has to make its way in the new release!
I just see a little bug! :cry: well just an oversee I think. If you display other media types on your gallery the thumbnails for these are stored somewhere else (different directory)! and in that case when the value pairs get built the URL for the media type is wrong resulting in a broken link/image. Not a huge deal, I need to look in your mod to find out where it is. It might be as easy as copying the other media type gif thumbs into each categories directories? dunno yet! -- Remember to always BACKUP! before you try a mod!!
Thanks a lot!
Sam
-
well, you are right about that.
and I now see the error myself. You will have to look for this string in each part of top.php. Since I only work with jpg files I did not see the bug, but in here I hardcoded the path to the thumbnails.
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
There should be a way to keep it dynamic, but I just don't know how yet.
Cheers,
Vraxor
-
and now it shows different images in "top 10 images by rating" with same rating. does script changed sequense of choosing images with same rating?
-
Dunno? that's a good question for Jan!!
Good Luck
Sam
-
Hi..
I SEE the module on your page and it is fantastic.. Great Job.
Dude it is possible to pub on the web a "tutorial" with we need to do, add... but a tutorial complete..
Tks.
-
hi,
great mod, but it will not work at my page.
what must an in the English and german language mail.php file?
thx
markus oeder
-
thanks Vraxor :D :D :D
it works fine with v1.7
-
you wrote at the first page of the thread:
"... Here I post the Top.php code I altered. You should be able to create the needed changes in the Top template and add a new line in the English and german language mail.php file..."
i can't find am "mail.php"-file. what file do you mean?
-
Vraxor meant "main.php" You can find this file under each language pack directory.
-
:o , sorry now I understand what you meant by Mail.php :oops:
yes, this should be main.php, I really have a problem with typing :)
Cheers,
Vraxor
-
ok, thank you :D
but, what " ... new line in the English and german language main.php file ..." i have to insert???
-
look at the code,
you have now 5 categories in the top.php and the new one is comments. you must add the new comment tag in the ../lang/english(deutsch)/main.php. It is only for the new comments header {lang_top_image_comments} in the top.html and you must modify in all language packs you are use.
1. add the comments description in the image details
//-----------------------------------------------------
//--- Image Details --------------------------------
//-----------------------------------------------------
$lang['hits'] = "Hits:";
$lang['downloads'] = "Downloads:";
$lang['rating'] = "Rating:";
$lang['votes'] = "Vote(s)";
$lang['comments']="Comments";
2. add the comments tag the top images details and if you have set more then 10 Top images you must change this to your prefer (5,20,50,?). look to the top.html here is the {lang_top_image_comments}
//-----------------------------------------------------
//--- Top Images --------------------------------------
//-----------------------------------------------------
$lang['top_image_hits'] = "Top 10 images by hits";
$lang['top_image_downloads'] = "Top 10 images by downloads";
$lang['top_image_rating'] = "Top 10 images by rating";
$lang['top_image_votes'] = "Top 10 images by votes";
$lang['top_image_comments'] = "Top 10 images by comments";
3. change of top.html for the new thumbnails
add a new tablerow for the thumbnails. in the new cells you write the thumb tag {image_hits_thumb_1} {image_downloads_thumb_1} {image_rating_thumb_1} {image_votes_thumb_1} and so on (_2, _3, _4,...) for the different top categories.
4. change the top.html for the new comment category
add new tablecells for the new top comments category. in the header you write {lang_top_image_comments} and in the cells you write the same as in the hits, downloads, rating,... but modifying the new comments tag z.B. {image_comments_thumb_1} {image_comments_1} {image_comments_user_1} {image_comments_cat_1} {image_comments_number_1} and so on (_2, _3, _4,...).
i hope it's clear
much fun threelum
-
finaly got it work... :D
but... :? how about media files? it displays bronken picture.
-
ok, fixed that.
if anyone need it I'll post the code. :wink:
-
hi,
ich need the code:
macho@imperium.de
thx
markus
-
V@no if it's possible could u send me your files that r edited? Im lost on this mod but I want it
-
ok, fixed that.
if anyone need it I'll post the code. :wink:
Please post it. Thanks.
-
Ok, there is not much to change in the Vraxor's code
I will show on example of RATING code.
so, here it goes:
1. u need add i.image_media_file in $sql line, in each part for RATING, VOTES, DOWNLOADS, HITS:
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_media_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
2. add after line in each part for RATING, VOTES, DOWNLOADS, HITS:for ($i = 1; $i <= 20; $i++) {
this code: if (isset($top_list[$i])) {
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
}
3. change this: $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
to this: $register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"".$thumb_file."\" width=\"48\" height=\"36\" border=\"1\" alt=\"\" />";
so, basicaly all u need is to change in last code - "<img src=....>"<img src=\"".$thumb_file."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />
for VOTES, DOWNLOADS, HITS u'll need change in step 3. :
image_rating_thumb_
to:
image_votes_thumb_
image_downloads_thumb_
image_hits_thumb_
hope that's understandable...;)
-
I get an "not found" Error, if i have no Thumbnail set for a picture.
For Example if a Video File ist locatet in the TOp Script, you have
no standart Thumbnail. Then you get: (http://www.amosnet.de/4images/data/thumbnails/69/)
Anyone a idea?
http://www.amosnet.de/4images/top.php
-
did u missed my post above? 8O
-
i get a broken image if i have no Thumbnail set for a picture.
when i add after line in each part for RATING, VOTES, DOWNLOADS, HITS: Code:
for ($i = 1; $i <= 20; $i++) {
this code: Code:
if (isset($top_list[$i])) {
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
i get a php error.
-
Can somebody please post the code for the broken link problem please?
-
Hello guys!!!
I took me about 30 minutes to find out how to intstall this MOD, I tried reading all 3 pages, finally gave up and made a new way of changing files based on the code of Vraxor.
The main file to be changed is top.php. There are 4 sections there named
// Rating
// Votes
// Hits
// Downloads
They are all the same, just have different setting for showing photos - Rating sorts images by rating and so on.
So all we need to do is:
1. In each section find:
$sql = "SELECT i.image_id, i.user_id, i.cat_id,
at the end of the line ADD:
, i.image_thumb_file
Note that you should do this for all 4 sections of the top.php file.
2. After in the //Rating part of the file you should find
$register_array['image_rating_number_'.$i]
and add add the new line below this line:
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
then find
$register_array['image_rating_number_'.$i] = "--";
and add below this line:
$register_array['image_rating_thumb_'.$i] = "--";
You are now finished with the //Rating part of the top.php file.
Now you have 3 more parts to finish:
// Votes
// Hits
// Downloads
Do the same as stated in 2. but don't forget to change way sorting is done. Just the //Rating part we were adding ['image_rating_thumg_'.$i], so in //Votes part we should add ['image_votes_part_'.$i] and so on. Don't forget to change it all the rest 3 parts!
3. In the top.html file you should add 1 column in the tables and paste this code to the corresponding parts:
{image_hits_thumb_1}
{image_downloads_thumb_1}
{image_rating_thumb_1}
{image_votes_thumb_1}
For each new row don't forget to change _1 to _2 and so on...
You can also play with the size of the thumbnails. Just find the width= in your code and put the setting you need.
Hope this helps!!!!
With deep respect to the 4homepages.de Gallery Author and site users,
Te-Ga.
------------------
Just in case you still can't figure out how to change the top.php file I am including the 1.7 version top.php file.
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: top.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$main_template = 'top';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_votes DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_votes_'.$i] = "--";
$register_array['image_votes_user_'.$i] = "--";
$register_array['image_votes_cat_'.$i] = "--";
$register_array['image_votes_number_'.$i] = "--";
$register_array['image_votes_thumb_'.$i] = "--";
}
}
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
$register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_hits_'.$i] = "--";
$register_array['image_hits_user_'.$i] = "--";
$register_array['image_hits_cat_'.$i] = "--";
$register_array['image_hits_number_'.$i] = "--";
$register_array['image_hits_thumb_'.$i] = "--";
}
}
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_downloads DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_downloads_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
$register_array['image_downloads_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_downloads_'.$i] = "--";
$register_array['image_downloads_user_'.$i] = "--";
$register_array['image_downloads_cat_'.$i] = "--";
$register_array['image_downloads_number_'.$i] = "--";
$register_array['image_downloads_thumb_'.$i] = "--";
}
}
$site_template->register_vars($register_array);
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_top_image_hits" => $lang['top_image_hits'],
"lang_top_image_downloads" => $lang['top_image_downloads'],
"lang_top_image_rating" => $lang['top_image_rating'],
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
-
it's about the same.
but still your code wont show thumbnails for media files such as .zip, .mpeg, .mp3 and so on.
http://4homepages.de/forum/viewtopic.php?p=13855#13855
-
What should i add to top.html? and where? Big THX!
Best Regards,
-
i get a broken image if i have no Thumbnail set for a picture.
when i add after line in each part for RATING, VOTES, DOWNLOADS, HITS: Code:
for ($i = 1; $i <= 20; $i++) {
this code: Code:
if (isset($top_list[$i])) {
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
i get a php error.
I've got the same problem here. The funny thing about this is that the parse error occurs on the last line of top.php wher there is only ?>.
Any solution to this?
-
I've got the same problem here. The funny thing about this is that the parse error occurs on the last line of top.php wher there is only ?>.
Any solution to this?
that probably because u either lost somewhere closing " or }
check your code again.
-
As usual you were right, but... because I used copy and past, it's been your fault ;) for your code on page 3 lacks the closing }.
... and it's much too late here for me to count brackets reliable 8O
-
ops :oops:
sry about that... :?
corrected.
-
without reading all the posts....
Is there a working version yet.?
-
yes there is.
just read te-ga's post on top of this page and add v@no's comments about the thumbs from 03.01.2003, 04:03 on page 3
-
.
-
Hi seffern,
did you change the top.html in your template? If you haven't added tables for the comments stuff, you won't see any differnce. :wink:
-
.
-
... I just copied the complete top.html which was published here and overwrote my old one. I did not do any further modifications to this then new file. Should I add additionnally something?
If yes, what and where?
Dirk
mmmm....where did u get top.html from? 8O
the script posted here is top.php that must be uploaded in root of your 4images dir.
besides that code, u'll need update your top.html template.
-
.
-
What template are you using?
-
.
-
OK, all you have to do is insert the following code
<tr>
<td class="head1" valign="top" colspan="5">{lang_top_image_comments}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>1</b></td>
<td valign="top" class="row1">{image_comments_1}</td>
<td valign="top" class="row1">{image_comments_user_1}</td>
<td valign="top" class="row1">{image_comments_cat_1}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_1}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>2</b></td>
<td valign="top" class="row2">{image_comments_2}</td>
<td valign="top" class="row2">{image_comments_user_2}</td>
<td valign="top" class="row2">{image_comments_cat_2}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_2}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>3</b></td>
<td valign="top" class="row1">{image_comments_3}</td>
<td valign="top" class="row1">{image_comments_user_3}</td>
<td valign="top" class="row1">{image_comments_cat_3}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_3}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>4</b></td>
<td valign="top" class="row2">{image_comments_4}</td>
<td valign="top" class="row2">{image_comments_user_4}</td>
<td valign="top" class="row2">{image_comments_cat_4}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_4}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>5</b></td>
<td valign="top" class="row1">{image_comments_5}</td>
<td valign="top" class="row1">{image_comments_user_5}</td>
<td valign="top" class="row1">{image_comments_cat_5}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_5}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>6</b></td>
<td valign="top" class="row2">{image_comments_6}</td>
<td valign="top" class="row2">{image_comments_user_6}</td>
<td valign="top" class="row2">{image_comments_cat_6}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_6}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>7</b></td>
<td valign="top" class="row1">{image_comments_7}</td>
<td valign="top" class="row1">{image_comments_user_7}</td>
<td valign="top" class="row1">{image_comments_cat_7}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_7}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>8</b></td>
<td valign="top" class="row2">{image_comments_8}</td>
<td valign="top" class="row2">{image_comments_user_8}</td>
<td valign="top" class="row2">{image_comments_cat_8}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_8}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>9</b></td>
<td valign="top" class="row1">{image_comments_9}</td>
<td valign="top" class="row1">{image_comments_user_9}</td>
<td valign="top" class="row1">{image_comments_cat_9}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_9}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>10</b></td>
<td valign="top" class="row2">{image_comments_10}</td>
<td valign="top" class="row2">{image_comments_user_10}</td>
<td valign="top" class="row2">{image_comments_cat_10}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_10}</td>
</tr>
Where you put it, depends on where you would like it to appear - meaning:
if you want the comments to be on top of the Top10 page above all others, look for
<tr>
<td class="head1" valign="top" colspan="5">{lang_top_image_rating}</td>
</tr>
and add it before this.
If you want it to be below highest votes look for
<tr>
<td class="head1" valign="top" colspan="5">{lang_top_image_votes}</td>
</tr>
and add it before this.
If you want it to be below most votes, look for
<tr>
<td class="head1" valign="top" colspan="5">{lang_top_image_hits}</td>
</tr>
and add it before this.
If you want it below most hits, look for
<tr>
<td class="head1" valign="top" colspan="5">{lang_top_image_downloads}</td>
</tr>
and add it before this.
If you want it at the bottom, look for
<tr>
<td valign="top" class="row2" align="center"><b>10</b></td>
<td valign="top" class="row2">{image_downloads_10}</td>
<td valign="top" class="row2">{image_downloads_user_10}</td>
<td valign="top" class="row2">{image_downloads_cat_10}</td>
<td valign="top" class="row2" nowrap>{image_downloads_number_10}</td>
</tr>
and add it after this.
-
what if I'm using some URL to represent a image.
I got image broken link. here is the HTMl it generated, how can I fix it?
<img src="data/thumbnails/73/http://..........image.jpg" width="48" height="36" border="0" alt="" /></td>
-
is that what u got? data/thumbnails/73/http://..........image.jpg
it seems u mess something up during the installation.
-
ya, that's what I got. It's not something wrong with the Installation. It is because I used image URL, no image is been uploaded to the server. I used URL. so when it request the Thumbnail, it get it from the URL instead get from the Data folder.
-
hi,
step one
i changed the code in "top.php" - posting thread-page 4 from te-ga - 19.01.2003, 18:42
step two
i changed the code - posting thread-page 3 from V@no - 03.01.2003, 04:03
and now i get a php-error - bla bla bla in line 69
what is the correct order or can someone post his top.php?
thx
markus oeder
www.chauvi-seite.de
-
Maybe somebody can help me,
i try to integrate my 4Image with Invisionsboard.
Everything works just fine.
I like to use this Mod (Toplist Altered).
Thank you :D
boti.(sorry for my english)
-
Maybe somebody can help me,
i try to integrate my 4Image with Invisionsboard.
Everything works just fine.
I like to use this Mod (Toplist Altered).
Thank you :D
boti.(sorry for my english)
O.K. i just did it, it works.
-
I only got remote images. I try all things in this thread but nothing works.
I always got the wrong path to the images. Now i have changed this line:
<img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />"
to this:
<img src=\"".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
and this works with remote images.
-
If someone like to show details from the toplist-thumbs in new window, just let me know (also for random image). I post the code then.
-
Great Stuff!
Just added this to my gallery and have to say it really adds flavour to the page.
Thanks to all involved in it!
Matt
-
hi,
I am totally lost between the 5 pages.
Could any body refer me to the well working code that should we use.
What about the other media files, will their thumbnails be shown?
My version is 1.7.
Thanks
-
media files fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855
-
media files fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855
-> What about the other media files, will their thumbnails be shown?
thx
elimes
-
-> What about the other media files, will their thumbnails be shown?
What are the others? :?
By media files I ment any files that dont have thumbnails and uses media icons.
-
-> What about the other media files, will their thumbnails be shown?
What are the others? :?
By media files I ment any files that dont have thumbnails and uses media icons.
my problem was, that i get a broken image if i have no Thumbnail set for a picture. and i am totally lost between the 5 pages, like aymanati.
cu
markus
-
Super mod!!.......realy make the top list page look so much better.
But I have one question.......many of my images are different sizes, some landscape and some portraite etc....
I have found in the code the "width" & "height" variables, is there a way to set the width and have the hight set proportionaly? so that the image will not be streched? this is the case when the thumbnails are created normaly.
Many Thanks!
-
I have found in the code the "width" & "height" variables, is there a way to set the width and have the hight set proportionaly? so that the image will not be streched?
I'm not gonna post changes for original code, just for this fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855
So, in that fix, replace changes in step 2. to this:
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
$thumb_info = @getimagesize($thumb_file);
$width = $thumb_info[0];
$height = $thumb_info[1];
$dimension = 48;
$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
then, changee width=\"48\" to width=\"$new_width\"
same for height.
Repeat for each section.
-
Superb!!! Worked like a charm!! Many Many thanx for this, looks so cool.
Cheers V@no & Vraxor :D Super V's :P
-
i can't get this to set proportionaly :(
i only accept .jpg files in my gallery, and i see that this fix has mentioned something about .gif. can this be the reason?
i can post my top.php code if needed
i envy M@2T gallery topimages page... it's so good lucking with that thumbnails ok... :cry:
please help me
Thanks
-
i can't get this to set proportionaly :(
i only accept .jpg files in my gallery, and i see that this fix has mentioned something about .gif. can this be the reason?
i can post my top.php code if needed
i envy M@2T gallery topimages page... it's so good lucking with that thumbnails ok... :cry:
please help me
Thanks
so, where the problem?
the .gif files are actualy the media icons that shows when no thumbnail available.
-
but i don't accept any media files, i only accept .jpg files
can't this be the problem? cause im inserting that code refering that i might be using media files, when i don't.
-
but i don't accept any media files, i only accept .jpg files
can't this be the problem? cause im inserting that code refering that i might be using media files, when i don't.
there is nothing to do what u accept and what u dont.
for every image/media/whatever when THUMBNAIL doesnt exist, will be showed an ICON acording tipe of the file, that calls MEDIA ICONS.
even if u accept only .jpg files and one of your picture doesnt have thumbnail, instead of showing red X it will display media icon (/templates/<yourtemplate>/media/jpg.gif)
-
Hi, there
I just added the "thumbnails" in my toplist - now the site is very long - I now want to tile this page in 4 pages - top 10 votes, top 10 downloads, top 10 visits...
how must I change the page_header.php to do this?
thx for helping a newbie in php!
-
You don't. You edit the top.html template instead. :wink:
-
thx - already done - i added 4 new top.php´s and 4 new top.html´s and i included them in the page_header - now you switch between 4 toplists!
-
i added 4 new top.php´s and 4 new top.html´s and i included them in the page_header - now you switch between 4 toplists!
u must be kidding! right?? 8O 8O 8O 8O
do u show your "TOP" images on each page? 8O 8O 8O
-
no - now i have 4 pages:
Top downloads
top hits
top ranking
top votes
not all in one page
have a look: http://www.coverengine.de/4images/
-
... but btw I have a problem with my memberlist - it don´t work correctly - maybe you be so kind to have look at this
thx
-
Yesterday I started changing the code of 4 images for the first time and with succes. I altered the Toplist to show a top 10 of Most commented images.
I also added some lines to the top.php file to show the thumbnails, this last edit took me many hours since I do not have any programming skills yet, I'm a quick learner so I will be able to mange soon enough I think ;-)
Feel free to take a look and if enough people love the way I changed the toplist I might write a tutorial here.
to view the toplist: http://haunter.student.utwente.nl/Terrarevolution/galleries/top.php
Cheers,
Vraxor
Hi, Vraxor.
I cannot writ those scripts at all, but I can follow directions.
What do you think it will be possible to do and how difficult it will be to modify your script something like this: instead text links- a pictures, instead ten best -one best?
This little JPG will explain better what I mean:
http://www.artpapa.com/best.jpg
And one more nave question: do you think it will be possible to display this script in the static HTML, or it supposed to be PHP?
Thank you
Alexei
www.artpapa.com
-
This little JPG will explain better what I mean:
http://www.artpapa.com/best.jpg
its about what POTD (Picture Of The Day) MOD does...
And one more nave question: do you think it will be possible to display this script in the static HTML, or it supposed to be PHP?
yes, but if u just rename your .html file to .php it will do the same, absolute no difference.
-
And one more nave question: do you think it will be possible to display this script in the static HTML, or it supposed to be PHP?
yes, but if u just rename your .html file to .php it will do the same, absolute no difference.
thank you I install "Picture Of The Day" MOD, but I cannot executives from any file I create myself hear is few examples: http://www.artpapa.com/gallery/templates/default_wide/pod.php
http://www.artpapa.com/gallery/templates/default_wide/potd_image.php
can I use SSI or a eframe? or that's supposed to be something else in order to executive php?
Alexei
-
bei mir funktioniert es leider nicht, vielleicht könnte jemand eine deutsche Übersetzung geben oder hat eine einfachere Lösung parat
-
bei mir funktioniert es leider nicht, vielleicht könnte jemand eine deutsche Übersetzung geben oder hat eine einfachere Lösung parat
-
èçâèíèòå íå ïîíÿë
-
èçâèíèòå íå ïîíÿë
well, u can not just take that script out the 4images without modification and put it outside of your 4images....
u must change it in a way "Random Image" MOD works.
also, let's move this discussion under the POTD mod, it will make more sence then discuss it here ;) (here is "Top Images" mod, remmeber ;) :D)
-
Thank you.
I don't think it's necessary to continue my question in this topic .
I think I can come up with something useful for this community, can you tell me please wear to display my small addition.
It is simple JavaScript which is let you change image background on the fly without reloading a page.
You can take a look at this in the my gallery. http://www.artpapa.com/gallery/
just click on any image to get detail page.
Alexei.
-
can anyone pm the top.php (altered) for 1.7.1?
-
it doesnt work with v1.7.1? :?
-
I don't know but I get confused with how the creator of the mod explained it ... so if some one has the top.php please send it to me orpost it here I would be very happy :)
-
i don't know where to start
-
ok this is the mod i want and have tryed to sort through the posts but the thread has become very confusing can somone please post the mod to display thumnails in the top list instead of the file name for ver 1.7.1
thanks
-
First Topic on Page 4: http://www.4homepages.de/forum/index.php?topic=2544.45
A easy Step-by-Step Description..
Works also with 1.7.1
--------
Auf Seite 4 ist das im ersten Beitrag sehr einfach beschrieben: http://www.4homepages.de/forum/index.php?topic=2544.45
Einfach Schritt für Schritt genau nachvollziehen, funktioniert bei mir auch mit Version 1.7.1
-----------
There is only a little Mistake in the Code
Im Code ist ein kleiner Fehler:
Unter 2. ist der Code
Replace Code unter 2.
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
zu ersetzen durch
with:
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" /></a>";
or just place an </a> at the End of the Code
Oder füge einfahc am Ende ein </a> ein.
-
New question
What I want to do is to alter the Toplist in a way that I can do something like
1 page - Top Downloads 01-10
2 page - Top Downloads 11-20
3 page - Top Downloads 21-30
4 page - Top Downloads 31-40
5 page - Top Downloads 41-50
I tried to do this with an iframe but this did not work.
Yes I could make Top Downloads 01-50 on one page, no problem, but page needs very long time to load
and therefore it would be easier to have 5 pages with only 10 images to load. Any idea :?: :?:
Would sth. like paging would work in top.php ????
-
Noone an idea 8O ??
Has anyone realized this ??
-
A nice addon for the toplist is
top 10 by lightbox.
A script by v@no
http://www.4homepages.de/forum/index.php?topic=9033.0
Matthias
-
I am getting the following data base errors with my site which is integrated with vBulletin and is sharing the same data base.
errors:
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_rating DESC, i.image_votes DESC LIMIT 20
Unknown column 'u.user_name' in 'field list'
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_votes DESC, i.image_name ASC LIMIT 20
Unknown column 'u.user_name' in 'field list'
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_hits, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_hits DESC, i.image_name ASC LIMIT 20
Unknown column 'u.user_name' in 'field list'
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_downloads, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_downloads DESC, i.image_name ASC LIMIT 20
Unknown column 'u.user_name' in 'field list'
DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name FROM actors_images i, actors_categories c, user u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY i.image_comments DESC, i.image_votes DESC LIMIT 20
Unknown column 'u.user_name' in 'field list'
Here is my site info:
I have successfully applied this mode: "4images Gallery 1.7 + vB 3.0.x"
http://www.vbulletin.org/forum/showthread.php?t=66335&page=1&pp=15&highlight=4images
Versions I am using:
4images 1.7.1
vBulletin Version 3.0.7
As part of the integration with vBulletin my 4images data base has a prefix of "actors_" and is in the same data base as vBulletin which has no prefix. So, my 4images is using vBulletin's user table. Which results in my users registering and signing in once to use the forum and picture gallery.
My data base:
"actors_categories" <---4images
"actors_comments" <---4images
"actors_groupaccess" <---4images
adminhelp <---vBulletin (no prefix)
user <---vBulletin (no prefix)
useractivation <---vBulletin (no prefix)
etc..
I am wondering if this could be fixed easily or has the integration with vBulletin made this mod unsalable?
thanks - Jason
-
Could someone edit the first post so it shows you how to edit the top images page? (It’s darn hard to look on 8 pages and not knowing what code I exactly should use)
-
I agree to Bart,
it is quite hard and time comsuming for a rookie to read 8 pages of discussion and error-tracking and fault finding.
It would be nice, if a mod has been seen as working error-free, to attach it somewhere for downloading.
To be honest, I also would like to use this thumb funtion, but I am not sure what to do and don't want to damage my working gallery :-(
-
I got it sorted out with thumbnails :)
top.html
add this to your top.html file
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">#</span></b></td>
<td valign="middle" class="row1"><div align="center"></div></td>
<td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Name</span></b></div></td>
<td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">By</span></b></div></td>
<td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Category</span></b></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><b><span id="topsite" class="bluetext">Hits</span></b></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">1</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_1}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_1}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">2</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_2}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_2}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">3</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_3}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_3}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">4</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_4}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_4}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">5</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_5}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_5}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">6</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_6}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_6}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">7</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_7}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_7}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">8</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_8}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_8}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">9</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_9}</span></div></td>
<td valign="middle" class="row1"><span id="topsite" class="bluetext">
<div align="center"><span id="topsite" class="bluetext">{image_hits_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_9}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_9}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">10</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_thumb_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_user_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_hits_cat_10}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_hits_number_10}</span></div></td>
</tr>
</table>
</div>
<div class="maincontent2">
<!-- baren med titlen af boxen -->
<div class="barmain">
{lang_top_image_rating}
</div>
<!-- div til indholdet af boxen -->
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">#</span></b></td>
<td valign="middle" class="row1"><div align="center"></div></td>
<td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Name</span></b></div></td>
<td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">By</span></b></div></td>
<td valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Category</span></b></div></td>
<td valign="middle" class="row1" nowrap><div align="center"><b><span id="topsite" class="bluetext">Rating</span></b></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">1</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_1}</span></div></td>
<td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_1}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">2</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_2}</span></div></td>
<td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_2}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">3</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_3}</span></div></td>
<td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_3}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">4</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_4}</span></div></td>
<td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_4}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">5</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_5}</span></div></td>
<td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_5}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">6</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_6}</span></div></td>
<td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_6}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">7</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_7}</span></div></td>
<td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_7}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">8</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_8}</span></div></td>
<td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_8}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">9</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_9}</span></div></td>
<td valign="middle" class="row1" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_9}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">10</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_thumb_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_user_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_rating_cat_10}</span></div></td>
<td valign="middle" class="row2" nowrap><div align="center"><span id="topsite" class="bluetext">{image_rating_number_10}</span></div></td>
</tr>
<tr>
</table>
</div>
<div class="maincontent2">
<!-- baren med titlen af boxen -->
<div class="barmain">
{lang_top_image_votes}
</div>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="3%" valign="middle" class="row1"><b><span id="topsite" class="bluetext">#</span></b></td>
<td width="17%" valign="middle" class="row1"><div align="center"></div></td>
<td width="19%" valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Name</span></b></div></td>
<td width="20%" valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">By</span></b></div></td>
<td width="19%" valign="middle" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Category</span></b></div></td>
<td width="22%" valign="middle" nowrap="nowrap" class="row1"><div align="center"><b><span id="topsite" class="bluetext">Rating</span></b></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">1</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_1}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_1}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_1}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">2</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_2}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_2}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_2}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">3</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_3}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_3}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_3}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">4</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_4}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_4}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_4}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">5</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_5}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_5}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_5}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">6</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_6}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_6}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_6}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">7</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_7}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_7}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_7}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">8</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_8}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_8}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_8}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row1"><b><span id="topsite" class="bluetext">9</span></b></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_9}</span></div></td>
<td valign="middle" class="row1"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_9}</span></div></td>
<td valign="middle" class="row1" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_9}</span></div></td>
</tr>
<tr>
<td valign="middle" class="row2"><b><span id="topsite" class="bluetext">10</span></b></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_thumb_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_user_10}</span></div></td>
<td valign="middle" class="row2"><div align="center"><span id="topsite" class="bluetext">{image_votes_cat_10}</span></div></td>
<td valign="middle" class="row2" nowrap="nowrap"><div align="center"><span id="topsite" class="bluetext">{image_votes_number_10}</span></div></td>
</tr>
</table>
I can't remember what I changed in top.php so i'm going to post the whole file.
top.php
[code]<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: top.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.1 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$main_template = 'top';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
$cache_id = create_cache_id(
'top',
array(
$user_info[$user_table_fields['user_id']],
$cat_id,
$config['template_dir'],
$config['language_dir']
)
);
if (!$cache_page_top || !$content = get_cache_file($cache_id)) {
if ($cache_page_top) {
// Always append session id if cache is enabled
$old_session_mode = $site_sess->mode;
$site_sess->mode = 'get';
}
ob_start();
$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_thumb_file, i.image_name, i.image_rating, i.image_votes, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_thumb_file, i.image_name, i.image_rating, i.image_votes, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_votes DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_votes_'.$i] = "--";
$register_array['image_votes_user_'.$i] = "--";
$register_array['image_votes_cat_'.$i] = "--";
$register_array['image_votes_number_'.$i] = "--";
$register_array['image_votes_thumb_'.$i] = "--";
}
}
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_thumb_file, i.image_name, i.image_hits, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
$register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"/data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file
-
@BartAfterDark :
The problem is, by posting the whole top.php file, it could affect some MODs that users might of installed seperately which amended modifications to that file. ;)
The best way to remember where you did your modifications is by specifying "uncommented text"
like this for example :
// Top List Altered Starts here.
your codes . . .
Then, at the end ;
// Top List Altered Ends here.
This way, it will avoid questionnings from users on why they could encounter difficulties to manage their top page. ;)
-
Thats true.
But he/they could allways post here again, if it isn't working :)
@BartAfterDark :
The problem is, by posting the whole top.php file, it could affect some MODs that users might of installed seperately which amended modifications to that file. ;)
The best way to remember where you did your modifications is by specifying "uncommented text"
like this for example :
// Top List Altered Starts here.
your codes . . .
Then, at the end ;
// Top List Altered Ends here.
This way, it will avoid questionnings from users on why they could encounter difficulties to manage their top page. ;)
-
Ich erhalte folgende Fehlermeldung / I get this error message:
Fatal error: Call to undefined function: create_cache_id() in /www/htdocs/xxx/top.php on line 35
:(
-
Thank you! It works fine! :D
-
i got following message
.Parse error: parse error in /usr/local/sites/prodersdorfat/public_html/album/top.php on line 171
have you post your full php-code???
because the last code is ......top_list[$i]['image_thumb_file end thats not the end, or yes????#
please help..thanks
-
cooler MOD
Thank you! It works fine!
Steffen
-
Hey
i have try to make the imagesize proportionaly how V@no describe but i became this ERROR Message : Parse error: syntax error, unexpected '}' in /usr/export/www/vhosts/funnetwork/hosting/funchecks/top.php on line 277
I will post my code here but Line 277 is by me not where, where i change anything. I change only the Rating part because i use only the Rating Part on the toplist.
Here is my code and where is the mistake ? Please Help me !
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_rating DESC, i.image_votes DESC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
$thumb_info = @getimagesize($thumb_file);
$width = $thumb_info[0];
$height = $thumb_info[1];
$dimension = 48;
$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"$new_width\" height=\"$new_height\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
-
@ PartyPix
... try to delete '}' in line ... (I think your latest '}' in your post) ... :wink:
-
@ PartyPix
... try to delete '}' in line 277 ...
That will go but now i have this error message:
Warning: Division by zero in /usr/export/www/vhosts/funnetwork/hosting/funchecks/top.php on line 84
Warning: Division by zero in /usr/export/www/vhosts/funnetwork/hosting/funchecks/top.php on line 89
and the Thumbnails will not show :(
What is now the problem ?
//EDIT
I have fix my problem. I Have forgot one line to copy ;)
-
if a category has under 10 pictures, this error message comes:
categorie with 9 images:
Warning: Division by zero in xxx/top.php on line 85
Warning: Division by zero in xxx/top.php on line 90
Warning: Division by zero in xxx/top.php on line 135
Warning: Division by zero in xxx/top.php on line 140
Warning: Division by zero in xxx/top.php on line 185
Warning: Division by zero in xxx/top.php on line 190
Warning: Division by zero in xxx/top.php on line 235
Warning: Division by zero in xxx/top.php on line 240
Warning: Division by zero in xxx/top.php on line 285
Warning: Division by zero in xxx/top.php on line 290
line 85: $ratio = $width / $height;
line 90: $new_width = floor(($dimension/$height) * $width);
line 135: $ratio = $width / $height;
...
http://www.shakit.de/gallery/top.php?cat_id=48
what is wrong?
-
http://www.foto-kocher.com/top.php?cat_id=96
in my case there is no error coming out - maybe the error is to find between the version 1.6 and 1.6.2
sincerly
vincent
-
Hallo zusammen.
Würde auch gerne dies Bilderfunktion bei meinen TOP Bilder einsetzen.
habe was auf Seite 3 gefunden.
Leider komme ich nicht klar.
Geht dies überhaupt mit der Version 1.7.2 ?
Habe schon Probleme wenn ich Schritt eins durchführen soll.
Finde nix im HTML Code.
Kann mir bitte jemand mit einer deutschen Anleitung helfen?
Gruß Stephan
look at the code,
you have now 5 categories in the top.php and the new one is comments. you must add the new comment tag in the ../lang/english(deutsch)/main.php. It is only for the new comments header {lang_top_image_comments} in the top.html and you must modify in all language packs you are use.
1. add the comments description in the image details
Code:
//-----------------------------------------------------
//--- Image Details --------------------------------
//-----------------------------------------------------
$lang['hits'] = "Hits:";
$lang['downloads'] = "Downloads:";
$lang['rating'] = "Rating:";
$lang['votes'] = "Vote(s)";
$lang['comments']="Comments";
2. add the comments tag the top images details and if you have set more then 10 Top images you must change this to your prefer (5,20,50,?). look to the top.html here is the {lang_top_image_comments}
Code:
//-----------------------------------------------------
//--- Top Images --------------------------------------
//-----------------------------------------------------
$lang['top_image_hits'] = "Top 10 images by hits";
$lang['top_image_downloads'] = "Top 10 images by downloads";
$lang['top_image_rating'] = "Top 10 images by rating";
$lang['top_image_votes'] = "Top 10 images by votes";
$lang['top_image_comments'] = "Top 10 images by comments";
3. change of top.html for the new thumbnails
add a new tablerow for the thumbnails. in the new cells you write the thumb tag {image_hits_thumb_1} {image_downloads_thumb_1} {image_rating_thumb_1} {image_votes_thumb_1} and so on (_2, _3, _4,...) for the different top categories.
4. change the top.html for the new comment category
add new tablecells for the new top comments category. in the header you write {lang_top_image_comments} and in the cells you write the same as in the hits, downloads, rating,... but modifying the new comments tag z.B. {image_comments_thumb_1} {image_comments_1} {image_comments_user_1} {image_comments_cat_1} {image_comments_number_1} and so on (_2, _3, _4,...).
i hope it's clear
-
am besten , Schritt für Schritt.
Danke
-
Kann mir keiner helfen?
-
Thanks for sharing! I've changed my toplist to show only thumbnails and it looks great.
-
bei mir klappt das auch bißher noch nicht .....wenn du es hinbekomen hast partyfinger wäre nett wenn du es nochmal posten könntest was du gemacht hat weil bei mir klappt es einfach nicht !!
-
HI
dear friends
Please help me i want show image in top image but only name image show
Please help me
-
Hello. I have followed this tutorial very carefully (several times), and I am having a troubling problem with it.
Thumbs are only being shown on the ODD numbers (#1, #3, #5, #7, #9). The even numbered thumbs are not being displayed. In fact, the even numbered template variables (example: {image_rating_thumb_2}) are not being parsed at all. So I end up with a page that looks like this:
|----------------------|
|----------------------|
|----------------------|
|-----THUMB #1 ----|
|----------------------|
|----------------------|
|----------------------|
{image_rating_thumb_2}
|----------------------|
|----------------------|
|----------------------|
|-----THUMB #3 ----|
|----------------------|
|----------------------|
|----------------------|
{image_rating_thumb_4}
|----------------------|
|----------------------|
|----------------------|
|-----THUMB #5 ----|
|----------------------|
|----------------------|
|----------------------|
{image_rating_thumb_6}
|----------------------|
|----------------------|
|----------------------|
|-----THUMB #7 ----|
|----------------------|
|----------------------|
|----------------------|
{image_rating_thumb_8}
|----------------------|
|----------------------|
|----------------------|
|-----THUMB #9 ----|
|----------------------|
|----------------------|
|----------------------|
{image_rating_thumb_10}
Here is a sample of the code I am using:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name, i.image_thumb_file".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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
BTW... I'm running v1.7.2
Anyone have a clue what's going on here?
Thanks!
-
Ahum... any ideas on my previous post? This is really strange.
-
gibst diesen mod auch komplett zusammen gefasst das man ihn auch verstehen kan sind einfach zuviel seiten !
Kann bitte den jemand mal zusammen fassen das man ihn versteht ?????? Bitte
-
http://4homepages.de/forum/index.php?topic=2544.msg13855#msg13855
you missed step 1
-
you do something wrong, that all I can guess...these errors should not be showed if you are using the original code with image dimention addon.
-
Hello,
I've installed the Mod with succes. Very nice!!! But I've also installed the Popup- message mod.(http://www.4homepages.de/forum/index.php?topic=3304.0). When I click now on a picture in the Toplist, the Popup didn't appear. Please Help!!!
Thanks and Greetz
Chull
-
Leider klappt es nicht. :cry:
Werde jetzt einfach warten bis das nächste Update 1.7.5 erscheint und hoffen das man dann diese „Bildanzeig-Funktion“ und „Top 20 Anzeige“ auf der TOP Seite , einfach über die Control Panel Seite einstellen kann.
Gruß Partyfinger.de
-
Hi *,
at first thanx for the mod. It works well on my page http://www.picspack.de/top.php.
However there is a little problem with the sorting:
In the first section 'highest rating' it sorts all photos with max. rate alphabetically. But I think it would make more sence if it would sort photos with the same rating for the most rates.
Cheers,
mikum
-
I have the same error as ivan!
Where exacly I have put this code:
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
$thumb_info = @getimagesize($thumb_file);
$width = $thumb_info[0];
$height = $thumb_info[1];
$dimension = 40;
$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
Thanks
-
It's ok now, I fixed it!
bye
-
dear sirs,
i am a new to all coding etc. I have gone through the threads for hours and altered my codes. but i was not successful. Any body PLEASE write step by step guide to change the code to display top images in thumb nails in all 5 categories. This is very much useful feature and it should have been included in version 1.7.4 which i use currently.. Thnaks in advance.
Reddy
-
Vielleicht könnte mal jemand der hier noch einen Überblick hat, eine Anleitung reinstellen wie man was machen muss. Blick hier überhaupt nicht mehr durch. Funktioniert die Anleitung auf Seite 4??
-
Vielleicht könnte mal jemand der hier noch einen Überblick hat, eine Anleitung reinstellen wie man was machen muss. Blick hier überhaupt nicht mehr durch. Funktioniert die Anleitung auf Seite 4??
Mir geht es genauso
Welchen Code muss man denn jetzt nehmen ?
Gruss
-
Tja, ich würd halt mal den code aus posting #6
für die top.php nehmen und für die top.html
z.B. posting #16 ( hier als beispiel aufgeführt für die comments, muss man halt umbenennen für die anderen top1)
Kurt
-
Ah habe den Fehler gefunden :)
Ich hatte die Zeile
$site_template->register_vars($register_array);
mit auskommentiert
Dabke für die Hilfe
-
Hallo
Ist es denn nun auch möglich sich nicht die gesante Zeit anzeigen zu lassen, sondern auch die meisten Klicks in der Woche oder am Tag ?
Gruss
-
ich bekomme folgende fehlermeldung:
Parse error: syntax error, unexpected T_VARIABLE in /mnt/web2/31/55/51656455/htdocs/gallery/top.php on line 78
line 78 ist das hier:
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
weiss jemand was zu ändern ist? Ich habe version 1.74 installiert...
-
Try this:
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
-
doesn't help, still the same error :(
-
I no can reproduce ...
Please read step 1-2-3 of my signature and post.
-
i get this error:
Parse error: syntax error, unexpected T_VARIABLE in /mnt/web2/31/55/51656455/htdocs/gallery/top.php on line 78
the code for the rating part is this:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
i use version 1.74, php version 4.4.7 ans mysql 4.0.27
-
I see old code. You no replace for my code. :?
-
but with your new code its the same error
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
-
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url
This line - no full.
-
yep, you are right. with the complete code it works, but there comes up a new error, when i embedd the tag in the template file, a thumbnail shows up, but also a little bit of code.
this is the the rating code in top.php:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
and after the thumbnail at the front end it shows this: ./details.php?image_id=719">(name of the file)
-
@ivan:
Image width and height is no suppose for 0 ... $image_info[0] and $image_info[1] is show width and height (for image size). If no see image size, is $thumb_file problem.
Is no see filename of local or remote. ;)
yep, you are right. with the complete code it works, but there comes up a new error, when i embedd the tag in the template file, a thumbnail shows up, but also a little bit of code.
this is the the rating code in top.php:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
and after the thumbnail at the front end it shows this: ./details.php?image_id=719">(name of the file)
Please post exact error message.
-
You use remote or local image ?
-
In FTP - see filename in data/<<cat_id>>/<<image_id>>/<<filename>> ?
-
Is CHMOD 777 for data (and subfolder) ?
If click on banner of signature I see this: englisch: No access on bildergallery.com!
-
i don't get an error msg. it shows the thumbnail but also parts of the url.
this is the code i used:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
and this is how it shows up, see attached pic
-
Find:
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
replace:
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" /></a>" : format_text(trim($top_list[$i]['image_name']), 2);
-
Find:
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text(trim($top_list[$i]['image_name']), 2)."</a>" : format_text(trim($top_list[$i]['image_name']), 2);
replace:
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" /></a>" : format_text(trim($top_list[$i]['image_name']), 2);
works, thank you very much!
-
@ivan:
You no reply for question:
http://www.4homepages.de/forum/index.php?topic=2544.msg104859#msg104859
-
You use IP ban for my IP ? If so, sorry - no support for you.
-
Wollte das mit den meisten Kommentaren pro Bild einbaun... aber ich blick bei den 12 Seiten postings nicht mehr durch...
kann mir mal jemand was zuschicken... welche Schritte ich in welcher Reihenfolge machen muss das bei den TOP 10 Listen die meist kommentierten Bilder auftauchen?
Thumbnails von den Fotos müssen nicht zwingend sein. Es reicht ein Link zu dem entsprechenden Fotos....
Fotoname (= Link) Fotograph Gallerie Kommentaranzahl
Ausserdem hätte ich noch gerne ... eine Top 10 der Mitglieder die am meisten Kommentieren
kann man ausserdem noch eine Unterteilung machen... also Kommerntare insgesamt und aufs Monat bezogen...
das es z.b. heisst
Meist kommentierte Pics insgesamt
und aufs aktuelle Monat bezogen
Meist kommentierte Pics des Monats Dezember
Wobei sich das Monat dann jedes Monat natürlich ändern soll.
ich hätte gerne so eine TOP 10 Seite
Meist betrachtete Profile insgesamt
Meist kommentierte Pics insgesamt
Meist betrachtete Pics insgesamt
Aktivste Kommentatoren insgesamt
und das alles jeweils für das aktuelle Monat wie Beispiel oben "... des Monats Dezember"
Kann mir da jemand weiterhelfen?
gruss UFO
-
If someone like to show details from the toplist-thumbs in new window, just let me know (also for random image). I post the code then.
Please share the code. I for one would love to see it.
Thanks
-
Kann mir bei den Problemen mal bitte jemand weiterhelfen?
gruss ufo
-
Ok ich hab mich mal damit beschäftigt und folgenden Code in die jeweiligen Dateien eingebaut...
Gilt für die Änderung TOP 10 Comments
Habe 4Homepages 1.7.2 am laufen.
Eventuelle Fehler könnten noch drin sein... bitte schreibt mir dann ändere ich das und werds testen.
Top.html
Adden wo man es hin haben will. z.b. unter
<td valign="top" class="row2" nowrap>{image_downloads_number_10}</td>
</tr>
folgendes einfügen
<tr>
<td class="head1" valign="top" colspan="5">{lang_top_image_comments}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>1</b></td>
<td valign="top" class="row1">{image_comments_1}</td>
<td valign="top" class="row1">{image_comments_user_1}</td>
<td valign="top" class="row1">{image_comments_cat_1}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_1}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>2</b></td>
<td valign="top" class="row2">{image_comments_2}</td>
<td valign="top" class="row2">{image_comments_user_2}</td>
<td valign="top" class="row2">{image_comments_cat_2}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_2}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>3</b></td>
<td valign="top" class="row1">{image_comments_3}</td>
<td valign="top" class="row1">{image_comments_user_3}</td>
<td valign="top" class="row1">{image_comments_cat_3}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_3}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>4</b></td>
<td valign="top" class="row2">{image_comments_4}</td>
<td valign="top" class="row2">{image_comments_user_4}</td>
<td valign="top" class="row2">{image_comments_cat_4}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_4}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>5</b></td>
<td valign="top" class="row1">{image_comments_5}</td>
<td valign="top" class="row1">{image_comments_user_5}</td>
<td valign="top" class="row1">{image_comments_cat_5}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_5}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>6</b></td>
<td valign="top" class="row2">{image_comments_6}</td>
<td valign="top" class="row2">{image_comments_user_6}</td>
<td valign="top" class="row2">{image_comments_cat_6}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_6}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>7</b></td>
<td valign="top" class="row1">{image_comments_7}</td>
<td valign="top" class="row1">{image_comments_user_7}</td>
<td valign="top" class="row1">{image_comments_cat_7}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_7}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>8</b></td>
<td valign="top" class="row2">{image_comments_8}</td>
<td valign="top" class="row2">{image_comments_user_8}</td>
<td valign="top" class="row2">{image_comments_cat_8}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_8}</td>
</tr>
<tr>
<td valign="top" class="row1" align="center"><b>9</b></td>
<td valign="top" class="row1">{image_comments_9}</td>
<td valign="top" class="row1">{image_comments_user_9}</td>
<td valign="top" class="row1">{image_comments_cat_9}</td>
<td valign="top" class="row1" nowrap>{image_comments_number_9}</td>
</tr>
<tr>
<td valign="top" class="row2" align="center"><b>10</b></td>
<td valign="top" class="row2">{image_comments_10}</td>
<td valign="top" class="row2">{image_comments_user_10}</td>
<td valign="top" class="row2">{image_comments_cat_10}</td>
<td valign="top" class="row2" nowrap>{image_comments_number_10}</td>
</tr>
dann in der Datei top.php
unter $register_array['image_downloads_number_'.$i] = "--";
}
}
folgendes einfügen
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_comments DESC, i.image_votes DESC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
$register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_comments_'.$i] = "--";
$register_array['image_comments_user_'.$i] = "--";
$register_array['image_comments_cat_'.$i] = "--";
$register_array['image_comments_number_'.$i] = "--";
$register_array['image_comments_thumb_'.$i] = "--";
}
}
und weiter unten in der Datei top.php folgende Zeile unter "lang_top_image_votes" => $lang['top_image_votes'],
folgendes einfügen
"lang_top_image_comments" => $lang['top_image_comments']
ACHTUNG... nicht das Komma hinter $lang['top_image_votes'] vergessen, sonst motzt er ;-) (Beim Suchen der Spalte is das Komma noch nicht vorhanden. Muss also angefügt werden ;-)
Dann in die main.php und unter $lang['top_image_votes'] = .....
folgende Zeile hinzufügen:
$lang['top_image_comments'] = "Die 10 Bilder mit den meisten Kommentaren";
Alle Dateien Hochladen und nun müsste er bei Top Images die 10 meist kommentierten Bilder anzeigen.
Weiss jemand wie ich die Top 10 der meisten Kommentatoren herbekomme??
gruss UFO
-
Hallo,
ich habe schon zahlreiche Versuche unternommen, die Code Schnipzel in die top.php einzubinden. Leider aber erfolglos.
Es wäre toll wenn einer vielleicht die komplette geänderte top.php veröffentlichen könnte.
Danke im vorraus
Gruß Steffen
-
Hallo 4images Gemeinde,
habe den Fehler gefunden. Klappt jetzt alles super :D
Gruß Steffen
http://www.urlauberschiff-fritzheckert.de/maritim/top.php (http://www.urlauberschiff-fritzheckert.de/maritim/top.php)
-
auf Anfrage einiger User, hier meine geändert Top.php. Ich hoffe ich kann einigen damit helfen
Gruß Steffen
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: top.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.6 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$main_template = 'top';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
$cache_id = create_cache_id(
'page.top',
array(
$user_info[$user_table_fields['user_id']],
$cat_id,
$config['template_dir'],
$config['language_dir']
)
);
if (!$cache_page_top || !$content = get_cache_file($cache_id)) {
if ($cache_page_top) {
// Always append session id if cache is enabled
$old_session_mode = $site_sess->mode;
$site_sess->mode = 'get';
}
ob_start();
$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_rating DESC, i.image_votes DESC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_rating_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_rating, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_votes DESC, i.image_name ASC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_votes_'.$i] = "--";
$register_array['image_votes_user_'.$i] = "--";
$register_array['image_votes_cat_'.$i] = "--";
$register_array['image_votes_number_'.$i] = "--";
$register_array['image_votes_thumb_'.$i] = "--";
}
}
//--- Start Top10 nach Postkarten -----------------------------------------------
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_postcards, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file, i.image_media_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_postcards DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
}
if (isset($top_list[$i])) {
$register_array['image_postcards_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_postcards_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_postcards_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_postcards_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_postcards_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_postcards_number_'.$i] = "<b>".$top_list[$i]['image_postcards']."</b>";
$register_array['image_postcards_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_postcards_'.$i] = "--";
$register_array['image_postcards_user_'.$i] = "--";
$register_array['image_postcards_cat_'.$i] = "--";
$register_array['image_postcards_number_'.$i] = "--";
$register_array['image_postcards_thumb_'.$i] = "--";
}
}
//--- Ende Top10 nach Postkarten -----------------------------------------------
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_hits, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
$register_array['image_hits_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_hits_'.$i] = "--";
$register_array['image_hits_user_'.$i] = "--";
$register_array['image_hits_cat_'.$i] = "--";
$register_array['image_hits_number_'.$i] = "--";
$register_array['image_hits_thumb_'.$i] = "--";
}
}
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_downloads, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_downloads DESC, i.image_name ASC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
$register_array['image_downloads_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_downloads_'.$i] = "--";
$register_array['image_downloads_user_'.$i] = "--";
$register_array['image_downloads_cat_'.$i] = "--";
$register_array['image_downloads_number_'.$i] = "--";
$register_array['image_downloads_thumb_'.$i] = "--";
}
}
// Comments
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_comments, i.image_rating, i.image_thumb_file, i.image_votes, c.cat_name, u.user_name
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id AND i.user_id = u.user_id $cat_match_sql
ORDER BY i.image_comments DESC, i.image_votes DESC
LIMIT 20";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 20; $i++) {
if (isset($top_list[$i])) {
$register_array['image_comments_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_comments_user_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'])."\">".htmlspecialchars($top_list[$i]['user_name'])."</a>";
$register_array['image_comments_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_comments_number_'.$i] = "<b>".$top_list[$i]['image_comments']."</b>";
$register_array['image_comments_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
else {
$register_array['image_comments_'.$i] = "--";
$register_array['image_comments_user_'.$i] = "--";
$register_array['image_comments_cat_'.$i] = "--";
$register_array['image_comments_number_'.$i] = "--";
$register_array['image_comments_thumb_'.$i] = "--";
}
}
$site_template->register_vars($register_array);
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_top_image_hits" => $lang['top_image_hits'],
"lang_top_image_downloads" => $lang['top_image_downloads'],
"lang_top_image_rating" => $lang['top_image_rating'],
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));
$content = ob_get_contents();
ob_end_clean();
if ($cache_page_top) {
// Reset session mode
$site_sess->mode = $old_session_mode;
save_cache_file($cache_id, $content);
}
} // end if get_cache_file()
echo $content;
include(ROOT_PATH.'includes/page_footer.php');
?>
-
He IWS_steffen,
Really great, thanks to your top.php.
It works great. In my top.html all images are shown the way they should.
But unfortunately on the top of my webpage there is an error: "An unexpected error occurred. Please try again later".
Do you (or someone else) know this error and how I can fix it.
I’m using 4images 1.7.6
thanx!!!
-
Bei rechten:
thumbnail = alle
bilder = registriert
Ich will den Besucher der nicht gereggt ist bei einem Klick aufs Thumb in der Topliste zur anmeldeseite verlinken und wenn eingeloggt zum bild.
erledigt siehe Antwort #185
-
@Bob
... da {image_rating_thumb_1} bereits den Link zum Bild enthält, musst du die gewünschte Änderung direkt in der top.php vornehmen ...
... jeweils für $register_array['image_rating_thumb_'.$i] und gleichartig etwa so ...
$register_array['image_rating_thumb_'.$i] = ($user_info['user_level'] >= USER) ? " ... hier der Thumbnail-Code für eingeloggte User ... " : " ... hier der Thumbnail-Code für nicht-eingeloggte User ... ";
-
Hallo Bob,
wie sollte denn das auch funktionieren?
der tag: {image_rating_thumb_1} wird ja schon komplett generiert in top.php
suche z.B.
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
esetze mit:
if ($user_info['user_level'] >= GUEST) {
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}else {
$register_array['image_votes_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."register.php")."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"48\" height=\"36\" border=\"0\" alt=\"\" />";
}
Nicht getestet, müsste aber klappen...
############# EDIT ####################
Wieder mal zu langsam gewesen.... :wink:
Gruß
Kurt
-
@Kurt
... zwei Dumme ... ein Gedanke ... :mrgreen: :mrgreen:
... mein Code ist um ein paar Zeichen kürzer, aber sonst von der Funktion her gleich ... und beide Varianten sollten halt funktionieren ...
-
siehe Antwort #185
-
Und jetzt... code aus Antwort#181
Kurt
-
Ne Kurt das geht leider auch nicht.
Ich habs aber anders gelöst:
in der top.php:
$register_array['image_rating_thumb_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"".$thumb_file."\" width=\"90\" height=\"90\" border=\"1\" alt=\"\" /></a>" : "<img src=\"".$thumb_file."\" width=\"90\" height=\"90\" border=\"1\" alt=\"\" />";
und in der top.html dann:
{if user_loggedout}
<a href="register.php">{image_rating_thumb_1}</a>
{endif user_loggedout}
{if user_loggedin}
{image_rating_thumb_1}
{endif user_loggedin}
so geht es einwandfrei :) :)
aber trotzden DANKE!!
-
Oke IWS_steffen,
I fixed the the error and now it works great.
From the top.php you have sent, I removed the 2 sections:
//--- Start Top10 nach Postkarten ------------- and //--- Comments -----------------------------------------------
Thanx man!
-
Hallo, habe das mit der Toplist hinbekommen nur bin ich etwas unzufrieden mit der Ausführung. Wenn ich die Bilder angezeigt bekommen möchte muss ich eine elenlange Tabelle schreiben. z.b. so:
<tr>
<td valign="top" class="row1"></td>
<td valign="top" class="row1">{image_rating_thumb_1}<p>{image_rating_number_1}</p><p></p></td>
<td valign="top" class="row1">{image_rating_thumb_2}<p>{image_rating_number_2}</p><p></p></td>
<td valign="top" class="row1">{image_rating_thumb_3}<p>{image_rating_number_3}</p><p></p></td>
<td valign="top" class="row1">{image_rating_thumb_4}<p>{image_rating_number_4}</p><p></p></td>
<td valign="top" class="row1">{image_rating_thumb_5}<p>{image_rating_number_5}</p><p></p></td>
</tr>
da müsste ich jetzt bis 30 durchzählen was wohl nicht der sinn wäre
Geht sowas nicht wie in der Search.html . dort reicht wenn man " {content} " in den Code einfügt und schon zeigt er alle neusten Bilder an
ich hätte das gerne aufs Rating bezogen. Kann mir einer das erklären weil bin net so helle :P
-
Hi, I'm usign top.php and works perfect. But my problem is I want to use this on my home.html . I try to use iframe and its shown but after I click one of images , it will open in the iframe.
is it possible to open in a new window or _parent, _top target.
thanks in advance
-
Hi, OtusDesign
open top.php
you need a target in the <a href=.....> tags.
<a href=\".....\" target=\"blank\">
-
Thanks for rapid reply, I try this but I have error. My top.php is
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: top.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.6 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$main_template = 'top';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
$cache_id = create_cache_id(
'page.top',
array(
$user_info[$user_table_fields['user_id']],
$cat_id,
$config['template_dir'],
$config['language_dir']
)
);
if (!$cache_page_top || !$content = get_cache_file($cache_id)) {
if ($cache_page_top) {
// Always append session id if cache is enabled
$old_session_mode = $site_sess->mode;
$site_sess->mode = 'get';
}
ob_start();
$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"200\" height=\"150\" border=\"0\" alt=\"\" /></a>" : format_text(trim($top_list[$i]['image_name']), 2);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_votes DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_votes_'.$i] = "--";
$register_array['image_votes_user_'.$i] = "--";
$register_array['image_votes_cat_'.$i] = "--";
$register_array['image_votes_number_'.$i] = "--";
}
}
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
}
else {
$register_array['image_hits_'.$i] = "--";
$register_array['image_hits_user_'.$i] = "--";
$register_array['image_hits_cat_'.$i] = "--";
$register_array['image_hits_number_'.$i] = "--";
}
}
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_downloads DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_downloads_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
}
else {
$register_array['image_downloads_'.$i] = "--";
$register_array['image_downloads_user_'.$i] = "--";
$register_array['image_downloads_cat_'.$i] = "--";
$register_array['image_downloads_number_'.$i] = "--";
}
}
$site_template->register_vars($register_array);
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_top_image_hits" => $lang['top_image_hits'],
"lang_top_image_downloads" => $lang['top_image_downloads'],
"lang_top_image_rating" => $lang['top_image_rating'],
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));
$content = ob_get_contents();
ob_end_clean();
if ($cache_page_top) {
// Reset session mode
$site_sess->mode = $old_session_mode;
save_cache_file($cache_id, $content);
}
} // end if get_cache_file()
echo $content;
include(ROOT_PATH.'includes/page_footer.php');
?>
How to add this code and where
-
Test it:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: top.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.6 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$main_template = 'top';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');
$cache_id = create_cache_id(
'page.top',
array(
$user_info[$user_table_fields['user_id']],
$cat_id,
$config['template_dir'],
$config['language_dir']
)
);
if (!$cache_page_top || !$content = get_cache_file($cache_id)) {
if ($cache_page_top) {
// Always append session id if cache is enabled
$old_session_mode = $site_sess->mode;
$site_sess->mode = 'get';
}
ob_start();
$cat_match_sql = ($cat_id && check_permission("auth_viewcat", $cat_id)) ? "AND i.cat_id = '$cat_id' " : "";
$register_array = array();
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file
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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_rating DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_rating_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_rating_thumb_'.$i] = (isset($top_list[$i]['image_id']) && !empty($top_list[$i]['image_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\"><img src=\"data/thumbnails/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file']."\" width=\"200\" height=\"150\" border=\"0\" alt=\"\" /></a>" : format_text(trim($top_list[$i]['image_name']), 2);
$register_array['image_rating_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_rating_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_rating_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_rating_'.$i] = "--";
$register_array['image_rating_user_'.$i] = "--";
$register_array['image_rating_cat_'.$i] = "--";
$register_array['image_rating_number_'.$i] = "--";
$register_array['image_rating_thumb_'.$i] = "--";
}
}
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_votes DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_votes_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_votes_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_votes_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_votes_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
}
else {
$register_array['image_votes_'.$i] = "--";
$register_array['image_votes_user_'.$i] = "--";
$register_array['image_votes_cat_'.$i] = "--";
$register_array['image_votes_number_'.$i] = "--";
}
}
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_hits DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_hits_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_hits_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_hits_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_hits_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_hits_number_'.$i] = "<b>".$top_list[$i]['image_hits']."</b>";
}
else {
$register_array['image_hits_'.$i] = "--";
$register_array['image_hits_user_'.$i] = "--";
$register_array['image_hits_cat_'.$i] = "--";
$register_array['image_hits_number_'.$i] = "--";
}
}
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, 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 NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_downloads DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
$register_array['image_downloads_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" target=\"blank\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
$register_array['image_downloads_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".format_text($top_list[$i]['image_name'])."</a>" : format_text($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\" target=\"blank\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_downloads_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_downloads_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\" target=\"blank\">".format_text($top_list[$i]['cat_name'])."</a>";
$register_array['image_downloads_number_'.$i] = "<b>".$top_list[$i]['image_downloads']."</b>";
}
else {
$register_array['image_downloads_'.$i] = "--";
$register_array['image_downloads_user_'.$i] = "--";
$register_array['image_downloads_cat_'.$i] = "--";
$register_array['image_downloads_number_'.$i] = "--";
}
}
$site_template->register_vars($register_array);
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['top_images']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"msg" => $msg,
"clickstream" => $clickstream,
"lang_top_image_hits" => $lang['top_image_hits'],
"lang_top_image_downloads" => $lang['top_image_downloads'],
"lang_top_image_rating" => $lang['top_image_rating'],
"lang_top_image_votes" => $lang['top_image_votes']
));
$site_template->print_template($site_template->parse_template($main_template));
$content = ob_get_contents();
ob_end_clean();
if ($cache_page_top) {
// Reset session mode
$site_sess->mode = $old_session_mode;
save_cache_file($cache_id, $content);
}
} // end if get_cache_file()
echo $content;
include(ROOT_PATH.'includes/page_footer.php');
?>
Please Post your Url
-
YESSSS its solved because of you Bob. I don't want to give my url now, after prepared I will show everybody 8)
Thanks a million Bob :thumbup:
-
Woher bekomme ich denn die Topliste?
Wieder mal was falsch gelesen :lol: 8) :oops:
Hat sich erledigt, es handelt sich um die Top10... ^^
-
I have found in the code the "width" & "height" variables, is there a way to set the width and have the hight set proportionaly? so that the image will not be streched?
I'm not gonna post changes for original code, just for this fix:
http://4homepages.de/forum/viewtopic.php?p=13855#13855
So, in that fix, replace changes in step 2. to this:
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
$thumb_info = @getimagesize($thumb_file);
$width = $thumb_info[0];
$height = $thumb_info[1];
$dimension = 48;
$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
then, changee width=\"48\" to width=\"$new_width\"
same for height.
Repeat for each section.
Id like to set these porportionately too... but the link you posted in this answer is broken... Can you explain how to do this porportionately?
Thanks!
-
So. ich hab jetzt glaub ich ca. 3 Stunden gebraucht um mich in diesen Thread "einzuarbeiten", und die Schnipsel zu "installieren".
Ich gehör mit Sicherheit nicht zu denen die zu faul zum suchen sind, oder alles vorgekaut bekommen wollen, bin auch in der Lage ne Weile zu suchen bis ich das finde was ich brauche, bevor ich einen Thread auf machen, oder hier antworte.
Aber Dieser hier ist mal wieder das beste Beispiel, momentan 13 Seiten, und überall liegen Schnipsel rum, für nen Newbie ist es hier unmöglich sich Informationen zu holen und zu verarbeiten, ohne blöde Fragen zu stellen.
-
servus!
also wenn du den input von UFO aus diesem Thread hier befolgst, bekommst du ohne probleme die "10 meisten Kommentare" zum Laufen => Link (http://www.4homepages.de/forum/index.php?topic=2544.msg107948#msg107948)
was brauchst du sonst noch?
gruss, bergblume
-
@Vano
I have finally fixed this, this is the first MOD i think i tried to do but was scared and i finally did.
If u click this link Vano, http://www.4homepages.de/forum/index.php?topic=2544.75 (http://www.4homepages.de/forum/index.php?topic=2544.75) u will be directed to another page in this topic, please look at the 3 rd which is yours, u r trying to help someone with the proportionality of images in the top, i tried to click that link but the link is dead. Is there another link which u can show me to fix this proportionality issue i have.
God bless u vano and thanks again for a great help and MOD
-
Yes, an old link from the times when we used phpbb forum software.
Link fixed now.
P.S.
In case you didn't know, each reply has a unique address which you can find by hovering over headline. You can use these links instead of saying which post from the top you mean.
for example: http://www.4homepages.de/forum/index.php?topic=2544.msg22107#msg22107
-
@ Vano,
Thank u so much for the advice, its funny u mentioned it because i have spent hours trying to find out how it worked :P and al i had to really do was to click on the header title.
1)
Sir i did exactly like u said and thank u for fixing the link, it was much appreciated. I have done it, but below is an image of what it looks like, i just wanted to know sir, is this how is suppose to look. The images up are all dummy images and some images are not in proportion to others, as u can see from the image below. I followed ur advice in proportionality
(http://i33.tinypic.com/24zfvj7.jpg)
2)
and also one more thing sir in this link http://www.4homepages.de/forum/index.php?topic=2544.msg22107#msg22107 (http://www.4homepages.de/forum/index.php?topic=2544.msg22107#msg22107) you are just missing 1 more parenthesis at the end inside the code. Sorry if i am wrong.
Thank u again Vano for great help and god bless u sir.
-
It seems it's resizes by height...
Since this topic pretty much messed up, what code do you use, from witch reply?
-
Hello Vano
Im so so sorry sir, but u said that "what code do i size, from which reply", please do not be angry sir but i did not understand what u mean by this. But i assume u r saying to me show u the code tht i used for this. If i am wrong please i apologize.
Below is the code i used to bring the images on toplist to proportion..
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
$thumb_info = @getimagesize($thumb_file);
$width = $thumb_info[0];
$height = $thumb_info[1];
$dimension = 48;
$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
Sorry if this is not what u are asking of me sir.
Thank u vano
-
actually I said "use", not "size" ;) wanted you to point out at the reply with the code of this mod you are using, but it's ok now, don't worry about it.
Looking at your screenshot, the images are proportional and resized properly, maintaining 48 pixels width or height which ever is larger.
If you want it always maintain 48 pixels width then replace
if ($ratio > 1) {
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
}else {
$new_width = floor(($dimension/$height) * $width);
$new_height = $dimension;
}
with:
$new_width = $dimension;
$new_height = floor(($dimension/$width) * $height);
-
@VAno,
Im so very sorry, i should have read ur post more carefully, how can i confuse size with use :P
Vano i want to thank u again, i have tremandous admiration for u. Im very glad that u r not working for google or microsoft or apple because they will not appreciate ur work like we do. To many good and amazing programmers like u are very scarce and just make companies billions each year. Its very nice to see at least 1 like ur self helping out the community and have made an amazing software which i highly respect and i for one am very appreciative for it. I have through every post said thank u to u, but like i said, no words can show how much gratitude i hold for ur help.
thank u so much vano