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

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Member personal photo v1.0
« Reply #15 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}

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.0
« Reply #16 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 ;)
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 ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Member personal photo v1.0
« Reply #17 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.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Member personal photo v1.0
« Reply #18 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)

Offline graficalicus

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [MOD] Member personal photo v1.0
« Reply #19 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 - -

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.0
« Reply #20 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);
    }
  }
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 ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Member personal photo v1.0 by V@no
« Reply #21 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}

Offline graficalicus

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [MOD] Member personal photo v1.0 by V@no
« Reply #22 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?

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.0 by V@no
« Reply #23 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} )
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 graficalicus

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [MOD] Member personal photo v1.0 by V@no
« Reply #24 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)

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] Member personal photo v1.0 by V@no
« Reply #25 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
Again this addres?!
http://www.funny.lt

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.0 by V@no
« Reply #26 on: April 16, 2005, 09:11:23 AM »
avatar?
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] Member personal photo v1.0 by V@no
« Reply #27 on: April 16, 2005, 09:28:05 AM »
Sorry, avatar = personal photo ;]
Again this addres?!
http://www.funny.lt

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.0 by V@no
« Reply #28 on: April 16, 2005, 10:02:42 AM »
and what is the code u've changed?
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: [MOD] Member personal photo v1.0 by V@no
« Reply #29 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.
Again this addres?!
http://www.funny.lt