4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: martrix on March 15, 2005, 09:44:32 PM

Title: [MOD] Member personal photo v1.1.3 by V@no (2011-10-23)
Post by: martrix on March 15, 2005, 09:44:32 PM
Originally posted by / Author: V@no

----- [ Overview ] -----

This mod will alow your members upload their photo that will be displayed in their profile.


----- [ Changed Files ] -----

member.php
includes/db_field_definitions.php
lang/<yourlanguage>/main.php
lang/<yourlanguage>/admin.php
admin/settings.php
admin/users.php
templates/<yourtemplate>/member_editprofile.html
templates/<yourtemplate>/member_profile.html
[/color]

----- [ New Files ]-----

userpic_install.php


----- [ New Folder ] -----

data/userpic/



----- [ Installation ] -----

Step 1
Open member.php
Find:

Code: [Select]
     "user_homepage_button" => $user_homepage_button,
Insert above:
Code: [Select]

//User Pic
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic


Step 1.1
Find:

Code: [Select]
 if (!$error && $user_email != $user_info['user_email'] && $user_info['user_level'] != ADMIN && $config['account_activation'] != 0) {
Insert above:
Code: [Select]
// Upload User Pic
  $userpic = $userpic_new = "";
  if (!$error && $config['userpic'])
  {
    $userpics_dir = ROOT_PATH."data/userpic/";
    if (!empty($HTTP_POST_FILES['userpic_file']['tmp_name']) && $HTTP_POST_FILES['userpic_file']['tmp_name'] != "none")
    {
      if (isset($HTTP_COOKIE_VARS['userpic_file']) || isset($HTTP_POST_VARS['userpic_file']) || isset($HTTP_GET_VARS['userpic_file'])) {
        die("Security violation");
      }
      if (!function_exists("is_uploaded_file")) {
        function is_uploaded_file($file_name) {
          if (!$tmp_file = @get_cfg_var('upload_tmp_dir')) {
            $tmp_file = tempnam('','');
            $deleted = @unlink($tmp_file);
            $tmp_file = dirname($tmp_file);
          }
          $tmp_file .= '/'.basename($file_name);
          return (ereg_replace('/+', '/', $tmp_file) == $file_name) ? 1 : 0;
        }
      
        function move_uploaded_file($file_name, $destination) {
          return (is_uploaded_file($file_name)) ? ((copy($file_name, $destination)) ? 1 : 0) : 0;
        }
      }
      $error = array();
      $extensions = array(
        "jpg",
        "jpeg",
        "gif",
        "png"
      );
      $mime_types = array();
      $mime_type_match = array();
      include_once(ROOT_PATH.'includes/upload_definitions.php');
      foreach($extensions as $val)
        $mime_types = array_merge($mime_types, $mime_type_match[$val]);
      $mime_types = array_unique($mime_types);
      $userpic_ext = strtolower(substr(strrchr($HTTP_POST_FILES['userpic_file']['name'],"."), 1));
      $userpic_mime = $HTTP_POST_FILES['userpic_file']['type'];
      if (!in_array($userpic_mime, $mime_types) || !in_array($userpic_ext, $extensions))
      {
        $error[] = $lang['invalid_file_type']. " (".$userpic_ext.", ".$HTTP_POST_FILES['userpic_file']['type'].")";
      }
      if ($HTTP_POST_FILES['userpic_file']['size'] > $config['userpic_size'] * 1024)
      {
        $error[] = $lang['invalid_file_size'];
      }
      if (empty($error))
      {
        $userpic_name = $user_info['user_id'].".".$userpic_ext;
        $userpic_file = $userpics_dir.$userpic_name;
         if (file_exists($userpic_file))
         {
            unlink($userpic_file);
        }
        if (!move_uploaded_file($HTTP_POST_FILES['userpic_file']['tmp_name'], $userpic_file))
        {
          $error[] = $lang['file_copy_error'];
        }
        else
        {
          @chmod($userpic_file, CHMOD_FILES);
        }
      }
      if (empty($error))
      {
        $userpic = $HTTP_POST_VARS['userpic'] = $userpic_new = $userpic_name;
        if ($user_info['userpic'] != $userpic_name && file_exists($userpics_dir.$user_info['userpic']))
        {
          @unlink($userpics_dir.$user_info['userpic']);
        }
        if (!function_exists(init_convert_options))
        {
          require(ROOT_PATH.'includes/image_utils.php');
        }
        $image_info = getimagesize($userpic_file);
        $convert_options = init_convert_options();
        if (($image_info[0] > $config['userpic_width'] || $image_info[1] > $config['userpic_height']))
        {
          if ($convert_options['convert_error'] || (!$convert_options['convert_error'] && !resize_image($userpic_file, 85, $config['userpic_width'], 1, $config['userpic_height'])))
          {
            if ($image_info[0] > $config['userpic_width'])
            {
              $error[] = $lang['invalid_image_width'];
            }
            if ($image_info[1] > $config['userpic_height'])
            {
              $error[] = $lang['invalid_image_height'];
            }
          }
        }
      }
      if (!empty($error))
      {
        $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$HTTP_POST_FILES['userpic_file']['name']."</b><br />";
        foreach ($error as $val) {
          $msg .= "<b>".$HTTP_POST_FILES['userpic_file']['name'].":</b> ".$val."<br />";
        }
        $HTTP_POST_VARS['userpic'] = $user_info['userpic'];
      }
    }
    else
    {
      if (isset($HTTP_POST_VARS['userpic_del']) && $HTTP_POST_VARS['userpic_del'])
      {
        @unlink($userpics_dir.$user_info['userpic']);
        $HTTP_POST_VARS['userpic'] = $userpic = "";
        $userpic_new = 1;
      }
    }
  }
// End Upload User Pic


Step 1.2
Find:
Code: [Select]
   "user_showemail_yes" => $user_showemail_yes,
Insert above:
Code: [Select]
//User Pic
    "userpic_allowed" => $config['userpic'],
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
    "lang_userpic_del" => $lang['userpic_del'],
    "lang_userpic_upload" => preg_replace("/".$site_template->start."userpic_max_size".$site_template->end."/siU", $config['userpic_size']."&nbsp;".$lang['kb'], preg_replace("/".$site_template->start."userpic_max_width".$site_template->end."/siU", $config['userpic_width'], preg_replace("/".$site_template->start."userpic_max_height".$site_template->end."/siU", $config['userpic_height'], $lang['userpic_upload']))),
    "userpic_max_width" => $config['userpic_width'],
    "userpic_max_height" => $config['userpic_height'],
    "userpic_max_size" => $config['userpic_size']."&nbsp;".$lang['kb'],
//End User Pic



Step 2
Open includes/db_field_definitions.php
At the end, above closing ?> insert:
Code: [Select]
$additional_user_fields['userpic'] = array($lang['userpic'], "text", 0);


Step 3
Open lang/<yourlanguage>/main.php
At the end, above closing ?> insert:

Code: [Select]
//-----------------------------------------------------
//--- User Pic ----------------------------------------
//-----------------------------------------------------
$lang['userpic'] = "Personal picture";
$lang['userpic_del'] = "Remove";
$lang['userpic_upload'] = "Maximum image size: {userpic_max_size}.<br />Image larger {userpic_max_width}x{userpic_max_height} will be resized";
$lang['file_copy_error'] = "Copy error. Please check the directory permissions.";
//--- End User Pic ------------------------------------



Step 4
Open lang/<yourlanguage>/admin.php
At the end, above closing ?> insert:
Code: [Select]
//User Pic
/*-- Setting-Group Member Personal Photo --*/
$setting_group['memberpersonalphoto']="Personal Picture";
$setting['userpic'] = "Activate";
$setting['userpic_size'] = "Max. image size in KB";
$setting['userpic_width'] = "Max. image width in pixel";
$setting['userpic_height'] = "Max. image height in pixel";
//End User Pic



Step 5
Open admin/settings.php
Find:
Code: [Select]
 show_form_footer($lang['save_changes'], "", 2);
Insert above:
Code: [Select]
//User Pic
  show_table_separator($setting_group['memberpersonalphoto'], 2, "setting_group_memberpersonalphoto");
  show_setting_row("userpic", "radio");
  show_setting_row("userpic_width");
  show_setting_row("userpic_height");
  show_setting_row("userpic_size");
//End User Pic



Step 6
Open templates/<yourtemplate>/member_editprofile.html
Find:
Code: [Select]
<form method="post" action="{url_member}">
Replace it with:
Code: [Select]
<form method="post" action="{url_member}" enctype="multipart/form-data">
or just make sure that enctype="multipart/form-data" is present inside the <form> tag.


Step 6.1
Find:
Code: [Select]
         <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>

Insert below:
Code: [Select]
{if userpic_allowed}
          <tr>
            <td class="row1" valign="top"><b>{lang_userpic}</b>
              <SPAN class="smalltext">
                <br />
                <B>{lang_userpic_upload}</B>
              </SPAN>
            </td>
            <td class="row1">
              <INPUT type="file" name="userpic_file"  size="30" class="input" /><br />
              {if userpic_img}<img src="{userpic_img}"><br /><input type="checkbox" name="userpic_del" value="1">&nbsp;{lang_userpic_del}{endif userpic_img}
            </TD>
          </TR>
{endif userpic_allowed}
(ofcourse u can add it anywhere u want in this file)



Step 7 updated 28.6.2006
Open templates/<yourtemplate>/member_profile.html
Find:
Code: [Select]
       <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>

Replace with:
Code: [Select]
       <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://www.icq.com/people/about_me.php?uin={user_icq}">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>
{if userpic_img}
        <tr>
          <td class="row1" valign="top"><b>{lang_userpic}</b></td>
          <td class="row1"><img src="{userpic_img}"></td>
        </tr>
{endif userpic_img}



Step 8
Create a new folder: data/userpic/
Set CHMOD 777 (unix systems only) and make sure its writible by your webserver.



Step 9
Download this (http://gallery.vano.org/file58dl) package, extract it and upload to your 4images root directory, then execute it by typing in your browser: http://<your_site_address_and_path_to_your_4images>/userpic_install.php
Follow the instructions.

Or u can update your database manualy by executing this MySQL query:
Code: [Select]
ALTER TABLE `4images_users` ADD `userpic` varchar(255) NOT NULL default '';
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('userpic', '1');
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('userpic_size', '500');
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('userpic_width', '200');
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` ) VALUES ('userpic_height', '200');



Step 10
Step 10 and 11 required if your would like display members photos on their images details page (details.php)
Open details.php
Find:
Code: [Select]
$additional_sql = "";Insert below:
Code: [Select]
if (!empty($additional_user_fields)) {
  foreach ($additional_user_fields as $key => $val) {
    $additional_sql .= ", u.".$key;
  }
}
(if this block of code is already present in details.php, then u dont need doublicate it ;))



Step 11
Open includes/functions.php
Find:
Code: [Select]
 if (!empty($additional_image_fields)) {Insert above:
Code: [Select]
 if (!empty($additional_user_fields)) {
    $additional_field_array = array();
    foreach ($additional_user_fields as $key => $val) {
      if ($key != "userpic" || ($key == "userpic" && $config['userpic']))
      {
        $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }

Now you can use {userpic} in details.html template.



Step 12
This steps 12 - 13 are required if you would like show members photos in their comments.
Open details.php
Find:
Code: [Select]
$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")."Replace it with:
Code: [Select]
 $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").", u.userpic

Step 12.1
Find:
Code: [Select]
       "comment_user_ip" => $comment_user_ip,Insert below:
Code: [Select]
       "comment_userpic" => ($config['userpic'] && $comment_row[$i]['userpic']) ? ROOT_PATH."data/userpic/".$comment_row[$i]['userpic'] : "",


Step 13
Insert in templates/<your_template>/comment_bit.html (whereever u want the member's pic to be displayed. Design is your job ;))
Code: [Select]
{if comment_userpic} <img src="{comment_userpic}">{endif comment_userpic}


Step 14
In admin/users.php find:
  $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name")."
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "user_id")." IN ($user_ids)";
  $user_result = $site_db->query($sql);
  $image_ids_sql = "";
  while ($user_row = $site_db->fetch_array($user_result)) {
    $user_id = $user_row[$user_table_fields['user_id']];
    $user_name = $user_row[$user_table_fields['user_name']];

Replace with:
  $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").", userpic
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "user_id")." IN ($user_ids)";
  $user_result = $site_db->query($sql);
  $image_ids_sql = "";
  while ($user_row = $site_db->fetch_array($user_result)) {
    $user_id = $user_row[$user_table_fields['user_id']];
    $user_name = $user_row[$user_table_fields['user_name']];
    if ($user_row['userpic'] && file_exists(ROOT_PATH."data/userpic/".$user_row['userpic']) && is_file(ROOT_PATH."data/userpic/".$user_row['userpic']))
    {
      unlink(ROOT_PATH."data/userpic/".$user_row['userpic']);
    }


----- [ Addons ] -----

[/list]


----- [ Version History ] -----

1.1.3 (2011-10-23)
    - Updated step 1.1, 4 and 5

1.1.2
    - Added Step 14 that deletes user personal photos when user is deleted. (Thanks to alekinna (http://www.4homepages.de/forum/index.php?topic=6797.msg129022#msg129022))

1.1.1
    - Fixed some tags not being displayed in the edit profile (redo Step 1.2)

1.1
    - Added optional Steps 10 - 13

1.0
    - Original release
Title: Re: [MOD] Member personal photo v1.0
Post by: AntiNSA2 on March 16, 2005, 06:23:41 AM
Hows this different than the avatar mod?

And will this show the members picture by whois online right now in ACP and home html?
Title: Re: [MOD] Member personal photo v1.0
Post by: JensF on March 25, 2005, 05:53:44 PM
Hi there,

is there a way to see the Member Photo in the ACP???

I have said to my Users the Member Photo is for Member Photos and not for others.

In ACP i can check the Photos and see the User Name to Contact them.....

Can anyone change the postcard viewer plugin??? This must go, or????
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on March 26, 2005, 04:10:43 AM
mmmm...so many questions...which question is actualy THE question? and what does postcard viewer has anything to do with this mod? :?
Title: Re: [MOD] Member personal photo v1.0
Post by: JensF on March 26, 2005, 10:36:56 AM
Quote
and what does postcard viewer has anything to do with this mod?

Nothing :) But the postcard viewer do this what i want to have by the Member Photo....

They let see me which postcards where send. I want a Mod they let see me wihich Member Photo have the Member....
Title: Re: [MOD] Member personal photo v1.0
Post by: bgnm2000 on April 03, 2005, 11:42:34 PM
ok assuming this is the same mod V@no originally posted, I installed it awhile back, perfectly, got an error, in admin cp, installed again, also went smooth. The mod works. But I keep getting this error when I click admin settings. Not sure what to do, any help would be great! :D

Code: [Select]
Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/ejnash/public_html/gallery/admin/settings.php on line 123
Title: Re: [MOD] Member personal photo v1.0
Post by: bgnm2000 on April 03, 2005, 11:44:23 PM
here is the code for settings.php

Code: [Select]
REMOVED
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on April 04, 2005, 12:15:56 AM
you've asked this before, havent u?
I've already seen this problem and have no idea WHY would anyone do such thing.
u have
Code: [Select]
    echo "> ".$val."<br size="20" />";which supposed to be
Code: [Select]
    echo "> ".$val."<br />";I have no idea why people trying put some size into <br /> ....:?
Title: Re: [MOD] Member personal photo v1.0
Post by: bgnm2000 on April 04, 2005, 01:35:32 AM
I didnt edit the code. So I dont know why anyone would do it either. Anyway, thank you. It works now. You're the man.  :mrgreen:
Title: Re: [MOD] Member personal photo v1.0
Post by: ascanio on April 08, 2005, 11:43:27 PM
I am getting frustrated any of the last tow mod that I hace installed are not working :( I finish to install this on and I see this:

(http://members.cox.net/jaime/cp1.jpg)
(http://members.cox.net/jaime/cp2.jpg)

I think that it could be this $setting_group[xx] = .... i lost the count maybe
or ... I don't know can anybody help me?
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on April 09, 2005, 12:32:22 AM
and where is the image pointing to? - that's a basic troubleshooting, u should do without anyone telling u to ;) :)
Title: Re: [MOD] Member personal photo v1.0
Post by: ascanio on April 09, 2005, 12:59:20 AM
This is what i get when I copy de image direction with opera http://69.56.196.226/~ascanio/member.php?action=showprofile&user_id=470 it is not an image is a profile :S
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on April 09, 2005, 01:12:39 AM
U forgot move {if userpic_img} and {endif userpic_img} with the rest of the code u moved in member_profile.html template ;) ...
as of possible messing up in settings - does your changes for user pic setting being saved? if it does, then its not the case.
Title: Re: [MOD] Member personal photo v1.0
Post by: ascanio on April 09, 2005, 01:22:47 AM
Ok! thanks V@no u were right in this:
Quote
U forgot move {if userpic_img} and {endif userpic_img} with the rest of the code u moved in member_profile.html template
  :oops: :oops:
but I don't understand what u mean with this:
as of possible messing up in settings - does your changes for user pic setting being saved? if it does, then its not the case.
The problem is that when I slect a picture to be upload as a personal picture it doesn't do anything :S
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on April 09, 2005, 01:35:21 AM
then I have only one explanation: u missed/miss-do/made a misstake in one or more steps (probably in member.php)
Title: Re: [MOD] Member personal photo v1.0
Post by: ascanio on April 09, 2005, 02:20:26 AM
Thanks again! I would never noticed of this U forgot move {if userpic_img} and {endif userpic_img}
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on April 09, 2005, 02:26:49 AM
I would never noticed
As I was going to say in my previous reply, but changed my mind, I think now it would be a good time to say it:

before you ask a question about a mod/code (from the forum) that doesnt work for you, make sure it doesnt work with the orignal code of the mod, without self-modifying it other then instructed by the installation guide, otherwise it will bring confusion and waste people's time trying find none existing "bug" in the original code...see what I mean? ;)

P.S. by "you" I mean anyone out there, not only you personaly ;)
Title: Re: [MOD] Member personal photo v1.0
Post by: ascanio on April 09, 2005, 02:29:21 AM
yes V@no, but I thought that the problem was in other part ofthe code. I will not do this again sorry.
Title: Re: [MOD] Member personal photo v1.0
Post by: ascanio on April 09, 2005, 04:53:22 AM
Hi I'm here again :P as I asked you in MOD Avatar is there any why for the user to upload their  avartar when they register, so I ask u the same here with the personal picture when they register, you said me in the MOD Avatar that the register.php should be changed and I got with some help  becuase I don't know to much of php (I would say anthing)
Title: Re: [MOD] Member personal photo v1.0
Post by: graficalicus on April 12, 2005, 11:15:26 PM
trying to "convert" this to an easy avatar mod, with the user's image showing up wherever their user name shows up, like on what images they've uploaded & comments they've made.

I can't simply plug in the {userpic_img} tag in my templates because details.php doesn't recognize it - so I get a broken image....

What & where in details.php would I need to add something like  $config['userpic']  etc.... ?

thanks for any tips - -
Title: Re: [MOD] Member personal photo v1.0
Post by: V@no on April 13, 2005, 12:27:09 AM
What & where in details.php would I need to add something like $config['userpic'] etc.... ?
generaly, this should work:
in details.php find:
Code: [Select]
$additional_sql = "";Insert below:
Code: [Select]
if (!empty($additional_user_fields)) {
  foreach ($additional_user_fields as $key => $val) {
    $additional_sql .= ", u.".$key;
  }
}

Then in includes/functions.php find:
Code: [Select]
  if (!empty($additional_image_fields)) {Insert above:
Code: [Select]
  if (!empty($additional_image_fields)) {
    $additional_field_array = array();
    foreach ($additional_image_fields as $key => $val) {
      $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: ascanio on April 13, 2005, 01:39:22 AM
I like this idea :)
trying to "convert" this to an easy avatar mod, with the user's image showing up wherever their user name shows up, like on what images they've uploaded & comments they've made.

I can't simply plug in the {userpic_img} tag in my templates because details.php doesn't recognize it - so I get a broken image....

What & where in details.php would I need to add something like $config['userpic'] etc.... ?

thanks for any tips - -

I did those modificatiosn and I put this on comment_bit.html and it is not working

Code: [Select]
{if userpic_img}<br>
<tr>
<td class="row1"><img src="{userpic_img}" width="65" height="68"></td>
</tr>
<br>{endif userpic_img}
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: graficalicus on April 13, 2005, 03:28:06 AM
Quote
Code:
  if (!empty($additional_image_fields)) {
    $additional_field_array = array();
    foreach ($additional_image_fields as $key => $val) {
      $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }

this was already in details.php from an earlier MOD (somewhere....  :? )  so I didn't add it again.

Now I just need to tell details to look in the data/userpic folder - currently, I'm getting broken images that point to the root directory. Even hard-coding in the template "data/userpic/{userpic_img}"  doesn't do it - it's not finding which userpic to insert....  8O

it seems like
Code: [Select]
//User Pic
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic

should be somewhere in details.php or functions.php  (  :?: )

BTW, ascanio, I'm using
Code: [Select]
{if userpic_img} <img src="{userpic_img}" align="absmiddle">
{endif userpic_img}
to add the image - - that way if a user doesn't have an image yet, it won't show a broken image - - or a guest won't show a broken image (even though it DOES currently show a broken image for everyone !) 

when I add
Code: [Select]
//User Pic
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic

 somewhere in either details.php or functions.php , the broken images disappear - but so does the userpic that's SUPPOSED to be there (mine - I'm testing locally, so I can't send a link  :?)

V@no, does this make sense??  Now I'm confused..   8O

SUMMARY:  Details doesn't know where to find the userpic - how do I tell it where to look?
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: V@no on April 13, 2005, 04:23:39 AM
u can try add in functions.php above the code u've added (scroll up little bit, u'll see simular lines.
Code: [Select]
//User Pic
      "userpic_img" => ($config['userpic'] && $image_row['userpic']) ? ROOT_PATH."data/userpic/".$image_row['userpic'] : "",
//End User Pic
but without this line, u should be able use {userpic} tag in the template. (not {userpic_img} )
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: graficalicus on April 13, 2005, 03:00:32 PM
Quote
but without this line, u should be able use {userpic} tag in the template. (not {userpic_img} )
DOH!!!!   :oops:

getting closer - - - !

in functions.php, find
Code: [Select]
"user_id" => $image_row['user_id'],
    "user_name" => $user_name,

below it, add
Code: [Select]
//User Pic
      "userpic" => ($config['userpic'] && $image_row['userpic']) ? ROOT_PATH."data/userpic/".$image_row['userpic'] : "",
//End User Pic

Then you can call the tag {userpic} in details.html wherever you want it - I put it here:
Code: [Select]
  <tr>
<td valign="top" class="row1"><b>{lang_added_by}</b></td>
<td valign="top" class="row1">{user_name_link}&nbsp;&nbsp;&nbsp;&nbsp;{if userpic} <img src="{userpic}" align="absmiddle">
{endif userpic}</td>
  </tr>

Commenting is still a little quirky, though.  Adding the {userpic} tag in comment_form.html and comment_bit.html doesn't grab the commenter's userpic - instead, it repeats the same userpic from the uploader's profile  (if they have one)

So user1 uploads an image and has his userpic in the details section.  User2 also has a userpic and wants to leaave a comment - the comment box shows user1's userpic.

Not sure about the syntax, but somewhere should be
Code: [Select]
$comment_user_userpic = "";and then also
Code: [Select]
"comment_userpic" => ($config['comment_userpic']..........
Many thanks - this is getting close!   8)
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: universal on April 16, 2005, 08:32:28 AM
Can someone say what to do to solve this problem?
If registered user posts a comment he is with avatar, but after him, guest posts comment, he is with registered user avatar, that posted before him...

Help please
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: V@no on April 16, 2005, 09:11:23 AM
avatar?
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: universal on April 16, 2005, 09:28:05 AM
Sorry, avatar = personal photo ;]
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: V@no on April 16, 2005, 10:02:42 AM
and what is the code u've changed?
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: universal on April 16, 2005, 10:26:52 AM
I just don`t know how to express my self.
Just look there, at the last post and its photo http://www.pramoga.net/details.php?image_id=2522

I`ve just installed this mod, and did nothing more.
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: V@no on April 16, 2005, 04:24:52 PM
this mod does not support comments, u'll need do changes posted by graficalicus on second page.
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: universal on April 16, 2005, 07:09:51 PM
hm, but if it is possible to add a personal photo for guests, the problem (i think) will disapear.
So, is it possible? ;]
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: ascanio on April 16, 2005, 07:12:47 PM
Hi, I was looking the other day in the userp c folder the users that have upload their personal picture and I saw that the name of the pic is the same of the user id, is there any way to show a list of the profiles that have a personal pictures?

For example

Profiles with personal picture:

- user 1 --> link: http://www.yourdomain/4images/member.php?action=showprofile&user_id=1
- user 2 --> link: http://www.yourdomain/4images/member.php?action=showprofile&user_id=2
- user 3 --> link: http://www.yourdomain/4images/member.php?action=showprofile&user_id=3

It would something like the MOD that shows the Last users online. if u have any idea of what files i have to changes or any idea of what i should do or u know how to doit please tell me it is really important for me
Title: Re: [MOD] Member personal photo v1.0 by V@no
Post by: universal on April 18, 2005, 08:29:20 AM
I still don`t get it...
Look at comments: http://www.pramoga.net/details.php?image_id=2522
Picture is supported perfectly, but one problem guests overtakes photo of previuos registered member.
Any suggestions how to add a photo to guest?

this mod does not support comments, u'll need do changes posted by graficalicus on second page.
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 18, 2005, 09:36:48 AM
I've added Step 10 - 13
try and see if it works. (I didnt not test those changes :oops:)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: universal on April 18, 2005, 10:16:00 AM
great!! it works. thanks ;]
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: universal on April 18, 2005, 10:26:48 AM
by the way, can I somehow show picture in the header? My login box is in the header...
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: graficalicus on April 21, 2005, 02:56:33 PM
you *should* be able to use {userpic} in the header, wherever you want it - - - try it and see (didn't test it either  :oops:)

Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: universal on April 21, 2005, 02:59:42 PM
I tried, no luck ;]
cant get id of image I think, because link to img not finished. .../
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: graficalicus on April 21, 2005, 03:10:55 PM
Quote
cant get id of image I think, because link to img not finished. .../
what is it looking for?  what path?  You may be able to use {userpic_img} instead, as in member_profile.html


Quote
Step 12
This steps 12 - 13 are required if you would like show members photos in their comments.
Open details.php
Find:
Code:
$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").

"Replace it with:
Code:
  $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").", u.userpic

V@no -  I've added the "paging in comments" MOD previously, so the above sql statement is commented out in my details.php.  Instead, I have
Code: [Select]
$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."
gonna try in a bit to see if they work as well (I need to go through the code & see what it's looking for... 8O)

Thanks for the cool addition!
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: universal on April 21, 2005, 03:16:06 PM
what i get
Code: [Select]
<img src="./data/userpic/" border=0>
I`m using it in user_logininfo.html
And user_logininfo.html is in header like that > {user_box}
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: graficalicus on April 21, 2005, 03:44:33 PM
OK - here's what I did (and it works great!)

for the sql statement I mentioned above - the one previously altered with the "paging in comments" MOD - I simply added
Code: [Select]
u.userpicimmediately after
Code: [Select]
c.comment_ip,so it now looks like this
Code: [Select]
$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, u.userpic, 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."

basically, the only thing added to the sql statement is the "u.userpic, " part - which can be added anywhere inside that blurb. MAKE SURE YOU MATCH THE "," SEQUENCE ALREADY PRESENT. If you manage that, you're good to go.

for use in header.html, I'll mess with it - - unless someone else jumps in first.

many thanks again - this is easier (I think, anyway) to implement than the avatar MOD - and works just as well.
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 21, 2005, 10:51:45 PM
Hi, it was really cool that modification V@no! I really like it. I have a question about it, like in the MOD where you can select the sex of the user, and when you installed it you need to put all the user by default male writing some comands on phpmyadmin is there any way to put this images by default to the users that don't have personal picture?

(http://members.cox.net/jaime/noimage.jpg)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 22, 2005, 03:46:33 AM
ascanio, yes, u can...the easiest and the fastest way without modifying any code is add path to that image into each member's profile, who doesnt have any personal photo.
Did I just hear someone said "Are you out of your mind? You call that the fastest way???"
Well, it is, through your favorite mysql manager (phpmyadmin) ;)
Here is the mysql query that u need execute
Quote
UPDATE 4images_users SET userpic = 'noimage.png' WHERE userpic = '';
ALTER TABLE 4images_users CHANGE userpic userpic VARCHAR( 255 ) DEFAULT 'noimage.png' NOT NULL
it will use  data/userpic/noimage.png image (u can name it whatever u want, just update the name in the mysql query).

P.S. the second line is changing the structure of the userpic field, so u dont have to run this query for each new member on your site ;)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 22, 2005, 03:56:46 AM
so if i run that query it will no replace the pics of the users that have personal photo rigth? just the ones that don't ?
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 22, 2005, 04:00:50 AM
yes, its filtered by WHERE userpic = '' ;)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 22, 2005, 04:05:47 AM
 It worked perfect!!! this is really cool now the profiles look nicer all of them with a pictures and in the comments i can see also the no image pic thanks V@no :) I think that this mod now its like the avatar one
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 22, 2005, 04:13:44 AM
yes, you are right, but the original idea of this mod was to show member's personal photos in their profile only, and avatar is for comments ;)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 22, 2005, 04:22:11 AM
Some time ago I asked this but nobody responded it. V@no can u just say me what is required to make this modification
Hi I'm here again :P as I asked you in MOD Avatar is there any why for the user to upload their avartar when they register, so I ask u the same here with the personal picture when they register, you said me in the MOD Avatar that the register.php should be changed and I got with some help becuase I don't know to much of php (I would say anthing)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 22, 2005, 04:39:47 AM
maybe u could try use the same code from Step 1.1 ?
in register.php find:
Code: [Select]
  if (isset($HTTP_POST_VARS['user_name'])) {Scroll down untill u find
Code: [Select]
    if (!empty($additional_user_fields)) {Above that line insert:
Code: [Select]
    if (!$error)
    {
      <code from Step 1.1 goes here>
    }

Obviosly u'll need udjust register_form.html template as well...
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 22, 2005, 09:03:19 PM
Thanks that worked
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 23, 2005, 12:38:04 AM
It did? that's good to hear :D
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: universal on April 23, 2005, 01:29:49 PM
I thought, maybe there is possible to do a thing like, random member photo in index.php?

Something like:

User name
[ photo ]
PM to this member!

And something like link to user photos:
Show me more user photos!

Will be great if this was possible :) So is it? I think something like memberlist.php
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 23, 2005, 06:12:57 PM
Yeah!!! i thought something like you but nobody awnser my question :? maybe it is dificult, i know that for me is imposible lol

Hi, I was looking the other day in the userp c folder the users that have upload their personal picture and I saw that the name of the pic is the same of the user id, is there any way to show a list of the profiles that have a personal pictures?

For example

Profiles with personal picture:

- user 1 --> link: http://www.yourdomain/4images/member.php?action=showprofile&user_id=1
- user 2 --> link: http://www.yourdomain/4images/member.php?action=showprofile&user_id=2
- user 3 --> link: http://www.yourdomain/4images/member.php?action=showprofile&user_id=3

It would something like the MOD that shows the Last users online. if u have any idea of what files i have to changes or any idea of what i should do or u know how to doit please tell me it is really important for me
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 26, 2005, 08:17:59 PM
ascanio, yes, u can...the easiest and the fastest way without modifying any code is add path to that image into each member's profile, who doesnt have any personal photo.
Did I just hear someone said "Are you out of your mind? You call that the fastest way???"
Well, it is, through your favorite mysql manager (phpmyadmin) ;)
Here is the mysql query that u need execute
Quote
UPDATE 4images_users SET userpic = 'noimage.png' WHERE userpic = '';
ALTER TABLE 4images_users CHANGE userpic userpic VARCHAR( 255 ) DEFAULT 'noimage.png' NOT NULL
it will use  data/userpic/noimage.png image (u can name it whatever u want, just update the name in the mysql query).

P.S. the second line is changing the structure of the userpic field, so u dont have to run this query for each new member on your site ;)

Hi V@no I think that the users can delete this picture cuz each day is not in the folder and i have to upload over and over again ... how can I prevent that?
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 27, 2005, 12:28:32 AM
oh, crap! you are right, I didnt think about that...:oops:
well, ok, first, restore the database with this query:
Code: [Select]
UPDATE 4images_users SET userpic = '' WHERE userpic = 'noimage.png';
ALTER TABLE 4images_users CHANGE userpic userpic VARCHAR( 255 ) DEFAULT '' NOT NULL

Then in member.php find:
Code: [Select]
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "", Replace it with:
Code: [Select]
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : ROOT_PATH."data/userpic/noimage.png",
Then find:
Code: [Select]
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",Replace it with:
Code: [Select]
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : ROOT_PATH."data/userpic/noimage.png",Place your noimage.png image into data/userpic/ folder.
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 27, 2005, 12:41:57 AM
thanks V@no :) I hope not to upload that pic again :P
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 27, 2005, 12:58:42 AM
thanks V@no :) I hope not to upload that pic again :P
how many times did u say "WTF?????" and cursing while uploading again that image? ;) :)
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: ascanio on April 27, 2005, 01:06:08 AM
I upload that pic like 15 times lol
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: TIMT on April 28, 2005, 12:48:48 PM
Hi everybody

The tags {userpic_max_size}, {userpic_max_width} and {userpic_max_height} are not interpreted on my homepage.
That means, there is no value displayed.

Thats the code in my main.php

Code: [Select]
$lang['userpic_upload'] = "Maximum Filegrösse: {userpic_max_size}.<br />Bilder grösser {userpic_max_width}x{userpic_max_height} werden in der Grösse angepasst";
What did I wrong?

Please let me now, if you need more informations.
Thank you for helping me.

Serge
Title: Re: [MOD] Member personal photo v1.1 by V@no
Post by: V@no on April 28, 2005, 02:38:22 PM
try redo Step 1.2
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TIMT on April 28, 2005, 06:05:01 PM
When I delete the following code (regarding point 1.2), all the information about the user pic isn't displayed anymore on the memberprofile.

Code: [Select]
//User Pic
    "userpic_allowed" => $config['userpic'],
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
    "lang_userpic_del" => $lang['userpic_del'],
    "lang_userpic_upload" => preg_replace("/".$site_template->start."userpic_max_size".$site_template->end."/siU", $config['userpic_size']."&nbsp;".$lang['kb'], preg_replace("/".$site_template->start."userpic_max_width".$site_template->end."/siU", $config['userpic_width'], preg_replace("/".$site_template->start."userpic_max_height".$site_template->end."/siU", $config['userpic_height'], $lang['userpic_upload']))),
    "userpic_max_width" => $config['userpic_width'],
    "userpic_max_height" => $config['userpic_height'],
    "userpic_max_size" => $config['userpic_size']."&nbsp;".$lang['kb'],
//End User Pic

But I have entered the values fix in main.php (hardcoded), instead of the variables. That is ok for me.

Thank's anyway
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 29, 2005, 12:19:59 AM
the only line was changed is the "lang_userpic_upload" => ...
what if u try use this line instead:
Code: [Select]
    "lang_userpic_upload" => str_replace("{userpic_max_size}", $config['userpic_size']."&nbsp;".$lang['kb'], str_replace("{userpic_max_width}", $config['userpic_width'], str_replace("{userpic_max_height}", $config['userpic_height'], $lang['userpic_upload']))),
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 29, 2005, 04:19:10 AM
I V@no how can i allow the usersjust to upload .jpg images only as a member personal picture? i think that there is some problem renaming the gif files they get a name like -1.gif
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 29, 2005, 04:24:37 AM
what renaming problem?

the allowed extensions are set in member.php:
Code: [Select]
      $mime_types = array(
        "image/jpeg",
        "image/pjpeg",
        "image/gif",
        "image/x-png"
      );
      $extensions = array(
        "jpg",
        "jpeg",
        "gif",
        "png"
make sure that mime type is sinchronized with the extensions.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 29, 2005, 04:26:47 AM

I don't know I look in the userpic folder and I saw a gif called -1.gif and  jpg -1.jpeg :S
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 29, 2005, 04:48:34 AM
thats not supposed to happend...
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 29, 2005, 04:50:19 AM
i know lol that's why i'm telling you :P
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 29, 2005, 05:45:37 AM
Hi V@no How can I insert the User personal picture here to see on the list?

Code: [Select]
$sql = "SELECT user_t_images, user_name, user_id FROM ".USERS_TABLE."
WHERE user_level >= '".USER."'
ORDER BY user_t_images DESC
LIMIT 100";
$result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
$last_action_user_list .= '<img border="0" src="http://69.56.196.226/~ascanio/templates/revolution/images/flecha.gif" width="13" height="10">&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span><br>';
}

$site_template->register_vars(array(
"user_top_uploaders" => $last_action_user_list,
));
unset($user_top_uploaders);
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 30, 2005, 02:44:32 AM
Ok I have try by myself and I almost got it!  :lol: :lol: :lol: but it just show the pics with jpg pictures  :( :( how can I do it to show all the formats?

what i did was this :

I change this:
Code: [Select]
$last_action_user_list .= '<img border="0" src="http://69.56.196.226/~ascanio/templates/revolution/images/flecha.gif" width="13" height="10">&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span><br>';
For this:

Code: [Select]
$last_action_user_list .= '<table border="0" width="100%" id="table1"><tr><td><img src="'.ROOT_PATH.'/data/userpic/'.$row['user_id'].'.jpg" width="37" height="39">&nbsp;&nbsp;<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span></td></tr></table><br>';
I would like to show the users in a table like in the V@no site, in the top members section

I need help please
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 30, 2005, 03:09:39 AM
u need get the userpic value from database for each member.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 30, 2005, 03:20:08 AM
u need get the userpic value from database for each member.
to do what? to get all the images formats? I allready see the members pictures but just the jpg ones
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 30, 2005, 04:02:50 AM
u need get the userpic value from database for each member. :roll:

in userpic field stores the name of the image and that's what u need.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 30, 2005, 04:27:53 AM
V@no the name of the image is the same name of the id of the user so what i did was this:
Code: [Select]
<img src="'.ROOT_PATH.'/data/userpic/'.$row['user_id'].'.jpg" width="37" height="39">and it work but just for jpg files
so i wonder if there are nay way to pchange this part
Code: [Select]
.'.jpg" and work for the other formats
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 30, 2005, 04:36:42 AM
oh boy...we are talking about same thing but about different thing...kinda none-sence, dont u think? ;) :)
I'm telling u, the image name with it's extension is saved in userpic field for each member. Yes, I know the name of the picture is the same as member id, but the extension may varay, that's why u need get the filename from the userpic field.
just add userpic in the field list in the database query, then u'll be able use $row['userpic'] variable.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 30, 2005, 04:47:05 AM
Thanks V@no but how should i use this $row['userpic']

Like this?

Code: [Select]
<img src="'.ROOT_PATH.'/data/userpic/'.$row['userpic'].'." width="37" height="39">
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 30, 2005, 04:48:29 AM
yes, close ;)
Code: [Select]
<img src="'.ROOT_PATH.'/data/userpic/'.$row['userpic'].'" width="37" height="39">(no dot at the end ;))
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 30, 2005, 05:16:53 AM
Close... heheh thanks again but the noimage.png does not show up :S for the users that not have pictures just load this
http://69.56.196.226/~ascanio/data/userpic/ I thougt that the noimage pic was associated with all the users that did not have picture
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on April 30, 2005, 05:23:07 AM
alrighty then:
Code: [Select]
<img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "noimage.png" : $row['userpic']).'" width="37" height="39">
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on April 30, 2005, 05:40:24 AM
Thanks that what i wanted :)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on May 03, 2005, 05:30:45 AM
hi V@no I having a weird problem, i think it is related with the modification that i did that allows the user to upload a picture when they register, the pictures are getting mixed, yesterday a user told me that his personal picture have  changed. :S and some others user told me the same, so do u have any idea of what is happening?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on May 03, 2005, 06:39:21 AM
hmmmm....actualy where and how do u get a user_id of a new registered user? That id is needed to save mpp.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on May 03, 2005, 07:19:13 AM
hmmmm....actualy where and how do u get a user_id of a new registered user? That id is needed to save mpp.
sorry V@no i don'tunderstand your question waht do u mean with where and how i get a user_id?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ascanio on May 03, 2005, 08:06:06 PM
ok I see the problem ... the modification that i did when ppl register has something wrong cuz the name of the pic that it get when a user regiter and upload a pic is -1.jpg and somehow it gets mixed up with other profiles :S
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Kauterbak on August 05, 2005, 01:12:59 PM
Help! Bitte - please
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on August 05, 2005, 02:32:44 PM
bug fixes
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: wiitanen on August 06, 2005, 06:48:10 AM
bug fixes

I have been looking through your bug fixes and cannot seem to locate that error either. ({if userpic_img} MISSING IMAGE {enduf userpic_img}

What do I need to do to get this problem resolved? I seem to have the exact same error. When trying to upload, it appears to be saving, but in fact nothing gets uploaded and the ..data/userpic/ is empty. userpic[chmod 777] ok.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: eshpro on August 10, 2005, 01:11:16 AM
Help! Bitte - please


i have same error.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: wiitanen on August 11, 2005, 10:32:33 PM
Help! Bitte - please

ANYONE here who can explain what needs to be done to get rid of this error message?

I am not able to upload the images either to userprofiles (unless first uploaded to the image file via i.e. ftp and specify the path to the image, no image will show... just the little red X)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Remplois on August 18, 2005, 05:34:30 AM
Great MOD so far  :mrgreen:

Although has anyone tried signing out of there admin account and tried viewing the comments? I find that none of the pictures appear. Ive tried refreshing but same prob, dont understand why?!

Ive followed all the steps, and gone through all the pages of other people problems just havent come accross this problem yet.

Thanks.

btw www.remplois.com/gallery

User: Test
Pass: test

if you could thanks.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Remplois on August 18, 2005, 05:43:48 AM
fixed it. Sorry, school boy error.  :lol:

but im still getting problems with guest image on the comments (Guests image & people without images get an "X"). works perfect for profile and profile edit. Is there a fix for this that i missed? ive tried nearly all the pieces of code suggested in this thread, and tried my own. stuck  :oops:

thanks in advance.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Flo2005 on August 19, 2005, 01:01:51 PM
Use this little trick but note, when you do this you can´t disabled the user photo in the controlpanel

Edit your member_editprofile.html

Quote
remove{if userpic_allowed}
          <tr>
            <td class="row1" valign="top"><b>{lang_userpic}</b>
              <SPAN class="smalltext">
                <br />
                <B>{lang_userpic_upload}</B>
              </SPAN>
            </td>
            <td class="row1">
              <INPUT type="file" name="userpic_file"  size="30" class="input" /><br />
              {if userpic_img}<img src="{userpic_img}"><br /><input type="checkbox" name="userpic_del" value="1">&nbsp;{lang_userpic_del}{endif userpic_img}
            </TD>
          </TR>
remove{endif userpic_allowed}[/quote]

Now you only get a photo, if the user has upload this  :wink:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: beseech on August 30, 2005, 03:55:40 PM
but this do the same of avatar mod, i'm right ???
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: martrix on August 30, 2005, 04:49:32 PM
Yes and no ;)

The avatar mod lets the user upload/set a small avatar which is being shown on many places of the page.
This mod lets the user upload a bigger image than the avatar to be shown only in the user-profile and not next to each comment etc.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: beseech on September 11, 2005, 05:09:11 PM
i want show this on PMS , how can i do this ?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: universal on September 13, 2005, 08:39:15 AM
Is it possible to choose is it males or is it females photo? Something like radio button to select.
And if no photo set, I want to show m.jpg if Male radio checked, f.jpg if Female radio checked.
Is it hard to do?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: martrix on September 13, 2005, 10:07:55 AM
it is not exactly what you're asking for...
but maybe it will help you: User GIS (http://www.4homepages.de/forum/index.php?topic=6000.msg26038#msg26038)



Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: universal on September 13, 2005, 11:03:18 AM
yes, thanks, but I want to use it with this mod, and if no picture is set, show big 200x300 females or males border.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: martrix on September 13, 2005, 11:09:38 AM
well - with that mod implemented you will have the information about the gender...
the rest you have to do is to check if a personal photo is set and if not, than just show an image according to the users gender...
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: universal on September 13, 2005, 11:12:34 AM
thanks for showing me the way  :!: ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: beseech on September 16, 2005, 08:43:45 PM
but if this can be used on comments , maybe the method for show on PM's will be similar....i think ... ?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: universal on September 24, 2005, 09:18:29 AM
Is it possible to add more than one photo?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: renz312 on October 03, 2005, 05:45:07 AM
@ V@no
Where to edit if i want the size of this personal photo to 50x50pixel when upload?i mean auto resize when upload?


sorry for my poor english :|
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on October 03, 2005, 05:58:07 AM
In the settings.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: renz312 on October 03, 2005, 01:39:31 PM
thanks v@no...amazing mod... :D
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: eZz on October 07, 2005, 10:42:48 PM
i have litle prob.

 i cant see usr img in comments or in image detailds :(

all my files what I editing is located here:

http://ez.pri.ee/personal_photo/
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: beseech on October 08, 2005, 04:44:28 PM
i've a lil problem..it's all works fine, but it's about default pic..."noimage.png" this works, but when some new user upload your own image, the image disapear.......

O_o any ideia ?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: beseech on October 13, 2005, 06:40:51 PM
another question ...

it's possible make the pic show in another pages ? (without be details.php) ...
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Nasser on October 20, 2005, 11:52:59 AM
I followed the steps .. all of them ..
but the personal photo didn't show up !!
can any one help ?

http://www.emarati.net/gallery
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Nasser on October 24, 2005, 10:46:05 PM
can't anyone help me .. please ?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Flo2005 on October 24, 2005, 10:52:08 PM
Is it possible to view your site in english? :?

Does the upload work? -> Have you done CHMOD777 for the userpic folder ?

Cya by Flo2005

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on October 25, 2005, 12:28:37 AM
I followed the steps .. all of them ..
but the personal photo didn't show up !!
can any one help ?

http://www.emarati.net/gallery

There is not enough details of the problem. Please be more describtive and show the link to page where it doesnt show. If its in control panel, then create a test acount and post login info here.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: aLey on October 25, 2005, 05:18:36 PM
Parse error: parse error, unexpected T_DOUBLE_ARROW in [...]member.php on line 1338 

what to do??

line 1338 is: "userpic_allowed" => $config['userpic'],
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on October 26, 2005, 12:20:19 AM
2 lines above and below this line please.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Nasser on October 27, 2005, 11:14:23 AM
I followed the steps .. all of them ..
but the personal photo didn't show up !!
can any one help ?

http://www.emarati.net/gallery

There is not enough details of the problem. Please be more describtive and show the link to page where it doesnt show. If its in control panel, then create a test acount and post login info here.
the problem is that my site is in arabic language . . I added a personal photo to my account as a user and asked an other user to do so to check if our personal pictures will be there after doing all steps here . .
but no results .. acept in member edit information page .. the is the uploading part for the personal photo
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: renicolay on November 05, 2005, 08:41:03 PM
Hello,
I've successfully added this MOD and it's GREAT! Here is my challenge.  I would like the member photo to be displayed on the postcards they send.  I know one person has asked before, but I don't see a response.  When I added:
    
"userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",

to the functions page it allows me to use the {userpic_img} tag, but once sent the picture link is broken.  Does it have to do with the current session ending? Most importantly, how can I make the member photo avaliable on postcard_send.html? Does anyone know?

Thanks,
Reggie
 :lol:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: renicolay on November 08, 2005, 05:20:33 AM
Regarding my qiestion above, I'm guessing that I need to store the userpic in the postcards table if I want it to be avaliable for others to see. Can anyone confirm? Is this difficult? Any help would be appreciated. 

Thanks!

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jako on November 09, 2005, 07:46:50 PM
i installed this mod but now it looks like this

http://partymetropole.de/jako/profile1.jpg

i don´t why
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on November 10, 2005, 12:00:41 AM
bug fix:
http://www.4homepages.de/forum/index.php?topic=7493.0
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: renicolay on November 10, 2005, 04:14:35 PM
Thanks V@no! I'll try this bug fix.

Reggie
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jako on November 10, 2005, 05:00:52 PM
thanks now it works
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on December 06, 2005, 05:01:15 PM
why each time a new user upload a mpp (personal photo) this delete the default pic (noimage.png) from ..data/userpic ??? how stop it !?

 :?:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 07, 2005, 01:06:27 AM
why each time a new user upload a mpp (personal photo) this delete the default pic (noimage.png) from ..data/userpic ??? how stop it !?

 :?:
There is no such feature in the original mod. If you are refering to some addon to this mod, please be kind and provide a link to the post. Otherwise dont expect much of the support ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on December 07, 2005, 01:39:48 AM
i've get a query for mysql  here posted ;)

http://www.4homepages.de/forum/index.php?topic=6797.msg34005#msg34005

Posted by you  8)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 07, 2005, 01:55:07 AM
Posted by you 8)
Sorry, I'm not google with unlimited memory resources :lol:


Anyways, try this. In member.php find:
Code: [Select]
if ($user_info['userpic'] != $userpic_name && file_exists($userpics_dir.$user_info['userpic']))Replace with:
Code: [Select]
if ($user_info['userpic'] != "noimage.png" && $user_info['userpic'] != $userpic_name && file_exists($userpics_dir.$user_info['userpic']))
If it works, I'll update the topic u refered to ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Toso on December 07, 2005, 04:10:51 PM
My problem is that members cannot delete their picture to upload an new one.  :cry:
Is it possible to overwrite a picture without deleting?  :?:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Toso on December 07, 2005, 09:32:51 PM
My problem is that members cannot delete their picture to upload an new one.  :cry:
Is it possible to overwrite a picture without deleting?  :?:


I solve my probs.  :wink:  :mrgreen:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 10, 2005, 11:00:48 AM
Iam show user pic on detail.html

When i go member list and show member pictures added
and i click on picture for detail this picture (link - details.php?image_id=44&mode=search ), i have this message

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, i.user_id FROM 4images_images i LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND user_id IN (2) AND i.cat_id IN (0, 29, 24, 21, 35, 32, 30, 22, 25, 33, 34, 26, 31, 23, 37, 27, 38, 28, 39, 36, 40, 41, 42, 43, 44, 45) ORDER BY image_date ASC
Column 'user_id' in where clause is ambiguous

Я отображаю фото юзера при детализации его картинки. Когда я захожу в список пользователей и осуществляю поиск катринок добавленных этим пользователем, при детализации катринки получаю выше описанное сообщение.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 10, 2005, 11:24:45 AM
search keywords: "mysql 5" (with qoutes)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Nasser on December 10, 2005, 01:56:17 PM
I installed this MOD ..
but nothing changed ..
and when I upload a picture
nothing uploaded

?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 10, 2005, 04:54:43 PM
I have installed MySQL 4.1.8-max, not MySQL 5.0?????
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 10, 2005, 07:32:22 PM
I have installed MySQL 4.1.8-max, not MySQL 5.0?????
oh, wait...what about integrations? maybe phpbb integration?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 10, 2005, 11:36:29 PM
Not installed. I basically use your mod. Many thanks for them. Iam install (auto resize when upload, member list)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 10, 2005, 11:44:30 PM
When i go member list and show member pictures added
and i click on picture for detail this picture (link - details.php?image_id=44&mode=search ), i have this message
What memberlist?
This mod has no support for memberlist. If you are talking about some 'custom' code that would integrate two mods, then perphaps you should atleast mention that AND provide a link to the thread where you took the code.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: brunorosa on December 11, 2005, 03:04:20 AM
How can i let the other users see my personal picture on my member details? (my profile)... i'm the only one that can see my own photo.. i want the other users to see my foto aswell
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 11, 2005, 03:10:58 AM
i'm the only one that can see my own photo.. i want the other users to see my foto aswell
then you did something wrong (probably in member.php
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 12, 2005, 07:44:43 AM
by V@no. Sorry! But,  I have taken member list MOD from your site http: // gallery.vano.org/ru/files? sessionid=e2aab003c9f0145a56bb89492653f773 (Members list v1.7)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 12, 2005, 07:53:37 AM
by V@no. Sorry! But, I have taken member list MOD from your site http: // gallery.vano.org/ru/files? sessionid=e2aab003c9f0145a56bb89492653f773 (Members list v1.7)

Even though you took it from my site, these mods do not support each other without extra codding. If you did that extra codding on your own, then how would I or anyone else possible know how you did it, and where the misstake possibly could be? (see my point?)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 12, 2005, 08:28:58 AM
Thanks V@no. Can be it is necessary was look at first  [Mod] Memberlist / Mitgliederliste> for/fur v 1.7.
My mistake. Thanks
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 12, 2005, 12:35:25 PM
V@no, sorry me again. But my problem not in MOD Member list,because iam not show member person foto in member list, that she is in a code details.php mainly when work action (search).
Because when i  click on link  "advansed search" and find added pictures any member, and when i click on any pictures iam have
the same error:

DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, i.user_id FROM 4images_images i LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND user_id IN (2) AND i.cat_id IN (0, 29, 24, 21, 35, 32, 30, 22, 25, 33, 34, 26, 31, 23, 37, 27, 38, 28, 39, 36, 40, 41, 42, 43, 44, 45) ORDER BY image_date ASC
Column 'user_id' in where clause is ambiguous


If you look on my link browser (details.php?image_id=44&mode=search).  This mode=search.
I think my error in code (details.php) where work (mode=search).

The error, where  in a red code I think!  Help me please!
This my details.php code:   



<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: details.php                                          *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) fьr weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

if (isset($HTTP_GET_VARS['big']) || isset($HTTP_POST_VARS['big'])) {
$templates_used = 'big,header';
$main_template = 'big';
}else{
$templates_used = 'details,header';
$main_template = 'details';
}

define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');

if (!$image_id) {
  header("Location: ".$site_sess->url($url, "&"));
  exit;
}

$additional_sql = "";
//User pic mod
if (!empty($additional_user_fields)) {
  foreach ($additional_user_fields as $key => $val) {
    $additional_sql .= ", u.".$key;
  }

//User pic mod
}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").get_user_table_field(", u.", "user_email")."
        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;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;

if (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !$image_row) {
  header("Location: ".$site_sess->url($url, "&"));
  exit;
}

$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars("random_cat_image", $random_cat_image);
unset($random_cat_image);

//-----------------------------------------------------
//--- Show Categories 2------full----------------------
//-----------------------------------------------------
$categories2 = get_categories2(0);
if (!$categories2)  {
  $categories2 = $lang['no_categories'];
}
$site_template->register_vars("categories2", $categories2);
unset($categories2);


//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = htmlspecialchars($image_row['image_name']);
show_image($image_row, $mode, 0, 1);

$in_mode = 0;

$sql = "";
if ($mode == "lightbox") {
 if (!empty($user_info['lightbox_image_ids'])) {
   $image_id_sql = str_replace(" ", ", ", trim($user_info['lightbox_image_ids']));
   $sql = "SELECT i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, i.user_id
           FROM ".IMAGES_TABLE." i
           LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
           WHERE i.image_active = 1 AND i.image_id IN ($image_id_sql) AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
           ORDER BY ".$config['image_order']." ".$config['image_sort'];
   $in_mode = 1;
 }
}

elseif ($mode == "search") {
  if (!isset($session_info['searchid']) || empty($session_info['searchid'])) {
    $session_info['search_id'] = $site_sess->get_session_var("search_id");
  }

  if (!empty($session_info['search_id'])) {
    $search_id = unserialize($session_info['search_id']);
  }

  $sql_where_query = "";

  if (!empty($search_id['image_ids'])) {
    $sql_where_query .= "AND image_id IN (".$search_id['image_ids'].") ";
  }

  if (!empty($search_id['user_ids'])) {
    $sql_where_query .= "AND user_id IN (".$search_id['user_ids'].") ";
  }

  if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    $sql_where_query .= "AND image_date >= $new_cutoff ";
  }

  if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
    $cat_id_sql = 0;
    $sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
    if (check_permission("auth_viewcat", $search_id['search_cat'])) {
      $cat_id_sql .= ", ".$search_id['search_cat'];
      if (!empty($sub_cat_ids[$search_id['search_cat']])) {
        foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
          if (check_permission("auth_viewcat", $val)) {
            $cat_id_sql .= ", ".$val;
          }
        }
      }
    }
  }
else {
   $cat_id_sql = get_auth_cat_sql("auth_viewcat");
 }

 if (!empty($sql_where_query)) {
 
   $sql = "SELECT i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, i.user_id
           FROM ".IMAGES_TABLE." i
           LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
           WHERE i.image_active = 1
           $sql_where_query
           AND i.cat_id IN ($cat_id_sql)
           ORDER BY ".$config['image_order']." ".$config['image_sort'];
   $in_mode = 1;
 }
}
if (!$in_mode || empty($sql)) {
 $sql = "SELECT i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, i.user_id
         FROM ".IMAGES_TABLE." i
         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
         ORDER BY ".$config['image_order']." ".$config['image_sort'];
}$result = $site_db->query($sql);

$image_id_cache = array();
$next_prev_cache = array();
$break = 0;
$prev_id = 0;
while($row = $site_db->fetch_array($result)) {
  $image_id_cache[] = $row['image_id'];
  $next_prev_cache[$row['image_id']] = $row;
  if ($break) {
    break;
  }
  if ($prev_id == $image_id) {
    $break = 1;
  }
  $prev_id = $row['image_id'];
}
$site_db->free_result();

if (!function_exists("array_search")) {
  function array_search($needle, $haystack) {
    $match = false;
    foreach ($haystack as $key => $value) {
      if ($value == $needle) {
        $match = $key;
      }
    }
    return $match;
  }
}

$act_key = array_search($image_id, $image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
unset($image_id_cache);

// Get next and previous image
if (!empty($next_prev_cache[$next_image_id])) {
  $next_image_name = htmlspecialchars($next_prev_cache[$next_image_id]['image_name']);
  $next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_image_file = ICON_PATH."/404.gif";
  }
  else {
    $next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    $next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    $next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  $next_image_name = REPLACE_EMPTY;
  $next_image_url = REPLACE_EMPTY;
  $next_image_file = REPLACE_EMPTY;
  $next_thumb_file = REPLACE_EMPTY;
}

if (!empty($next_prev_cache[$prev_image_id])) {
  $prev_image_name = htmlspecialchars($next_prev_cache[$prev_image_id]['image_name']);
  $prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    $prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    $prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    $prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  $prev_image_name = REPLACE_EMPTY;
  $prev_image_url = REPLACE_EMPTY;
  $prev_image_file = REPLACE_EMPTY;
  $prev_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
  "next_image_id" => $next_image_id,
  "next_image_name" => $next_image_name,
  "next_image_url" => $next_image_url,
  "next_image_file" => $next_image_file,
  "next_thumb_file" => $next_thumb_file,
  "prev_image_id" => $prev_image_id,
  "prev_image_name" => $prev_image_name,
  "prev_image_url" => $prev_image_url,
  "prev_image_file" => $prev_image_file,
  "prev_thumb_file" => $prev_thumb_file
));
unset($next_prev_cache);

//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  $id = intval($HTTP_POST_VARS[URL_ID]);
  $sql = "SELECT cat_id, image_allow_comments
          FROM ".IMAGES_TABLE."
          WHERE image_id = $id";
  $row = $site_db->query_firstrow($sql);

  if ($row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
    $msg = $lang['comments_deactivated'];
  }
  else {
    $user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    $comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

    // Flood Check
    $sql = "SELECT comment_ip, comment_date
            FROM ".COMMENTS_TABLE."
            WHERE image_id = $id
            ORDER BY comment_date DESC
            LIMIT 1";
    $spam_row = $site_db->query_firstrow($sql);
    $spamtime = $spam_row['comment_date'] + 180;

    if ($session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
      $error = 1;
    }

    $user_name_field = get_user_table_field("", "user_name");
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
    if ($user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    }
    if ($comment_headline == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
      $error = 1;
    }
    if ($comment_text == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
      $error = 1;
    }

    if (!$error)  {
      $sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
    }
  }
  unset($row);
  unset($spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if ($image_allow_comments == 1) {
  $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")."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date 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 = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    $comments = "";
    $bgcounter = 0;
    for ($i = 0; $i < $num_comments; $i++) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

      $comment_user_email = "";
      $comment_user_email_save = "";
      $comment_user_mailform_link = "";
      $comment_user_email_button = "";
      $comment_user_homepage_button = "";
      $comment_user_icq_button = "";
      $comment_user_profile_button = "";
      $comment_user_status_img = REPLACE_EMPTY;
      $comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
      $comment_user_info = $lang['userlevel_guest'];

      $comment_user_id = $comment_row[$i]['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_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_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";

        $comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";

        $comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
        if (!empty($comment_user_homepage)) {
          $comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }

        $comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? $comment_row[$i][$user_table_fields['user_icq']] : "";
        if (!empty($comment_user_icq)) {
          $comment_user_icq_button = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://web.icq.com/whitepages/online?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }

        if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          $comment_user_email = $comment_row[$i][$user_table_fields['user_email']];
          $comment_user_email_save = str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]);
          if (!empty($url_mailform)) {
            $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
          }
          else {
            $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }

        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'];
        }

        $comment_user_info .= "<br />";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $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=\"_blank\">".$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=\"_blank\">".$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>";
      }

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_profile_button" => $comment_user_profile_button,
        "comment_user_email" => $comment_user_email,
        "comment_user_email_save" => $comment_user_email_save,
        "comment_user_mailform_link" => $comment_user_mailform_link,
        "comment_user_email_button" => $comment_user_email_button,
        "comment_user_homepage_button" => $comment_user_homepage_button,
        "comment_user_icq_button" => $comment_user_icq_button,
        "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("comment_bit");
    } // end while
  } //end else
  $site_template->register_vars("comments", $comments);
  unset($comments);

  //-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  $allow_posting = check_permission("auth_postcomment", $cat_id);
  $bbcode = "";
  if ($config['bb_comments'] == 1 && $allow_posting) {
    $site_template->register_vars(array(
      "lang_bbcode" => $lang['bbcode'],
      "lang_tag_prompt" => $lang['tag_prompt'],
      "lang_link_text_prompt" => $lang['link_text_prompt'],
      "lang_link_url_prompt" => $lang['link_url_prompt'],
      "lang_link_email_prompt" => $lang['link_email_prompt'],
      "lang_list_type_prompt" => $lang['list_type_prompt'],
      "lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    $bbcode = $site_template->parse_template("bbcode");
  }

  if (!$allow_posting) {
    $comment_form = "";
  }
  else {
    $user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['user_name']))) : (($user_info['user_level'] != GUEST) ? htmlspecialchars($user_info['user_name']) : "");
    $comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']))) : "";
    $comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['comment_text']))) : "";

    $site_template->register_vars(array(
      "bbcode" => $bbcode,
      "user_name" => $user_name,
      "comment_headline" => $comment_headline,
      "comment_text" => $comment_text,
      "lang_post_comment" => $lang['post_comment'],
      "lang_name" => $lang['name'],
      "lang_headline" => $lang['headline'],
      "lang_comment" => $lang['comment']
    ));
    $comment_form = $site_template->parse_template("comment_form");
  }
  $site_template->register_vars("comment_form", $comment_form);
  unset($comment_form);
} // end if allow_comments

// Admin Links
$admin_links = "";
if ($user_info['user_level'] == ADMIN) {
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif ($is_image_owner) {
  $admin_links .= ($config['user_edit_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  $admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
$site_template->register_vars("admin_links", $admin_links);

// Update Hits
if ($user_info['user_level'] != ADMIN) {
  $sql = "UPDATE ".IMAGES_TABLE."
          SET image_hits = image_hits + 1
          WHERE image_id = $image_id";
  $site_db->query($sql);
}

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

if ($mode == "lightbox" && $in_mode) {
  $page_url = "";
  if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
    if (!empty($regs[1]) && $regs[1] != 1) {
      $page_url = "?".URL_PAGE."=".$regs[1];
    }
  }
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];
}
elseif ($mode == "search" && $in_mode) {
  $page_url = "";
  if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
    if (!empty($regs[1]) && $regs[1] != 1) {
      $page_url = "&amp;".URL_PAGE."=".$regs[1];
    }
  }
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];
}
else {
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $image_name."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "image_id2" => $image_id,
  "clickstream" => $clickstream,
  "lang_category" => $lang['category'],
  "lang_added_by" => $lang['added_by'],
  "lang_description" => $lang['description'],
  "lang_keywords" => $lang['keywords'],
  "lang_date" => $lang['date'],
  "lang_hits" => $lang['hits'],
  "lang_downloads" => $lang['downloads'],
  "lang_rating" => $lang['rating'],
  "lang_votes" => $lang['votes'],
  "lang_author" => $lang['author'],
  "lang_comment" => $lang['comment'],
  "lang_prev_image" => $lang['prev_image'],
  "lang_next_image" => $lang['next_image'],
  "lang_file_size" => $lang['file_size'],
  // Я добавил
  "lang_full_file_size" =>$lang['full_file_size']
));

$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>

 
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on December 12, 2005, 02:41:41 PM
Ok
1) sorry about missunderstanding about memberlist, have no idea why I start thinking the problem was there...
2) the problem is indeed in the code block you've showed, but it has nothing to do with this mod. (atleast with original code)
3) to fix that replace
Code: [Select]
    $sql_where_query .= "AND image_id IN (".$search_id['image_ids'].") ";
  }

  if (!empty($search_id['user_ids'])) {
    $sql_where_query .= "AND user_id IN (".$search_id['user_ids'].") ";
  }

  if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    $sql_where_query .= "AND image_date >= $new_cutoff ";
with:
Code: [Select]
    $sql_where_query .= "AND i.image_id IN (".$search_id['image_ids'].") ";
  }

  if (!empty($search_id['user_ids'])) {
    $sql_where_query .= "AND i.user_id IN (".$search_id['user_ids'].") ";
  }

  if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    $sql_where_query .= "AND i.image_date >= $new_cutoff ";
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: MRJEE on December 12, 2005, 06:27:01 PM
Thank you. Now It works. I think a problem that is difficult to collect correctly a lot of a different code in one place, probably I have passed any step in my work.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on December 20, 2005, 09:30:04 PM
any ideia of how make the userpic  as link on (details.php) i mean in comments  :?:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on January 09, 2006, 10:44:17 PM
i've notice of how make Avatar (MOD) show in logininfo using this :

Page_Header.php

Code: [Select]
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" name=\"icons\" border=\"0\" alt=\"\">" : "",
so how make it work but wth member personal photo ?

cheers ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: brunorosa on January 13, 2006, 05:07:11 PM
Hey! There is a problem... i've installed it... but on detail.php.. when user had no personal picture there show a square with a cross insite (means that the picture doesn't exist)... is there a way, on the php coda to put a default picture in case user doesn't yet have uploaded his picture??? something like "user has no picture"... it's better than a red cross....
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on January 13, 2006, 06:04:45 PM
Hey! There is a problem... i've installed it... but on detail.php.. when user had no personal picture there show a square with a cross insite (means that the picture doesn't exist)... is there a way, on the php coda to put a default picture in case user doesn't yet have uploaded his picture??? something like "user has no picture"... it's better than a red cross....

In your member.php file,

find :

Quote

"userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",


replace with :

Code: [Select]

"userpic_img" => ($user_info['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$user_info['userpic'])) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : ROOT_PATH."data/userpic/no_picture.jpg",


Then, create yourself a little default image file (when user has no picture) called : no_picture.jpg. Once created, upload it in your data/userpic folder. ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on January 14, 2006, 12:56:10 AM
Hey! There is a problem... i've installed it... but on detail.php.. when user had no personal picture there show a square with a cross insite (means that the picture doesn't exist)... is there a way, on the php coda to put a default picture in case user doesn't yet have uploaded his picture??? something like "user has no picture"... it's better than a red cross....
This has been asked before and answered already. Please read the replys.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: brunorosa on January 14, 2006, 02:07:19 PM
weird... oracle... it hasn't worked...
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on January 14, 2006, 02:14:00 PM
Quote

it hasn't worked...


Could you PLEASE be more specific ???  :?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: brunorosa on January 15, 2006, 02:31:33 AM
Hey! There is a problem... i've installed it... but on detail.php.. when user had no personal picture there show a square with a cross insite (means that the picture doesn't exist)... is there a way, on the php coda to put a default picture in case user doesn't yet have uploaded his picture??? something like "user has no picture"... it's better than a red cross....

In your member.php file,

find :

Quote

"userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",


replace with :

Code: [Select]

"userpic_img" => ($user_info['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$user_info['userpic'])) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : ROOT_PATH."data/userpic/no_picture.jpg",


Then, create yourself a little default image file (when user has no picture) called : no_picture.jpg. Once created, upload it in your data/userpic folder. ;)



I made this exctly as you said... i replaced the code by the one you gave me... but it still doesn't show a default image for the users that haven't uploaded personal picture yet... as you can see here for example...
http://www.janelaurbana.com/galeria/member.php?action=showprofile&user_id=25
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on January 15, 2006, 02:17:45 PM
@brunorosa:

After 2 mins of waiting for your site to load up, it is clairly that I can't assist to help you on this problem due to this kind of speed. Sorry.  :|
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: brunorosa on January 15, 2006, 05:27:33 PM
thanks :\
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on January 15, 2006, 05:43:47 PM
@brunorosa: after your 14 posts, I've noticed that you dont like to read...or search...so, please, give yourself a favour, try to atleast open the 10 pages of this topic, which will probably take no more then 15 minutes, instead of waiting for 2 days for a sollution.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on February 06, 2006, 07:01:53 PM
I've make a request and after decide move to here my request , being this MOD (topic) a best place to continue..

The Request...

Its possible make work in Home , a random "userpic's" ($userpic) , with links to profiles ?
Making a max of 3 , making userpic/username as link to user profile ... !?

Make the the userpics  to 100 x 100 px 

but if we can added that on acp to control the size so ill be great  , make all userpic show 100 x 100 px (on random) 

=> Make as Avatar Size <= 

Resume : 3 random userpics on Home  ; Being userpic and username below both as link to profile.

screenshot (for best example below)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: glitzer on February 07, 2006, 07:32:57 AM
I have problem with this Mod. Because when somebody load his picture in his profile and  he would like to take another, it does only show the new one when he refresh the site, the same problem is ..when he would delete the picture. :oops:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 07, 2006, 07:39:21 AM
Sorry, I dont understand...what is the problem?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: alex on February 07, 2006, 08:54:41 AM
Hi,



i have installed this Mod and it works fine.

But now I tried to show the userpic into the details.html.
So I make the steps 10 and 11 and insert the {userpic} tag into the details.html
Quote
functions.php
...
   if (!empty($additional_user_fields)) {
    $additional_field_array = array();
    foreach ($additional_user_fields as $key => $val) {
      if ($key != "userpic" || ($key == "userpic" && $config['userpic']))
      {
        $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }

  if (!empty($additional_image_fields)) {
    $additional_field_array = array();
    foreach ($additional_image_fields as $key => $val) {
      $additional_field_array[$key] = (!empty($image_row[$key])) ? format_text($image_row[$key], 1) : REPLACE_EMPTY;
      $additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }
...
Quote
details.php
...
if (!$image_id) {
  header("Location: ".$site_sess->url($url, "&"));
  exit;
}

$additional_sql = "";
if (!empty($additional_user_fields)) {
  foreach ($additional_user_fields as $key => $val) {
    $additional_sql .= ", u.".$key;
  }
}
if (!empty($additional_image_fields)) {
  foreach ($additional_image_fields as $key => $val) {
    $additional_sql .= ", i.".$key;
  }
}
...
Quote
details.html
<td valign="top" class="row2">{user_name_link}<br>{userpic}</td>

if I got to the details of a picture I do´nt see an image  :(
I get no error or something else.

can anyone help me.

regards
Alex
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 07, 2006, 01:57:12 PM
Try add
Code: [Select]
global $additional_user_fields;above the new code you've added into functions.php
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: alex on February 07, 2006, 02:32:54 PM
Try add
Code: [Select]
global $additional_user_fields;above the new code you've added into functions.php
Thanks Veno...but now i see olny the image name, like 1.jpg
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 07, 2006, 02:54:06 PM
So? uset it inside your html...
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: alex on February 07, 2006, 03:25:17 PM
So? uset it inside your html...
I think the {userpic}-Tag should print the whole image-path....but it prints olny the image-name
(http://www.ring-action.de/details.php?image_id=21651)

I´ve wrote {userpic} into the details.html...see my post befor
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 07, 2006, 08:58:44 PM
Hi,

I have not posted often on this topic since I didn't had any additional ideas in order to expand this MOD.

However, since yesterday, I have worked on the userpic MOD in order, for users and admins, to see a random userpic window in the home page of their gallery. The good news is, it has been reported as complete success. ;)

For now, no more than a single picture at the time will load (most likely like the random image feature - already integrated as part of 4images core). If more images needs to be loaded at the time, further modifications would need to be done but would also be applied differently. That said, it would be best to remain on 1 picture at the time (randomly of course). ;)

// Beta-Tester

My thanks goes to Stoleti for requesting and evaluating this project.

// Affected files

- index.php
- lang/english/main.php
- templates/<your_template>/home.html

// Step 1

In your index.php file,

find :

Quote

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------


add above :

Code: [Select]

//--------------------------------------
//--- Random Userpic Images ------------
//--------------------------------------

$sql = "

SELECT DISTINCT ".get_user_table_field("", "user_id"). get_user_table_field(", ", "user_name"). get_user_table_field(", ", "user_level").", userpic
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_level")." >= '".USER."'
ORDER BY RAND()
LIMIT 1

";

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

if (!$result) {

$userpic_img = $lang['no_random_userpic'];

} else {

while ($row = $site_db->fetch_array($result)) {

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$config['userpic_width']."\" height=\"".$config['userpic_height']."\" border=\"0\"></a>" : $lang['no_random_userpic'];
$user_name = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\">".$row['user_name']."</a>" : "<br /><br /><a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\">".$row['user_name']."</a>";

} ###### End of while statement.

if ($user_info['user_level'] >= USER) {

$site_template->register_vars(array(
"user_name" => $user_name,
"userpic_img" => $userpic_img,
"lang_no_random_userpic" => $lang['no_random_userpic'],
"lang_random_userpic_images_title" => $lang['random_userpic_images_title']
));
} ###### End of if statement.
} ###### End of if statement.

unset ($userpic_img);
unset ($user_name);


// Step 2

In your templates/<your_template>/home.html file,

add the following where you want it to appear :

Code: [Select]

                <br />
                  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_random_userpic_images_title}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="row1" align="center" valign="top">{if userpic_img}<br />{userpic_img}{endif userpic_img}{if user_name}<br />{user_name}{endif user_name}</td>
                    </tr>
                  </table>
                <br />


Of course, this peace of template is simply an example. You may customize it the way you feel is right for you. ;)

// Step 3

In your lang/english/main.php file,

add above the '?>' tag :

Code: [Select]

//-----------------------------------------------------
//--- Random userpic images ---------------------------
//-----------------------------------------------------
$lang['random_userpic_images_title'] = "Random userpic images";
$lang['no_random_userpic'] = "This user has no picture on his profile";


// Installation complete

This completes the installation of this MOD. To try it, simply go to your home page gallery and "login first" (either as a USER or ADMIN - your choice). From there, you should be able to see random userpic from your database users.

// What if they didn't uploaded a picture within their profile ?

This has been thought. If users didn't uploaded a picture on their profile at all, a text will appear with their user name below (with URL of course). On either case, you will still be able to see their personal profile page.

Good luck ! 8)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: IcEcReaM on February 07, 2006, 10:13:14 PM
I have problem with this Mod. Because when somebody load his picture in his profile and  he would like to take another, it does only show the new one when he refresh the site, the same problem is ..when he would delete the picture. :oops:


Jep, have the same problem too using Firefox. (tested only locally yet)
If I update my pic, i have to refresh with holding Shift + F5,
so Firefox is loading the new picture not from Brwoser Cache.
That was headache to found out, because i thought first,
i did a mistake when i build in this nice mod.

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: glitzer on February 07, 2006, 10:15:39 PM
Ok! Thank you icecream. I Use Maxthon as my browser..is the same problem with it how you..!
Then is this the mistake ok  not a mistake of mine  :D

Many Thanx :D
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: IcEcReaM on February 07, 2006, 10:41:19 PM
@alex:
What vano mean, is to use it in your details.html in "<img>" Tag.
It should be then like this

Code: [Select]
               <tr>
                <td valign="top" class="row2"><b>{lang_added_by}</b></td>
                <td valign="top" class="row2">{user_name_link} {if userpic}<img src="./data/userpic/{userpic}">{endif userpic}</td>
                  </tr>

This should work.



Quote
This has been thought. If users didn't uploaded a picture on their profile at all, a text will appear with their user name below (with URL of course). On either case, you will still be able to see their personal profile page.
Why not search in WHERE statement of the query only where userimages are set?
Would be nicer only to see users with user images then.
Like this?
Code: [Select]
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic>= '0'

Mod: Search for Userimages per Admin Control

I've made also a little addon.
Two Options are availble.
1. Admins can search in Control Panel for Users that had set an userimage.
2. Show in User Results the userimage (if you has set one) next to name.

Its a good option to control what userimages are being used, instead of searching all user profiles.

Files to modify
language/admin.php
includes/constants.php
admin/users.php

language/admin.php
find
Code: [Select]
//-----------------------------------------------------
//--- Fields ------------------------------------------
//-----------------------------------------------------
below insert
Code: [Select]
// Mod Find Userpics
$lang['field_userpic'] = "User mit Userpic suchen";
$lang['field_showuserpic'] = "Userpics anzeigen";

or for english language
Code: [Select]
// Mod Find Userpics
$lang['field_userpic'] = "Find Users with Userpic";
$lang['field_showuserpic'] = "Show Userpics on Searchresults";


includes/constants.php
after
Code: [Select]
// Data pathsinsert
Code: [Select]
define('USERPICS_DIR', 'data/userpic/');
admin/users.php
find
Code: [Select]
show_table_separator($lang['sort_options'], 2);above insert
Code: [Select]
   // Mod Find Userpics
  show_radio_row($lang['field_userpic'], "user_userpic", 0);
  show_radio_row($lang['field_showuserpic'], "user_showuserpic", 0);



Find
   
Code: [Select]
$orderby = trim($HTTP_POST_VARS['orderby']);insert
Code: [Select]
  // Mod Find Userpics
  $user_userpic = intval($HTTP_POST_VARS['user_userpic']);
  $user_showuserpic = intval($HTTP_POST_VARS['user_showuserpic']);
  if ($user_userpic==1) {
    $condition .= " AND userpic <> ''";
  }




Find
Code: [Select]
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."and replace with
Code: [Select]
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction").(($user_showuserpic == 1) ? ", userpic" : "")."




Find
   
Code: [Select]
echo "<td><b>".$show_user_name."</b></td>\n";and add before
Code: [Select]
      // Mod Find Userpics
      $show_user_name .= ($user_showuserpic == 1 && $user_row['userpic']) ? "&nbsp;&nbsp;<img src=\"".ROOT_PATH.USERPICS_DIR.$user_row['userpic']."\">" : "";
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 08, 2006, 12:33:58 AM
@IcEcReaM:
I'm not an expert, but I think since the userpic field in the database is for strings, its better use userpic <> '' or NOT userpic in mysql queries
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 08, 2006, 12:47:32 AM
In the mean time, if I may suggest, rather than simply defining the userpic folder from includes/constants.php file,

this line :

Quote

<img src=\"".ROOT_PATH.USERPICS_DIR.$user_row['userpic']."\">


could simply become something like :

Quote

<img src=\"".get_userpic_image($user_row['userpic'])."\">


Then, in your includes/functions.php file,

find :

Quote

function get_gallery_image($image_name) {
  global $config;
  if (file_exists(TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name)) {
    return TEMPLATE_PATH."/images_".$config['language_dir']."/".$image_name;
  }
  else {
    return TEMPLATE_PATH."/images/".$image_name;
  }
}


add below :

Code: [Select]

function get_userpic_image($userpic_name) {
 if (@file_exists(ROOT_PATH."data/userpic/".$userpic_name)) {
   return ROOT_PATH."data/userpic/".$userpic_name;
  }
}


It makes it a little bit shorter to type and little bit easier to remember. ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 08, 2006, 12:54:52 AM
It makes it a little bit shorter to type and little bit easier to remember. ;)
And a bit longer to install and a most important a bit slower.
The reason 4images has get_gallery_image() function is because it supports different templates which could be changed at any time.
And since userpic directory is static and there is not possible have more then one userpic directory, there is no point of creating additional functions. If you ever desided to change directory name, simply update the USERPICS_DIR in constants.php - done.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: IcEcReaM on February 09, 2006, 12:30:48 AM
@IcEcReaM:
I'm not an expert, but I think since the userpic field in the database is for strings, its better use userpic <> '' or NOT userpic in mysql queries

thanks, you are right.
i didn't noticed that,
cause i was working also on an similar mod where the userpic is an integer value,
and the file extension is saved seperatly.

I modified my post,
thanks for this hint.

P.S.: If this "mod" is working correctly,
you can post it if you want as an additional step/option in your first post.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 09, 2006, 01:24:57 AM
P.S.: If this "mod" is working correctly,
you can post it if you want as an additional step/option in your first post.
I'll added it in "addons" section at the end of the tutorial ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 09, 2006, 04:04:31 AM
// USERPIC within PMS !!!

// Introduction

As we may already know this so far, the PMS MOD has been obsolete since almost a year now. However, for those who are still using it, they've been requesting to have the userpic MOD under the PMS (which I have just finished - thanks to the cooperation of Stoleti for letting me evaluating my project).

// Beta-Tester

So, for those who might miss this part of the message, again, my thanks goes to Stoleti for this evaluation.

// Features

Obviously, the userpic will be shown from the recipient who PMs you directly, when you reply to the recipient and into the sent items.

// Weakness

Unfortunitely, at least - for now - the userpic is NOT available within the "preview action".

// Obligations - {if... and ifno...}

The {if ... and ifno ...} MOD must be installed (if you haven't already done so) in order to install this addon.

// Affected files



- pms.php
- templates/<your_template>/pms_folder.html
- templates/<your_template>/pms_view.html



// Backup your files

Note: Backup these affected files first !!!

// Step 1

In your pms.php file,

find :

Quote

$site_template->register_vars(array(
            "view" => $lang['pms_'.$mode],             
             "lang_from" => $lang['pms_'.(($mode == "inbox") ? "to" : "from")],
            "lang_subject" => $lang['pms_subject'],
           "lang_date" => $lang['pms_date'],
           "previewedit" => 0,
           "action" => 0,
           "lang_to" => 0,
//           "reply" => 0,
           "ip" => 0,
          "lang_received" => 0,
         "colspan" => "colspan=\"2\"",
          "from" => stripslashes($user_info['user_name']),
          "subject" => stripslashes($subject),
          "message" => format_text($message, $html, $config['wordwrap_comments'], $bbcode, $config['bb_img_comments']),
          "date" => format_date($config['date_format']." ".$config['time_format'], time())
        ));
        $preview = $site_template->parse_template("pms_view");
      }
   }


replace with :

Code: [Select]

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$user_list['userpic'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$user_list[$user_table_fields['user_id']])."\"><img src=\"".ROOT_PATH."data/userpic/".$user_list['userpic']."\"></a>" : "";

$site_template->register_vars(array(
      "view" => $lang['pms_'.$mode],
              "userpic_img" => $userpic_img,
        "lang_from" => $lang['pms_'.(($mode == "inbox") ? "to" : "from")],
      "lang_subject" => $lang['pms_subject'],
  "lang_date" => $lang['pms_date'],
  "previewedit" => 0,
  "action" => 0,
  "lang_to" => 0,
//   "reply" => 0,
  "ip" => 0,
    "lang_received" => 0,
"colspan" => "colspan=\"2\"",
    "from" => stripslashes($user_info['user_name']),
    "subject" => stripslashes($subject),
    "message" => format_text($message, $html, $config['wordwrap_comments'], $bbcode, $config['bb_img_comments']),
    "date" => format_date($config['date_format']." ".$config['time_format'], time())
  ));
  $preview = $site_template->parse_template("pms_view");
}
}


Then, find :

Quote

$sql = "SELECT *
                  FROM ".PMS_TABLE." p
                  LEFT JOIN ".USERS_TABLE." u ON (p.pms_".$who." = u.user_id)
                  WHERE p.pms_id = ".$id.$pms_sql;
      $result = $site_db->query_firstrow($sql);
      if ($result){
         $to = get_user_info($result['pms_'.$who2]);


add below :

Code: [Select]

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$result['userpic'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$result[$user_table_fields['user_id']])."\"><img src=\"".ROOT_PATH."data/userpic/".$result['userpic']."\"></a>" : "";


Then, find :

Quote

}
         elseif ($row['pms_type'] != PMS_UNREAD){
            $bstart = "";
            $bend = "";
            $new = "";
         }


add below :

Code: [Select]

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row[$user_table_fields['user_id']])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\"></a>" : "";


Then, find :

Quote

$msg_list .= "<tr class=\"row".(($bgcounter++ % 2 == 0) ? 1 : 2)."\" align=\"center\">
<td>".$new."</td>
<td align=\"left\"><a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=view&mode=".$action."&id=".$row['pms_id'])."\">".$bstart.htmlspecialchars($row['pms_subject']).$bend."</a></td>
<td>".$bstart."<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id'])."\">".$row['user_name']."</a>".$bend."</td>
<td>".$bstart.format_date($config['date_format']." ".$config['time_format'], $row['pms_date']).$bend."</td>


replace with :

Code: [Select]

$msg_list .= "<tr class=\"row".(($bgcounter++ % 2 == 0) ? 1 : 2)."\" align=\"center\">
<td>".$new."</td>
<td align=\"left\"><a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=view&mode=".$action."&id=".$row['pms_id'])."\">".$bstart.htmlspecialchars($row['pms_subject']).$bend."</a></td>
<td>".$bstart."<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id'])."\">".$row['user_name']."</a>".$bend."</td>
";
if ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic'])) {
$msg_list .= "
<td>".$bstart. $userpic_img."</td>
";
} ###### End of if statement.
$msg_list .= "
<td>".$bstart.format_date($config['date_format']." ".$config['time_format'], $row['pms_date']).$bend."</td>
".(($action == "sentbox") ? "
<td>".$bstart.format_date($config['date_format']." ".$config['time_format'], $row['pms_date_rcvd']).$bend."</td>" : "")."
".(($action == "outbox") ? "
<td>"."<a href=\"".$site_sess->url(ROOT_PATH."pms.php?action=edit&id=".$row['pms_id'])."\">[".$lang['pms_edit']."]</a>"."</td>" : "")."
<td><input type=\"checkbox\" name=\"delete[]\" value=\"".$row['pms_id']."\"></td>
</tr>

";
}


Then, find :

Quote

"lang_delete_all" => $lang['pms_delete_all'],


add right below :

Code: [Select]

"lang_userpic" => $lang['userpic'],


// Step 2

In your templates/<your_template>/pms_folder.html file,

find :

Quote

<td width="20%"><b>{lang_who}</b></td>


add below :

Code: [Select]

<td width="20%">{lang_userpic}</td>


// Step 3

In your templates/<your_template>/pms_view.html file, important as the pms.php file - let me recommend you to use this template instead :

Code: [Select]

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bordercolor">

  <tr>

    <td valign="top">

      <table width="100%" border="0" cellpadding="3" cellspacing="1">

{if previewedit}

        <tr class="row1" align="center">

    <td width="100%" colspan="3" height="28" valign="top">

<font color="#808000">{view}</font></td>

</tr>

{endif previewedit}

  <tr class="row2">

    {if userpic_img}<td nowrap width="10%"><b>{lang_from}</b>{if ip}<br />IP: {ip}{endif ip}</td>

<td width="90%" colspan="2" align="center">

                    {userpic_img}<br />

{from}

</td>

</tr>

                </table>{endif userpic_img}

                {ifno userpic_img}<td nowrap width="">{lang_from}</b>{if ip}<br />IP: {ip}{endif ip}</td>

                    <td width="78%" colspan="2">

    {from}

</td>

</tr>

                </table>{endifno userpic_img}

               <table width="100%" border="0" cellpadding="3" cellspacing="1">

<tr class="row2" width="100%">

<td width="22%"><b>{lang_date}</b></td>

<td width="78%"colspan="2">{date}</td>

</tr>

                </table>

{if lang_received}

                <table width="100%" border="0" cellpadding="3" cellspacing="1">

<tr class="row2" width="100%">

<td width="22%"><b>{lang_received}</b></td>

<td width="78%" colspan="2">{received}</td>

</tr>

                </table>

{endif lang_received}

                <table width="100%" border="0" cellpadding="3" cellspacing="1">

<tr class="row2" width="100%">

<td width="22%"><b>{lang_subject}</b></td>

<td width="22%" {colspan}>{subject}</td>

{if quote}<td width="56%" nowrap> {quote} |{endif quote}{if reply} {reply} |{endif reply}{if edit} {edit} |{endif edit} {delete} </td>

</tr>

                </table>

               <table width="100%" border="0" cellpadding="3" cellspacing="1">

<tr class="row1">

<td width="100%" colspan="3">{message}</td>

</tr>

      </table>

      </td>
      </tr>
      </table>


Note: This is the {if ... and ifno ...} obligation part !!! (otherwise, your template will look a little chunky  :mrgreen:).

// Installation complete

This completes the installation of this addon. Simply use your PMS MOD and see if you can view your userpic along with your messages (whoever you are). 8)

Good luck !
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 09, 2006, 04:13:05 AM
// USERPIC within WHO'S ONLINE !!!
[/b]

// Introduction

This one's pretty simple to understand since the who's online list is already part of the core "but" this one presents it a little bit more professional.

// Features

Obviously, it will show the userpic "above" the user name from now on.

// Weakness

The $paging class module has not been added into my modifications so beware to those who has a huge user database (might get slower too).

// Affected file

- includes/sessions.php

// Backup your file

Backup your includes/sessions.php file before proceeding.

// Step 1

In your includes/sessions.php file (assuming you're using the original codings of 4images),

find :

Quote

if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."
     FROM ".SESSIONS_TABLE." s
     LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
     WHERE s.session_lastaction >= $time_out
     ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    if ($row['session_user_id'] != GUEST && (isset($row['user_id']) && $row['user_id'] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "*" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? ", " : "";
          $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;


replace with :

Code: [Select]

if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible").", userpic
  FROM ".SESSIONS_TABLE." s
  LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
  WHERE s.session_lastaction >= $time_out
  ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    if ($row['session_user_id'] != GUEST && (isset($row['user_id']) && $row['user_id'] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? "<br />" : "";
          $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
          $userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$userpic_width."\" height=\"".$userpic_height."\">" : "";
          $whos_online_userpic = str_replace("{userpic_img}", "", $userpic_img);
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\"><center>".$whos_online_userpic."<br />".$username."</a>".$invisibleuser."</center>".REPLACE_EMPTY. REPLACE_EMPTY;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;


// Installation complete

That's it. You're done !

Simply visit your home page of your gallery as you should be able to see userpics above each user names. ;)

Good luck !
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 09, 2006, 06:12:07 PM
A forgotten step was discovered this morning for the whos online above (as I have corrected it).

Please, find :

Quote

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\">" : "";


replace with :

Code: [Select]

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$userpic_width."\" height=\"".$userpic_height."\">" : "";


My apologize for this.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on February 10, 2006, 10:55:10 PM
how make it show for example  4 userpics by row  8) ?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 10, 2006, 11:29:25 PM
Quote

how make it show for example  4 userpics by row


Please be more specific. For which one ? I have posted two different editions above. :?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on February 10, 2006, 11:32:19 PM
About "who's online " !!

now thats show 1 user/pic by row :

user 1

user 2

...

So i want make it on horizontal :


user 1  user 2  user 3  user 4

user 5 ......                               <= 4 users/userpics by row  :mrgreen:

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on February 11, 2006, 12:26:44 AM
Replace <br /> with ,
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: TheOracle on February 11, 2006, 03:34:08 AM
Quote

Replace <br /> with ,


No, I know what Stoleti is trying to do. He's trying to make series of 4 userpics per 4 rows of TDs. ;)

Ex:

TD 1: userpic1  |  TD 2: userpic2  |  TD 3: userpic3  |  TD 4: userpic4
TD 5: userpic5  |  TD 6: userpic6  | TD 7:  userpic7  |  TD 8: userpic8

ect . . .

Unfortunitely, by doing so, it would eliminate the possibility for users to edit their whos_online.html as it would require a much bigger modulation from includes/sessions.php file in order to accomplish this (more extensive codings).
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: nutnick on March 04, 2006, 12:18:55 AM
Hi as a newbe i need a little help please! six times i have changed the code for pic in profile and end with the same thing blank image with red x in?
any idea where im going wrong. I have read your posts opn this and the only comment i found with the same problem the answer was you should no this! this is the first time i have ever used php all the rest of the pages are great! all done except members pic! please help
Nick :roll:
I refer to post Re: [MOD] Member personal photo v1.0
« Reply #9 on: April 08, 2005, 11:43:27 PM »
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on March 04, 2006, 01:16:18 AM
1) see an icon infront of headline of each reply? this is a link to that specific reply, show the link to the reply you are refering to, because the time of the reply you showed does not match with time somebody else see, because of different time zones.
2) dont forget to mention what 4images version do you use.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: nutnick on March 05, 2006, 11:17:14 PM
Thanx to you martrix for you quick reply   :D that is the mod i used but had a few probs but i worked it out myself php is new to me and i have a long way to go but don't mind reading up and putting in the hours I have looked at the forum and a lot of the answers don't help as they dont tell you a file name or where to find it, if they are answering a question to a problem thay say "put this code in" but not what file it is and it's because they are only answering the person that asked the question , so it don't make to much sence to a newbe lol so i try to read betwen the lines.
Thanx again
Nick
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jmello on March 06, 2006, 09:30:15 AM
Hi!
I would like to have a thumbnail instead of a normal sized picture on the comments of the pictures.
When someone comments it comes the realsize picture and it takes a lot of space...
How can I do  that?

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on March 06, 2006, 02:41:53 PM
use the commands "width" and "height" in your template. For example:

<img src="./data/userpic/{user_pic}" width="100" height="120"> or

<img src="./data/userpic/{user_pic}" width="100">if you want to have a fixed aspect ratio

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jmello on March 06, 2006, 06:38:16 PM
Thanks!
It solved ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: wallpapers on March 23, 2006, 07:40:16 PM
great mod  :D
this mod is installed in 4images 1.7.2 and it's works perfect  :lol:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: wallpapers on April 02, 2006, 10:04:06 PM
Is there a way to upload a picture when a user will register.
so that the picture can be uploaded bij the registration form  :D
i hope it can  :D

thanks
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: wallpapers on April 09, 2006, 10:15:19 PM
Can anybody help please. :roll:
I have try many things but it doesn't work  :oops:

Here is a link to what i try to say http://www.tuned-cars.net/register.php
the "Personal picture" will not work when a user upload his picture  :(

If you want more info just ask  :D
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on May 21, 2006, 07:21:01 AM
how can i make a option for users upload from a URL ?

i mean external web address ... keeping both options

1 - upload from machine (default)
2 - from url (external web address)

 :?:

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: nfprehn on July 02, 2006, 09:58:54 PM
I want users to upload their personal photo when they register so I added the following to register_form.html:

   <tr>
            <td class="row1" valign="top"><b>{lang_userpic}</b>
            <SPAN class="smalltext">   
                <br />
                <b>{lang_userpic_upload}</b>
               </SPAN>
            </td>
            <td class="row1">
              <INPUT type="file" name="userpic_file"  size="30" class="input" /><br />
              {if userpic_img}<img src="{userpic_img}"><br /><input type="checkbox" name="userpic_del" value="1">&nbsp;{lang_userpic_del}{endif userpic_img}
            </TD>
          </TR>


However, for some reason, the {lang_userpic_upload} text will not appear in the registration form, although it is visible in the edit profile page?  Please help!
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: mstgokcen on July 20, 2006, 01:33:35 PM
after posting a command my post seem OK with my picture but if I refresh the page, it dublicate the last post and again and again until you change the page ...

Does anyone checked it or how can i solve this bug?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on July 20, 2006, 02:40:47 PM
I didnt understand...what is the problem again? maybe a screenshot or a link to the page would help ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on August 07, 2006, 10:58:39 PM
hi i have the next error... maybe it is because i have phpbb integrated with 4images... could you help me to fix the problem?

Code: [Select]
DB Error: Bad SQL Query: UPDATE phpbb_users SET user_email = 'ccsakuweb@hotmail.com', user_viewemail = 1, = 0, user_allow_viewonline = 0, user_website = 'http://www.ccsakuweb.net', user_icq = '', userpic = '2.jpg' WHERE user_id = 2
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 0, user_allow_viewonline = 0, user_website = 'http://www.ccsak
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on August 07, 2006, 11:46:15 PM
error where?
anyways, I dont see any connections between the error you showed and this mod.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on August 08, 2006, 01:06:14 AM
ups sorry... it is because the mod sure... i have this error after upload the photo.. and when i view the profile, the photo isn´t shown. Do you have any idea?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on August 09, 2006, 12:43:10 AM
remove the mod and I'm sure you'll see the same error - the mod is not the issue.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on August 09, 2006, 04:04:27 PM
yes... i don´t know when i modified the control panel... i think i don´t have any mod about the profile... please... could you help me? in what files it could be the failure?   what archives are related to SQL and the Control Panel? Please... I don´t know... I open a new topic in Discussion & Troubleshooting forum... ---> http://www.4homepages.de/forum/index.php?topic=14022.0
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on August 11, 2006, 10:35:02 PM
the problem seems to be that if i change something of the profile, which I want is to change the table of phpbb profile and then apparently does not leave me because I put information different…

Then with this mod i can´t save the change because i don´t modified phpbb table for your mod.. could you help me to do it? only i have to overwrite 4images to phpbb??? the prefix from my gallery and forum..

help me please..
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on August 26, 2006, 03:19:58 AM
How make it show for Guests/Users/Admin , since this didn«t show the usepic at guests....

Quote
//--------------------------------------
//--- Random Userpic Images ------------
//--------------------------------------

$sql = "

SELECT DISTINCT ".get_user_table_field("", "user_id"). get_user_table_field(", ", "user_name"). get_user_table_field(", ", "user_level").", userpic
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_level")." >= '".USER."'
ORDER BY RAND()
LIMIT 1

";

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

if (!$result) {

$userpic_img = $lang['no_random_userpic'];

} else {

while ($row = $site_db->fetch_array($result)) {

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$config['userpic_width']."\" height=\"".$config['userpic_height']."\" border=\"0\"></a>" : $lang['no_random_userpic'];
$user_name = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\">".$row['user_name']."</a>" : "<br /><br /><a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\">".$row['user_name']."</a>";

} ###### End of while statement.

if ($user_info['user_level'] >= USER) {

$site_template->register_vars(array(
"user_name" => $user_name,
"userpic_img" => $userpic_img,
"lang_no_random_userpic" => $lang['no_random_userpic'],
"lang_random_userpic_images_title" => $lang['random_userpic_images_title']
));
} ###### End of if statement.
} ###### End of if statement.

unset ($userpic_img);
unset ($user_name);

 :?:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on August 26, 2006, 09:55:43 AM
I dont understand the quesiton...guests cant have user pic...
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Silversand on August 26, 2006, 02:39:35 PM
Hello,

can someone post the userpic_install.php again? it doesn't seem to be available.

Thanks!

SIlver
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on August 29, 2006, 02:35:12 PM
yes.. my problem was in phpbb integration.. I uninstalled that mod and now i install member personal photo and it works correctly thanks for this great mod!! :D

but i have any questions.. i need more than a userpic in member profile.. can I do this if i change the name "user_pic" to "banner" (for example) in all steps???  Because i need add a banner for user websites. I will need to do a link with the url in this image, do you know how to do this??

I have another question.. i would like to add the userpic in user_logininfo, could u help me please?

how can i make a option for users upload from a URL ?

i mean external web address ... keeping both options

1 - upload from machine (default)
2 - from url (external web address)

 :?:
How can i make this in editprofile???

@Silversand.. yesterday i downloaded this mod, and it runs!!! :D
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on September 08, 2006, 08:16:26 PM
I am stuck with an issue.

I want to show the userpic on a template (index.php?template=XXX), how do i do this? I tried include it into the page_header, index.php and then use {userpic} - dont work.

Can someone please give me a hand on this :) thanks

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on September 08, 2006, 08:50:48 PM
yes.. my problem was in phpbb integration.. I uninstalled that mod and now i install member personal photo and it works correctly thanks for this great mod!! :D

but i have any questions.. i need more than a userpic in member profile.. can I do this if i change the name "user_pic" to "banner" (for example) in all steps???  Because i need add a banner for user websites. I will need to do a link with the url in this image, do you know how to do this??

I have another question.. i would like to add the userpic in user_logininfo, could u help me please?

how can i make a option for users upload from a URL ?

i mean external web address ... keeping both options

1 - upload from machine (default)
2 - from url (external web address)

 :?:
How can i make this in editprofile???

@Silversand.. yesterday i downloaded this mod, and it runs!!! :D

well i'm trying know how :D
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on September 09, 2006, 12:53:07 AM
I am stuck with an issue.

I want to show the userpic on a template (index.php?template=XXX), how do i do this? I tried include it into the page_header, index.php and then use {userpic} - dont work.

Can someone please give me a hand on this :) thanks



maybe you didn't understand me: The persons userpic (who is logged in) has to be shown on a template like config.html, something like the user-avatar on the left side.
I know its possible and its easy, but after 3 hours of trieng i'am depending on you  :?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on September 09, 2006, 01:58:52 AM
I tried include it into the page_header, index.php and then use {userpic} - dont work.
It depence on what did you try to include and where...
if you add proper code into page_header.php in proper place, then it will be available on any custom templates.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on September 09, 2006, 11:02:54 AM
It depence on what did you try to include and where...
if you add proper code into page_header.php in proper place, then it will be available on any custom templates.

Can you be a little more specific ;) I really can't get it to work  :?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Stoleti on September 09, 2006, 04:39:40 PM
Using it at page_header.php would be nice , how do it ? :roll:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on September 10, 2006, 02:55:26 PM
tried

Code: [Select]
  $userpic = ($config['userpic'] && (@file_exists(ROOT_PATH."data/userpic/".$row['userpic'])) && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"100".$userpic_width."\" border=\"0\">" : "<img src=\"".get_gallery_image("nouserpic.jpg")."\" width=\"100".$userpic_width."\">";

but i get broken images.

tried

Code: [Select]
  "userpic" => ($config['userpic'] && (@file_exists(ROOT_PATH."data/userpic/".$row['userpic'])) && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"100".$userpic_width."\" border=\"0\">" : "<img src=\"".get_gallery_image("nouserpic.jpg")."\" width=\"100".$userpic_width."\">",

..ibut i get the image, when a user dont have an image. I give up, hopefully someone posts the right code  :?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on September 10, 2006, 07:02:03 PM
you are going in the right direction ;) just its not $row but $user_info ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on September 10, 2006, 07:16:49 PM
you are going in the right direction ;) just its not $row but $user_info ;)

oh of course it is :) Thanks!

PS: I understand why you didn't post the solution in the first time - you want us to learn to think logicly, to try to understand by ourself things we used to just don't understand - but it works ;) Thanks.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on September 10, 2006, 07:49:12 PM
PS: I understand why you didn't post the solution in the first time - you want us to learn to think logicly, to try to understand by ourself things we used to just don't understand - but it works ;) Thanks.
Exactly! if one just following blindly directions from others they will never learn, or at least will take alot longer to learn ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: trez on September 10, 2006, 10:55:24 PM
So, my next goal is to display the userpicture in the PM's. I've allready managed to display the userpictures on the main pm-page (pmfolder template), but how about the pm-view template next to the username (from XXX)

when i use {userpic} it displays "my" userpic (of course) ;)

so, i open the pm.php, i think i have to use ".$userpic_img.", but where ? Most possible maybe here?:
Code: [Select]
"from" => "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$next_prev_cache[$id]['user_id'])."\">".stripslashes($next_prev_cache[$id]['user_name']."</a>"),
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Forty on September 18, 2006, 02:46:30 PM
I need the Code or downloadlink for the install. The Downloadlink is broken.

Edit: i am sorry i found the sql code after the link :D
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on September 23, 2006, 07:00:18 PM
well i'm trying know how :D
it works?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: ccsakuweb on October 12, 2006, 01:32:03 PM
Hi! This mod is really great, I have a problem. I want to add an userpic to an user but i can't add it in control panel (mygallery/admin.php)
how can i add it in a user?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Parador on October 13, 2006, 12:51:17 PM
I have the same problem... how can a user or I upload a picture ?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no - memberlist MOD etc
Post by: fgabriel on October 24, 2006, 10:36:45 AM
some questions

i want to put the userpict on the memberlist MOD that i found in the forum?
and other--- i want to put the userpict close to the autor name of the photo on details.php page

thanks for the help
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: qpatrick on November 01, 2006, 11:45:22 AM
works in 1.7.4
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: chull on February 08, 2007, 10:17:37 PM
Hello,

really Great Mod!!! :D

Is it possible to show an standard photo if the user hasn't uploaded a photo. Like this:

(http://data.stadtleben.de/themes/stadtleben/images/user_sex2.gif)


Greetz and Thanks

Chull
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: CeJay on February 08, 2007, 10:57:42 PM
Hello,

really Great Mod!!! :D

Is it possible to show an standard photo if the user hasn't uploaded a photo. Like this:

(http://data.stadtleben.de/themes/stadtleben/images/user_sex2.gif)


Greetz and Thanks

Chull
was already posted how to do this: http://www.4homepages.de/forum/index.php?topic=6797.msg34005#msg34005
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: chull on February 09, 2007, 01:56:11 PM
Thanks, works perfect.  :D :D

I have installed the addon to show an random user on the home page. There is a big error. Where it should show the User name it is shown all the time my User name. I don't know why it is my. And the other problem is, if somebody hasn't upload a photo, there isn't shown the noimage.png (from the addon I asked above) photo.

Know somebody waht to do?

Thanks and many Greetz

Chull
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: CeJay on February 09, 2007, 09:03:14 PM
I don't know why it is my. And the other problem is, if somebody hasn't upload a photo, there isn't shown the noimage.png (from the addon I asked above) photo.
Check this message to see if that is your issue: http://www.4homepages.de/forum/index.php?topic=6797.msg34586#msg34586

As for the username I have no idea as I am not even using this mod.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Parasco on February 18, 2007, 08:19:34 PM
Hiya, how can we change the following code to show member.jpg if no user_pic exists?

Code: [Select]
//User Pic
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: CeJay on February 19, 2007, 07:17:45 AM
Hiya, how can we change the following code to show member.jpg if no user_pic exists?

Code: [Select]
//User Pic
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic

Read a few post above yours  :!:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: buetler on May 09, 2007, 03:18:32 PM
I have read the whole thread hoping to find a solution but it seems nobody had a similar problem.
I'm using 1.7.4 and it just does not work for me - user picture does not show up.
I have tried to redo all the steps - the same effect.
I noticed that once I upload user picture it is not stored in data/userpic folder. I checked properties and it is 777.
Can't figure out why it is not uploading the pic.

Can anyone help? What could be a reason for it?

update: reinstall the whole thing from scratch. Still don't know what the problem was
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Smoothice on June 03, 2007, 06:52:45 AM
OK I love this mod but I am having problems with one thing.  I can get the pic to show in the comments and in the profile but I can not get it to show on the details page.  I have double checked all the code and it is not working.  Anyone else run into this problem.

Smoothice

Never mind found the answer in another post.  Thought I ready them all.  Thanx for a great mod.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: cronk005 on July 07, 2007, 06:02:04 PM
I am having problems also getting the photo to upload. I go and check the CHMOD settings for the folder and they are at 777. When I go into member_editprofile and try to upload it, nothing happens.

Thoughts? I've checked the code several times and it all appears as it should based on the installation instructions.

I'm using 1.7.2

Regards,

DECronk
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: son_gokou on October 08, 2007, 02:20:47 AM
Everything worked except one thing.
On details.html I can't show the user image. It appears the box with a X.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: UFOSWORLD on November 02, 2007, 01:01:37 PM
Nice Mod, works fine,

i want to hide userpic for guests, when they click on usernames are online.

I installed the Last Visitor Mod for Member Profile, there it works...
with the column

Code: [Select]
if($user_info['user_id'] <> GUEST)the last visitors shown only to registered users.

Where in the member.php i had to add that code, that the userpic also shown to registered users only and for guest no picture is shown. 

Btw. i need that shown to registered users only thing on the mail adress too... where i have to add?

thx UFO
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: thunderstrike on November 04, 2007, 04:24:36 PM
No need for add this line if use: {if user_loggedin}...{endif user_loggedin} in member_profile.html file. ;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: vitara on December 13, 2007, 06:10:07 PM
Auf meiner Seite können die User Ihre Userpics nicht mehr sehen.
Wenn ich als Admin eingeloggt bin geht es wieder, wo könnte der Hase begraben sein?

Sorry, das ganze nur bei den Kommentaren wo das Bild unter dem Usernamen zu sehen ist!

Besten dank für eure Mithilfe!
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: masterred on December 28, 2007, 06:44:10 PM
hi

i have this error

Quote
Warning: move_uploaded_file(./data/userpic/1.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\AppServ\www\4images\member.php on line 1147

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINNT\TEMP\php8E6.tmp' to './data/userpic/1.jpg' in C:\AppServ\www\4images\member.php on line 1147

Quote
Error enviando archivo de imagen: S2020007.JPG
S2020007.JPG: Copy error. Please check the directory permissions


i need you help

thanks

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: thunderstrike on December 28, 2007, 07:19:28 PM
Please read this:

http://www.4homepages.de/forum/index.php?topic=19952.0
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: masterred on December 29, 2007, 08:31:42 AM
hi

my gallery 4images 1.7.4 work at

Apache Web Server Version 1.3.34

PHP Script Language Version 5.2.5

MySQL Database Version 5.0.16

phpMyAdmin Database Manager Version 2.5.7-pl1

i see

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: thunderstrike on December 29, 2007, 04:23:08 PM
Ok so is permission problem:

http://www.4homepages.de/forum/index.php?topic=7400.0

;)
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: masterred on December 30, 2007, 03:48:41 PM
hi

A question, work win2000, before installing this mod, had no trouble creating images, everything started when installing the MOD Member Personal Photo, I have installed other MOD as Avatar without any problems. Will continue to be problem for permission ?, I have never used FTP client to work on localhost and never have this problem.

thanks
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: thunderstrike on December 30, 2007, 03:49:32 PM
Check IIS setting.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: masterred on January 04, 2008, 06:21:48 AM
hi

Is running I think that the problem is that was using a photo from more size permitted in the ACP.

cuestion



1- http://www.4homepages.de/forum/index.php?topic=6797.msg34005#msg34005 (http://www.4homepages.de/forum/index.php?topic=6797.msg34005#msg34005)

2-http://www.4homepages.de/forum/index.php?topic=6797.msg34586#msg34586 (http://www.4homepages.de/forum/index.php?topic=6797.msg34586#msg34586)

thanks
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: marcuskillen on January 13, 2008, 07:48:17 PM
uhm... really funny... the download link in the original post dosent work !!!!!!!!  :idea: and A have already changed everything so far... Is it just me or isent it confusing when an application add on have 48 pages and one are suppose to read throw everything ! gosh
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jan-Lukas on January 19, 2008, 05:59:36 PM
Versuche unseren Katalog auf 1.7.4 zu updaten, aber beim einbau vom personal photo kommt folgender Fehler
Parse error: parse error, unexpected '}' in /srv/www/vhosts/ue-ei-portal-sammlerkatalog.de/httpdocs/1.7.5/includes/template.php(101) : eval()'d code on line 45

und zwar nur beim aufruf vom Userprofil, im Kontrollzentrum ist alls OK
Habe es genau so eingebaut wie in der 1.7.1 die z.Z. noch läuft

hoffe kann jemand helfen, möchte nämlich noch Avatar einbinden, und wird dann ja wohl auch nicht klappen ?


Ps. gibt es den Threat mit dem security image nicht mehr ? mit dem transparenten Bild über der Grafik legen, kann es nicht mehr finden.


alles erledigt

Danke
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: nobby on January 19, 2008, 06:01:35 PM
Hallo Jan -Lukas,

das Update auf 1.4.7 hättest Dir sparen können.
In wenigen Tagen kommt die Version 1.7.5 raus  :wink:

siehe Hier: http://www.4homepages.de/forum/index.php?topic=16886.msg109616#msg109616

nobby
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jan-Lukas on January 19, 2008, 06:39:43 PM
das behebt aber nicht gerade den Fehler, und ich neige nicht immer dazu, direkt auf eine neue Version zu updaten  :wink:


Habe den original Thread zum Thema leer Gif über ein Bild legen gefunden


Das Problem hatte ich anfangs auch. Schau nach, ob es in Deinem Verzeichnis "4images/templates/default/" einen Ordner mit dem Namen

{template_url}

gibt. Wenn nicht, lege ihn an. Er muß genauso heißen, wie hier angegeben, also auch mit den Klammern.

Und in dem Ordner {template_url} muß dann noch ein weiterer Ordner angelegt werden mit dem Namen "images".

Dort schiebst Du das spacer.gif rein. Dann sollte es gehen.

Bei mir waren beide nicht vorhanden. Deshalb hatte ich das Problem. Mag ja sein, daß es bei Dir auch so ist.

Wenn es läuft, kann es sein, daß Du feststellst, daß unten am Bildrand ein übler weißer Rand zu sehen ist. Dann muß das spacer.gif auf die Mitte ausgerichtet werden.

Am besten, Du nimmst gleich diesen Code:

Code: [Select]
<!-- Template file for JPG Files -->
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="{media_src}">
      <img src="{template_url}/images/spacer.gif" border =" 0" alt="{image_name}" {width_height} border="0" vspace="0" hspace="0" align="absmiddle">
    </td>
  </tr>
</table>

Viele Grüße, Biggi
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: nobby on January 19, 2008, 07:41:50 PM
Aber hier habe ich noch was, das was Du gesucht hast "leere Gif-Datei"

Hier im Forum konnte ich es auch nicht mehr finden. Aber ich habe es bei mir auf dem Rechner noch.

Code: [Select]
<!-- Template file for JPG Files -->
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="{media_src}">
      <img src="{template_url}/images/spacer.gif" border =" 0" alt="{image_name}" {width_height} border="0" vspace="0" hspace="0" align="absmiddle">
    </td>
  </tr>
</table>

Den Code musst Du Einbauen in media/jpeg.html.

Im Anhang befindet sich das Verzeichnis "{template_url}", dieses kopierst Du in Dein Template-Verzeichnis. Hier ist auch die Spacer.jpg drin.

nobby

edit

Zu Deinem Parse-Problem, könnte das helfen?  :arrow: http://www.4homepages.de/forum/index.php?topic=10326.msg50870#msg50870

edit ende
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: rubberduck on January 25, 2008, 11:52:06 PM
Bevor ich das installiere, wo ist der Unterschied zwischen

[MOD] Member personal photo v1.1.1 by V@no
http://www.4homepages.de/forum/index.php?topic=6797.0

und dem hier

[Mod] Avatar v2.01
http://www.4homepages.de/forum/index.php?topic=3978.0

bzw. welches sollte man lieber installieren?

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: rubberduck on January 28, 2008, 01:22:38 PM
Mal ganz vorsichtig nach oben schieb  :oops:

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jan-Lukas on January 28, 2008, 01:58:00 PM
verstehe deine Frage nicht  :wink:
Was soll angezeigt werden, User Bild oder User Avatar
Glaube das solltest Du besser beantworten können  :lol:
Oder ist Dir der Unterschied zwischen User Bild / Avatar nicht bekannt  :?:
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: rubberduck on January 28, 2008, 03:12:36 PM
verstehe deine Frage nicht  :wink:
Was soll angezeigt werden, User Bild oder User Avatar
Glaube das solltest Du besser beantworten können  :lol:
Oder ist Dir der Unterschied zwischen User Bild / Avatar nicht bekannt  :?:

Darum ja meine Frage (vieleicht umständlich formuliert).

Bei beiden Mods kann der User ein Bild hochladen was dann sein persönliches ist und angezeigt wird !? Oder steh ich jetzt auf dem Schlauch und hab da was falsch verstanden ?

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: nobby on January 28, 2008, 03:48:06 PM
Hallo Rubberduck,

was ein Foto ist weist Du bestimmt, und was ein Avatar ist kannst Du hier:  :arrow: http://de.wikipedia.org/wiki/Avatar_%28Internet%29 nachlesen.

Also, das erste ist für Fotos in dem Profil und das zweite eben für Avatare  :wink:

nobby
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Jan-Lukas on January 28, 2008, 03:52:48 PM
beim Member personal photo sollte ein persönliches Bild hochgeladen werden

beim Avatar Mod, wird meist ein Fantasie Bild hochgeladen, ähnlich wie ein Nickname

ich persönlich habe nur Member personal photo installiert, weil der Avatarmod zu komplex ist, und so nicht nötig ist.
Werde mir lieber den Member personal photo so umschreiben das auf dem selben Wege auch ein Avatar hochgeladen wird

Harald
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: rubberduck on January 28, 2008, 03:57:34 PM
was ein Foto ist weist Du bestimmt, und was ein Avatar ist kannst Du hier:  :arrow: http://de.wikipedia.org/wiki/Avatar_%28Internet%29 nachlesen.

Ja - nochmal - ich kenne den Unterscheid zwischen einem Foto und einem Avatar. Ich wollte was über Funktion der Mods Wissen, denn ob dann im Endeffekt ein "Foto" oder ein "Avatar" hochgeladen wird ist im Grunde Jacke wie Hose.

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: rubberduck on January 28, 2008, 03:58:04 PM
ich persönlich habe nur Member personal photo installiert, weil der Avatarmod zu komplex ist, und so nicht nötig ist.
Werde mir lieber den Member personal photo so umschreiben das auf dem selben Wege auch ein Avatar hochgeladen wird

Harald

Und genau das war es was ich Wissen wollte ... Vielen Dank für die Info!

Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Sunny C. on July 26, 2008, 12:02:32 AM
Klappt wunderbar mit der Version 1.7.6!
Habs in der Liste mit aufgenommen!

http://www.4homepages.de/forum/index.php?topic=21849.0
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Holger2 on September 24, 2008, 03:03:09 PM
@IcEcReaM:
I'm not an expert, but I think since the userpic field in the database is for strings, its better use userpic <> '' or NOT userpic in mysql queries

thanks, you are right.
i didn't noticed that,
cause i was working also on an similar mod where the userpic is an integer value,
and the file extension is saved seperatly.

I modified my post,
thanks for this hint.

P.S.: If this "mod" is working correctly,
you can post it if you want as an additional step/option in your first post.
A very old post I am quoting now, I know!
But I cannot get this thing working.
I have added the Member Personal Photo MOD and the Addon which shows random Members on the index. Now I only want to show members, who really HAVE uploaded a profilephoto.
I do not want the placeholder-text to show up.
It does not have any effect with
Code: [Select]
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic>= '0'nor with
Code: [Select]
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic <> ''
Also: I cannot make the correct membername show up.
I almost always get a memberphoto with the WRONG membername below it.
I removed the user_name if/endif, but it would be really nice to HAVE it there!

Any idea what I have to do?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on September 24, 2008, 11:59:45 PM
can you explain with more details what EXACTLY have you done to the code besides the changes from first post.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Holger2 on September 25, 2008, 09:20:50 AM
Maybe we can start to solve one problem first.

1. I have installed Member Personal Photo MOD - works
2. I have installed the Addon which shows random Members on the index - works
This addon was described some pages into this thread.
3. I also added the snippet which places a placeholder-photo for members who have NOT uploaded any member personal photo - works
This addon was also linked to some pages into this thread.

NOW I would like to only show members who really HAVE uploaded a photo.
I tried:
Code: [Select]
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic>= '0'and:
Code: [Select]
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic <> ''but there is no difference. The members without member photo still are shown.

Shouldn't it be
Code: [Select]
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic > '0'> instead of >=
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: crs on October 04, 2008, 01:38:27 AM
Hallo

Ich würde das Userbild gerne neben den ganzen Userinformationen anzeigen.
Standard sieht man das Foto ja zwischen den Informationen...

Ist bestimmt leicht zu machen aber ich bin Anfänger :(

Beispielfoto, wie es aussehen soll hänge ich an.



Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on October 04, 2008, 01:52:17 AM
It doesn't look like the default template you are using, so unless you provide a link to your gallery you probably won't get far with such request.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: crs on October 04, 2008, 02:50:46 AM
www.Autospotter.de

Look at my profile "crs" i´ve uploaded a picture.
But i want to show the picture beside the userinfos, not inside...
I´ ve uploaded an example of that in my post before.
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: V@no on October 04, 2008, 06:39:15 AM
try attached template
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: crs on October 04, 2008, 08:18:32 PM
Hi, thanks for this, but its still not perfect  :(
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: bergblume on December 05, 2008, 10:39:54 AM
I want users to upload their personal photo when they register so I added the following to register_form.html:

   <tr>
            <td class="row1" valign="top"><b>{lang_userpic}</b>
            <SPAN class="smalltext">   
                <br />
                <b>{lang_userpic_upload}</b>
               </SPAN>
            </td>
            <td class="row1">
              <INPUT type="file" name="userpic_file"  size="30" class="input" /><br />
              {if userpic_img}<img src="{userpic_img}"><br /><input type="checkbox" name="userpic_del" value="1">&nbsp;{lang_userpic_del}{endif userpic_img}
            </TD>
          </TR>


However, for some reason, the {lang_userpic_upload} text will not appear in the registration form, although it is visible in the edit profile page?  Please help!

hi,
is there already a solution available for integrating user pic upload in register-form?
would be nice if someone could solve this question...
best regards,
bergblume
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Sunny C. on December 06, 2008, 07:19:15 PM
   
Hello,

there's something in me that disturbs modification. If I were a picture in the size of "352x460" and upload to the admin area the size of "200x267" set had me on the picture "150x200" asked. How can I get the out that this image then as a "200x267" is cut?
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: bergblume on December 09, 2008, 11:10:05 AM

hi,
is there already a solution available for integrating user pic upload in register-form?
would be nice if someone could solve this question...
best regards,
bergblume

hello,

can anyone tell me how to insert form for uploading user-pic directly in register-form!?
thank you in advance for your help!

bergblume
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: alekinna on December 11, 2008, 07:49:34 AM
If you deleted user from DB, for deleting his userpic find in the file admin/users.php

Code: [Select]
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name")."
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "user_id")." IN ($user_ids)";
  $user_result = $site_db->query($sql);
  $image_ids_sql = "";
  while ($user_row = $site_db->fetch_array($user_result)) {
    $user_id = $user_row[$user_table_fields['user_id']];
    $user_name = $user_row[$user_table_fields['user_name']];

replace with
Code: [Select]
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").", userpic
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "user_id")." IN ($user_ids)";
  $user_result = $site_db->query($sql);
  $image_ids_sql = "";
  while ($user_row = $site_db->fetch_array($user_result)) {
    $user_id = $user_row[$user_table_fields['user_id']];
    $user_name = $user_row[$user_table_fields['user_name']];
    $userpic = $user_row['userpic'];
    if (file_exists(ROOT_PATH."data/userpic/".$userpic)) {
      unlink(ROOT_PATH."data/userpic/".$userpic);
    }

Quote
can anyone tell me how to insert form for uploading user-pic directly in register-form!?

I did in this way:

1. in the template register_form.html before
Code: [Select]
{if captcha_registration}
add
Code: [Select]
          {if userpic_allowed}
          <tr>
            <td width="50%" class="row2" valign="top"><b>{lang_userpic}</b>
              <SPAN class="smalltext">
                <br />
                {lang_userpic_upload}
              </SPAN>
            </td>
            <td class="row2">
              <INPUT type="file" name="userpic_file"  size="30" class="input" />
            </TD>
          </TR>
          {endif userpic_allowed}

1.1 find
Code: [Select]
<form method="POST" action="{url_register}">
replace with
Code: [Select]
<form method="POST" action="{url_register}" enctype="multipart/form-data">

2. in the file register.php

find
Code: [Select]
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
add above
Code: [Select]
$userpic = "";
  $userpics_dir = ROOT_PATH."data/userpic/";

2.1 find
Code: [Select]
} // end if
add above
Code: [Select]
    if (!empty($HTTP_POST_FILES['userpic_file']['tmp_name']) && $HTTP_POST_FILES['userpic_file']['tmp_name'] != "none") {
      $userpic = 1;
      $mime_types = array(
        "image/jpeg",
        "image/pjpeg",
        "image/gif",
        "image/x-png"
      );
      $extensions = array(
        "jpg",
        "jpeg",
        "gif",
        "png"
      );
      $userpic_ext = strtolower(substr(strrchr($HTTP_POST_FILES['userpic_file']['name'],"."), 1));
      $userpic_mime = $HTTP_POST_FILES['userpic_file']['type'];
      if (!in_array($userpic_mime, $mime_types) || !in_array($userpic_ext, $extensions)) {
        $error = 1;
        $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_file_type']. " (".$userpic_ext.", ".$HTTP_POST_FILES['userpic_file']['type'].")";
      }
      if ($HTTP_POST_FILES['userpic_file']['size'] > $config['userpic_size'] * 1024) {
        $error = 1;
        $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_file_size'];
      }
    }

2.2 find
Code: [Select]
$additional_field_sql = "";
    $additional_value_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_field_sql .= ", $key";
          $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }
    $activationkey = get_random_key(USERS_TABLE, get_user_table_field("", $user_table_fields['user_activationkey']));
    $user_id = $site_db->get_next_id($user_table_fields['user_id'], USERS_TABLE);

replace with
Code: [Select]
    $activationkey = get_random_key(USERS_TABLE, get_user_table_field("", $user_table_fields['user_activationkey']));
    $user_id = $site_db->get_next_id($user_table_fields['user_id'], USERS_TABLE);
   
    if ($config['userpic'] && $userpic) {
        $userpic_name = $user_id.".".$userpic_ext;
        $userpic_file = $userpics_dir.$userpic_name;

        if (!move_uploaded_file($HTTP_POST_FILES['userpic_file']['tmp_name'], $userpic_file)) {
          $error[] = $lang['file_copy_error'];
        }
        else {
          @chmod($userpic_file, CHMOD_FILES);
          $HTTP_POST_VARS['userpic']  = $userpic_name;
        }

      if (empty($error)) {
        if (!function_exists(init_convert_options)){
          require(ROOT_PATH.'includes/image_utils.php');
        }
        $image_info = getimagesize($userpic_file);
        $convert_options = init_convert_options();
        if (($image_info[0] > $config['userpic_width'] || $image_info[1] > $config['userpic_height'])) {
          if ($convert_options['convert_error'] || (!$convert_options['convert_error'] && !resize_image($userpic_file, 85, $config['userpic_width'], 1))) {
            if ($image_info[0] > $config['userpic_width']) {
              $error[] = $lang['invalid_image_width'];
            }
            if ($image_info[1] > $config['userpic_height']) {
              $error[] = $lang['invalid_image_height'];
            }
          }
        }
      }
      if (!empty($error)) {
        $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$HTTP_POST_FILES['userpic_file']['name']."</b><br />";
        foreach ($error as $val) {
          $msg .= "<b>".$HTTP_POST_FILES['userpic_file']['name'].":</b> ".$val."<br />";
        }
      }
    }
     
    $additional_field_sql = "";
    $additional_value_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_field_sql .= ", $key";
          $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }

2.3 find
Code: [Select]
"user_invisible_no" => $user_invisible_no,
add below
Code: [Select]
//User Pic
      "userpic_allowed" => $config['userpic'],
      "userpic_max_width" => $config['userpic_width'],
      "userpic_max_height" => $config['userpic_height'],
      "userpic_max_size" => $config['userpic_size']."&nbsp;".$lang['kb'],
      "lang_userpic_upload" => preg_replace("/".$site_template->start."userpic_max_size".$site_template->end."/siU", $config['userpic_size']."&nbsp;".$lang['kb'], preg_replace("/".$site_template->start."userpic_max_width".$site_template->end."/siU", $config['userpic_width'], preg_replace("/".$site_template->start."userpic_max_height".$site_template->end."/siU", $config['userpic_height'], $lang['userpic_upload']))),
//End User Pic
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on December 11, 2008, 08:33:08 AM
Thanks alekinna. Added step 14
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: bergblume on December 11, 2008, 10:00:27 AM
thank you so much, alekinna!!!

perfect additional codes to this great MOD !!!  :thumbup: :thumbup: :thumbup:
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: shadowhunter on December 11, 2008, 01:44:50 PM
@alekinna:

Your extension with "insert form for uploading user-pic directly in register-form" doesn't works! It's strange.
I made all the steps for the code change.

- When I upload a file, which isn't allowed, then it doesn't come an error!
- The allowed files aren't uploaded!

Can you help me, please? Thanks!
Greetings
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: bergblume on December 11, 2008, 01:54:21 PM
hi scluzern,
you are right - I also just tried it out - uploaded user_pic is not shown after registering...
@ alekinna, can you pls. help! I used further the small modification of V@no described here (http://www.4homepages.de/forum/index.php?topic=6797.45), in order to show a noimge.png-pic for the case a user has not uploaded a user-pic.

oh, crap! you are right, I didnt think about that...:oops:
well, ok, first, restore the database with this query:
Code: [Select]
UPDATE 4images_users SET userpic = '' WHERE userpic = 'noimage.png';
ALTER TABLE 4images_users CHANGE userpic userpic VARCHAR( 255 ) DEFAULT '' NOT NULL

Then in member.php find:
Code: [Select]
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "", Replace it with:
Code: [Select]
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : ROOT_PATH."data/userpic/noimage.png",
Then find:
Code: [Select]
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",Replace it with:
Code: [Select]
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : ROOT_PATH."data/userpic/noimage.png",Place your noimage.png image into data/userpic/ folder.

find attached noimage.png

greetings, bergblume
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: shadowhunter on December 11, 2008, 02:08:58 PM
Problem solved
Quote
If you deleted user from DB, for deleting his userpic find in the file admin/users.php
I have found an another error:
If I have deleted a user without an image, then the following error in ACP comes:
Code: [Select]
Warning: unlink(./../data/userpic/) [function.unlink]: Is a directory in /home/www/................../admin/users.php on line 60
User erfolgreich gelöscht asd (ID: XXX)
  Bilder erfolgreich gelöscht
  Kommentare erfolgreich gelöscht

If I have deleted a user with an image, then it works perfectly!
Greetings
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on December 11, 2008, 03:27:36 PM
Ops, my bad.
Please re-do Step 14. Should fix the error.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: alekinna on December 11, 2008, 09:14:50 PM
Ops.. I forgot step 1.1 :oops:

scluzern
bergblume

thanks for your feedback

V@no
thanks for correcting my pure code
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on December 11, 2008, 11:40:59 PM
Of course it doesn't work, because I mess up the code again...I'm very sorry. Was late for work this morning.
Try re-do Step 14 one more time, this time it must work, otherwise I don't know...I go mad(http://img177.imageshack.us/img177/7264/freakouthy1.gif)
j/k :lol:
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: Sweetness on January 30, 2009, 08:47:49 PM
Also ich habe jetzt alles wie beim ersten Posting gemacht und umgeschrieben. Userpic-Verzeichnis angelegt, alle Seiten dementsprechend angeglichen, aber meine User können keine Bilder ins Profil laden.
Es wird mir zwar alles für den Profilbild-Upload angezeigt ( member_edtiprofil.html ) aber nach dem drücken auf "Speichern", ist kein Userbild zu sehen.
Auch im Verzeichnis "Userpic" wurde nichts hochgeladen.

Kann mir mal bitte jemand sagen, was ich falsch gemacht habe? Bekomme nämlich keinerlei Fehlermeldungen.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on January 31, 2009, 01:37:43 AM
Check Step 1.1 and Step 6

Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: Sweetness on January 31, 2009, 12:14:00 PM
Supi! Hat geklappt! Danke :)

Hatte ein mal <form method="post" action="{url_member}"> noch vergessen zu ändern!
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: neverkas on May 31, 2009, 10:51:37 PM
ENGLISH
With this mod, I can not change photo.
To delete the current photo, and put another, follow the first to appear Subi.

Ex
Upload in my profile foto1.jpg the clear, then I upload foto2.jpg because I like more, but being foto1.jpg SIGE



SPANISH
Con este MOD, no puedo cambiar de foto.
Al borrar la foto actual, y poner otra, sige apareciendo la primera que subi.

Ej.
Subo en mi perfil FOTO1.JPG la borro, y luego quiero subir FOTO2.JPG porque me gusta más, pero sige viendose FOTO1.JPG
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on June 01, 2009, 07:20:28 AM
Are you sure what you see is not coming from your brower's cache? try clear your browser's cache.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: neverkas on June 02, 2009, 05:53:22 PM
Are you sure what you see is not coming from your brower's cache? try clear your browser's cache.

If I did, use Mozilla Firefox, and delete the cache.
Close user session, the session and start again, but I SIGE the same picture emerging.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on June 03, 2009, 04:01:00 AM
hmmm this is strange. Then the following troubleshooting:

To simplify I'll use first.jpg and second.jpg as filenames for two different images.


if it's second.jpg, then to be sure, download that image from FTP (like in 9.)

P.S.
SIGE = see?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: bergblume on June 22, 2009, 10:43:21 AM
mmh... bei mir ist auch etwas komisch...
ich habe bei usern, die kein bild hochgeladen haben, standardmäßig die bilddatei noimage.png in ./data/userpic hinterlegt... nach einigen tagen ist dieses bild dann spurlos verschwunden und auch nicht mehr auf dem server in dem ordner??
kann mir jmd. dies erklären bzw. zur lösung beitragen?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on June 22, 2009, 03:48:38 PM
noimage.png is not part of this mod...
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: bergblume on June 22, 2009, 04:17:27 PM
then how can I use the noimage-feature along with this mod... in some previous topics there was s.th. mentioned about showing a standard pic when a user does not have uploaded a personal photo..,.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on June 22, 2009, 05:23:25 PM
you can use {ifno userpic_img} ... {endifno userpic_img}
Title: Re: [MOD] Member personal photo v1.1.1 by V@no
Post by: Sebas Bonito on June 25, 2009, 04:00:13 PM
Hi,

I have not posted often on this topic since I didn't had any additional ideas in order to expand this MOD.

However, since yesterday, I have worked on the userpic MOD in order, for users and admins, to see a random userpic window in the home page of their gallery. The good news is, it has been reported as complete success. ;)

For now, no more than a single picture at the time will load (most likely like the random image feature - already integrated as part of 4images core). If more images needs to be loaded at the time, further modifications would need to be done but would also be applied differently. That said, it would be best to remain on 1 picture at the time (randomly of course). ;)

// Beta-Tester

My thanks goes to Stoleti for requesting and evaluating this project.

// Affected files

- index.php
- lang/english/main.php
- templates/<your_template>/home.html

// Step 1

In your index.php file,

find :

Quote

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------


add above :

Code: [Select]

//--------------------------------------
//--- Random Userpic Images ------------
//--------------------------------------

$sql = "

SELECT DISTINCT ".get_user_table_field("", "user_id"). get_user_table_field(", ", "user_name"). get_user_table_field(", ", "user_level").", userpic
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_level")." >= '".USER."'
ORDER BY RAND()
LIMIT 1

";

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

if (!$result) {

$userpic_img = $lang['no_random_userpic'];

} else {

while ($row = $site_db->fetch_array($result)) {

$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\" width=\"".$config['userpic_width']."\" height=\"".$config['userpic_height']."\" border=\"0\"></a>" : $lang['no_random_userpic'];
$user_name = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<br /><a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\">".$row['user_name']."</a>" : "<br /><br /><a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['user_id']."&user_name=".$row['user_name'])."\">".$row['user_name']."</a>";

} ###### End of while statement.

if ($user_info['user_level'] >= USER) {

$site_template->register_vars(array(
"user_name" => $user_name,
"userpic_img" => $userpic_img,
"lang_no_random_userpic" => $lang['no_random_userpic'],
"lang_random_userpic_images_title" => $lang['random_userpic_images_title']
));
} ###### End of if statement.
} ###### End of if statement.

unset ($userpic_img);
unset ($user_name);


// Step 2

In your templates/<your_template>/home.html file,

add the following where you want it to appear :

Code: [Select]

                <br />
                  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_random_userpic_images_title}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="row1" align="center" valign="top">{if userpic_img}<br />{userpic_img}{endif userpic_img}{if user_name}<br />{user_name}{endif user_name}</td>
                    </tr>
                  </table>
                <br />


Of course, this peace of template is simply an example. You may customize it the way you feel is right for you. ;)

// Step 3

In your lang/english/main.php file,

add above the '?>' tag :

Code: [Select]

//-----------------------------------------------------
//--- Random userpic images ---------------------------
//-----------------------------------------------------
$lang['random_userpic_images_title'] = "Random userpic images";
$lang['no_random_userpic'] = "This user has no picture on his profile";


// Installation complete

This completes the installation of this MOD. To try it, simply go to your home page gallery and "login first" (either as a USER or ADMIN - your choice). From there, you should be able to see random userpic from your database users.

// What if they didn't uploaded a picture within their profile ?

This has been thought. If users didn't uploaded a picture on their profile at all, a text will appear with their user name below (with URL of course). On either case, you will still be able to see their personal profile page.

Good luck ! 8)


This doesnt' work on my site correct. First of all... the user name is wrong... it's always the same, and the one from the pic. And finally when the user doesn't have an avatar a blank "img"-container will appear instead of a message/text.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: robertx on August 18, 2009, 09:54:34 AM
Hello . I have modified that new changes .
The problem is that the noimge.png-pic for the case that user has not uploaded a user-pic does NOT show in any comments .

Could anyone help me ?

Regards,

Robert


hi scluzern,
you are right - I also just tried it out - uploaded user_pic is not shown after registering...
@ alekinna, can you pls. help! I used further the small modification of V@no described here (http://www.4homepages.de/forum/index.php?topic=6797.45), in order to show a noimge.png-pic for the case a user has not uploaded a user-pic.

oh, crap! you are right, I didnt think about that...:oops:
well, ok, first, restore the database with this query:
Code: [Select]
UPDATE 4images_users SET userpic = '' WHERE userpic = 'noimage.png';
ALTER TABLE 4images_users CHANGE userpic userpic VARCHAR( 255 ) DEFAULT '' NOT NULL

Then in member.php find:
Code: [Select]
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "", Replace it with:
Code: [Select]
      "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : ROOT_PATH."data/userpic/noimage.png",
Then find:
Code: [Select]
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",Replace it with:
Code: [Select]
    "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : ROOT_PATH."data/userpic/noimage.png",Place your noimage.png image into data/userpic/ folder.

find attached noimage.png

greetings, bergblume
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on August 18, 2009, 02:38:55 PM
Does it show a broken image instead?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: robertx on August 18, 2009, 03:48:35 PM
Thanks for responce V@no.

No , no picture appear . But is strange that i see that "noimage" in user profile .
IN comment_bit.html i use {if comment_userpic} <img src="{comment_userpic}">{endif comment_userpic} . I mention that users that had uploaded their pictures post comments with pictures .

Thanks again


Does it show a broken image instead?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on August 19, 2009, 02:12:08 AM
try this then:
Code: (HTML Template) [Select]
{if comment_userpic} <img src="{comment_userpic}">{endif comment_userpic}{ifno comment_userpic} <img src="<?=ROOT_PATH."data/userpic/noimage.png";?>">{endifno comment_userpic}
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: robertx on August 19, 2009, 10:41:08 AM
it is working . thanks V@no


try this then:
Code: (HTML Template) [Select]
{if comment_userpic} <img src="{comment_userpic}">{endif comment_userpic}{ifno comment_userpic} <img src="<?=ROOT_PATH."data/userpic/noimage.png";?>">{endifno comment_userpic}
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: arabcine on September 29, 2009, 06:40:07 PM
Step 9
Download this package, extract it and upload to your 4images

where i can download this package because file not found in this web site ...
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: mawenzi on September 29, 2009, 07:27:29 PM
@ arabcine

... at the very bottom of the first post ...
... find : userpic_install.zip ...
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: arabcine on September 29, 2009, 08:06:21 PM
what about this ?

in http://gallery.vano.org/file58dl

Step 9
Download this[/b]]this (http://[b) package, extract it and upload to your 4images root directory, then execute it by typing in your browser: http://<your_site_address_and_path_to_your_4images>/userpic_install.php
Follow the instructions.



on word (This) you will see the link we must download it ?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@nо on September 29, 2009, 08:33:49 PM
did you click on the link?

the needed file is attached to the first post
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: arabcine on September 30, 2009, 10:01:27 AM
did you click on the link?

the needed file is attached to the first post


YOU MEAN THEIS
http://www.4homepages.de/forum/index.php?topic=3978.0#post_attachment


yes NOTHING IN ATTACHED not work the link

http://www.4homepages.de/forum/index.php?topic=3978.0#post_attachment


can you give me the link of this ?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on September 30, 2009, 03:46:30 PM
Yes, the link isn't pointed to the attachment, but your browser should scroll down to the link for attached file.
I'm deliberately don't want give you direct link to the file, so you learn how it works, because this method used a lot on this forum.

(hint: all attachments placed below the post)
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: arabcine on September 30, 2009, 07:11:29 PM
why , and how i can learn how ?

u can upload it by web zshare.net rapaidshare.com etc

iam searching for your attached but not found please upload and give me the link of this file
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: mawenzi on September 30, 2009, 07:22:25 PM
@ arabcine

... please take down the tomatos from your eyes ...
... as we said ...
... at the very bottom of the first post from this thread ...
... find : userpic_install.zip ...
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: arabcine on September 30, 2009, 07:26:24 PM
sorry brother i saw it before and  iwas think i have to download other file by this ,,

and thanks for your help
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: luener on October 16, 2009, 03:43:22 PM
Klappt prima und sieht gut aus..!

Aber ein Problem:
Firefox und Opera zeigen alles an, nur im Internet-Explorer wird das Pic
in der comment_bit  nicht angezeigt

Zu sehen auf:  http://topfoto24.lima-city.de/details.php?image_id=163

Kann mir jemand helfen???

Gruß
Ralf

Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on October 16, 2009, 04:06:00 PM
apparently IE doesn't like when in width/height used % values
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: luener on October 16, 2009, 04:30:19 PM
Hi, V@no..!

Thx for your fast Answer.
Any Idea, how i can schow the Pic in comment_bit smaller then the original Size???

So that also  IE displays The Pic.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: zakaria666 on September 08, 2010, 05:56:32 PM
So in this MOD is it the same as the avatar MOD or can users actually upload real photos to be on profile or just avatars?

thanks
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on September 09, 2010, 12:46:12 AM
Usually avatars is something being visible everywhere where the user is published, while personal photo is something being showed at their profile page, in much larger resolution then avatar.
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: fermachado on October 16, 2010, 10:30:25 AM
Hi,

Thanks for this great mod.

A question about the random userpic
http://www.4homepages.de/forum/index.php?topic=6797.msg60282#msg60282 (http://www.4homepages.de/forum/index.php?topic=6797.msg60282#msg60282)

How I can show the members userpic to guests?Now only registered members can see the members user pic.

Thanks
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: Rembrandt on October 16, 2010, 12:47:14 PM
...
How I can show the members userpic to guests?Now only registered members can see the members user pic.
search:
if ($user_info['user_level'] >= USER) {

$site_template->register_vars(array(
"user_name" => $user_name,
"userpic_img" => $userpic_img,
"lang_no_random_userpic" => $lang['no_random_userpic'],
"lang_random_userpic_images_title" => $lang['random_userpic_images_title']
));
} ###### End of if statement.


replace:

$site_template->register_vars(array(
"user_name" => $user_name,
"userpic_img" => $userpic_img,
"lang_no_random_userpic" => $lang['no_random_userpic'],
"lang_random_userpic_images_title" => $lang['random_userpic_images_title']
));
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: fermachado on October 17, 2010, 10:01:41 AM
Hi,

Thanks,

I changed the code,but only show this for guests.

Random userpic images
 

This user has no picture on his profile
fer


 But ,the user have userpic.


Found a problem in the original code.
The name under the thumbnail does not match with the userpic

Thanks
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: trez on October 11, 2011, 01:41:39 PM
With 1.7.10 the userpic isn't shown in the details page of an image - Comments are working, but using {userpic} in the details doesn't show anything.

To solve it take a look at that fix:

http://www.4homepages.de/forum/index.php?topic=19297.0 (http://www.4homepages.de/forum/index.php?topic=19297.0)
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on October 11, 2011, 07:31:20 PM
mmmm what about step 10?
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: trez on October 22, 2011, 09:29:15 PM
mmmm what about step 10?

Did it. Or maybe the beer was too much, anyway I got it working now ;)

V@no, can we crop the image to a fixed size, rather then resize only the longest side? That was requested before in this thread.

Example: I set 200x200 px in the admin panel, and the uploaded pictures are all 200x200 px (Like in this modification for thumbnails (http://www.4homepages.de/forum/index.php?topic=20353.msg111341#msg111341) ?

I tried to play around to do it myself, but didn't manage it. Hope you can help, again. Beer is on me ;)










Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on October 23, 2011, 06:58:22 AM
Try this:
1) [FIX] Max height has no affect when do image resize (http://www.4homepages.de/forum/index.php?topic=7058.msg30980#msg30980)
2) in member.php find:
          if ($convert_options['convert_error'] || (!$convert_options['convert_error'] && !resize_image($userpic_file, 85, $config['userpic_width'], 1)))
Replace it with:
          if ($convert_options['convert_error'] || (!$convert_options['convert_error'] && !resize_image($userpic_file, 85, $config['userpic_width'], 1, $config['userpic_height'])))


[EDIT]
I think I misunderstood your request...maybe this will suit you better (assuming you've added the code for thumbnails you've mentioned)
replace the line above (in member.php) with this:
          $image_info = @getimagesize($userpic_file);
          if ($image_info)
            $wh = get_width_height($config['userpic_width'], $image_info[0], $image_info[1], 1);
          if ($convert_options['convert_error'] || !$wh || (!$convert_options['convert_error'] && !resize_image_gd_thumb($userpic_file, $userpic_file, 85, $wh['width'], $wh['height'], $image_info)))
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: trez on October 23, 2011, 03:11:18 PM
Hey,

thanks for your help on such short notice. I included the code snippet, image upload works, but there is no resize of the userpic image.
That's how it looks like:

Code: [Select]
      {
        $userpic = $HTTP_POST_VARS['userpic'] = $userpic_new = $userpic_name;
        if ($user_info['userpic'] != $userpic_name && file_exists($userpics_dir.$user_info['userpic']))
        {
          @unlink($userpics_dir.$user_info['userpic']);
        }
        if (!function_exists(init_convert_options))
        {
          require(ROOT_PATH.'includes/image_utils.php');
        }
        $image_info = getimagesize($userpic_file);
        $convert_options = init_convert_options();
        if (($image_info[0] > $config['userpic_width'] || $image_info[1] > $config['userpic_height']))
        {
          $image_info = @getimagesize($src);
          if ($image_info)
  $wh = get_width_height($config['userpic_width'], $image_info[0], $image_info[1], 1);
          if ($convert_options['convert_error'] || !$wh || (!$convert_options['convert_error'] && !resize_image_gd_thumb($userpic_file, $userpic_file, 85, $wh['width'], $wh['height'])))
          {
            if ($image_info[0] > $config['userpic_width'])
            {
              $error[] = $lang['invalid_image_width'];
            }
            if ($image_info[1] > $config['userpic_height'])
            {
              $error[] = $lang['invalid_image_height'];
            }
          }
        }
      }

You were assuming right, I have added the code for those thumbnails

I tried this too, but I assume it's wrong because I get sql errors:

Code: [Select]
        $image_info = getimagesize($userpic_file);
        $convert_options = init_convert_options();

          if ($image_info)
  $wh = get_width_height($config['userpic_width'], $image_info[0], $image_info[1], 1);
          if ($convert_options['convert_error'] || !$wh || (!$convert_options['convert_error'] && !resize_image_gd_thumb($userpic_file, $userpic_file, 85, $wh['width'], $wh['height'])))
          {
            if ($image_info[0] > $config['userpic_width'])
            {
              $error[] = $lang['invalid_image_width'];
            }
            if ($image_info[1] > $config['userpic_height'])
            {
              $error[] = $lang['invalid_image_height'];
            }
          }


EDIT:

Replacing $image_info = @getimagesize($src); with $image_info = @getimagesize($userpic_file); shows me an error in the "resize_image_gd_thumb()". But I guess I am one step closer now.



Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: V@no on October 23, 2011, 05:53:39 PM
I've updated my post above. Seems to work for me (at least no error messages)
Title: Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
Post by: trez on October 23, 2011, 06:26:30 PM
Yepp, working now ;)

PS: Where to send you a six-pack of Heinecken?  8)