• [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 327612 times)

0 Members and 1 Guest are viewing this topic.

Offline alekinna

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • Gallery of cross-stitching
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #270 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

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.2 by V@no (2008-12-11)
« Reply #271 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
j/k :lol:
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 Sweetness

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #272 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.
lokaler Apache
PHP5
MySQL


Der Rest ist 90-60-90 ;)

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.2 by V@no (2008-12-11)
« Reply #273 on: January 31, 2009, 01:37:43 AM »
Check Step 1.1 and Step 6

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 Sweetness

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #274 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!
lokaler Apache
PHP5
MySQL


Der Rest ist 90-60-90 ;)

Offline neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #275 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
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

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.2 by V@no (2008-12-11)
« Reply #276 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.
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 neverkas

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
    • FullPosteo
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #277 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.
http://www.fullposteo.com.ar/



La nueva forma de compartir tus fotos y vídeos con tus amigos!

The new form to share photos and videos width your friends!

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.2 by V@no (2008-12-11)
« Reply #278 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.

  • from the user's control panel upload first.jpg image
  • check via FTP that the file exists (the file should be at: data/userpics/<user ID>.jpg, image will be renamed so you won't find first.jpg)
  • check via FTP what are the permissions on that file (CHMOD, it should be 0666 or 666)
  • from user's control panel delete user's picture
  • make sure via FTP that the file deleted
  • upload second.jpg picture
  • make sure that now you see second.jpg and not first.jpg in member's profile (if you see first.jpg, then you did something wrong or your browser messed up)
  • upload first.jpg picture
  • download via FTP that file (data/userpics/<user ID>.jpg) to your computer, if what you downloaded is first.jpg picture you can stop here, everything is working correctly and it's most likely something wrong with your browser.
  • via FTP change permissions on data/userpics/<user ID>.jpg to 777
  • upload first.jpg picture
  • check at member's profile page what kind of images is showed, if it's first.jpg, then in the code from Step 1.1 replace
              @chmod($userpic_fileCHMOD_FILES);
    With this:
              @chmod($userpic_file0777); 


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

P.S.
SIGE = see?
« Last Edit: June 03, 2009, 04:11:22 AM by V@no »
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 bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #279 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?

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.2 by V@no (2008-12-11)
« Reply #280 on: June 22, 2009, 03:48:38 PM »
noimage.png is not part of this mod...
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 bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #281 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..,.

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.2 by V@no (2008-12-11)
« Reply #282 on: June 22, 2009, 05:23:25 PM »
you can use {ifno userpic_img} ... {endifno userpic_img}
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 Sebas Bonito

  • Sr. Member
  • ****
  • Posts: 271
  • Sebas Bonito
    • View Profile
Re: [MOD] Member personal photo v1.1.1 by V@no
« Reply #283 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.

Offline robertx

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Member personal photo v1.1.2 by V@no (2008-12-11)
« Reply #284 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, 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