61
Mods & Plugins (Releases & Support) / Re: [Mod] Mini-Top
« on: June 28, 2007, 04:27:55 PM »
an awesome MOD. Now, how could i show the mini-top mod on an external page outside of 4images directory?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
<?php
define('GET_CACHES', 1);
define('ROOT_PATH', './photos/');
$user_access = get_permission();
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$mini_top_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
$mini_top_images .= "<tr class=\"imagerow1\">\n";
$selection = array('rating', 'votes', 'hits', 'comments', 'downloads');
$selection_alt = array('votes DESC', 'rating DESC', 'name ASC', 'name ASC', 'name ASC');
# $selection_cutoff = array(' AND i.image_votes > 10', '', '', '', '');
$num_of_cells = $config['image_cells'];
$num_of_cells = $num_of_cells > count($selection) ? count($selection) : $num_of_cells;
for ($cnt = 0; $cnt < $num_of_cells; $cnt++) {
$mini_top_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")".$selection_cutoff[$cnt]."
ORDER BY i.image_".$selection[$cnt]." DESC, i.image_".$selection_alt[$cnt];
$result = $site_db->query_firstrow($sql);
show_image($result);
$site_template->register_vars("lang_mini_top_mode", $lang['mini_top_'.$selection[$cnt]]);
$mini_top_images .= $site_template->parse_template("mini_top_bit");
$mini_top_images .= "\n</td>\n";
}
$mini_top_images .= "</tr>\n";
$mini_top_images .= "</table>\n";
$site_template->register_vars(array(
"mini_top_images" => $mini_top_images,
"lang_hits" => $lang['hits'],
"lang_downloads" => $lang['downloads'],
"lang_mini_top_title" => $lang['mini_top_title']
));
unset($mini_top_images);
?>
yes i have
i added {rating_url} the the path seeme to be registered correctly
also when i`ve already voted i get the corresponding message
so i think it has something to do with rating .php (??)
somene posted this link http://komodomedia.com/blog/index.php/2005/08/24/creating-a-star-rater-using-css/
i`ve tried it and works
in rate_form.html
inside the span tags replace the code with this
<ul class='star-rating'>
<li><a href="javascript:rate('1');" title='Rate this 1 star out of 5' class='one-star'>1</a></li>
<li><a href='"javascript:rate('2');" title='Rate this 2 stars out of 5' class='two-stars'>2</a></li>
<li><a href="javascript:rate('3');" title='Rate this 3 stars out of 5' class='three-stars'>3</a></li>
<li><a href="javascript:rate('4');" title='Rate this 4 stars out of 5' class='four-stars'>4</a></li>
<li><a href="javascript:rate('5');" title='Rate this 5 stars out of 5' class='five-stars'>5</a></li>
</ul>
and add in style.css
/* styles for the star rater */
.star-rating{
list-style:none;
margin: 0px;
padding:0px;
width: 100px;
height: 20px;
position: relative;
background: url(star_rating.gif) top left repeat-x;
}
.star-rating li{
padding:0px;
margin:0px;
/*\*/
float: left;
/* */
}
.star-rating li a{
display:block;
width:20px;
height: 20px;
text-decoration: none;
text-indent: -9000px;
z-index: 20;
position: absolute;
padding: 0px;
}
.star-rating li a:hover{
background: url(star_rating.gif) left bottom;
z-index: 1;
left: 0px;
}
.star-rating a.one-star{
left: 0px;
}
.star-rating a.one-star:hover{
width:20px;
}
.star-rating a.two-stars{
left:20px;
}
.star-rating a.two-stars:hover{
width: 40px;
}
.star-rating a.three-stars:hover{
width: 60px;
}
.star-rating a.three-stars{
left: 40px;
}
.star-rating a.four-stars{
left: 60px;
}
.star-rating a.four-stars:hover{
width: 80px;
}
.star-rating a.five-stars{
left: 80px;
}
.star-rating a.five-stars:hover{
width: 100px;
}
don`t foregt to change the paths of the images
ps it`s for a 20X20p star image
Hi mstgokcen,
follow the link below for an explanation why this error occurs. If you are using 4Images with MySQL 5.0.12 or higher it should solve your problem.
http://www.4homepages.de/forum/index.php?&topic=3102.msg71831#msg71831
So this is what you have to do:
In top.php find the 4 SQL-queries producing the error-messages in your post and change them as described in the link. You will have to change in each query
[qcode]... FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c LEFT JOIN ...[/qcode]
to
[qcode]... FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c) LEFT JOIN ...[/qcode]
I hope this will do the trick.
e-trader_2002
PS:
This error may occur in other PHP-modules of 4Images as well. Identify the PHP-module by looking at the URL-entryfield of your browser:Quotehttp://www.domain.xy/4images/index.php?sessionid=...
Always find the related SQL-query (best done by searching for the string LEFT JOIN) in that module and do the modification described above.