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.


Topics - V@no

Pages: 1 ... 7 8 9 10 [11] 12 13 14
151
Chit Chat / How does internet search engines works?
« on: February 24, 2003, 05:11:43 AM »
The reason I started this topic, because I've never subscribe my site to any search angines. But, recently, I got two hits from google.com ( http://www.google.com/search?hl=en&ie=Windows-1252&oe=Windows-1252&q=4images%20v@no )
so, the question is - HOW???

152
I was thinking about this kind of change, like on this forum, it shows new posts since last visit.
what do u think, is it worthit to try?

153
This MOD will resize uploaded by users images and thumbnails to Max. Image Width set in settings.
Working on v1.7 - v1.7.9


-----------------------------------------------
Files to edit:
member.php
includes/upload.php
admin/settings.php
lang/<yourlanguage>/admin.php

-----------------------------------------------


Step 1
Open /member.php

Find:
Code: [Select]
   if (!$uploaderror) {
Insert above (if u installed "MOD Annotation by SLL" then, u'll need do Step 7 too):
Code: [Select]
//--------------------------------------------
//--------- Auto Image Resizing --------------
//--------------------------------------------
    if ($config['auto_image'] && !$uploaderror)
    {
      if ($direct_upload)
      {
        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
      }
      else
      {
        $src = MEDIA_TEMP_PATH."/".$new_name;
      }
      $do_resize = 0;
      if ($image_info = @getimagesize($src))
      {
        if ($image_info[2] > 0 && $image_info[2] < 4 && $image_info[0] > $config['max_image_width'] || $image_info[1] > $config['max_image_height'])
        {
          if (!function_exists("init_convert_options"))
          {
            require(ROOT_PATH.'includes/image_utils.php');
          }
          $convert_options = init_convert_options();
          if (!$convert_options['convert_error'])
          {
            $quality = intval($config['auto_image_quality']);
            $quality = ($quality >= 0 && $quality <= 100) ? $quality : 85;
            if (!resize_image($src, $quality, $config['max_image_width'], 1, $config['max_image_height']))
            {
              $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
              $uploaderror = 1;
            }
          }
        }
      }
    }
    if ($config['auto_thumbnail'] && !$uploaderror)
    {
      if ($direct_upload)
      {
        $src = THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else
      {
        $src = THUMB_TEMP_PATH."/".$new_name;
      }
      $do_resize = 0;
      if ($image_info = @getimagesize($src))
      {
        if ($image_info[2] > 0 && $image_info[2] < 4 && $image_info[0] > $config['max_thumb_width'] || $image_info[1] > $config['max_thumb_height'])
        {
          if (!function_exists("init_convert_options"))
          {
            require(ROOT_PATH.'includes/image_utils.php');
          }
          $convert_options = init_convert_options();
          if (!$convert_options['convert_error'])
          {
            $quality = intval($config['auto_image_quality']);
            $quality = ($quality >= 0 && $quality <= 100) ? $quality : 85;
            if (!resize_image($src, $quality, $config['max_thumb_width'], 1, $config['max_thumb_height']))
            {
              $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name;
              $uploaderror = 1;
            }
          }
        }
      }
    }
//--- End Auto Image Resizing ----------------




Step 2
Open /includes/upload.php

Find:
Code: [Select]
   $this->max_height['media'] = $config['max_image_height'];
Insert below:
Code: [Select]
   $this->auto_image['media'] = $config['auto_image'];
    $this->auto_image['thumb'] = $config['auto_thumbnail'];



Step 2.2
Find:
Code: [Select]
   $this->image_size = @getimagesize($this->upload_file);
    $ok = 1;

Insert below:

Code: [Select]
    if ($this->auto_image[$this->image_type]) {
      return 1; //auto image is on, don't need check for anything else.
    }




Step 3
Open /admin/settings.php

Find:
Code: [Select]
 show_setting_row("upload_emails");
Insert below:
Code: [Select]
 show_setting_row("auto_image", "radio");
  show_setting_row("auto_image_quality");




Step 4
Open /lang/<yourlanguage>/admin.php

Find:
Code: [Select]
$setting['auto_thumbnail_quality'] = "Thumbnail quality<br /><span class=\"smalltext\">0 to 100</span>";
Insert below:
Code: [Select]
$setting['auto_image'] = "Auto-resize image";
$setting['auto_image_quality'] = "Auto-resize image quality";




Step 5
Download attached file below.

Unzip it and upload to your 4images ROOT dir.
Execute it http://yoursiteaddress/4images/install_autoimage.php




Step 6
Go to Admin Control Panel -> settings. Under Upload settings u should find new options. Make sure "Max. image size in KB" is set to a high enough number




Step 7
This step u'll need only if u installed MOD Annotation by SLL
All u need to do is move code of Annotation, that u added in member.php, move it below the code u added in Step 1


Step 8 (Added 19/09/04)
This is an optional step, u'd need it if u want resize images not only using max width value as dimention but also max height.
Install atleast Step 1.x from this fix:
[FIX] Max height has no affect when do image resize


Video tutorial for this mod:
http://www.asian-lady.org/tutors/resize-mod/resize-mod.html


Changes log

v2.0.1 (2010-12-18)
* Fixed: thumbnails not being resized by non-admins (re-do Step 2)

v2.0 (2010-12-12)
+ Added: thumbnails resize (more info and upgrade instructions here)

v1.0 (2004-??-??)
- First release


154
Mods & Plugins (Releases & Support) / [Mod] Notify sender on received eCard
« on: February 16, 2003, 09:53:51 PM »
This MOD will send email notify to the sender, when eCard has been received/viewed by recipient.

----------------------------------------------------------------
Files to edit:
postcards.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/postcard_create.html
/templates/<yourtemplate>/postcard_preview.html

...............................................................................

New template:
/lang/<yourlanguage>/email/postcard_confirm.html
-----------------------------------------------------------------


Step 1.
Open postcards.php

Find:
Code: [Select]
 $recipient_email = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));Add after:
Code: [Select]
$confirm = $HTTP_POST_VARS['confirm'];
1.2
Find:
Code: [Select]
 $sql = "INSERT INTO ".POSTCARDS_TABLE."
          (postcard_id, image_id, postcard_date, postcard_bg_color, postcard_border_color, postcard_font_color, postcard_font_face, postcard_sender_name, postcard_sender_email, postcard_recipient_name, postcard_recipient_email, postcard_headline, postcard_message)
          VALUES
          ('$postcard_id', $image_id, $current_time, '$bg_color', '$border_color', '$font_color', '$font_face', '$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$headline', '$message')";
  $result = $site_db->query($sql);
Replace with:
Code: [Select]
 $sql = "INSERT INTO ".POSTCARDS_TABLE."
          (postcard_id, image_id, postcard_date, postcard_bg_color, postcard_border_color, postcard_font_color, postcard_font_face, postcard_sender_name, postcard_sender_email, postcard_recipient_name, postcard_recipient_email, postcard_headline, postcard_message, postcard_confirm)
          VALUES
          ('$postcard_id', $image_id, $current_time, '$bg_color', '$border_color', '$font_color', '$font_face', '$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$headline', '$message', '$confirm')";
  $result = $site_db->query($sql);

1.3.
Find:
Code: [Select]
   $sql = "SELECT p.postcard_id, p.image_id, p.postcard_date, p.postcard_bg_color, p.postcard_border_color, p.postcard_font_color, p.postcard_font_face, p.postcard_sender_name, p.postcard_sender_email, p.postcard_recipient_name, p.postcard_recipient_email, p.postcard_headline, p.postcard_message, i.image_name, i.cat_id, i.image_media_file, i.image_thumb_file
            FROM ".POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
            WHERE p.postcard_id = '$postcard_id' AND p.image_id = i.image_id";
    $image_row = $site_db->query_firstrow($sql);
Replace with:
Code: [Select]
   $sql = "SELECT p.postcard_id, p.image_id, p.postcard_date, p.postcard_bg_color, p.postcard_border_color, p.postcard_font_color, p.postcard_font_face, p.postcard_sender_name, p.postcard_sender_email, p.postcard_recipient_name, p.postcard_recipient_email, p.postcard_headline, p.postcard_message, i.image_name, i.cat_id, i.image_media_file, i.image_thumb_file, p.postcard_confirm
            FROM ".POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
            WHERE p.postcard_id = '$postcard_id' AND p.image_id = i.image_id";
    $image_row = $site_db->query_firstrow($sql);

1.4.
Find:
4images older then v1.7.7
Code: [Select]
   if (!$image_row) {
      $msg = $lang['invalid_postcard_id'];
    }
    else {
4images v1.7.7 or newer
Code: [Select]
    if (!$image_row) {
      show_error_page($lang['invalid_postcard_id']);
    }
    else {

Add after:
Code: [Select]
if ($msg == "" && $image_row['postcard_confirm'] == 1) {
$sql = "UPDATE ".POSTCARDS_TABLE."
SET postcard_confirm = 0
WHERE postcard_id = '$postcard_id'";
$site_db->query($sql);
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to(stripslashes($image_row['postcard_sender_email']), stripslashes($image_row['postcard_sender_name']));
$site_email->set_from(stripslashes($config['site_email']), "");
$site_email->set_subject($lang['postcard_confirm_subj']);
$site_email->register_vars(array(
"recipient_name" => stripslashes($image_row['postcard_sender_name']),
"recipient_email" => stripslashes($image_row['postcard_sender_email']),
"sender_name" => stripslashes($image_row['postcard_recipient_name']),
"sender_email" => stripslashes($image_row['postcard_recipient_email']),
"postcard_send_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$image_row['image_id'],
"site_name" => $config['site_name']
));
$site_email->set_body("postcard_confirm", $config['language_dir']);
$site_email->send_email();
}

1.5.
Find:
Code: [Select]
   $main_template = "postcard_preview";
    $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
    $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
    $site_template->register_vars(array(
Add right after:
Code: [Select]
"lang_postcard_confirm" => $lang['postcard_confirm'],
"postcard_confirm" => ($HTTP_POST_VARS['confirm'] == 1) ? $lang['yes'] : $lang['no'],
"confirm" => $HTTP_POST_VARS['confirm'],

1.6.
Find:
Code: [Select]
if ($action == "createcard") {
  if (!$sendprocess) {
    $bg_color = "";
    $border_color = "";
    $font_color = "";
    $font_face = "";
    $sender_name = ($user_info['user_level'] != GUEST) ? $user_info['user_name'] : "";
    $sender_email = ($user_info['user_level'] != GUEST) ? $user_info['user_email'] : "";
    $recipient_name = "";
    $recipient_email = "";
    $headline = "";
    $message = "";
  }
  $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
  $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
  $site_template->register_vars(array(
Add right after:
Code: [Select]
"lang_postcard_confirm" => $lang['postcard_confirm']."?",

Step 2.
Open /lang/<yourlanguage>/main.php

Add at the end of the file, just before ?> :
Code: [Select]
$lang['postcard_confirm'] = "Receive confirmation when postcard viewed";
$lang['postcard_confirm_subj'] = "eCard confirmation";


Step 3.
Open /templates/<yourtemplate>/postcard_create.html

Add this:
Code: [Select]
<TR>
<TD class="row1" valign="top"><B>{lang_postcard_confirm}</B></TD>
<TD class="row1" valign="top">
<INPUT type="checkbox" name="confirm" value="1" checked>
</TD>
</TR>


Step 4.
Open /templates/<yourtemplate>/postcard_preview.html

Add this:
Code: [Select]
<B>{lang_postcard_confirm}:</B> {postcard_confirm}and this:
Code: [Select]
   <INPUT type="hidden" name="confirm" value="{confirm}" />

Step 5.
Create new template /lang/<yourlanguage>/email/postcard_confirm.html
Insert this:
Code: [Select]
Dear {recipient_name},

{sender_name} ({sender_email}) received your eCard!

{site_url}
--
Best regards,
{site_name}


Step 6.
Download install_ecard.zip ... then unzip it, upload it to 4images ROOT dir and start it. [ update 04.01.2007 by mawenzi ]

Now, when u are sending eCard, u have an option to receive a notify, when your recipient viewed the eCard.

http://gallery.vano.org/postcard7570

P.S. sorry for my bad english, if u think of better text for this mod, let me know.

155
This mod will work "almost" same as "Display all images added by user" in user's profile.

---------------------------
Modifyed files:
member.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/member_profile.html


New template:
member_comment_bit.html
---------------------------


Step 1.
Open member.php

Find:
Code: [Select]
   $site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,
Insert below :below::
Code: [Select]
 "lang_show_user_comments" => $lang['show_user_comments'],
      "url_show_user_comments" => $site_sess->url(ROOT_PATH."member.php?action=showcomments&user_id=".$user_row['user_id']),

1.2.
Find:
Code: [Select]
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
Add before (:above: above it):
Code: [Select]
//-----------------------------------------------------
//---Show Member Comments-------------------------------
//-----------------------------------------------------

if ($action == "showcomments") {

  if (isset($HTTP_GET_VARS[URL_USER_ID]) || isset($HTTP_POST_VARS[URL_USER_ID])) {
    $user_id = (isset($HTTP_GET_VARS[URL_USER_ID])) ? intval($HTTP_GET_VARS[URL_USER_ID]) : intval($HTTP_POST_VARS[URL_USER_ID]);
    if (!$user_id) {
      $user_id = GUEST;
    }
  }
  else {
    $user_id = GUEST;
  }

    $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_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").$additional_sql."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.user_id = $user_id
          ORDER BY c.comment_date DESC, c.image_id ASC";
  $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 = "<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"bordercolor\"><tr><td class=\"commentrow1\" colspan=\"2\">".$lang['member_no_comments']."</td></tr></table>";
  }
  else {
    $comments = "";
    $bgcounter = 0;
$comments ="<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"bordercolor\">\n<TR>\n<TD>\n<TABLE width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n";
$current = "";
    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, i.image_allow_comments
            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;
 $image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
     if ($image_allow_comments == 1){
 if ($current != $comment_row[$i]['image_id']) {
$comments .= ($i == 0) ? "" : "</TABLE>\n</TD>\n</TR>\n</TABLE>\n<br>\n<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"bordercolor\">\n<TR>\n<TD>\n<TABLE width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n";
$same = 1;
 }else{
$same = 0;
 }
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

      $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);
      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_info .= "<br />";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"admin_edit\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"admin_edit\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }
 $show_link = (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? 0 : 1;
      $site_template->register_vars(array(
"comment_image" => ($same) ? get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 0, 1) : "",
"comment_image_name" => (!$show_link) ? $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)."\" class=\"smalltext\">".$image_row['cat_name']."</a>",
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_ip" => $comment_user_ip,
        "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']),
        "row_bg_number" => $row_bg_number,
        "admin_links" => $admin_links
      ));
      $comments .= $site_template->parse_template("member_comment_bit");

 $current = $comment_row[$i]['image_id'];
}
    } // end while
  } //end else
  $comments .= "</TABLE>\n</TD>\n</TR>\n</TABLE>\n";
  $content = $comments;
  $txt_clickstream = $lang['member_comments'].(($user_id == GUEST) ? $lang['userlevel_guest'] : '<a href="' . (!empty($url_show_profile) ? str_replace("{user_id}", $user_id, $url_show_profile) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;" . URL_USER_ID . "=" . $user_id)) . '">' . $comment_user_name . '</a>');
}
//---End Member Comments----


Step 2.
Open /lang/<yourlanguage>/main.php

Add at the end of file, just before ?> :
Code: [Select]
$lang['show_user_comments'] = "Show user's comments";
$lang['member_comments'] = "Comments added by ";
$lang['member_no_comments'] = "There are no comments for this user";


Step 3.
Open /templates/<yourtemplate>/member_profile.html

Add this tag, whereever u want to display link for comments:
Code: [Select]
<A href="{url_show_user_comments}">&nbsp;&nbsp;{lang_show_user_comments}&nbsp;&nbsp;</a>

Step 4.
Create new file in /templates/<yourtemplate>/. Name it as member_comment_bit.html

Insert this code (this is just an example, you'll need udjust it for your layout):
Code: [Select]
<TR>
  <TD class="commentrow{row_bg_number}" valign="top">
    <B> {comment_image_name}</B><BR />
{comment_cat_name}<BR />
<TABLE border="0" cellpadding="0" cellspacing="0" width="100" height="100" align="center">
<TR>
<TD valign="middle" align="center">
{comment_image}
</TD>
</TR>
</TABLE>
{if comment_user_ip}<BR /><BR /><B>IP:</B> {comment_user_ip}{endif comment_user_ip}
  </TD>
  <TD width="100%" class="commentrow{row_bg_number}" valign="top">
    <TABLE width="100%" >
      <TR>
        <TD valign="top"><B>{comment_headline}</B></TD>
        <TD valign="top" align="right">{if admin_links}{admin_links}{endif admin_links}</TD>
      </TR>
    </TABLE>
<BR /><BR />
    {comment_text}
  </TD>
</TR>
<TR>
  <TD class="commentrow{row_bg_number}" nowrap="nowrap" colspan="2">
    {comment_date}
  </TD>
</TR>


-----------------------------------------------------------
edited by mawenzi 15.06.2007 :
- is now compatible with MySQL 5 ...

156
Mods & Plugins (Releases & Support) / [Mod] Show user's lightbox to admin.
« on: February 13, 2003, 07:45:53 AM »
The simples way to do is use search engine to display someone's lightbox using image ids.

--------------------------------
Only ( :wink: ) 4 files to modify:
member.php
search.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/member_profile.html


---------------------------------


Step 1.
Open member.php

Find:
Code: [Select]
   $site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,
Replace with:
Code: [Select]
    $sql = "SELECT *
         FROM ".LIGHTBOXES_TABLE."
         WHERE ".get_user_table_field("", "user_id")." = ".$user_row['user_id'];
     $user_lightbox_info = $site_db->query_firstrow($sql);
     $num_rows_all = 0;
     if (!empty($user_lightbox_info['lightbox_image_ids'])) {
     $image_id_sql = str_replace(" ", ",", trim($user_lightbox_info['lightbox_image_ids']));
     $sql = "SELECT COUNT(image_id) AS images
          FROM ".IMAGES_TABLE."
          WHERE image_active = 1 AND image_id IN ($image_id_sql)";
     $result = $site_db->query_firstrow($sql);
     $num_rows_all = $result['images'];
    }
    $site_template->register_vars(array(
      "lang_show_user_lightbox" => $lang['show_user_lightbox']." (".$num_rows_all.")",
      "url_show_user_lightbox" => ($user_info['user_level'] == ADMIN) ? $site_sess->url(ROOT_PATH."search.php?search_lightbox=".$user_row['user_id']) : "",
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,


Step 2.
Open search.php
Find:
Code: [Select]
include(ROOT_PATH.'global.php');
Add after:
Code: [Select]
if (isset($HTTP_POST_VARS['search_lightbox']) || isset($HTTP_GET_VARS['search_lightbox'])) {
  $search_lightbox = intval((isset($HTTP_POST_VARS['search_lightbox'])) ? trim($HTTP_POST_VARS['search_lightbox']) : trim($HTTP_GET_VARS['search_lightbox']));
  if ($search_lightbox) {
    $show_result = 1;
  }
}
else {
  $search_lightbox = "";
}

2.2.
Find:
Code: [Select]
$search_id = array();Add after:
Code: [Select]
if ($user_info['user_level'] == ADMIN){;
  if ($search_lightbox != ""){
$sql = "SELECT *
  FROM ".LIGHTBOXES_TABLE."
  WHERE ".get_user_table_field("", "user_id")." = $search_lightbox";
 $search_lightbox_info = $site_db->query_firstrow($sql);
 $search_lightbox_ids = str_replace(" ", ",", trim($search_lightbox_info['lightbox_image_ids']));
  $search_id['image_ids'] = $search_lightbox_ids;
  }
}


Step 3.
Open /lang/<yourlanguage>/main.php

Add at the end, just before ?> :
Code: [Select]
$lang['show_user_lightbox'] = "Show user's lightbox";

Step 4.
Open /templates/<yourtemplate>/member_profile.html

Add where ever u want to display Show user's lightbox:
Code: [Select]
{if url_show_user_lightbox}<A href="{url_show_user_lightbox}">{lang_show_user_lightbox}</a>{endif url_show_user_lightbox}

now, when u logged in as admin, go view an user's profile.

157
Feedback & Suggestions / DB fields: user_lastaction VS user_lastvisit
« on: February 13, 2003, 01:54:40 AM »
I'm just wondering, what user_lastvisit field store?
Well, obviously it store date of last visit, but how come, I had 2+ days difference with user_lastaction ?
 :?

158
Mods & Plugins (Releases & Support) / [Mod] Most Ever Users Online
« on: February 10, 2003, 03:39:21 AM »
This mod is obsolete due to v2 is out:
http://www.4homepages.de/forum/index.php?topic=7290.0


This little "MOD" will log and show Most Ever Users Online (same as on this board, just look at the bottom of index page)

There are only 3 files to modify:
/includes/sessions.php
/lang/<yourlanguage>/main.php
/templates/<yourtemlplate>/whos_online.html
I chosed this temlplate, but u can add this to any template(s) u wish.

So, here it goes:

Step 1.
Open /includes/sessions.php

Find:
Code: [Select]
 $site_template->register_vars(array(
Replace with:
Code: [Select]
//-----------------------------
//---Most ever users online----
//-----------------------------
  if ($num_total_online > preg_replace("/,[0-9]+/", "",$config['most_users'])) {
  $most_users = $num_total_online.",".time();
  $config['most_users'] = $most_users; //ensure that this will be displayed right now, not after second refresh
  $sql = "UPDATE ".SETTINGS_TABLE."
 SET setting_value = '$most_users'
 WHERE setting_name = 'most_users'";
  $site_db->query($sql);
  }
  $site_template->register_vars(array(
"mueo" => preg_replace("/,[0-9]+/", "",$config['most_users']),
"mueo_date" => format_date($config['date_format'].", ".$config['time_format'], preg_replace("/[0-9]+,/", "", $config['most_users'])),
"lang_mueo" => $lang['mueo'],
"lang_mueo_date" => $lang['mueo_date'],




Step 2.
Open /lang/<yourlanguage>/main.php

At the end of the file, just before ?> add this:
Code: [Select]

$lang['mueo'] = "Most users ever online was ";
$lang['mueo_date'] = "on";
 



Step 3.
Open /temlates/<yourtemplate>/whos_online.html

Add this:
Code: [Select]
{lang_mueo} <B>{mueo}</B> {lang_mueo_date} {mueo_date}


Step 4.
Download "MEUO Install" file

extract it in root of your 4images dir. And run it(http://yoursite/install_mueo.php)

Upload all modified files.

P.S. at first I wrote this mod using two fields in DB, to store "most users" and date in separate fields. the code was smaller.
so, if someone think it's better use two fields in DB, I can post it too.

159
Mods & Plugins (Releases & Support) / [Mod] Avatar v2.01
« on: February 06, 2003, 05:30:43 AM »
Avatar v2

Some people were interesting in such a mod.
This mod will let users select an avatar for their profiles.
The avatars will be displayed in comments. ( can be added somewhere else, if needed )

New features in v2:
1. users can upload their own avatars.
2. administrator can anable/disable: using avatars, upload avatars, change alowed width/height.


This MOD was writen and tested on Windows system with 4images v1.7
---------------------------------------------------------------------------------------------------------------
Changes in following files:


/member.php
/details.php
/includes/upload.php
/includes/db_field_definitions.php
/admin/settings.php
/admin/admin_functions.php
/lang/<yourlanguage>/admin.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/member_profile.html
/templates/<yourtemplate>/member_editprofile.html
/templates/<yourtemplate>/comment_bit.html


---------------------------------------------------------------------------------------

Step 1.
Open member.php

Find:
Code: [Select]
      "user_email_save" => $user_email_save,
Insert below:
Code: [Select]
    "lang_avatar" => $lang['avatar'],
     "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" : $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" alt=\"\">" : "",


1.2.
Find:
Code: [Select]
  if (!$error) {
   $additional_sql = "";
    if (!empty($additional_user_fields)) {
      $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 = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
    $site_db->query($sql);
    $msg_color = 1;
    $msg .= $lang['update_profile_success'];
    if (!empty($new_email_msg)) {
      $msg .= "<br />".$new_email_msg;
    }
    $user_info = $site_sess->load_user_info($user_info['user_id']);
  }
  else {
    $update_process = 1;
  }
  $action = "editprofile";
}

Add above it:
Code: [Select]
// Upload Avatar file
  if (!$error) {
     if (!empty($HTTP_POST_FILES['avatar_file']['tmp_name']) && $HTTP_POST_FILES['avatar_file']['tmp_name'] != "none") {
    include(ROOT_PATH.'includes/upload.php');
    $site_upload = new Upload();
    $new_name = $site_upload->upload_file("avatar_file", "avatar", $config['template_dir'], $user_info['user_id']);
     if (!$new_name) {
     $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name."</b><br />".$site_upload->get_upload_errors();
     $error = 1;
     }else{
    $HTTP_POST_VARS['user_avatar'] = "users/".$new_name;
    $avatars_dir = TEMPLATE_DIR."/".$config['template_dir']."/avatars/users/";
    $dir = opendir($avatars_dir);
    $contents = array();
    while ($contents[] = readdir($dir)){;}
    closedir($dir);
    foreach ($contents as $line){
      $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
      $extension = substr(strrchr($line,"."), 1);
      $filename2 = substr($new_name,0,(strlen($new_name)-strlen(strrchr($new_name,"."))));
      $extension2 = substr(strrchr($new_name,"."), 1);
      if ($filename == $filename2 && $extension != $extension2) {
      unlink($avatars_dir.$line);
      }
    }

     }
    }
  }
// End Avatar file


1.3.
Find:
Code: [Select]
   $user_icq = $user_info['user_icq'];

Add after:
Code: [Select]
 $user_avatar = $user_info['user_avatar'];


1.4.
Few lines below find:
Code: [Select]
 $site_template->register_vars(array(
    "user_name" => htmlspecialchars(stripslashes($user_name)),

Replace with:
Code: [Select]
//-----------------------
//------ Avatar ---------
//-----------------------
  if ($config['avatar_use']){
   $images = "";
  $checked = ($user_avatar == "blank.gif" || $user_avatar == "") ? " selected" : "";
  $images .= "\n<option value=\"blank.gif\"$checked>none</option>\n";
  $dir = opendir(TEMPLATE_PATH."/avatars/users/");
  $contents = array();
  while ($contents[] = readdir($dir)){;}
  closedir($dir);
  natcasesort ($contents);
  foreach ($contents as $line){
   $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
   if ($filename == $user_info['user_id']) {
     $checked = (stristr($user_avatar, "users/")) ? " selected" : "";
     $images .= "\n<option value=\"users/$line\"$checked>".$lang['custom']."</option>\n";
   }
  }
   $dir = opendir(TEMPLATE_PATH."/avatars/");
   $contents = array();
   while ($contents[] = readdir($dir)){;}
   closedir($dir);
   natcasesort ($contents);
   $checked = "";
   foreach ($contents as $line){
      $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
      $extension = substr(strrchr($line,"."), 1);
      $checked = "";
      if ($line == $user_avatar) { $checked = " selected"; }
      if (strcasecmp($extension,"gif")==0 || strcasecmp($extension,"jpg")==0 || strcasecmp($extension,"jpeg")==0 || strcasecmp($extension,"png")==0 ){
         if ($line != "blank.gif") {
        $filename = str_replace("_", " ", $filename);
        $images .= "<option value=\"$line\"$checked>$filename</option>\n";
       }
      }
   }
  }
//----------------------
//----- End Avatar -----
//----------------------

  $site_template->register_vars(array(
   "lang_avatar" => $lang['avatar'],
   "lang_avatar_file" => $lang['avatar_file'],
   "lang_avatar_dim" => $lang['avatar_max_dim']." ".$config['avatar_width']."x".$config['avatar_height'].$lang['px'],
   "lang_avatar_select" => $lang['avatar_select'],
   "user_avatar_images" => $images,
   "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_avatar == "") ? "blank.gif" : $user_avatar)."\" name=\"icons\" border=\"0\" alt=\"\">" : "",
   "lang_or" => $lang['or'],
   "user_avatar_file" => $config['avatar_user_custom'],
    "user_name" => htmlspecialchars(stripslashes($user_name)),



Step 2.
Open details.php
Find:
Code: [Select]
     $comment_user_id = $comment_row[$i]['user_id'];

Add after:
Code: [Select]
   $user_row_comment = get_user_info($comment_user_id);


2.2.
Find:
Code: [Select]
       "comment_id" => $comment_row[$i]['comment_id'],

Add after:
Code: [Select]
   "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row_comment['user_avatar'] == "") ? "blank.gif" : $user_row_comment['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "",




Step 3.
Open /includes/upload.php
Find:
Code: [Select]
   $this->max_height['media'] = $config['max_image_height'];

    $this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;

Replace with:
Code: [Select]
   $this->max_height['media'] = $config['max_image_height'];
  $this->max_width['avatar'] = $config['avatar_width'];
  $this->max_height['avatar'] = $config['avatar_height'];

    $this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;
    $this->max_size['avatar'] = 99999999999;



3.2.
Find:
Code: [Select]
 function copy_file() {

Add after:
Code: [Select]
 if ($this->image_type == "avatar") {
    if (file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
        @unlink($this->upload_path[$this->image_type]."/".$this->file_name);
      }
      $ok = move_uploaded_file($this->upload_file, $this->upload_path[$this->image_type]."/".$this->file_name);
  }else{

3.3.
At the end of this function find:
Code: [Select]
   @chmod($this->upload_path[$this->image_type]."/".$this->file_name, CHMOD_FILES);
Replace with:
Code: [Select]
 }
    @chmod($this->upload_path[$this->image_type]."/".$this->file_name, CHMOD_FILES);


3.4.
Find:
Code: [Select]
   if ($cat_id) {
      $this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
      $this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
    }
    else {
      $this->upload_path['thumb'] = THUMB_TEMP_PATH;
      $this->upload_path['media'] = MEDIA_TEMP_PATH;
    }

    if ($file_name != "") {

Replace with:
Code: [Select]
   if ($cat_id) {
      $this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
      $this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
    $this->upload_path['avatar'] = TEMPLATE_DIR."/".$cat_id."/avatars/users";
    }
    else {
      $this->upload_path['thumb'] = THUMB_TEMP_PATH;
      $this->upload_path['media'] = MEDIA_TEMP_PATH;
    }

    if ($file_name != "" && $this->image_type != "avatar") {


3.5.
Find:
Code: [Select]
   $this->mime_type = $this->HTTP_POST_FILES[$this->field_name]['type'];

Replace with:
Code: [Select]
if ($this->image_type == "avatar") {
    $this->file_name = $file_name.".".$this->extension;
  }

    $this->mime_type = $this->HTTP_POST_FILES[$this->field_name]['type'];


3.6.
Find:
Code: [Select]
   //Thumbnails
    $this->accepted_mime_types['thumb'] = array(

Insert above:
Code: [Select]
 //Avatar
    $this->accepted_mime_types['avatar'] = array(
      "image/jpeg",
      "image/pjpeg",
      "image/gif",
      "image/x-png"
    );
    $this->accepted_extensions['avatar'] = array(
      "jpg",
      "jpeg",
      "gif",
      "png"
    );


3.7. *new
Find:
Code: [Select]
     $error_msg .= "<b>".$this->file_name.":</b> ".$msg."<br />";

Replace with:
Code: [Select]
     $error_msg .= "<b>".(($this->image_type == "avatar") ? $this->HTTP_POST_FILES[$this->field_name]['name'] : $this->file_name).":</b> ".$msg."<br />";




Step 4.
Open /includes/db_field_definitions.php file.
Add this line:
Code: [Select]
$additional_user_fields['user_avatar'] = array($lang['avatar'], "avatar", 0);




Step 5.
Open /admin/settings.php
Find:
Code: [Select]
 show_setting_row("highlight_admin", "radio");

Add after:
Code: [Select]
 show_table_separator($setting_group[8], 2, "#setting_group_8");
  show_setting_row("avatar_use", "radio");
  show_setting_row("avatar_user_custom", "radio");
  show_setting_row("avatar_width");
  show_setting_row("avatar_height");
If u installed some other MOD for example "Annotation by SLL" then u probably will need change $setting_group[8], 2, "#setting_group_8");




Step 6. *updated
Open /admin/admin_functions.php
Find:
Code: [Select]
     case "text":
      default:
        show_input_row($val[0], $field_name, $value);
    
      } // end switch
    }
  }
}
?>

Replace with:
Code: [Select]
  case "avatar":
    show_avatar_row($val[0], $field_name, $value);
    break;
      case "text":
      default:
        show_input_row($val[0], $field_name, $value);
    
      } // end switch
    }
  }
}
//-----------------------
//------ Avatar ---------
//-----------------------
function show_avatar_row($title, $name, $value = "blank.gif"){
  global $config;
  if ($config['avatar_use']){
  $dir = opendir(TEMPLATE_PATH."/avatars/");
  $contents = array();
  while ($contents[] = readdir($dir)){;}
  closedir($dir);
  natcasesort ($contents);
  echo "<tr width=\"50%\"class=\"".get_row_bg()."\" valign='top'>\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
  echo "<td width=\"50%\" height=\"115\" valign=\"middle\">\n<table>\n<tr>\n<td>\n<SELECT name=\"$name\" size=\"6\" onkeypress=\"if(window.event.keyCode==13){this.form.submit();}\" onChange=\"document.form.icons_$name.src='".TEMPLATE_PATH."/avatars/'+document.form.$name.options[document.form.$name.selectedIndex].value;\">";
   if ($value == "blank.gif" || $value == "") {
   $checked = " selected";
   }else{
   $checked = "";
   }
   echo "<option value=\"blank.gif\"$checked>none</option>\n";
  foreach ($contents as $line){
     $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
     $extension = substr(strrchr($line,"."), 1);
     $checked = "";
     if ($line == $value) { $checked = " selected"; }
     if (strcasecmp($extension,"gif")==0 || strcasecmp($extension,"jpg")==0 || strcasecmp($extension,"jpeg")==0 || strcasecmp($extension,"png")==0 ){
      if ($line != "blank.gif") {
      $filename = str_replace("_", " ", $filename);
      echo "<option value=\"$line\"$checked>$filename</option>\n";
      }
     }
  }
  echo "</select>\n</td>\n<td valign='middle' align='left'>\n<img align='center' src=\"".TEMPLATE_PATH."/avatars/".(($value == "") ? "blank.gif" : $value)."\" name=\"icons_$name\" border=\"0\" alt=\"\">\n</td>\n</tr>\n</table>\n</td>\n";
  }
}
//----- End Avatar -----
?>




Step 7.
Open /lang/<yourlanguage>/admin.php
Add at the end of the file, just before <? :
Code: [Select]
/*-- Setting-Group 8 --*/
$setting_group[8]="Avatar";
$setting['avatar_use'] = "Use avatars";
$setting['avatar_user_custom'] = "Allow users use their own avatars";
$setting['avatar_width'] = "Max. avatar width in pixel";
$setting['avatar_height'] = "Max. avatar height in pixel";
Change $setting_group[8]="Avatar"; to the number u set in /admin/settings.php




Step 8.
Open /lang/<yourlanguage>/main.php
Add at the end of the file, just before <? :
Code: [Select]
$lang['avatar'] = "Avatar: ";
$lang['avatar_file'] = "Upload avatar:";
$lang['avatar_max_dim'] = "Max. allowed";
$lang['avatar_select'] = "Select from the list:";
$lang['custom'] = "Custom";




Step 9.
Open /templates/<yourtemplate>/member_profile.html
Add this:
Code: [Select]
       {if user_avatar_current}
        <TR>
          <TD class="row2"><B>{lang_avatar}</B></TD>
          <TD class="row2">{user_avatar_current}</TD>
        </TR>
        {endif user_avatar_current}




Step 10.
Open /templates/<yourtemplate>/member_editprofile.html
Change top form to this:
Code: [Select]
<FORM method="post" action="{url_member}" name="creator" enctype="multipart/form-data">
  <TABLE width="100%" border="0" cellspacing="0" cellpadding="1">
    <TR>
      <TD valign="top" class="head1">
        <TABLE width="100%" border="0" cellpadding="4" cellspacing="0">
          <TR>
            <TD colspan="2" valign="top" class="head1">{lang_profile_of} {user_name}</TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_email}</B></TD>
            <TD class="row1"><INPUT type="text" name="user_email"  size="30" value="{user_email}" class="input" /></TD>
          </TR>
          <TR>
            <TD class="row2"><B>{lang_email_confirm}</B></TD>
            <TD class="row2"><INPUT type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_show_email}</B></TD>
            <TD class="row1">
              <INPUT type="radio" name="user_showemail" value="1"{user_showemail_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <INPUT type="radio" name="user_showemail" value="0"{user_showemail_no} />
              {lang_no}</TD>
          </TR>
      <TR>
            <TD class="row2"><B>{lang_allow_emails}</B></TD>
            <TD class="row2">
              <INPUT type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <INPUT type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}
      </TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_invisible}</B></TD>
            <TD class="row1">
              <INPUT type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <INPUT type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no}
      </TD>
          </TR>
          <TR>
            <TD colspan="2" class="head1">{lang_optional_infos}</TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_homepage}</B></TD>
            <TD class="row1"><INPUT type="text" name="user_homepage"  size="30" value="{user_homepage}" class="input" /></TD>
          </TR>
          <TR>
            <TD class="row2"><B>{lang_icq}</B></TD>
            <TD class="row2"><INPUT type="text" name="user_icq"  size="30" value="{user_icq}" class="input" /></TD>
          </TR>
                   {if user_avatar_images}
          <TR>
            <TD colspan="2" class="head1">{lang_avatar}</TD>
          </TR>

          <TR>
            <TD class="row2" valign="top">
            {if user_avatar_file}
              <B>{lang_avatar_file}</B><BR />
              <SPAN class="smalltext">
              <B>{lang_avatar_dim}</B>
              </SPAN>
              <BR>
              <b>{lang_or}</b><BR>
              {endif user_avatar_file}
              <B>
              {lang_avatar_select}
              </B>
            </TD>
            <TD class="row2">
            {if user_avatar_file}
              {lang_upload}
              <INPUT type="file" name="avatar_file"  size="30" class="input" />
              <BR />
              <BR />
              {endif user_avatar_file}
              <SELECT name="user_avatar" size="6" onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onChange="document.images.icons.src='{template_url}/avatars/'+this.value;">{user_avatar_images}</SELECT>
              <TABLE width="100%" height="100" border="0">
                <TR>
                  <TD align="center">
                    {user_avatar_current}
                  </TD>
                </TR>
              </TABLE>
            </TD>
          </TR>
          {endif user_avatar_images}
        </TABLE>
      </TD>
    </TR>
  </TABLE>
  <INPUT type="hidden" name="action" value="updateprofile" />
  <P align="center">
    <INPUT type="submit" value="{lang_save}" class="button" />
    <INPUT type="reset" value="{lang_reset}" class="button" />
  </P>
</FORM>



Step 11.
Open /templates/<yourtemplate>/comment_bit.html
Add this:
Code: [Select]
{if user_avatar_current}
  {user_avatar_current}
  {endif user_avatar_current}




Step 12.
Download attached package
Upload  install_avatar.php into your 4images root folder, and blank.gif into new /templates/<yourtemplate>/avatars
Start the installation by http://yourhost.com/your4images/install_avatar.php


Now, create two folders:
/templates/<yourtemplate>/avatars/users/
Upload your avatars in /avatars/

Now users can sellect their avatar from control panel.

P.S. Thank SLL for the installer :)
P.P.S. This MOD probably wont work if u have integrated 4images with some boards.

160
Just a thought, would be nice let visitors to chose how they want browse pictures sorted by name/date.

161
so far I have 5 script that quit working properly after I upgraded to PHP v4.3.
on of them is 4images if I want use ImageMagic or trying do something with .GIF files. instead of give me an error on screen or phperror.log it just throught to me blank page.

another thing that bother me is that in phperror.log I get
Quote
PHP Warning:  (null)() [<a href='http://www.php.net/ref.outcontrol'>ref.outcontrol</a>]: output handler 'ob_gzhandler' cannot be used twice in Unknown on line 0
after each view/refresh page with 4images script.
I have tryed set to dont use "gzip" from admin control panel - still same thing, then I tryed remove PHP feature from php.ini file - no luck.
I'm using prebuilded version of PHP (dont know how to compile myself) so, maybe it has some bugz?
Is anyone else having problem with PHP v4.3?

P.S. or maybe somebody know how I can setup Apache2.0.44 running with PHP v4.2.3 as module (isapi php4apache2.dll) not as CGI (php.exe) on WindowsXP? It gives me an error that php version is not what expected when I try so, thats the reason I had to switch to PHP v4.3

162
how come?

163
maybe I missed something out there, but I can't find what I can use to count total of new images.
I have found in global.php
Code: [Select]
 $new_cutoff = time() - (60 * 60 * 24 * $config['new_cutoff']);
  $sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
          FROM ".CATEGORIES_TABLE." c
          LEFT JOIN ".IMAGES_TABLE." i ON (i.cat_id = c.cat_id AND i.image_date >= $new_cutoff AND i.image_active = 1)
          GROUP BY c.cat_id
          ORDER BY c.cat_order, c.cat_name ASC";
  $result = $site_db->query($sql);
I changed it to count also new images, it worked, but it counts all images without user access control restriction.
I would use something like
Code: [Select]
 $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
but I dont know how to use it...
if someone would help me out with it.. :wink:
thx.

164
Installation, Update & Configuration / min. limit letters to search?
« on: January 10, 2003, 11:06:55 PM »
I've seen a post that tells how to change min. limit of letters to search...cant find it now.
anyone know where is the setting for minimal number of letters possible use in search?
thx.

165
was wondering if someone can do this:
send activation link along with new password if the user has not activated.
right now I'm not aware the way I as an admin, or a user can reseive email with activation link again if first email was lost...
right now email with registration for new user content username and password, and if a user go to "lost password" he'll receive email with new password, but since he is not activated it wont work.
so, it would be nice for not activated users receive new password AND again activation link.

Pages: 1 ... 7 8 9 10 [11] 12 13 14