• [MOD] Member personal photo v1.1.3 by V@no (2011-10-23) 4 0 5 1
Currently:  

Author Topic: [MOD] Member personal photo v1.1.3 by V@no (2011-10-23)  (Read 326250 times)

0 Members and 2 Guests are viewing this topic.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #150 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.  :|

Offline brunorosa

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Janela Urbana
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #151 on: January 15, 2006, 05:27:33 PM »
thanks :\

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #152 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #153 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)

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #154 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:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #155 on: February 07, 2006, 07:39:21 AM »
Sorry, I dont understand...what is the problem?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline alex

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Ring-Action Motorsportfotos
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #156 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #157 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
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline alex

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Ring-Action Motorsportfotos
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #158 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #159 on: February 07, 2006, 02:54:06 PM »
So? uset it inside your html...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline alex

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Ring-Action Motorsportfotos
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #160 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

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #161 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)

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #162 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.

Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #163 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

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #164 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']."\">" : "";
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump