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 - Bomba

Pages: 1 2 [3] 4 5 6 7 ... 10
31
Discussion & Troubleshooting / last commented image listing
« on: May 27, 2003, 02:26:06 PM »
thanks mate! :D

i've seen your code and that's the code of index.php right?
i inserted the code in page_header because i don't want to show last comments in home.html, i want to have new template just for that
i created comments.html where i'd put {comments_short}

but this example of yours its different, it uses a new php file? how can i create this example.php? just copying index.php code?
maybe it would work, dunno

it's so sad to be a newbie :(  
:wink:

32
Mods & Plugins (Requests & Discussions) / image in two categories
« on: May 27, 2003, 02:07:21 PM »
is there a way to show random pics of images with certain marks?
i mean, wouldn't be possible to show something like {random_image_honor} ?

 :?:

33
Discussion & Troubleshooting / last commented image listing
« on: May 27, 2003, 01:57:13 PM »
in that new template that this mod tells to creat "coment_short_bit.html"
i use

{comment_image_name}
{comment_cat_name}

and
{comment_image_thumb}


is this what u asked?  :roll:
lol... were u talking to me?  :oops:

34
Discussion & Troubleshooting / last commented image listing
« on: May 27, 2003, 01:30:36 PM »
im sorry for insist
but i really need this mod :( i have more than 1000 comments made and about 90 per day ...

this would be the solution or, another way to do it would be shown last comments made to images in their owner profiles...
none of this is possible?

i've posted my problem 3 posts above. thanks in advance

35
Mods & Plugins (Requests & Discussions) / image in two categories
« on: May 26, 2003, 08:00:16 PM »
ok, done
and what about this
Quote
but i would like to know how can i make this showing as a category, where people can go inside and seek all honored images.
if not possible, just how can i make something like this http://4homepages.de/forum/viewtopic.php?t=4336&highlight= showing honored images


i currently have a line of 6 random images pointed to category #1, which is honor category, how can i change this to show 6 random images of pics marked as honored?

here is my index.php
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; index.php                                            *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.7                                                  *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/

$templates_used 'home,category_bit,whos_online,thumbnail_bit';
$main_template 'home';

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;;
include&#40;ROOT_PATH.'includes/stats.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;;

if &#40;!empty&#40;$template&#41;&#41; &#123;
  
$clickstream "<a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;.str_replace&#40;"_", " ", ucfirst&#40;$template&#41;&#41;;
  
$site_template->register_vars&#40;"clickstream", $clickstream&#41;;
  
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;
  
include&#40;ROOT_PATH.'includes/page_footer.php'&#41;;
&#125;

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories get_categories&#40;0&#41;;
if &#40;!$categories&#41;  &#123;
  
$categories $lang['no_categories'&#93;;
&#125;
$site_template->register_vars&#40;"categories", $categories&#41;;
unset&#40;$categories&#41;;

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$imgtable_width ceil&#40;intval&#40;$config['image_table_width'&#93;&#41; / $config['image_cells'&#93;&#41;;
if &#40;&#40;substr&#40;$config['image_table_width'&#93;, -1&#41;&#41; == "%"&#41; &#123;
  
$imgtable_width .= "%";
&
#125;

$additional_sql "";
if &
#40;!empty&#40;$additional_image_fields&#41;&#41; &#123;
  
foreach &#40;$additional_image_fields as $key => $val&#41; &#123;
    
$additional_sql .= ", i.".$key;
  &
#125;
&#125;

$num_new_images $config['image_cells'&#93; * 2;
$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&#40;", u.", "user_name"&#41;." 
        
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_active AND c.cat_id i.cat_id AND i.cat_id IN &#40;".get_auth_cat_sql&#40;"auth_viewcat"&#41;."&#41; 
        
ORDER BY i.image_date DESC 
        LIMIT $num_new_images
";
$result = $site_db->query&#40;$sql&#41;;
$num_rows = $site_db->get_numrows&#40;$result&#41;;

if &#40;!
$num_rows&#41;  &#123;
  
$new_images = "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\"><tr class=\"imagerow1\"><td>";
  
$new_images .= $lang['no_new_images'&#93;;
  
$new_images .= "</td></tr></table>";
&
#125;
else  &#123;
  
$new_images "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\">";
  
$count 0;
  
$bgcounter 0;
  while &
#40;$image_row = $site_db->fetch_array&#40;$result&#41;&#41;&#123;
    
if &#40;$count == 0&#41; &#123;
      
$row_bg_number = &#40;$bgcounter++ % 2 == 0&#41; ? 1 &#58; 2;
      
$new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    &
#125;
    
$new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image&#40;$image_row&#41;;
    
$new_images .= $site_template->parse_template&#40;"thumbnail_bit"&#41;;
    
$new_images .= "\n</td>\n";
    
$count++;
    if &
#40;$count == $config['image_cells'&#93;&#41; &#123;
      
$new_images .= "</tr>\n";
      
$count 0;
    &
#125;
  
&#125; // end while

  
if &#40;$count > 0&#41;  &#123;
    
$leftover = &#40;$config['image_cells'&#93; - $count&#41;;
    
if &#40;$leftover >= 1&#41; &#123;
      
for &#40;$f = 0; $f < $leftover; $f++&#41; &#123;
        
$new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      &
#125;
      
$new_images .= "</tr>\n";
    &
#125;
  
&#125;
  
$new_images .= "</table>\n";
&
#125; // end else

$site_template->register_vars&#40;"new_images", $new_images&#41;;
unset&#40;$new_images&#41;;
$num_new_images $config['image_cells'&#93;;
//------------------------------------ 
//------- Random Images -------------- 
//------------------------------------ 
$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&#40;", u.", "user_name"&#41;." 
        
FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." 
        LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
        
WHERE i.image_active AND c.cat_id i.cat_id AND i.cat_id 
        ORDER BY RAND
&#40;&#41; 
        
LIMIT $num_new_images"; 
// end new 
$result = $site_db->query&#40;$sql&#41;; 
$num_rows = $site_db->get_numrows&#40;$result&#41;; 

if &#40;!
$num_rows&#41;  &#123; 
  
$random_images = "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\"><tr class=\"imagerow1\"><td>"; 
//  $random_images .= $lang['no_new_images'&#93;; 
  
$random_images .= "</td></tr></table>"
&
#125; 
else  &#123; 
  
$random_images "<table width=\"".$config['image_table_width'&#93;."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding'&#93;."\" cellspacing=\"".$config['image_table_cellspacing'&#93;."\">"; 
  
$count 0
  
$bgcounter 0
  while &
#40;$image_row = $site_db->fetch_array&#40;$result&#41;&#41;&#123; 
    
if &#40;$count == 0&#41; &#123; 
      
$row_bg_number = &#40;$bgcounter++ % 2 == 0&#41; ? 1 &#58; 2; 
      
$random_images .= "<tr class=\"imagerow".$row_bg_number."\">\n"
    &
#125; 
    
$random_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n"

    
show_image&#40;$image_row&#41;; 
    
$random_images .= $site_template->parse_template&#40;"thumbnail_bit"&#41;; 
    
$random_images .= "\n</td>\n"
    
$count++; 
    if &
#40;$count == $config['image_cells'&#93;&#41; &#123; 
      
$random_images .= "</tr>\n"
      
$count 0
    &
#125; 
  
&#125; // end while 

  
if &#40;$count > 0&#41;  &#123; 
    
$leftover = &#40;$config['image_cells'&#93; - $count&#41;; 
    
if &#40;$leftover >= 1&#41; &#123; 
      
for &#40;$f = 0; $f < $leftover; $f++&#41; &#123; 
        
$random_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n"
      &
#125; 
      
$random_images .= "</tr>\n"
    &
#125; 
  
&#125; 
  
$random_images .= "</table>\n"
&
#125; // end else 

$site_template->register_vars&#40;array&#40; 
"random_images" => $random_images
"lang_random_images" => $lang['random_images'&#93; 
&#41;&#41;; 
unset&#40;$random_images&#41;;

//----- End Random Images---------
$sql "SELECT * 
        FROM "
.USERS_TABLE.
        WHERE user_id <> "
.GUEST." AND user_lastaction >= ".&#40;time&#40;&#41; - 60 * 60 * 24 * 1&#41;." AND user_invisible = 0 
        
ORDER BY user_lastaction DESC"; 
$result = $site_db->query&#40;$sql&#41;; 
$today_users = $site_db->get_numrows&#40;$result&#41;; 
$i = 0; 
while &#40;
$todayusers = $site_db->fetch_array&#40;$result&#41;&#41;&#123; 
  
$today_users_list .= "<a href=\"".ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$todayusers['user_id'&#93;."\">".$todayusers['user_name'&#93;."</a>".&#40;&#40;$i >= $today_users-1&#41; ? "" &#58; ", "&#41;; 
  
$i++; 
&
#125; 
$site_template->register_vars&#40;array&#40; 
                           
"today_users" => $today_users
                           
"today_users_list" => $today_users_list 
                           
&#41;&#41;;
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"user_realname" => $lang['user_realname'&#93;,
  
"user_local" => $lang['user_local'&#93;
&#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;;
?>




thanks v@no  :wink:

36
Mods & Plugins (Requests & Discussions) / image in two categories
« on: May 26, 2003, 07:23:06 PM »
ok, just did it and i now see a new radio button in ACP.
but i would like to know how can i make this showing as a category, where people can go inside and seek all honored images.
if not possible, just how can i make something like this http://4homepages.de/forum/viewtopic.php?t=4336&highlight= showing honored images

and by the way, what type of table should "image_honor" be?

- tinyint(4)
- varchar(255)
- mediumint(8)
- text
- tinyint(1)
...


thanks

37
Mods & Plugins (Releases & Support) / [Mod] Mini-Top
« on: May 26, 2003, 03:18:59 PM »
would it be possible to show random top images from each section on this mini top?
i mean, this shows always the same pic, only the #1 of each top section and i think it would be nice to show each time page loads a different pic from that top, one of the top 10 of each top section.

possible?
thanks

38
Mods & Plugins (Requests & Discussions) / image in two categories
« on: May 26, 2003, 02:39:41 PM »
but how will i mark pics as honored?
shouldn't i move them to the "honor category"? it's a private category in my galeries

thanks

39
Mods & Plugins (Requests & Discussions) / image in two categories
« on: May 26, 2003, 03:34:25 AM »
thanks im gonna try this :)

just one thing, i may use same picture in both category, where the "category of honor" has the #1 id, and with this code all images that goes to that category will be marked, right?
and this way i«ll keep the picture main category and honor category would be just an award.

does this works this way?
sorry for asking but im quite newbie and my english is very poor :)

thanks for everything

40
Mods & Plugins (Releases & Support) / [Mod] Mini-Top
« on: May 26, 2003, 12:32:07 AM »
awesome!!!
didn't tryed yet but im sure i will :)

thanks
would it be possible to show this mini top outside gallery? and if possible on another site and server

thanks

41
Mods & Plugins (Requests & Discussions) / Mod Request: Guestbook
« on: May 24, 2003, 01:51:29 PM »
yeah, i propose this mod long time ago and didn't get any results. hope that this will get answers now :)

42
hi,

i would like to add in profiles a link to comments made to his images. i use the mod that shows all user comments in his profile, but i would like to know if it's possible to show all comments made to his own images.

thanks

43
Discussion & Troubleshooting / last commented image listing
« on: May 24, 2003, 02:12:14 AM »
i add the code in page_header.php and it shows last commented pics, but when i click in any thumb, it goes always to same picture, and this happen in all files (index.php, categories.php, ...)

here's the page_header.php code:
Code: [Select]
//--- End Photo Of The Day ----------------------------

$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 30";
  $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 = 120;
      $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);
//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------


any ideia what could possible be wrong?
thanks

44
Mods & Plugins (Requests & Discussions) / browse last comments
« on: May 23, 2003, 11:26:00 PM »
im trying to use the last commented images http://4homepages.de/forum/viewtopic.php?t=4060 mod on my site, and i did everything correct, i added the code in index.php and created the comment_short_bit.html like i wanted.

now to see the images i created a new template, called comments.html, where i put the {comments_short}

i try to see index.php?template=comments
but nothing shows... what should i do? must i put the code in includes/page_header.php and not in index.php?
if so, in wich part of the code and how should it be?

thanks

45
Mods & Plugins (Requests & Discussions) / image in two categories
« on: May 22, 2003, 02:20:02 AM »
sounds great man!

can u tell me how to do it?
thanks

Pages: 1 2 [3] 4 5 6 7 ... 10