31
Templates & Styles (Requests & Discussions) / Re: Template "4default_wide" von Bali Web Design
« on: October 20, 2011, 03:31:57 PM »
Kein Problem, vor 7 Jahren war ich derjenige der diese Fragen gestellt hat
4images code on GitHub Click here to visit GitHub.
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
$tu = "{template_url}";
$us = "{url_search}";
$ls = "{lang_search}";
$las = "{lang_advanced_search}";
?>
<tr>
<td>
<?php
$tu = "{template_url}";
$us = "{url_search}";
$ls = "{lang_search}";
$las = "{lang_advanced_search}";
require "{template_url}/incl/searchbox.php";
?>
</td>
</tr>
<script type="text/javascript">
function Open(cls,nu,h,days){
var objs=bycls(cls,document),z0=0;
for (var z0=0;z0<objs.length;z0++){
objs[z0].style.height=(z0!=nu?0:objs[z0].offsetHeight>h-5?0:h)+'px';
}
if (typeof(days)=='number'){
cookieset(cls,nu+'|'+objs[nu].offsetHeight,days);
}
return false;
}
function cookieget(nme){
var rtn=cookie(nme),objs=bycls(nme,document);
if (rtn){
rtn=rtn.split('|');
if (objs[rtn[0]]){
objs[rtn[0]].style.height=rtn[1]+'px';
}
}
}
function cookie(nme){
var re=new RegExp(nme+'=[^;]+','i');
if (document.cookie.match(re)){
return document.cookie.match(re)[0].split("=")[1];
}
return null
}
function cookieset(nme,v,days){
document.cookie=nme+'='+v+';expires='+(new Date(new Date().getTime()+days*86400000).toGMTString())+';path=/';
}
function bycls(nme,el){
for (var reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName('*'),ary=[],z0=0; z0<els.length;z0++){
if(reg.test(els[z0].className)){
ary.push(els[z0]);
}
}
return ary;
}
</script>
<script type="text/javascript">
window.onload = function() {
cookieget('filter_search');
}
</script>
.filter_search {
position:relative;
overflow:hidden;
height:0px;
}
<div class="filter_search">
your content
</div>
<a class="filter_button" href="" onclick="return Open('filter_search',0,140,1);"></a>
.filter_button {
width: 90px;
height: 30px;
cursor: pointer;
display: block;
background-image: url( 'images/filter.png' );
}
.filter_button:hover {
background-image: url( 'images/filter_hover.png' );
}
.imgteaser {
margin: 0;
overflow: hidden;
position: relative;
}
.imgteaser a {
text-decoration: none;
}
.imgteaser a:hover {
text-decoration: none;
cursor: pointer;
}
.imgteaser a img {
margin: 0;
background: #fff;
}
.imgteaser a .desc { display: none; }
.imgteaser a:hover .desc{
display: block;
font-size: 10px;
background: #111;
filter:alpha(opacity=75);
opacity:.75;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=75)"; /*--IE 8 Transparency--*/
color: #fff;
position: absolute;
bottom: 0px;
padding: 10px;
margin: 0;
width: 180px;
border-top: 1px solid #999;
text-decoration: none;
}
.imgteaser a:hover .desc strong {
display: block;
margin-bottom: 5px;
font-size: 11px;
}
<table width="960" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="left">
{if content} {content} {endif content}
</td>
</tr>
</table>
<div style="float: left; padding-right: 30px; padding-bottom: 30px;">
<div style="width: 200px; border: 1px solid #dddddd; padding: 1px;">
<div class="imgteaser">
<a href="details.php?image_id={image_id}&mode=search"><img src="data/thumbnails/{cat_id}/{thumbnail_file_name}">
<span class="desc">
<strong>{image_name}</strong>
by <b>{user_firstname} {user_lastname}</b><br /><br />
{image_comments} comments | {image_votes} votes | {image_lightboxcount} likes
</span>
</a>
</div>
</div>
</div>
//-----------------------------------------------------
//--- Show Search Results -----------------------------
//-----------------------------------------------------
if ($num_rows_all && $show_result == 1) {
$link_arg = $site_sess->url(ROOT_PATH."search.php?show_result=1");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows_all, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$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").", u.user_lastname, u.user_firstname
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
$sql_where_query
AND c.cat_id = i.cat_id $cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
LIMIT $offset, $perpage";
$result = $site_db->query($sql);
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)) {
show_image($image_row, "search");
$thumbnails .= $site_template->parse_template("thumbnail_bit_search");
$count++;
} // end while
// $thumbnails .= "</table>\n";
$content = $thumbnails;
unset($thumbnails);
} // end if
else {
$site_template->register_vars(array(
"search_keywords" => format_text(stripslashes($org_search_keywords), 2),
"search_user" => format_text(stripslashes($org_search_user), 2),
"lang_search_by_keyword" => $lang['search_by_keyword'],
"lang_search_by_username" => $lang['search_by_username'],
"lang_new_images_only" => $lang['new_images_only'],
"lang_search_terms" => $lang['search_terms'],
"lang_or" => $lang['or'],
"lang_and" => $lang['and'],
"lang_category" => $lang['category'],
"lang_search_fields" => $lang['search_fields'],
"lang_all_fields" => $lang['all_fields'],
"lang_name_only" => $lang['name_only'],
"lang_description_only" => $lang['description_only'],
"lang_keywords_only" => $lang['keywords_only'],
"category_dropdown" => get_category_dropdown($cat_id)
));
if (!empty($additional_image_fields)) {
$additional_field_array = array();
foreach ($additional_image_fields as $key => $val) {
if (isset($lang[$key.'_only'])) {
$additional_field_array['lang_'.$key.'_only'] = $lang[$key.'_only'];
}
}
if (!empty($additional_field_array)) {
$site_template->register_vars($additional_field_array);
}
}
$content = $site_template->parse_template("search_form");
}
<script type="text/javascript">
document.onkeyup = KeyCheck;
function KeyCheck(e)
{
var KeyID = (window.event) ? event.keyCode : e.keyCode;
switch(KeyID)
{
case 37:
window.location = "{prev_image_url}";
break;
case 39:
window.location = "{next_image_url}";
break;
}
}
</script>
http://domain.com/4images/search.php?search_keywords=100
http://domain.com/4images/search.php?search_field=image_ISO&value=100
get_user_table_field(", u.", "user_icq")."
get_user_table_field(", u.", "user_icq")." ,u.userpic,
"comment_user_ip" => $comment_user_ip,
"comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",