Show Posts

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.


Messages - Art1977

Pages: [1] 2
1
Discussion & Troubleshooting / Re: last commented image listing
« on: April 14, 2005, 03:21:08 PM »
Thx i already included everything.

2
Installation, Update & Configuration / @vano
« on: June 16, 2003, 10:24:56 PM »
no  ,

no messages , nothing der screen reloads ! but nothing is changed

3
I changed the permissions like in the installation.txt chmod 777

Set permissions for the following directories:

Quote
(drwxrwxrwx) : data
     chmod 777 (drwxrwxrwx) : data/database
     chmod 777 (drwxrwxrwx) : data/media
     chmod 777 (drwxrwxrwx) : data/thumbnails
     chmod 777 (drwxrwxrwx) : data/tmp_media
     chmod 777 (drwxrwxrwx) : data/tmp_thumbnails
     chmod 777 (drwxrwxrwx) : templates
     chmod 777 (drwxrwxrwx) : templates/default
     chmod 777 (drwxrwxrwx) : templates/default/media

     Set permissions for the following files:

     chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default"
     chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default/media"


i can add categories but if i upload pics and check for new images they are not added to the category.

also if i add manually a new user , he is not added !

4
Installation, Update & Configuration / hi @vano
« on: June 06, 2003, 12:26:34 PM »
where do i do this?

and how?

i thought only the config.php includes information about the database ?!!?

i think i have an idea , i have to change the chmode in my folder do u know how it has to be? 664 ?

5
I changed my server

i uploaded all files
i changed the config.php from 4Images
and restored my database on the new server with phpMyAdmin!
Everything works

But when i try change something like userinformation in the control panel nothing changes.
When i try to create a new category , i get the statement:

Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 78

Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 81

Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 78

Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 81
Kategorie erfolgreich hinzugefügt (Category adding succeeded in english)

if i delete this cateogorie i get the following message:

Kategorie erfolgreich gelöscht Test (ID: 15)
-» Bild erfolgreich gelöscht (Pics deleting succeeded in english)

Warning: Unlink failed (No such file or directory) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 101

Warning: Unlink failed (No such file or directory) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 101
-» Kommentare erfolgreich gelöscht (comments deleting succeeded in english)

Error Log:  
  Es sind Fehler bei folgenden Aktionen aufgetreten:
  (The following error occurred in enlish)
Fehler beim Löschen der Bild-Datei (Test, ID: 15)
(Error deleting Pic-File (........))
Fehler beim Löschen der Thumbnail-Datei (Test, ID: 15)
 (Error deleting Thumbnail-File(.........)


whats wrong ? what will i have to change if i move to a new server .
i changed the config.php . I edited my new DB Name and password .....

is there any file what have to be changed?

6
Mods & Plugins (Releases & Support) / and the second problem is
« on: June 04, 2003, 02:38:25 AM »
and the second problem is :

where do i have to change the code to display the "last comments" like the member comments!

Code: [Select]

<?php 
$templates_used 
'whos_online,comment_short_bit,last_comments,commentsperpage_dropdown_form';
$main_template 'last_comments';

define&#40;'GET_CACHES', 1&#41;;
define&#40;'ROOT_PATH', './'&#41;;
define&#40;'GET_USER_ONLINE', 1&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;
$user_access get_permission&#40;&#41;;
if &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41; || isset&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41; &#123;
  
$template = &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; ? stripslashes&#40;trim&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; &#58; stripslashes&#40;trim&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41;;
  
if &#40;!file_exists&#40;TEMPLATE_PATH."/".$template.".".$site_template->template_extension&#41;&#41; &#123;
    
$template "";
  &
#125;
  
else &#123;
    
$main_template $template;
  &
#125;
&#125;
else &#123;
  
$template "";
&
#125;
include&#40;ROOT_PATH.'includes/page_header.php'&#41;;


//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\" class=\"clickstream\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;.get_category_path&#40;$cat_id&#41;."</span>";



//-----------------------------------------------------
//--- Letzte Kommentare
//-----------------------------------------------------
 
if &#40;isset&#40;$HTTP_POST_VARS['commentsetperpage'&#93;&#41; || isset&#40;$HTTP_GET_VARS['commentsetperpage'&#93;&#41;&#41; &#123; 
  
$commentsetperpage = &#40;intval&#40;$HTTP_POST_VARS['commentsetperpage'&#93;&#41; &#41; ? intval&#40;$HTTP_POST_VARS['commentsetperpage'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['commentsetperpage'&#93;&#41;; 
  
if &#40;$commentsetperpage&#41; &#123; 
    
$site_sess->set_session_var&#40;"commentperpage", $commentsetperpage&#41;; 
    
$session_info['commentperpage'&#93; = $commentsetperpage; 
  
&#125; 
&#125; 

if &#40;isset&#40;$session_info['commentperpage'&#93;&#41;&#41; &#123; 
  
$commentperpage $session_info['commentperpage'&#93;; 
&#125; 
else &#123; 
  
$commentperpage 5
&
#125; 
$commentsperpage_dropdown "\n<select name=\"commentsetperpage\" onchange=\"if &#40;this.options[this.selectedIndex&#93;.value != 0&#41;&#123; forms['commentsperpage'&#93;.submit&#40;&#41; &#125;\" class=\"select\">\n"
    for&
#40;$i = 1; $i <= 50; $i++&#41; &#123; 
      
$setvalue $i
      
$commentsperpage_dropdown .= "<option value=\"".$setvalue."\""
        if &
#40;$setvalue == $commentperpage&#41; &#123; 
        
$commentsperpage_dropdown .= " selected=\"selected\""
      &
#125; 
      
$commentsperpage_dropdown .= ">"
      
$commentsperpage_dropdown .= $setvalue
      
$commentsperpage_dropdown .= "</option>\n"
    &
#125; 
    
$commentsperpage_dropdown .= "</select>\n"

    
$site_template->register_vars&#40;"commentsperpage_dropdown", $commentsperpage_dropdown&#41;; 
    
$commentsperpage_dropdown_form $site_template->parse_template&#40;"commentsperpage_dropdown_form"&#41;; 
    
$site_template->register_vars&#40;"commentsperpage_dropdown_form", $commentsperpage_dropdown_form&#41;; 
      
$sql "SELECT COUNT&#40;image_id&#41; AS comments
      FROM "
.COMMENTS_TABLE.
      WHERE image_id = 
$image_id"
    
$result $site_db->query_firstrow&#40;$sql&#41;; 
    
$site_db->free_result&#40;&#41;; 
    
$num_comments $result['comments'&#93;; 
    
if &#40;$action == "postcomment"&#41; &#123; 
        
$page ceil&#40;$num_comments / $commentperpage&#41;; 
    
&#125; 
    
$num_rows_all = &#40;isset&#40;$num_comments&#41;&#41; ? $num_comments &#58; 0; 
    
$link_arg $site_sess->url&#40;ROOT_PATH."last_comments.php?image_id=$image_id"&#41;; 
    
include&#40;ROOT_PATH.'includes/paging.php'&#41;; 
    
$getpaging = new Paging&#40;$page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'&#93;, "comments"&#41;; 
    
$offset $getpaging->get_offset&#40;&#41;; 
    
$site_template->register_vars&#40;array&#40; 
      
"paging" => $getpaging->get_paging&#40;&#41;, 
      
"paging_stats" => &#40;$num_comments&#41; ? $getpaging->get_paging_stats&#40;&#41; &#58; "" 
    
&#41;&#41;;             

$additional_sql ""
      
$table_fields $site_db->get_table_fields&#40;USERS_TABLE&#41;; 
      
foreach &#40;$additional_user_fields as $key => $val&#41; &#123; 
        
if &#40;isset&#40;$HTTP_POST_VARS[$key&#93;&#41; && isset&#40;$table_fields[$key&#93;&#41;&#41; &#123; 
          
$additional_sql .= ", $key = '".un_htmlspecialchars&#40;trim&#40;$HTTP_POST_VARS[$key&#93;&#41;&#41;."'"; 
        
&#125; 
      
&#125; 
  
$sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_date".get_user_table_field&#40;", u.", "user_level"&#41;.get_user_table_field&#40;", u.", "user_name"&#41;.get_user_table_field&#40;", u.", "user_lastaction"&#41;.get_user_table_field&#40;", u.", "user_comments"&#41;.$additional_sql." 
          
FROM ".COMMENTS_TABLE." 
          LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = c.user_id&#41; 
          
ORDER BY c.comment_date DESC 
          LIMIT $offset
$commentperpage";
  
$result = $site_db->query&#40;$sql&#41;; 
  
$comment_row = array&#40;&#41;; 
  while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
    
$comment_row[&#93; = $row
  &#125; 
  
$site_db->free_result&#40;$result&#41;; 
  
$num_comments = sizeof&#40;$comment_row&#41;; 
  if &#40;!
$num_comments&#41; &#123; 
    
$comments_short = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments'&#93;."</td></tr>"; 
  
&#125; 
  
else &#123; 
    
$comments_short ""
    for &
#40;$i = 0; $i < $num_comments; $i++&#41; &#123; 
        
$image_id $comment_row[$i&#93;['image_id'&#93;; 
        
$sql "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_file
                FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c 
                LEFT JOIN "
.USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
                
WHERE i.image_id $image_id AND c.cat_id i.cat_id"; 
        
$image_row = $site_db->query_firstrow&#40;$sql&#41;; 
        
$cat_id = &#40;isset&#40;$image_row['cat_id'&#93;&#41;&#41; ? $image_row['cat_id'&#93; &#58; 0; 
      if &#40;check_permission&#40;"
auth_readcomment", $cat_id&#41;&#41;&#123; 
        
$comment_user_name = htmlspecialchars&#40;$comment_row[$i&#93;['comment_user_name'&#93;&#41;; 
        
$comment_user_info = $lang['userlevel_guest'&#93;; 
        
$comment_user_id = $comment_row[$i&#93;['user_id'&#93;; 
        
$user_row_comment = get_user_info&#40;$comment_user_id&#41;; 
        
$comment_user_profile_link = ""; 
        
$comment_user_info = $lang['userlevel_guest'&#93;; 
        if &#40;!isset&#40;
$comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93;&#41; || &#40;isset&#40;$comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93;&#41; && $comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93; == USER&#41;&#41; &#123; 
          
$comment_user_info = $lang['userlevel_user'&#93;; 
        &#125; 
        elseif &#40;
$comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93; == ADMIN&#41; &#123; 
          
$comment_user_info = $lang['userlevel_admin'&#93;; 
        &#125; 
        if &#40;isset&#40;
$comment_row[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41; && $comment_user_id != GUEST&#41; &#123; 
          
$comment_user_name = htmlspecialchars&#40;$comment_row[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41;; 
          
$comment_user_profile_link = !empty&#40;$url_show_profile&#41; ? $site_sess->url&#40;preg_replace&#40;"/&#123;user_id&#125;/", $comment_user_id, $url_show_profile&#41;&#41; &#58; $site_sess->url&#40;ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id&#41;; 
        
&#125; 
          
$comment_user_profile_link = &#40;$comment_user_profile_link&#41; ? "<a href=\"".$comment_user_profile_link."\">".$comment_user_name."</a>" &#58; $comment_user_name; 
        
if &#40;!get_file_path&#40;$image_row['image_thumb_file'&#93;, "thumb", $image_row['cat_id'&#93;, 0, 0&#41;&#41; &#123; 
        
$thumb_file ICON_PATH."/".get_file_extension&#40;$image_row['image_media_file'&#93;&#41;.".gif"; 
      
&#125;else &#123; 
        
$thumb_file get_file_path&#40;$image_row['image_thumb_file'&#93;, "thumb", $image_row['cat_id'&#93;, 0, 1&#41;; 
      
&#125; 
      
$thumb_info = @getimagesize&#40;$thumb_file&#41;; 
      
$width $thumb_info[0&#93;; 
      
$height $thumb_info[1&#93;; 
      
$dimension 80
      
$ratio $width $height
      if &
#40;$ratio > 1&#41; &#123; 
        
$new_width $dimension
        
$new_height floor&#40;&#40;$dimension/$width&#41; * $height&#41;; 
      
&#125;else &#123; 
        
$new_width floor&#40;&#40;$dimension/$height&#41; * $width&#41;; 
        
$new_height $dimension
      &
#125; 
$site_template->register_vars&#40;array&#40;   
          
"comment_image_thumb" => &#40;!check_permission&#40;"auth_viewcat", $cat_id&#41; || !check_permission&#40;"auth_viewimage", $cat_id&#41;&#41; ? "<img src=\"".$thumb_file."\" 
  width=\"".$new_width."\" height=\"".$new_height."\" onClick=\"alert&#40;'".$lang['members_only'&#93;."'&#41;;\" border=\"".$config['image_border'&#93;."\">" &#58; "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i&#93;['image_id'&#93;.&#40;&#40;!empty&#40;$mode&#41;&#41; ? "&amp;mode=".$mode &#58; ""&#41;&#41;."\">
  <img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" border=\"".$config['image_border'&#93;."\"></a>", 
        
          
"comment_image_name" => &#40;!check_permission&#40;"auth_viewcat", $cat_id&#41; || !check_permission&#40;"auth_viewimage", $cat_id&#41;&#41; ? $image_row['image_name'&#93; &#58; "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i&#93;['image_id'&#93;.&#40;&#40;!empty&#40;$mode&#41;&#41; ? "&amp;mode=".$mode &#58; ""&#41;&#41;."\">".$image_row['image_name'&#93;."</a>", 
          
"comment_cat_name" => &#40;!check_permission&#40;"auth_viewcat", $cat_id&#41;&#41; ? $image_row['cat_name'&#93; &#58; "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id&#41;."\">".$image_row['cat_name'&#93;."</a>", 
          
"comment_user_name" => $comment_user_profile_link
          
"comment_user_info" => $comment_user_info
          
"comment_headline" => format_text&#40;$comment_row[$i&#93;['comment_headline'&#93;, 0, $config['wordwrap_comments'&#93;, 0, 0&#41;, 
          
"comment_text" => format_text&#40;$comment_row[$i&#93;['comment_text'&#93;, $config['html_comments'&#93;, $config['wordwrap_comments'&#93;, $config['bb_comments'&#93;, $config['bb_img_comments'&#93;&#41;, 
          
"comment_date" => format_date&#40;$config['date_format'&#93;." ".$config['time_format'&#93;, $comment_row[$i&#93;['comment_date'&#93;&#41;, 
                  
&#41;&#41;; 



        
$comments_short .= $site_template->parse_template&#40;"comment_short_bit"&#41;; 
      
&#125; 
    
&#125; // end while 
  
&#125; //end else 
  
$site_template->register_vars&#40;"comments_short", $comments_short&#41;; 
  
unset&#40;$comments_short&#41;;

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"msg" => $msg,
  
"clickstream" => $clickstream
&#41;&#41;;
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;
include&#40;ROOT_PATH.'includes/page_footer.php'&#41;;
?>



this is my code at the moment but this doesn´t look like very attractive

7
Mods & Plugins (Releases & Support) / Hi
« on: June 04, 2003, 02:32:44 AM »
thanx

i created the comments_perpage_dropdownform

and for securtity i copied your code in my member.php
but i get the same error.

after i choose in the dropdown menu how many comments i want to show
the page opens

password forgotten.

8
Mods & Plugins (Releases & Support) / Hi V@no
« on: June 04, 2003, 01:34:52 AM »
Nice mod everything works
but when i try to include the dropdown menu for how many comments of the user per page . everytime i get an error. The paging function is ok. but the dropdown menu does not work

the code i added after :
Code: [Select]
if (isset($session_info['commentperpage'])) {
  $commentperpage = $session_info['commentperpage'];
}
else {
  $commentperpage = 5;
}



is:
--------------------------
Code: [Select]
$commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">\n";
    for($i = 1; $i <= 50; $i++) {
      $setvalue = 1 * $i;
      $commentsperpage_dropdown .= "<option value=\"".$setvalue."\"";
        if ($setvalue == $commentperpage) {
        $commentsperpage_dropdown .= " selected=\"selected\"";
      }
      $commentsperpage_dropdown .= ">";
      $commentsperpage_dropdown .= $setvalue;
      $commentsperpage_dropdown .= "</option>\n";
    }
    $commentsperpage_dropdown .= "</select>\n";

    $site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown);
    $commentsperpage_dropdown_form = $site_template->parse_template("commentsperpage_dropdown_form");
    $site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);


at the commandline normaly is shown : http://............/4images1.7/4images/member.phpaction=showcomments&user_id=3&page=2

but after the choice of the number of comments this is started :
http://........./4images1.7/4images/member.php?page=2#comments


The next problem is:

I want the last comments shown like the users comments ....
what do i have to change and what is this => and this -> in php?
is like a pointer in C?

9
Mods & Plugins (Releases & Support) / i found my mistake
« on: May 28, 2003, 03:19:00 AM »
if i change the value of the dropdown menu _ how many comments per page on any site this always affects all other sites .

10
Mods & Plugins (Releases & Support) / sorry
« on: May 28, 2003, 03:11:11 AM »
sorry but i only see 1 comment ..........

if the ftp is working i will upload the modification and show u the link, so u can see what i mean

we have 3 o´clock and i have to get up at 7 to go to the university
good night and thx for your help .

cu tomorrow
Art

11
Discussion & Troubleshooting / thx v@no
« on: May 28, 2003, 02:57:42 AM »
@vano

under
http://mitglied.lycos.de/brkcrew/4images1.7/4images/last_comments.php

u will see what i mean

now i would the last comments displayed like the categories ........


but if i copy the part of the code from categories and change it
i always get 9 times the same comment
what u see is the backup before i changed the code ......
the ftp is down at the moment so i can´t upload the file
maybe u have an idea how i could display the comments like the thumbs on the categories site ....

12
with all your code , i only see the last comment of the user and can navigate through his comments with paging ,but how could i see for example 15 comments per page

13
<?php
$templates_used = 'whos_online,comment_short_bit,last_comments,commentsperpage_dropdown_form';
$main_template = 'last_comments';

define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
if (isset($HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
  $template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));
  if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
    $template = "";
  }
  else {
    $main_template = $template;
  }
}
else {
  $template = "";
}
include(ROOT_PATH.'includes/page_header.php');
include(ROOT_PATH.'includes/paging.php');


//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].get_category_path($cat_id)."</span>";



//-----------------------------------------------------
//--- Letzte Kommentare
//-----------------------------------------------------

if (isset($HTTP_POST_VARS['commentsetperpage']) || isset($HTTP_GET_VARS['commentsetperpage'])) {
  $commentsetperpage = (intval($HTTP_POST_VARS['commentsetperpage']) ) ? intval($HTTP_POST_VARS['commentsetperpage']) : intval($HTTP_GET_VARS['commentsetperpage']);
  if ($commentsetperpage) {
    $site_sess->set_session_var("commentperpage", $commentsetperpage);
    $session_info['commentperpage'] = $commentsetperpage;
  }
}

if (isset($session_info['commentperpage'])) {
  $commentperpage = $session_info['commentperpage'];
}
else {
  $commentperpage = 5;
}
$commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">\n";
    for($i = 1; $i <= 50; $i++) {
      $setvalue = 1 * $i;
      $commentsperpage_dropdown .= "<option value=\"".$setvalue."\"";
        if ($setvalue == $commentperpage) {
        $commentsperpage_dropdown .= " selected=\"selected\"";
      }
      $commentsperpage_dropdown .= ">";
      $commentsperpage_dropdown .= $setvalue;
      $commentsperpage_dropdown .= "</option>\n";
    }
    $commentsperpage_dropdown .= "</select>\n";

    $site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown);
    $commentsperpage_dropdown_form = $site_template->parse_template("commentsperpage_dropdown_form");
    $site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);
      $sql = "SELECT COUNT(image_id) AS comments
      FROM ".COMMENTS_TABLE."
      WHERE image_id = $image_id";
    $result = $site_db->query_firstrow($sql);
    $site_db->free_result();
    $num_comments = $result['comments'];
    if ($action == "postcomment") {
        $page = ceil($num_comments / $commentperpage);
    }
    $num_rows_all = (isset($num_comments)) ? $num_comments : 0;
    $link_arg = $site_sess->url(ROOT_PATH."last_comments.php?image_id=$image_id");  
    $getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'], "comments");
    $offset = $getpaging->get_offset();
    $site_template->register_vars(array(
      "paging" => $getpaging->get_paging(),
      "paging_stats" => ($num_comments) ? $getpaging->get_paging_stats() : ""
    ));            

$additional_sql = "";
      $table_fields = $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").$additional_sql."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          ORDER BY c.comment_date DESC
          LIMIT $offset, $commentperpage";
  $result = $site_db->query($sql);
  $comment_row = array();
  while ($row = $site_db->fetch_array($result)) {
    $comment_row[] = $row;
  }
  $site_db->free_result($result);
  $num_comments = sizeof($comment_row);
  if (!$num_comments) {
    $comments_short = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    $comments_short = "";
    for ($i = 0; $i < $num_comments; $i++) {
        $image_id = $comment_row[$i]['image_id'];
        $sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, 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_id = $image_id AND c.cat_id = i.cat_id";
        $image_row = $site_db->query_firstrow($sql);
        $cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
      if (check_permission("auth_readcomment", $cat_id)){
        $comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
        $comment_user_info = $lang['userlevel_guest'];
        $comment_user_id = $comment_row[$i]['user_id'];
        $user_row_comment = get_user_info($comment_user_id);
        $comment_user_profile_link = "";
        $comment_user_info = $lang['userlevel_guest'];
        if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          $comment_user_info = $lang['userlevel_user'];
        }
        elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];
        }
        if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
          $comment_user_name = htmlspecialchars($comment_row[$i][$user_table_fields['user_name']]);
          $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
        }
          $comment_user_profile_link = ($comment_user_profile_link) ? "<a href=\"".$comment_user_profile_link."\">".$comment_user_name."</a>" : $comment_user_name;
       
      if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0)) {
        $thumb_file = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
      }else {
        $thumb_file = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
      }
      $thumb_info = @getimagesize($thumb_file);
      $width = $thumb_info[0];
      $height = $thumb_info[1];
      $dimension = 80;
      $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;
      }    
      $site_template->register_vars(array(    
          "comment_image_thumb" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? "<img src=\"".$thumb_file."\"
        width=\"".$new_width."\" height=\"".$new_height."\" onClick=\"alert('".$lang['members_only']."');\" border=\"".$config['image_border']."\">" : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">
        <img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" border=\"".$config['image_border']."\"></a>",
       
          "comment_image_name" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? $image_row['image_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$image_row['image_name']."</a>",
          "comment_cat_name" => (!check_permission("auth_viewcat", $cat_id)) ? $image_row['cat_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\">".$image_row['cat_name']."</a>",
          "comment_user_name" => $comment_user_profile_link,
          "comment_user_info" => $comment_user_info,
          "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
          "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
          "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
                 
      ));
      
      
      
        $comments_short .= $site_template->parse_template("comment_short_bit");
      }
    } // end while
  } //end else
  $site_template->register_vars("comments_short", $comments_short);
  unset($comments_short);

//-----------------------------------------------------
//--- Show Comments like thumbnails -------------------------------------
//-----------------------------------------------------
$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;
$link_arg = $site_sess->url(ROOT_PATH."last_comments.php?");//.URL_CAT_ID."=".$cat_id);

$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")."
        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
        ORDER BY ".$config['image_order']." ".$config['image_sort']."
        LIMIT $offset, $perpage";

$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $commentnails = "";
  $msg = $lang['no_images'];
}
else {
  $commentnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $commentnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $commentnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($image_row);
    $commentnails .= $site_template->parse_template("comment_short_bit");
    $commentnails .= "\n</td>\n";

    $count++;
    if ($count == $config['image_cells']) {
      $commentnails .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover > 0) {
      for ($i = 0; $i < $leftover; $i++){
        $commentnails .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $commentnails .= "</tr>\n";
    }
  }
  $commentnails .= "</table>\n";
} //end else
$site_template->register_vars("commentnails", $commentnails);
unset($commentnails);
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>

14
Discussion & Troubleshooting / hi
« on: May 27, 2003, 11:26:43 PM »
did u get my pmessage?

15
Discussion & Troubleshooting / hmmm
« on: May 27, 2003, 09:53:34 PM »
now i have the template ....

the problem is that not the last comment is shown ......
als comments are the same i have the same comment 6 times ....
if i change the value to number of comments = 5 .
i get the 5. comment 6 times .......

Pages: [1] 2