php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2009

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 12.11.2009, 09:49  
Neuer Benutzer
 
Registriert seit: 12.11.2009
Beiträge: 3
PHP-Kenntnisse:
Anfänger
sati51 befindet sich auf einem aufstrebenden Ast
Standard Umzug Server -> Problem mit Thumbnail-Erstellung

Hallo,
nach Umzug unseres Hosters auf einen anderen Server mit der PHP Version 5.2.11-0.dotdeb.1 habe ich Probleme mit der Thumbnail-Erstellung.
Es ist nicht mehr möglich Thumbnails zu generieren.

Hier ein evtl. verantwortlicher Code:
PHP-Code:
<?php
// +----------------------------------------------------------------------+
// | EngineLib - Image Functions                                          |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003,2004 AlexScriptEngine - e-Visions                 |
// +----------------------------------------------------------------------+
// | This code is not freeware. Please read our licence condition care-   |
// | fully to find out more. If there are any doubts please ask at the    |
// | Support Forum                                                        |
// |                                                                      |
// +----------------------------------------------------------------------+
// | Author: Alex Höntschel <info@alexscriptengine.de>                    |
// | Web: http://www.alexscriptengine.de                                  |
// | IMPORTANT: No email support, please use the support forum at         |
// |            http://www.alexscriptengine.de                            |
// +----------------------------------------------------------------------+
// $Id: function.img.php 6 2005-10-08 10:12:03Z alex $

//define("FILE_NAME","img_global.php");

function calcThumbnail($dl,$add="./") {
    global 
$config$resize;
        
$pic = array();
        if (
$config['active_image_resizer']) {
            
$orig_data = @getimagesize($add."thumbnail/".$dl['thumb']);

            if(
$orig_data[0] > $orig_data[1]) {
                
$pic['width'] = $config['image_width'];
                
$pic['height'] = @floor(($orig_data[1]*$config['image_width'])/$orig_data[0]);
            } else {
                
$pic['height'] = $config['image_height'];
                
$pic['width'] = @floor(($orig_data[0]*$config['image_height'])/$orig_data[1]);
            }
            
$resize == true;
        } else {
            
$size = @getimagesize($add."thumbnail/".$dl['thumb']);
            if(
$size[0] != ""$pic['width'] = $size[0];
            if(
$size[1] != ""$pic['height'] = $size[1];
            
$resize == false;
        }    
    return 
$pic;    
}    

function 
createThumbnail($source,$size_array,$dest,$gd_version) {
    global 
$config,$settings;
    
$pic_exist FALSE;
    
$type getImgType($source);
    
$size = @getimagesize($source);
    if (
function_exists("imagecreatetruecolor") && $gd_version >= 2) {
      
$thumb imagecreatetruecolor($size_array['width'], $size_array['height']);
    } else {
      
$thumb imagecreate($size_array['width'], $size_array['height']);
    }
    
    if (
$image = @call_user_func("imagecreatefrom".$type$source)) {
      if (
function_exists("imagecopyresampled") && $gd_version >= 2) {
        
imagecopyresampled($thumb$image0000$size_array['width'], $size_array['height'], $size[0], $size[1]);
      } else {
        
imagecopyresized($thumb$image0000$size_array['width'], $size_array['height'], $size[0], $size[1]);
      }
      @
call_user_func("image".$type$thumb$dest100);
      
imagedestroy($thumb);
    }        
    if(
file_exists($dest)) $pic_exist TRUE;
    
    return 
$pic_exist;
}

function 
getImgType($source) {
    
$size = @getimagesize($source);

    switch(
$size[2]) {
        case 
1:
            return 
'gif';
            break;
        case 
2:
            return 
'jpeg';
            break;
        case 
3:
            return 
'png';
            break;
        }
}
        
/*
Siehe www.php.net/createimagetruecolor 
comment from Andreas 28-Feb-2003 01:15
*/
function chkgd2() {
    
ob_start();
    
phpinfo(8);
    
$phpinfo ob_get_contents();
    
ob_end_clean();
    
$phpinfo strip_tags($phpinfo);
    
$phpinfo stristr($phpinfo,"gd version");
    
$phpinfo stristr($phpinfo,"version");
    
$end strpos($phpinfo,".");
    
$phpinfo substr($phpinfo,0,$end);
    
$length strlen($phpinfo)-1;
    
$phpinfo substr($phpinfo,$length);
    return 
$phpinfo;
}


?>

Nächste Datei (Code):
:
PHP-Code:
<?php
/*
+--------------------------------------------------------------------------
|   Alex Download Engine
|   ========================================
|   by Alex Höntschel
|   (c) 2002 AlexScriptEngine
|   http://www.alexscriptengine.de
|   ========================================
|   Web: http://www.alexscriptengine.de
|   Email: info@alexscriptengine.de
+---------------------------------------------------------------------------
|
|   > Beschreibung
|   > Funktionsbibliothek für die DL-Engine
|
|   > Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-
|   > bedingungen (read-me.html) für weitere Informationen.
|   >-----------------------------------------------------------------
|   > This script is NOT freeware! Please read the Copyright Notice
|   > (read-me_eng.html) for further information. 
|
|   > $Id: function.dl.php 29 2005-10-30 10:09:10Z alex $
|
+--------------------------------------------------------------------------
*/

function postCss($comno) {
    global 
$config;
    if((
$comno/2) != floor($comno/2)) {
        
$css 'list_dark';
    } else {
        
$css 'list_light';
    }
    return 
$css;
}

function 
buildThumbnail($dl,$resize_img) {
    global 
$config;
    if (
$dl['thumb'] != "0" && $dl['thumb'] != "") {
        if(
$resize_img == false) {
               
$size = @getimagesize("./thumbnail/".$dl['thumb']);
               if(
$size[0] != ""$thumb_width "width=\"".$size[0]."\"";
               if(
$size[1] != ""$thumb_height "height=\"".$size[1]."\"";
            
$thumb_url $config['thumburl']."/".$dl['thumb'];
        } else {
            
$thumb_file "./thumbnail/thumb_".$dl['thumb'];
                            
            if(
file_exists($thumb_file)) {
                
$orig_data = @getimagesize($thumb_file);
                if(
$orig_data[0] != ""$thumb_width "width=\"".$orig_data[0]."\"";
                if(
$orig_data[1] != ""$thumb_height "height=\"".$orig_data[1]."\"";
                
$thumb_url $config['thumburl']."/thumb_".$dl['thumb'];
            } else {  

                
$orig_data = @getimagesize($add."thumbnail/".trim($dl['thumb']));

                if((
$orig_data[0] > $config['image_width']) || ($orig_data[1] > $config['image_height'])) {     
                    
$thumb calcThumbnail($dl,$add="./");
                    if(
createThumbnail("./thumbnail/".$dl['thumb'],$thumb,$thumb_file,chkgd2())) {
                        
$size = @getimagesize($thumb_file);
                        if(
$size[0] != ""$thumb_width "width=\"".$size[0]."\"";
                        if(
$size[1] != ""$thumb_height "height=\"".$size[1]."\"";                   
                        
$thumb_url $config['thumburl']."/thumb_".$dl['thumb'];
                    } else {
                        if(
$orig_data[0] != ""$thumb_width "width=\"".$orig_data[0]."\"";
                        if(
$orig_data[1] != ""$thumb_height "height=\"".$orig_data[1]."\"";                     
                        
$thumb_url $config['thumburl']."/".$dl['thumb'];
                    }                       
                } else {
                    
$size = @getimagesize("./thumbnail/".$dl['thumb']);
                    if(
$size[0] != ""$thumb_width "width=\"".$size[0]."\"";
                    if(
$size[1] != ""$thumb_height "height=\"".$size[1]."\"";
                    
$thumb_url $config['thumburl']."/".trim($dl['thumb']);                      
                }       
            }
        }
        
$pic "<img src=\"".$thumb_url."\" ".$thumb_width." ".$thumb_height." border=\"0\" align=\"top\" />";          
    } else {
        
$pic "";
    }
    return 
$pic;
}

function 
displayDetailedFiles($subcat,$start,$orderby) {
    global 
$db_sql$config$auth$sess$lang$_ENGINE,$dl_table,$mirror_table,$bbcode,$total_dls;
    
    if(
$config['active_image_resizer']) {
        include_once(
$_ENGINE['eng_dir']."admin/enginelib/function.img.php");
        if(
chkgd2() >= 2) {
            
$resize_img true;
        } else {
            
$resize_img false;
        }
    }
    
    
$detailed_files_loop = array();
    
    
$result2 $db_sql->sql_query("SELECT $dl_table.*, count(mirror_id) AS mirror_no FROM $dl_table 
                                    LEFT JOIN $mirror_table ON $dl_table.dlid = $mirror_table.dlid
                                    WHERE $dl_table.catid='$subcat' AND $dl_table.status!='3' GROUP BY $dl_table.dlid ORDER BY $orderby LIMIT "
.$start.",$config[dlperpage]");
    while(
$dl $db_sql->fetch_array($result2)) {
        
$dl stripslashes_array($dl);
        unset(
$points);
        unset(
$kom_i);
        unset(
$email_author);
        unset(
$homep);
        unset(
$update_mark);
        if (
$dl['dlpoints'] != 0) {
            
$dl_divp $dl['dlpoints'] / $dl['dlvotes'];
            
$points round($dl_divp,2);
        }
        
        if(
$config['active_image_resizer']) {
            
$pic buildThumbnail($dl,$resize_img);
        } else {
            if (
$dl['thumb'] != "0" && $dl['thumb'] != "") {
                
$size = @getimagesize("./thumbnail/".$dl['thumb']);
                if(
$size[0] != ""$thumb_width "width=\"".$size[0]."\"";
                if(
$size[1] != ""$thumb_height "height=\"".$size[1]."\"";
                
$pic "<img src=\"$config[thumburl]/$dl[thumb]\" $thumb_width $thumb_height border=\"0\" align=\"left\" />";
            } else {
                
$pic "";
            }       
        }

        if (
$dl['onlyreg'] == || $auth->user['canaccessregisteredfiles'] == "1") {
            
$headlink "<a class=\"list_headline\" href=\"".$sess->url("comment.php?dlid=".$dl['dlid'])."\">".trim($dl['dltitle'])."</a>";
            
$headlink2 "<a class=\"file_new_link\" href=\"".$sess->url("comment.php?dlid=".$dl['dlid'])."\">".trim($dl['dltitle'])."</a>";            
            
            if(
$config['front_download']) $piclink "<a class=\"cat\" href=\"".$sess->url("redirect.php?dlid=".$dl['dlid'])."\"><img src=\"".$_ENGINE['languageurl']."/img_download.gif\" width=\"105\" height=\"22\" border=\"0\" align=\"middle\" /></a>";
            if(
$dl['mirror_no'] >= 1$mirrorlink "&raquo; <a href=\"".$sess->url("comment.php?dlid=".$dl['dlid'])."#mirror\">".$lang['index_mirror_links']."</a> (".$dl['mirror_no'].")<br />";
        } else {
            
$headlink trim($dl['dltitle'])." *<br><font size=\"1\">".$lang['index_registered_members_only']."</font>";
            
$piclink "&nbsp;";
        }       

        if (
$dl['dlpoints'] == 0) {
            
$rate $lang['index_currently_no_rating'];
        } else {
            
$rate sprintf($lang['index_rate_on_total_votes'],$points,$dl['dlvotes']);
        }
        
        
$file_author trim($dl['dlauthor']);
        
        if (
$dl['hplink'] != "" && $dl['hplink'] != "0") {
            
$homep " <a href=\"".trim(htmlspecialchars($dl['hplink']))."\"><img src=\"$config[grafurl]/img_homepage.gif\" alt=\"$lang[php_goto_hp] $file_author\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" /></a> ";
        } else {
            
$homep "";
        }

        if (
$dl['authormail'] != ""$email_author "<a href=\"".$sess->url("misc.php?action=formmailer&dlid=".$dl['dlid'])."\"><img src=\"$config[grafurl]/img_email.gif\" alt=\"$lang[php_sendmail] $file_author\" width=\"16\" height=\"16\" border=\"0\" align=\"middle\" /></a>";
        
        if (
$dl['status'] == ) {
            
$deadlink " <a class=\"infile\" href=\"".$sess->url("deadlink.php?subcat=".$dl['catid']."&dlid=".$dl['dlid'])."\">".$lang['index_report_deadlink']."</a>";
        } else {
            
$deadlink $lang['index_link_will_be_checked_soon'];
        }
        
        if(
$config['updatemark'] && $dl['update_date']) $update_mark buildUpdate($dl['update_date']);

        if (
$config['newmark']) $graph newgraph($dl['dl_date']);
        
        if (
$config['top_list']) $cool CoolDL($dl['dlhits'],$total_dls);
        
$stars Stars($points);
        
$loadtime LoadTime($dl['dlsize']);
        
        
$detailed_files_loop[] = array('headlink' => $headlink,
                                        
'index_comment' => $lang['index_comment'],
                                        
'index_rate_file' => $lang['index_rate_file'],
                                        
'index_options' => $lang['index_options'],
                                        
'gfx_graph' => $graph,
                                        
'gfx_cool' => $cool,
                                        
'gfx_stars' => $stars,
                                        
'gfx_update' => $update_mark,
                                        
'file_description' => $bbcode->rebuildText($dl['dldesc']),
                                        
'file_total_downloads' => sprintf($lang['index_total_downloads'],$dl['dlhits']),
                                        
'file_total_rating' => $rate,
                                        
'file_total_time_to_download' => LoadTime($dl['dlsize']),
                                        
'options_mirror_link' => $mirrorlink,
                                        
'options_deadlink' => $deadlink,
                                        
'options_comment_count' => $dl['comment_count'],
                                        
'options_comment_url' => $sess->url('comment.php?dlid='.$dl['dlid']).'#comm',
                                        
'options_rate_url' => $sess->url('comment.php?dlid='.$dl['dlid']).'#rate',
                                        
'options_recommend_url' => $sess->url('recommend.php?dlid='.$dl['dlid']),
                                        
'file_pic' => $pic,
                                        
'direct_download_link' => $piclink,
                                        
'author_information' => sprintf($lang['index_author_of_file'],trim($dl['dlauthor']),$email_author,$homep,aseDate($config['shortdate'],$dl['dl_date'])));
    }  
    return 
$detailed_files_loop;
}

function 
displayListedFiles($subcat,$start,$orderby) {
    global 
$db_sql$config$auth$sess$lang$_ENGINE,$dl_table,$mirror_table,$bbcode,$total_dls;
    
$result2 $db_sql->sql_query("SELECT $dl_table.*, count(mirror_id) AS mirror_no FROM $dl_table 
                                    LEFT JOIN $mirror_table ON $dl_table.dlid = $mirror_table.dlid
                                    WHERE $dl_table.catid='$subcat' AND $dl_table.status!='3' GROUP BY $dl_table.dlid ORDER BY $orderby LIMIT "
.$start.",$config[dlperpage]");
    
$no 0;
    
$listed_files_loop = array();
    while(
$dl $db_sql->fetch_array($result2)) {
        
$dl stripslashes_array($dl);
        unset(
$points);
        unset(
$added);
        unset(
$loadtime);
        unset(
$description);
        unset(
$graph);
        unset(
$cool);
        unset(
$stars);
        
$rowcolor postCss($no);
        if (
$dl['dlpoints'] != 0) {
            
$dl_divp $dl['dlpoints'] / $dl['dlvotes'];
            
$points round($dl_divp,2);
        }

        
//if ($dl['onlyreg'] == 0 || $auth->user['canaccessregisteredfiles'] == "1") {
            
$headlink "<a href=\"".$sess->url("comment.php?dlid=".$dl['dlid'])."\"><b>".trim($dl['dltitle'])."</b></a>";
        
/*} else {
            $headlink = "<b>".trim($dl['dltitle'])."</b> *<font size=\"1\">".$lang['index_registered_members_only']."</font>";
        }*/     

        
if ($dl['dlpoints'] == 0) {
            
$rate $lang['index_currently_no_rating'];
        } else {
            
$rate "<b>".$points."</b> (".$dl['dlvotes']." ".$lang['index_votes'].")";
        }

        if (
$config['newmark']) $graph newgraph($dl['dl_date']);
        
        if (
$config['top_list']) $cool CoolDL($dl['dlhits'],$total_dls);
        
$stars Stars($points);
        
$file_size buildFileSize($dl['dlsize']);
        
        if(
strlen($dl['dldesc'])>160$dl['dldesc'] = substr($dl['dldesc'],0,157)."...";
        
$description $bbcode->rebuildText($dl['dldesc']);  
        
$no++;                      
        
        
$listed_files_loop[] = array('headlink' => $headlink,
                                    
'description' => $description,
                                    
'file_date' => aseDate($config['longdate'],$dl['dl_date'],1),
                                    
'rowcolor' => $rowcolor,
                                    
'file_size' => $file_size,
                                    
'file_rating' => $rate,
                                    
'file_hits' => $dl['dlhits'],
                                    
'file_stars' => $stars
                                    
'file_graph' => $graph,
                                    
'file_cool' => $cool);
    }  
    return 
$listed_files_loop;
}

function 
displayCatBits($subcat=0,$count_rows=0) {
    global 
$db_sql$lang,$cat_table,$dl_childtable,$cat_table,$sess,$parse_categories,$tpl;
    
$result $db_sql->sql_query("SELECT $cat_table.*, $dl_childtable.childlist FROM $cat_table
                                    LEFT JOIN $dl_childtable ON $cat_table.catid = $dl_childtable.catid
                                    WHERE subcat='"
.$subcat."' ORDER BY catorder ASC");
                                    
    if(
$count_rows) {                                    
        
$row $db_sql->num_rows($result);
        if (
$row != 0) {
            
$parse_categories true;
        }
    }
    
    
// entspricht $config['no_of_cat']
    
$cat_rows 2;
    
    
$i 1;
    
$anz $cat_rows;
    
    
$b 0;
    
$width_cat round(100/$anz,0);
    
$tpl->register(array('width'=>$width_cat,
                        
'colspan' => $cat_rows));
    
    
$row $db_sql->num_rows($result);
                                            
    
$count_cat 1;
    
$category_loop = array();
    while(
$cat $db_sql->fetch_array($result)) {
        
$cat stripslashes_array($cat);
        unset(
$new_count);
        
$new_count $cat['download_count'];
        if(
$cat['childlist']) {
            
$result2 $db_sql->sql_query("SELECT $cat_table.download_count FROM $cat_table WHERE catid IN (".modifyCatChildList($cat['childlist']).")");
            while(
$counter $db_sql->fetch_array($result2)) $new_count $new_count intval($counter['download_count']);
        }

        
$dl_counter $new_count;
        
$cat_counter $db_sql->num_rows($db_sql->sql_query("SELECT catid FROM $cat_table WHERE subcat='$cat[catid]'"));

        
$b++;
        
$table_end "</td>\n";
        if(
$b == $anz && $i != intval($row)) {
            
$table_end .= "</tr>\n<tr>\n";
            
$b 0;
        }        
        
        
$category_loop[] = array('category_headline' => $cat['titel'],
                                
'category_description' => $cat['cat_desc'],
                                
'category_url' => $sess->url('index.php?subcat='.$cat['catid']),
                                
'number_of_subcategories' => $cat_counter,
                                
'number_of_files' => $dl_counter,
                                
'table_start' => "<td width=\"$width_cat%\" valign=\"top\">\n",
                                
'table_end' => $table_end);
        
        unset(
$dl_counter);
        unset(
$cat_counter);
        
$count_cat++;
        
$i++;
    }
    
$catbits = array($cat_mainbit_l,$cat_mainbit_r);
    if(
$count_rows$catbits[] = $subcat_head;
    return 
$category_loop;
}

function 
newgraph($date) {
    global 
$lang$config;
    
$today time();
    
    
$latest $config['newmark']*24*60*60;
    
$intervall $latest 3;
    
    if (
$date $today-($intervall*2) && $date $today-$latest) {
        
$newgr " <img src=\"$config[grafurl]/img_new3.gif\" alt=\"\" width=\"60\" height=\"14\" border=\"0\" align=\"middle\" /> ";
    } elseif (
$date $today-$intervall && $date $today-($intervall*2)) {
        
$newgr " <img src=\"$config[grafurl]/img_new2.gif\" alt=\"\" width=\"60\" height=\"14\" border=\"0\" align=\"middle\" /> ";
    } elseif (
$date $today-$intervall || $date == $today) {
        
$newgr " <img src=\"$config[grafurl]/img_new.gif\" alt=\"\" width=\"60\" height=\"14\" border=\"0\" align=\"middle\" /> ";
    } else {
        
$newgr " ";
    }    
    return 
$newgr;
}

function 
GetFile($dlid) {
    global 
$dl_table,$db_sql,$cat_table;
    
$sql $db_sql->query_array("SELECT $dl_table.*, $cat_table.titel FROM $dl_table 
                                LEFT JOIN $cat_table ON $dl_table.catid = $cat_table.catid
                                WHERE $dl_table.dlid='$dlid'"
);
    return 
stripslashes_array($sql);
}
         
function 
VoteFile($vote,$dlid,$userid) {
    global 
$dl_table,$dl_iptable,$db_sql,$config,$_COOKIE,$lang,$user;
    
$update_vote FALSE;
    list(
$dlid,$dlvotes,$dlpoints) = $db_sql->sql_fetch_row("SELECT dlid,dlvotes,dlpoints FROM $dl_table WHERE dlid='$dlid'");       
         
    switch (
$config['kindoflock']) {
        case 
0// Cookie
            
$cookie_name "vote_dlid_".$dlid;
            if(
$_COOKIE["$cookie_name"] != $dlid) {
                
$update_vote TRUE;
                
setcookie("$cookie_name"$dlidtime()+($config['time_to_lock']*60),"/");
            }
            break;
        case 
1// IP
            
$block_time time() - ($config['time_to_lock']*60);
            
$db_sql->sql_query("DELETE FROM $dl_iptable WHERE vote_time < '$block_time'");
            
$user_ip getenv("REMOTE_ADDR");
            
$voted_file $db_sql->query_array("SELECT * from $dl_iptable WHERE user_ip='$user_ip' AND dl_id='$dlid'");
            if(
$voted_file == "") {
                
$update_vote TRUE;
                
$db_sql->sql_query("INSERT INTO $dl_iptable (dl_id,user_ip,vote_time) VALUES ('$dlid','$user_ip','".time()."')");
            }
            break;
    case 
2// Cookie und IP
        
$cookie_name "vote_dlid_".$dlid;
        if(
$_COOKIE["$cookie_name"] != $dlid) {
            
$update_vote TRUE;
            
setcookie("$cookie_name"$dlidtime()+($config['time_to_lock']*60),"/");
        }        
        
$block_time time() - ($config['time_to_lock']*60);
        
$db_sql->sql_query("DELETE FROM $dl_iptable WHERE vote_time < '$block_time'");
        
$user_ip getenv("REMOTE_ADDR");
        
$voted_file $db_sql->query_array("SELECT * FROM $dl_iptable WHERE user_ip='$user_ip' AND dl_id='$dlid'");
        if(
$voted_file == "") {
            
$update_vote TRUE;
            
$db_sql->sql_query("INSERT INTO $dl_iptable (dl_id,user_ip,vote_time) VALUES ('$dlid','$user_ip','".time()."')");
        }        
        break;          
    }
    
    if(!
$config['active_lock']) $update_vote TRUE;

    if(
$update_vote) {
        if(
$config['user_rate_factor'] == 0$config['user_rate_factor'] = 1;
        if(
$user['groupid'] != 8) {
            
$value $vote*$config['user_rate_factor'];
            
$uservotes $config['user_rate_factor'];
        } else {
            
$value $vote;
            
$uservotes 1;
        }
        
        
$dlpoi $dlpoints $value;
        
$dlvot $uservotes $dlvotes;
        
$db_sql->sql_query("UPDATE $dl_table SET dlpoints='$dlpoi', dlvotes='$dlvot' WHERE dlid='$dlid'");
        return 
$lang['rec_error8'];
    } else {
        return 
$lang['rec_error41'];
    }
}   

function 
convertOrderBy($table$order) {
    if(
$order == "nameA")       return "$table.username ASC"
    if(
$order == "pnameA")      return "$table.dltitle ASC"
    if(
$order == "rankA")       return "$table.groupid ASC";
    if(
$order == "sinceA")      return "$table.regdate ASC";
    if(
$order == "dateA")       return "$table.dl_date ASC";
    if(
$order == "nameD")       return "$table.username DESC"
    if(
$order == "pnameD")      return "$table.dltitle DESC"
    if(
$order == "rankD")       return "$table.groupid DESC";
    if(
$order == "sinceD")      return "$table.regdate DESC";
    if(
$order == "dateD")       return "$table.dl_date DESC";
}
         
function 
convertorderbyin($orderby) {
    global 
$dl_table;
    if (
$orderby == "titleA")   $orderby "$dl_table.dltitle ASC"
    if (
$orderby == "dateA")    $orderby "$dl_table.dl_date ASC";
    if (
$orderby == "hitsA")    $orderby "$dl_table.dlhits ASC";
    if (
$orderby == "votesA")   $orderby "$dl_table.dlvotes ASC";
    if (
$orderby == "titleD")   $orderby "$dl_table.dltitle DESC"
    if (
$orderby == "dateD")    $orderby "$dl_table.dl_date DESC";
    if (
$orderby == "hitsD")    $orderby "$dl_table.dlhits DESC";
    if (
$orderby == "votesD")   $orderby "$dl_table.dlvotes DESC";
    return 
$orderby;
}
         
function 
postcolor($comno) {
    global 
$config;
    if((
$comno/2) != floor($comno/2)) {
        
$background $config['postcol1'];
    } else {
        
$background $config['postcol2'];
    }
    return 
$background;
}

function 
CatHead($catid,$no) {
    global 
$cat_table,$config,$db_sql;
    list (
$titel) = $db_sql->sql_fetch_row("SELECT titel FROM $cat_table WHERE catid='$catid'");
    eval (
"\$including = \"".gettemplate("newdl_cathead")."\";");   
}
         
function 
CoolDL($t_hits,$total=0) {
    global 
$dl_table$config,$db_sql;
    
$hits 0;
    
    
$top $total 100 $config['top_list_q'];
    
    if (
$t_hits $top) {
        
$cool "";
    } else {
        
$cool " <img src=\"$config[grafurl]/img_popular.gif\" alt=\"\" width=\"60\" height=\"14\" border=\"0\" align=\"middle\" /> ";
    }
    return 
$cool;
}

function 
buildUpdate($up_date) {
    global 
$config;
    
$new_d = ($config['updatemark']*24*60*60)+$up_date;
    if(
$new_d >= time()) {
        return 
" <img src=\"$config[grafurl]/img_updated.gif\" alt=\"\" width=\"60\" height=\"14\" border=\"0\" align=\"middle\" /> ";
    } else {
        return 
false;
    }
}
         
function 
Stars($points) {
    global 
$config,$lang;
    if (
$points "4") {
        
$stars "";
    } elseif (
$points "3") {
        
//$stars = " <img src=\"$config[grafurl]/pop.gif\" width=11 height=10 border=0 alt=\"$lang[file_bit_rate] $points\">";
        
$stars " <img src=\"$config[grafurl]/stars1.gif\" width=\"35\" height=\"14\" border=\"0\" align=\"middle\" alt=\"".sprintf($lang['misc_top10_rating_rate'],$points)."\" />";
    } elseif (
$points "2") {
        
//$stars = " <img src=\"$config[grafurl]/pop.gif\" width=11 height=10 border=0 alt=\"$lang[file_bit_rate] $points\">";
        //$stars .= "<img src=\"$config[grafurl]/pop.gif\" width=11 height=10 border=0 alt=\"$lang[file_bit_rate] $points\">";
        
$stars " <img src=\"$config[grafurl]/stars2.gif\" width=\"35\" height=\"14\" border=\"0\" align=\"middle\" alt=\"".sprintf($lang['misc_top10_rating_rate'],$points)."\" />";        
    } elseif (
$points >= "1") {
        
//$stars = " <img src=\"$config[grafurl]/pop.gif\" width=11 height=10 border=0 alt=\"$lang[file_bit_rate] $points\">";
        //$stars .= "<img src=\"$config[grafurl]/pop.gif\" width=11 height=10 border=0 alt=\"$lang[file_bit_rate] $points\">";
        //$stars .= "<img src=\"$config[grafurl]/pop.gif\" width=11 height=10 border=0 alt=\"$lang[file_bit_rate] $points\">";
        
$stars " <img src=\"$config[grafurl]/stars3.gif\" width=\"35\" height=\"14\" border=\"0\" align=\"middle\" alt=\"".sprintf($lang['misc_top10_rating_rate'],$points)."\" />";        
    } else {
        
$stars " ";
    }
    return 
$stars;
}

function 
buildFileSize($fsize) {
    global 
$config,$lang;
    
//$fsize = intval($fsize);
    
$length strlen($fsize);
    if(
$length <= 3) {
        
$fsize number_format($fsize,2,",",".");
        return 
$fsize." Bytes";
    } elseif(
$length >= && $length <= 6) {
        
$fsize number_format($fsize/1024,2,",",".");
        return 
$fsize." kB";
    } elseif(
$length >= && $length <= 9) {    
        
$fsize number_format($fsize/1048576,2,",",".");
        return 
$fsize." MB";
    } else {
        
$fsize number_format($fsize/1073741824,2,",",".");
        return 
$fsize." GB";
    }   
}
         
function 
InsertPost($text) {
    
$text str_replace("'","&acute;"$text);
    
$text str_replace("\"","&quot;"$text);      
    return 
$text;        
}       

function 
sBBcode($text,$imgcode 1,$urlparsing 1,$smilie 1) {
    global 
$sBBcode,$config;
    if(
$imgcode == 1$sBBcode->imgcode 1;
    if(
$urlparsing == 1$text $sBBcode->url_parse($text);

    
$textstripslashes($text);
    
$text htmlspecialchars($text);
    
$text $sBBcode->parsen($text);
    
$text nl2br($text);
    
$text str_replace(":-)","<image src=\"$config[smilieurl]/smile.gif\" />",$text);
    
$text str_replace(";-)","<image src=\"$config[smilieurl]/wink.gif\" />",$text);
    
$text str_replace(":O","<image src=\"$config[smilieurl]/wow.gif\" />",$text);
    
$text str_replace(";-(","<image src=\"$config[smilieurl]/sly.gif\" />",$text);
    
$text str_replace(":D","<image src=\"$config[smilieurl]/biggrin.gif\" />",$text);
    
$text str_replace("8-)","<image src=\"$config[smilieurl]/music.gif\" />",$text);
    
$text str_replace(":-O","<image src=\"$config[smilieurl]/cry.gif\" />",$text);
    
$text str_replace(":-(","<image src=\"$config[smilieurl]/confused.gif\" />",$text);
    
$text str_replace("(?)","<image src=\"$config[smilieurl]/sneaky2.gif\" />",$text);
    
$text str_replace("(!)","<image src=\"$config[smilieurl]/notify.gif\" />",$text);
    
$text str_replace(":!","<image src=\"$config[smilieurl]/thumbs-up.gif\" />",$text);
    
$text str_replace(":zzz:","<image src=\"$config[smilieurl]/sleepy.gif\" />",$text);
    
$text str_replace(":baaa:","<image src=\"$config[smilieurl]/baaa.gif\" />",$text);
    
$text str_replace(":blush:","<image src=\"$config[smilieurl]/blush.gif\" />",$text);
    
$text str_replace(":inlove:","<image src=\"$config[smilieurl]/inlove.gif\" />",$text);
    
$text str_replace(":stupid:","<image src=\"$config[smilieurl]/withstupid.gif\" />",$text);
    
$text str_replace(":xmas:","<image src=\"$config[smilieurl]/xmas.gif\" />",$text);
    return 
$text;
}        

function 
SetDeadLink($dlid) {
    global 
$config$dl_table,$db_sql;
    if (
$config['deadlink'] == 1) {
        
$db_sql->sql_query("UPDATE $dl_table SET status=2 WHERE dlid='$dlid'");
    }
}
            
function 
holeComment($comid) {
    global 
$config$dlcomment_table,$db_sql;
    
$sql $db_sql->query_array("SELECT * FROM $dlcomment_table WHERE comid='$comid'");
    return 
stripslashes_array($sql);
}
        
function 
CountComments($dlid) {
    global 
$dlcomment_table,$db_sql;
    return 
$db_sql->num_rows($db_sql->sql_query("SELECT comid FROM $dlcomment_table where dlid='$dlid' and com_status='1'"));
}       
        
function 
GetCatForm() {
    global 
$cat_table,$config;
    
$result sql_query("SELECT * FROM $cat_table"$link);
    while(
$cat mysql_fetch_array($result)) echo "<option value=\"$cat[catid]\">".stripslashes($cat[titel])."</option>\n";
}   
        
function 
makeCatLink($catid,$subcat,$depth=1) {
    global 
$cat_table,$db_sql;
    
$result2 $db_sql->sql_query("SELECT * FROM $cat_table WHERE subcat='$subcat' ORDER BY catorder");
    while (
$dl_cat $db_sql->fetch_array($result2)) {
        
$dl_cat stripslashes_array($dl_cat);
        if (
$depth != "1"$limiter str_repeat("--",$depth-1);
        
        if (
$dl_cat['catid'] == $catid) {
            
$cat_link .= "<option value=\"$dl_cat[catid]\" selected=\"selected\">".$limiter.$dl_cat['titel']."</option>\n";
        } else {
            
$cat_link .= "<option value=\"$dl_cat[catid]\">".$limiter.$dl_cat['titel']."</option>\n\t\t\t\t\t\t\t";             
        }        
        
$newcat $dl_cat['catid'];
        
$cat_link .= makeCatLink($catid,$newcat,$depth+1);
    }    
    return 
$cat_link;
}        

function 
uploadThumbnail($thumbsdir) {
    global 
$_FILES,$config,$lang;       
    
$allowed_pics = array("gif","png","jpg","jpeg");            
    
$pic_extension strtolower(substr(strrchr($_FILES['upl_thumbnail']['name'],"."),1));
            
    if(!
in_array($pic_extension,$allowed_pics)) { // Dateierweiterung Vorschaubild ungültig
        
$upload FALSE;
    } else {
        if(
file_exists($thumbsdir."/".$_FILES['upl_thumbnail']['name'])) {
            
// Zufallsnamen wählen
            
$build_destname strtolower(randomName(8));
            
$thumb_destname $build_destname.".".$pic_extension;
        } else {
            
// Filename bleibt
            
$thumb_destname $_FILES['upl_thumbnail']['name'];
        }           
                
        if(@
move_uploaded_file($_FILES['upl_thumbnail']['tmp_name'],$thumbsdir."/".$thumb_destname)) { // Datei kopieren
            
@chmod($thumbsdir."/".$thumb_destname0777); 
            @
unlink($thumb_destname);                       
            
$upload $thumb_destname;                      
        } else {
            
$upload FALSE;
        }
    }           
    return 
$upload;     
}       
        
function 
randomName($word_len 10) { 
    
$allchar "ABCDEFGHIJKLNMOPQRSTUVWXYZ0123456789" 
    
$str "" 
    
mt_srand (( double) microtime() * 1000000 ); 
    
    for ( 
$i 0$i<$word_len $i++ ) 
    
$str .= substr$allcharmt_rand (0,25), ) ; 
    
    return 
$str 
}       

function 
buildBreadCrumb($bread) {
    global 
$config$lang;
    
$no count($bread);
    
$i 1;
    foreach(
$bread as $val => $key) {
        if(
$i == 0$breadcrumb .= "<a href=\"".$key."\" class=\"catrow\">".$val."</a>";
        if(
$i == $no) {
            
$breadcrumb .= "<b>".$val."</b>";
        } else {
            
$breadcrumb .= "<a href=\"".$key."\" class=\"catrow\">".$val."</a>";
        }
        
        if(
$i != $no$breadcrumb .= "&nbsp;&raquo;&nbsp;";
        
$i++;
    }
    return 
$breadcrumb;
}

function 
realFileSize() {
    
$size 0;
    
$handle = @opendir('./files/');
    while (
$file = @readdir($handle)) {
        if (
eregi("^\.{1,2}$",$file))  continue;
        
$size += filesize('./files/'.$file);
    }
    @
closedir($handle);  
    return 
$size;
}  

function 
getPosticon($value) {
    global 
$config;
    switch(
$value) {
        case 
$config['smilieurl']."/posticons/ausrufezeichen.gif":
            
$ch 1;
            break;
        case 
$config['smilieurl']."/posticons/biggrin.gif":
            
$ch 2;
            break;
        case 
$config['smilieurl']."/posticons/boese.gif":
            
$ch 3;
            break;
        case 
$config['smilieurl']."/posticons/cool.gif":
            
$ch 4;
            break;
        case 
$config['smilieurl']."/posticons/eek.gif":
            
$ch 5;
            break;
        case 
$config['smilieurl']."/posticons/frage.gif":
            
$ch 6;
            break;
        case 
$config['smilieurl']."/posticons/frown.gif":
            
$ch 7;
            break;
        case 
$config['smilieurl']."/posticons/icon1.gif":
            
$ch 8;
            break;
        case 
$config['smilieurl']."/posticons/lampe.gif":
            
$ch 9;
            break;
        case 
$config['smilieurl']."/posticons/mad.gif":
            
$ch 10;
            break;
        case 
$config['smilieurl']."/posticons/sad.gif":
            
$ch 11;
            break;
        case 
$config['smilieurl']."/posticons/smilie.gif":
            
$ch 12;
            break;
        case 
$config['smilieurl']."/posticons/thumb_down.gif":
            
$ch 13;
            break;
        case 
$config['smilieurl']."/posticons/thumb_up.gif":
            
$ch 14;
            break;
        case 
$config['smilieurl']."/posticons/tongue.gif":
            
$ch 15;
            break;
        case 
$config['smilieurl']."/posticons/noicon.gif":
            
$ch 16;
            break;                                                                                                                                                                                                
    }
    return 
$ch;
}   

function 
modifyCatChildList($var) {
    
$t substr($var,0,1);
    if(
$t == ",") {
        
$var_modified substr($var,1);
    } else {
        
$var_modified $var;
    }
    
    
$var_reverse strrev($var_modified);
    
$s substr($var_reverse,0,1);
    
    if(
$s == ",") {
        return 
strrev(substr($var_reverse,1));
    } else {
        return 
strrev($var_reverse);
    }  
}   

?>

Hier noch ein Auszug aus der comment PHP:
PHP-Code:
<?php
/*
+--------------------------------------------------------------------------
|   Alex Download Engine
|   ========================================
|   by Alex Höntschel
|   (c) 2002 AlexScriptEngine
|   http://www.alexscriptengine.de
|   ========================================
|   Web: http://www.alexscriptengine.de
|   Email: info@alexscriptengine.de
+---------------------------------------------------------------------------
|
|   > Beschreibung
|   > Kommentare zu Downloads
|
|   > Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-
|   > bedingungen (read-me.html) für weitere Informationen.
|   >-----------------------------------------------------------------
|   > This script is NOT freeware! Please read the Copyright Notice
|   > (read-me_eng.html) for further information. 
|
|   > $Id: comment.php 7 2007-02-19 10:12:03Z alex $
|
+--------------------------------------------------------------------------
*/

include_once('lib.inc.php');
include_once(
$_ENGINE['eng_dir']."admin/enginelib/function.".ENG_TYPE.".php");
include_once(
$_ENGINE['eng_dir']."admin/enginelib/class.comment.php");

/*
Comments per Page
Set this to 0 to show all comments on one page (deactivate)
*/
$comments_per_page 10;
if(
$_GET['action'] != "popup") {
    
$tpl->register(array('comment_js_too_long' => $lang['comment_js_too_long'],
                        
'comment_js_maximum' => $lang['comment_js_maximum'],
                        
'comment_js_long1' => $lang['comment_js_long1'],
                        
'comment_js_long2' => $lang['comment_js_long2'],
                        
'comment_js1' => $lang['comment_js1'],
                        
'comment_js2' => $lang['comment_js2'],
                        
'comment_js3' => $lang['comment_js3'],
                        
'comment_js4' => $lang['comment_js4'],   
                        
'captcha_empty' => 'Captcha leer!',
                        
'max_comment_length' => $config['max_comment_length']));
    
    
$tpl->loadFile('meta''comment_js.html'); 
    
$tpl->register('header_add'$tpl->pget('meta'));
    
    
$tpl->loadFile('main''comment.html'); 
    
$tpl->register('title'$lang['title_comment']);
    
    
$conditions = array("table"=>$dlcomment_table,
                        
"id"=>"comid",
                        
"userid"=>"userid",
                        
"headline"=>"com_headline",
                        
"comment"=>"dl_comment",
                        
"date"=>"com_date",
                        
"status"=>"com_status",
                        
"postid"=>"dlid",
                        
"ip"=>"user_ip",
                        
"username"=>"user_comname",
                        
"posticon"=>"posticon");
                        
    
$ct = new engineComment($conditions);    
    
} else {
    
define('IS_POPUP',true);
    
$tpl->loadFile('meta''comment_js.html'); 
    
$tpl->register('header_add'$tpl->pget('meta'));
    
    
$tpl->loadFile('main''comment_popup.html'); 
    
    
$img $db_sql->query_array("SELECT dltitle,thumb FROM $dl_table WHERE dlid='".intval($_GET['dlid'])."'");
    
$size = @getimagesize("./thumbnail/".$img['thumb']);
    if(
$size[0] != ""$width "width=\"".$size[0]."\"";
    if(
$size[1] != ""$height "height=\"".$size[1]."\"";
    
$alt $img['dltitle']; 
    
$title $img['dltitle'];   
    
$pic $config['thumburl']."/".$img['thumb'];
    
    
$tpl->register(array('alt' => $img['dltitle'],
                        
'title' => $img['dltitle'],
                        
'pic' => $config['thumburl']."/".$img['thumb'],
                        
'width' => $width,
                        
'height' => $height));
    
    
$tpl->pprint('main'); 
    exit;
}

if (!isset(
$_POST['dlid']) && !isset($_GET['dlid'])) {
    
header("Location: ".$sess->url("index.php"));
    exit;
}

if (isset(
$_POST['comment']) && $_POST['comment']=='send') {

    if(
$config['use_captcha_comment'] == 1) {
        if (
trim(strtoupper($sess->getSessVar('ase_captcha_com_string'))) != trim(strtoupper($_POST['captcha_com_text']))) {
            
rideSite($sess->url('comment.php?'.$conditions['postid'].'='.$_POST[$conditions['postid']]), $lang['rec_error57']);
            exit();
        }
    }
    
$sess->setSessVar('ase_captcha_com_string');

    if (
$auth->user['canpostcomments']) {
        if (
$_POST['comment_message'] == "") {
            
rideSite($sess->url('comment.php?dlid='.$_POST['dlid']), $lang['rec_error11']);
            exit();      
        } else {
            
$comment['postid'] = intval($_POST['dlid']);
        
            
$direct_post $ct->writeComment($comment);
            
            if (
$config['directpost'] == && !$direct_post) {
                
$com_status 2;
            } else {
                
$com_status 1;
                
$db_sql->sql_query("UPDATE $dl_table SET comment_count=comment_count+1 WHERE dlid='".intval($_POST['dlid'])."'");
            }              
                    
            if (
$config['directpost'] == && !$direct_post) {
                
rideSite($sess->url('comment.php?dlid='.$_POST['dlid']), $lang['rec_error9']);
                exit();         
            } else {
                
rideSite($sess->url('comment.php?dlid='.$_POST['dlid']), $lang['rec_error10']);
                exit();         
            }
        }
    }
}

if (isset(
$_POST['vote'])) {
    
$error_title VoteFile($_POST['vote'],$_POST['dlid'],$auth->user['userid']);
    
rideSite($sess->url('comment.php?dlid='.$_POST['dlid']), $error_title);
    exit();        
}
$dlid "";
if(
$_POST['dlid']) $dlid intval($_POST['dlid']);
if(
$_GET['dlid']) $dlid intval($_GET['dlid']);   
   
if (
$config['top_list']) {
    
$result4 $db_sql->sql_query("SELECT dlhits FROM $dl_table");
    while (list(
$dlhits) =mysql_fetch_row($result4)) {
        
$hitsalt $dlhits;
        
$total_dls += $hitsalt;
    }
}   

$file GetFile($dlid);

if(
$file['status'] == '3') {
    
rideSite($sess->url('index.php?subcat='.$file['catid']), $lang['rec_error55']);
    exit();     
}

include_once(
$_ENGINE['eng_dir']."admin/enginelib/class.bbcode.php");
$bbcode = new engineBBCode(1,0,1,0,$config['smilieurl']);   
            
if (
$file['dlpoints'] != 0) {
    
$dl_divp $file['dlpoints'] / $file['dlvotes'];
    
$points round($dl_divp,2);
}

if(
$config['active_image_resizer']) {
    include_once(
$_ENGINE['eng_dir']."admin/enginelib/function.img.php");
    if(
chkgd2() >= 2) {
        
$resize_img true;
    } else {
        
$resize_img false;
    }
     
$pic buildThumbnail($file,$resize_img);


} else {
    if (
$file['thumb'] != "0" && $file['thumb'] != "") {
        
$size = @getimagesize("./thumbnail/".$file['thumb']);
        if(
$size[0] != ""$thumb_width "width=\"".$size[0]."\"";
        if(
$size[1] != ""$thumb_height "height=\"".$size[1]."\"";
        
$pic "<img src=\"$config[thumburl]/$file[thumb]\" $thumb_width $thumb_height border=\"0\" align=\"left\" />";
    } else {
        
$pic "";
    }       
}

if(
$pic && file_exists("./thumbnail/thumb_".$file['thumb'])) {  
    
$parse_link_to_image true;
    
$link_to_pic "<a href=\"javascript:popupWindow('".$sess->url('comment.php?action=popup&dlid='.$file['dlid'])."')\">".$lang['comment_click_to_enlarge']."</a><br><br>";
}


if (
$file['onlyreg'] == || $auth->user['canaccessregisteredfiles'] == "1") {
    
$headlink "<a class=\"list_headline\" href=\"".$sess->url("redirect.php?dlid=".$file['dlid'])."\">".trim($file['dltitle'])."</a>";
    
$piclink "<a class=\"cat\" href=\"".$sess->url("redirect.php?dlid=".$file['dlid'])."\"><img src=\"".$_ENGINE['languageurl']."/img_download.gif\" width=\"105\" height=\"22\" border=\"0\" align=\"absmiddle\"></a>";
} else {
    
$headlink trim($file['dltitle'])." *<br><font size=\"1\">".$lang['index_registered_members_only']."</font>";
    
$piclink "<img src=\"".$_ENGINE['languageurl']."/img_disabled_download.gif\" width=\"105\" height=\"22\" border=\"0\" align=\"absmiddle\">";
}       

$file_author trim($file['dlauthor']);
    
if (
$file['hplink'] != "" && $file['hplink'] != "0") {
    
$homep " <a href=\"".trim(htmlspecialchars($file['hplink']))."\"><img src=\"$config[grafurl]/img_homepage.gif\" alt=\"$lang[php_goto_hp] $file_author\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" /></a> ";
} else {
    
$homep "";
}

if (
$file['authormail'] != ""$email_author "<a class=\"infile\" href=\"".$sess->url("misc.php?action=formmailer&dlid=".$file['dlid'])."\"><img src=\"$config[grafurl]/img_email.gif\" alt=\"$lang[php_sendmail] $file_author\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" /></a>";

if (
$file['status'] == ) {
    
$deadlink " <a class=\"infile\" href=\"".$sess->url("deadlink.php?subcat=".$file['catid']."&dlid=".$file['dlid'])."\">".$lang['index_report_deadlink']."</a>";
} else {
    
$deadlink " ".$lang['comment_link_will_be_checked_soon'];
}
/*
if($config['mail_a_friend_registered'] == 0 || ($config['mail_a_friend_registered'] == 1 && $auth->user['groupid'] != 8)) {
    $mail_a_friend = "&raquo; <a href=\"".$sess->url('recommend.php?dlid='.$file['dlid'])."\">".$lang['index_mail_a_friend']."</a>";
} else {
    $mail_a_friend = "";
}
*/
if ($config['newmark']) $graph newgraph($file['dl_date']);

if(
$config['updatemark'] && $file['update_date']) $update_mark buildUpdate($file['update_date']);
    
if (
$config['top_list']) $cool CoolDL($file['dlhits'],$total_dls);
$stars Stars($points);
$loadtime LoadTime($file['dlsize']);

$tpl->register(array('headlink' => $headlink,
                        
'index_comment' => $lang['index_comment'],
                        
'index_rate_file' => $lang['index_rate_file'],
                        
'index_options' => $lang['index_options'],
                        
'gfx_graph' => $graph,
                        
'gfx_cool' => $cool,
                        
'gfx_stars' => $stars,
                        
'gfx_update' => $update_mark,
                        
'file_description' => $bbcode->rebuildText($file['dldesc']),
                        
'file_total_downloads' => sprintf($lang['index_total_downloads'],$file['dlhits']),
                        
'file_total_time_to_download' => LoadTime($file['dlsize']),
                        
'options_deadlink' => $deadlink,
                        
'options_comment_count' => $file['comment_count'],
                        
'options_comment_url' => $sess->url('comment.php?dlid='.$file['dlid']).'#comm',
                        
'options_rate_url' => $sess->url('comment.php?dlid='.$file['dlid']).'#rate',
                        
'options_recommend_link' => $mail_a_friend,
                        
'file_pic' => $pic,
                        
'link_to_pic' => $link_to_pic,
                        
'comment_total_votes_on_rating' => sprintf($lang['comment_total_votes_on_rating'],$file['dlvotes']),
                        
'comment_current_rating' => sprintf($lang['comment_current_rating'],$points),
                        
'dlid' => $file['dlid'],
                        
'comment_alternative_download' => $lang['comment_alternative_download'],
                        
'comment_rating' => $lang['comment_rating'],
                        
'comment_only_rate_once_for_a_file' => $lang['comment_only_rate_once_for_a_file'],
                        
'comment_rate_with_your_real_opinion' => $lang['comment_rate_with_your_real_opinion'],
                        
'comment_excelent_file' => $lang['comment_excelent_file'],
                        
'comment_really_bad' => $lang['comment_really_bad'],                        
                        
'direct_download_link' => $piclink,
                        
'author_information' => sprintf($lang['index_author_of_file'],trim($file['dlauthor']),$email_author,$homep,aseDate($config['shortdate'],$file['dl_date']))));

$result_mirror $db_sql->sql_query("SELECT * FROM $mirror_table WHERE dlid='".intval($file['dlid'])."' ORDER BY mirror_date DESC");
if(
$db_sql->num_rows($result_mirror) >= 1) { 
    
$parse_alternate_downloads true;
    
$alternate_download_loop = array();
    while(
$mirror $db_sql->fetch_array($result_mirror)) {
        
$mirror stripslashes_array($mirror);
        
$added_date aseDate($config['longdate'],$mirror['mirror_date'],1);
        
$mirror_id $mirror['mirror_id'];
        
$alternate_download_loop[] = array(
                                            
'mirror_text' => trim($mirror['mirror_text']),
                                            
'added_date' => sprintf($lang['comment_mirror_added_at'],aseDate($config['longdate'],$mirror['mirror_date'],1)),
                                            
'mirror_url' => $sess->url('redirect.php?mirror_id='.$mirror['mirror_id']));
    }
    
$tpl->parseLoop('main''alternate_download_loop');
}

if(
$comments_per_page >= 1) {
    
$over_all $db_sql->query_array("SELECT Count(*) as total FROM ".$ct->table." WHERE ".$ct->postid."='".intval($file['dlid'])."' AND com_status='1'");
    
    include_once(
$_ENGINE['eng_dir']."admin/enginelib/class.nav.php");
    if(!isset(
$_GET['start'])) {
        
$start 0;
    } else {
        
$start intval($_GET['start']);
    }
    
$nav = new Nav_Link();
    
$nav->overAll $over_all['total'];
    
$nav->perPage $comments_per_page;
    
$nav->DisplayLast 1;
    
$nav->DisplayFirst 1;    
    
$nav->MyLink $sess->url("comment.php?dlid=".intval($file['dlid']))."&amp;";
    
$nav->LinkClass "page_step";
    
$nav->start $start;
    
$pagecount $nav->BuildLinks();
    if(!
$pagecount$pagecount "<b>1</b>";
    
$pages intval($over_all['total'] / $nav->perPage);
    if(
$over_all['total'] % $nav->perPage$pages++;        
    
$tpl->register('pagecount'sprintf($lang['comment_pagecount'],$pages,$pagecount,$over_all['total']));
}

if(
$auth->user['canpostcomments'] == 1) {
    if(
$auth->user['userid'] == 2) {
        if(
$config['guestpost'] == 1) {
            
$com_post_name $lang['php_guest'];
            
$comment_details $ct->buildComments($file['dlid']);
            
$comment_form $ct->displayCommentForm($file['dlid'],$auth->user['userid'],$com_post_name);
        } else {
            
$com_post_name "Name_Input";
            
$comment_details $ct->buildComments($file['dlid']);
            
$comment_form $ct->displayCommentForm($file['dlid'],$auth->user['userid'],$com_post_name);
        }
    } else {
        
$comment_details $ct->buildComments($file['dlid']);
        
$comment_form $ct->displayCommentForm($file['dlid'],$auth->user['userid'],$auth->user['username']);
    }
} else {
    
$comment_form = array('user_can_post_comments' => false'user_can_post_no_comments' => true);  
    
$com_post_name $lang['php_guest'];
    
$comment_details $ct->buildComments($file['dlid']);
}

$tpl->register('comments'$comment_details);

$user_can_post_comments $comment_form['user_can_post_comments'];
$user_can_post_no_comments $comment_form['user_can_post_no_comments'];
$use_captcha_comment $config['use_captcha_comment'];

if(
$comment_form['user_can_post_comments']) {
    
$tpl->register(array('hidden' => $comment_form['hidden'],
                         
'input' => $comment_form['autor'],
                         
'newsid' => $newsid,
                         
'user_ip' => $comment_form['user_ip']));
}                    

$tpl->register('breadcrumb'buildBreadCrumb(array($lang['php_overall_home'] => $config['mainurl'], $lang['title_engine'] => $sess->url('index.php'), trim($file['titel']) => $sess->url('index.php?subcat='.$file['catid']) ,trim($file['dltitle']) => $sess->url('comment.php?dlid='.$file['dlid']),sprintf($lang['comment_comments'],aseDate($config['shortdate'],$entry['postdate'])) => '')));

$tpl->register(array(
                    
'comment_comments' => sprintf($lang['comment_comments'],aseDate($config['shortdate'],$entry['postdate'])),
                    
'comment_comments_for_the_file' => sprintf($lang['comment_comments_for_the_file'],trim($file['dltitle'])),
                    
'comment_button_alt_answer' => $lang['comment_button_alt_answer'],
                    
'comment_link_write_answer' => $lang['comment_link_write_answer'],
                    
'comment_author' => $lang['comment_author'],
                    
'comment_message' => $lang['comment_message'],
                    
'comment_write_your_comment_here' => $lang['comment_write_your_comment_here'],
                    
'comment_username' => $lang['comment_username'],
                    
'comment_topic' => $lang['comment_topic'],
                    
'comment_posticons' => $lang['comment_posticons'],
                    
'comment_your_message' => $lang['comment_your_message'],
                    
'comment_bold' => $lang['comment_bold'],
                    
'comment_italic' => $lang['comment_italic'],
                    
'comment_underline' => $lang['comment_underline'],
                    
'comment_url' => $lang['comment_url'],
                    
'comment_email' => $lang['comment_email'],
                    
'comment_code' => $lang['comment_code'],
                    
'comment_quote' => $lang['comment_quote'],
                    
'comment_center' => $lang['comment_center'],
                    
'comment_line' => $lang['comment_line'],
                    
'comment_click_smilies' => $lang['comment_click_smilies'],
                    
'comment_check_message_length' => $lang['comment_check_message_length'],
                    
'comment_add_comment_btn' => $lang['comment_add_comment_btn'],
                    
'comment_reset_btn' => $lang['comment_reset_btn'],
                    
'comment_not_allowed_to_post_comment' => $lang['comment_not_allowed_to_post_comment'],
                    
'comment_confirm_comment' => $lang['comment_confirm_comment'],
                    
'comment_captcha_confirm' => $lang['comment_captcha_confirm']));

$tpl->parseIf('main''parse_link_to_image');
$tpl->parseIf('main''parse_alternate_downloads');
$tpl->parseIf('main''user_can_post_comments');
$tpl->parseIf('main''user_can_post_no_comments');
$tpl->parseIf('main''use_captcha_comment');


$tpl->register('query'showQueries($develope));
$tpl->register('header'$tpl->pget('header'));

$tpl->register('footer'$tpl->pget('footer'));
$tpl->pprint('main'); 
?>
Link zur PHP Info:

http://freesoftpage.de/phpinfo.php

Ich hoffe Ihr könnt mit diesen Daten etwas anfangen!!

Ich würde mich sehr freuen wenn mir jemand mit meinem Problem helfen könnte.

Grüsse
Sati51

Geändert von sati51 (12.11.2009 um 11:25 Uhr).
sati51 ist offline  
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 12.11.2009, 09:53  
Erfahrener Benutzer
 
Registriert seit: 28.03.2008
Beiträge: 1.847
HPR1974 wird schon bald berühmt werden
Standard

Super was soll das denn werden SW Support für irgendein Sript? -> pls contact provider
Ansonsten ist geht nicht und hinklatschen von den ganzen scripten einfach nur "macht mal meine Arbeit"
HPR1974 ist offline  
Alt 12.11.2009, 10:13  
Neuer Benutzer
 
Registriert seit: 12.11.2009
Beiträge: 3
PHP-Kenntnisse:
Anfänger
sati51 befindet sich auf einem aufstrebenden Ast
Standard

Hallo HPR1974,

tut mir leid, ich wollte nicht irgend was hinklatschen!
Aber wir wissen nicht mehr weiter.
Mein Hoster sucht bereits seit dem 31.10.2009 nach dem Fehler.
Der Hoster meint dass das Script nicht zu der neuen PHP-Version passt.
Ich suche ebenso schon nächtelang seit 31.10.2009 (Server-Umzug).
Der Scriptverfasser meldet sich nicht. (Das Script wird auch nicht mehr Supportet)
Und meine Kenntnisse sind einfach zu mager.
Unsere Seite sollte halt nach Möglichkeit aktuell bleiben, sonst können wir zumachen.
Da wir die Seite aus reinem Idealismus betreiben (wir schießen jeden Monat kräfig Money dazu), haben wir uns an Euch Spezialisten gewant.
Ich wollte Euch bestimmt nicht mit Scripts zumüllen. Denn ich habe nur einen kleinen Teil des Scripts (bei dem ich dachte, dass er Verantwortlich sein könnte) eingefügt.

Sorry

Grüsse
Sati51
sati51 ist offline  
Alt 12.11.2009, 10:21  
Erfahrener Benutzer
 
Registriert seit: 28.03.2008
Beiträge: 1.847
HPR1974 wird schon bald berühmt werden
Standard

Sorry aber ich sehe in dem Post keinerei Ansätze, dass Ihr selbst irgendwie versucht habt den Fehler einzugrenzen.
thumbnailerstellung geht nicht ok.
Wo denn bitte es muss ja einen bestimmten nachvollziehbaren Vorgang geben bei dem ein Thumbnail (an einem bestimmten Speicherort?) erstellt wird. Habt Ihr diesen nachvollzogen nachgebaut, debugged??
Wen ja warum steht dann hier nicht das Ergebnis Eurer Analyse und das nicht lösbare Problem?
Im moment sehe ich kompleten code und die Aussage geht nicht, macht mal für mich.
HPR1974 ist offline  
Alt 12.11.2009, 11:24  
Neuer Benutzer
 
Registriert seit: 12.11.2009
Beiträge: 3
PHP-Kenntnisse:
Anfänger
sati51 befindet sich auf einem aufstrebenden Ast
Standard

Es wurde versucht die Funktion "getimagesize" auszuführen.
allerdings wurde ein falscher Pfad generiert.
An den Pfad wurde ein Leerzeichen angehängt.

Ab Zeile 25 in folgendem Script.

PHP-Code:
<?php
// +----------------------------------------------------------------------+
// | EngineLib - Image Functions                                          |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003,2004 AlexScriptEngine - e-Visions                 |
// +----------------------------------------------------------------------+
// | This code is not freeware. Please read our licence condition care-   |
// | fully to find out more. If there are any doubts please ask at the    |
// | Support Forum                                                        |
// |                                                                      |
// +----------------------------------------------------------------------+
// | Author: Alex Höntschel <info@alexscriptengine.de>                    |
// | Web: http://www.alexscriptengine.de                                  |
// | IMPORTANT: No email support, please use the support forum at         |
// |            http://www.alexscriptengine.de                            |
// +----------------------------------------------------------------------+
// $Id: function.img.php 6 2005-10-08 10:12:03Z alex $

define("FILE_NAME","img_global.php");

function 
calcThumbnail($dl,$add="./") {
    global 
$config$resize;
        
$pic = array();
        if (
$config['active_image_resizer']) {
            
$orig_data = @getimagesize($add."thumbnail/".$dl['thumb']);

            if(
$orig_data[0] > $orig_data[1]) {
                
$pic['width'] = $config['image_width'];
                
$pic['height'] = @floor(($orig_data[1]*$config['image_width'])/$orig_data[0]);
            } else {
                
$pic['height'] = $config['image_height'];
                
$pic['width'] = @floor(($orig_data[0]*$config['image_height'])/$orig_data[1]);
            }
            
$resize == true;
        } else {
            
$size = @getimagesize($add."thumbnail/".$dl['thumb']);
            if(
$size[0] != ""$pic['width'] = $size[0];
            if(
$size[1] != ""$pic['height'] = $size[1];
            
$resize == false;
        }    
    return 
$pic;    
}    

function 
createThumbnail($source,$size_array,$dest,$gd_version) {
    global 
$config,$settings;
    
$pic_exist FALSE;
    
$type getImgType($source);
    
$size = @getimagesize($source);
    if (
function_exists("imagecreatetruecolor") && $gd_version >= 2) {
      
$thumb imagecreatetruecolor($size_array['width'], $size_array['height']);
    } else {
      
$thumb imagecreate($size_array['width'], $size_array['height']);
    }
    
    if (
$image = @call_user_func("imagecreatefrom".$type$source)) {
      if (
function_exists("imagecopyresampled") && $gd_version >= 2) {
        
imagecopyresampled($thumb$image0000$size_array['width'], $size_array['height'], $size[0], $size[1]);
      } else {
        
imagecopyresized($thumb$image0000$size_array['width'], $size_array['height'], $size[0], $size[1]);
      }
      @
call_user_func("image".$type$thumb$dest100);
      
imagedestroy($thumb);
    }        
    if(
file_exists($dest)) $pic_exist TRUE;
    
    return 
$pic_exist;
}

function 
getImgType($source) {
    
$size = @getimagesize($source);

    switch(
$size[2]) {
        case 
1:
            return 
'gif';
            break;
        case 
2:
            return 
'jpeg';
            break;
        case 
3:
            return 
'png';
            break;
        }
}
        
/*
Siehe www.php.net/createimagetruecolor 
comment from Andreas 28-Feb-2003 01:15
*/
function chkgd2() {
    
ob_start();
    
phpinfo(8);
    
$phpinfo ob_get_contents();
    
ob_end_clean();
    
$phpinfo strip_tags($phpinfo);
    
$phpinfo stristr($phpinfo,"gd version");
    
$phpinfo stristr($phpinfo,"version");
    
$end strpos($phpinfo,".");
    
$phpinfo substr($phpinfo,0,$end);
    
$length strlen($phpinfo)-1;
    
$phpinfo substr($phpinfo,$length);
    return 
$phpinfo;
}


?>
Danach wurde in der Zeile 25 die trim Funktion hinzugefügt!
PHP-Code:
$orig_data = @getimagesize($add."thumbnail/".trim($dl['thumb'])); 
Dies führte aber nicht zum Erfolg.

GD2 Biliothek ist vorhanden!

Die PHP info kann hier eingesehen werden.
phpinfo()

Vielleicht hilft das weiter?

Grüsse

Sati51
sati51 ist offline  
Alt 12.11.2009, 14:31  
Moderator
 
Benutzerbild von robo47
 
Registriert seit: 03.09.2004
Beiträge: 11.792
PHP-Kenntnisse:
Fortgeschritten
robo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz seinrobo47 kann auf vieles stolz sein
Standard

Vielleicht mal die ganzen @'s entfernen, error_reporting hochsetzen, display_errors aktivieren, eventuell auch log_errors und dann das script ausführen ?

Wie willst du denn irgendein Problem oder Fehler feststellen wenn du alles mit @ zugebombt hast und damit jegliche Fehlermeldungen die kommen könnten verhinderst ?
robo47 ist offline  
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Datenbank problem nach umzug MichaelK PHP Tipps 2009 48 19.10.2009 23:29
Problem mit Benutzerrechten nach Thumbnail erstellung Arguss PHP Tipps 2008 8 08.12.2008 22:24
Probleme mit Zeichencodierung nach Server Umzug knödelkopf Datenbanken 4 27.02.2008 21:25
Problem mit SQLite(bzw. Server) coder Datenbanken 8 18.10.2007 14:51
Server Problem Mutatos Server, Hosting und Workstations 3 21.04.2005 13:10
[Erledigt] Problem: Can't connect to local MySQL server through socket Datenbanken 3 01.03.2005 18:51
problem mit mail.php in verbindung mit server PHP Tipps 2005 13 25.02.2005 17:06
Hab ein Problem mit meinem Server PHP Tipps 2005 4 16.01.2005 15:28
problem mit login auf neuem server PHP Tipps 2005 9 15.01.2005 00:45
Problem mit php unter windows server 2003 djrace PHP-Fortgeschrittene 2 24.12.2004 13:22
Debian Server, ddclient und SMC Router Problem. c01001 Server, Hosting und Workstations 6 09.12.2004 19:08
problem bei thumbnail generieren PHP Tipps 2004-2 3 03.12.2004 18:40
Thumbnail Problem PHP Tipps 2004 14 05.07.2004 10:12
kleines problem aufn Server! PHP Tipps 2004 12 26.06.2004 03:01
[Erledigt] Problem bei installation PHP auf dem apache server Server, Hosting und Workstations 2 25.06.2004 11:39

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
getimagesize debian, alex höntschel, alexscriptengine download, download engine (alex höntschel, alexscriptengine forum, php5 getimagesize thumbnail, alexscriptengine, http://www.alexscriptengine.de/, alexscriptengine captcha, download-engine vorschaubilder, “name” “headline” “comment” “bbcode”, php resize_img, /images/img_disabled_download.gif, alexscriptengine.de, download engine (alex höntschel), name headline comment bbcode, thumbnail php version 5.2.11-0.dotdeb.1 geht nicht, download engine alex höntschel, \download engine\ \headlink\, download engine \headlink\

Alle Zeitangaben in WEZ +2. Es ist jetzt 20:42 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum