-
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:
"user_homepage_button" => $user_homepage_button,
Insert above:
//User Pic
"userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic
Step 1.1
Find:
if (!$error && $user_email != $user_info['user_email'] && $user_info['user_level'] != ADMIN && $config['account_activation'] != 0) {
Insert above:
// 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:
"user_showemail_yes" => $user_showemail_yes,
Insert above:
//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']." ".$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']." ".$lang['kb'],
//End User Pic
Step 2
Open includes/db_field_definitions.php
At the end, above closing ?> insert:
$additional_user_fields['userpic'] = array($lang['userpic'], "text", 0);
Step 3
Open lang/<yourlanguage>/main.php
At the end, above closing ?> insert:
//-----------------------------------------------------
//--- 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:
//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:
show_form_footer($lang['save_changes'], "", 2);
Insert above:
//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:
<form method="post" action="{url_member}">
Replace it with:
<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:
<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:
{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"> {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:
<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:
<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:
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:$additional_sql = "";
Insert below:
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: if (!empty($additional_image_fields)) {
Insert above: 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:$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: $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: "comment_user_ip" => $comment_user_ip,
Insert below: "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 ;)){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 ] -----
- Show random member photo on home page (http://www.4homepages.de/forum/index.php?topic=6797.msg60282#msg60282) (by TheOracle) (February 07, 2006, 14:58:44)
- Search for members with personal photo from ACP (Admin Control Panel) (http://www.4homepages.de/forum/index.php?topic=6797.msg60294#msg60294) (by IcEcReaM ) (February 07, 2006, 16:41:19)
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.
[/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
-
Hows this different than the avatar mod?
And will this show the members picture by whois online right now in ACP and home html?
-
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????
-
mmmm...so many questions...which question is actualy THE question? and what does postcard viewer has anything to do with this mod? :?
-
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....
-
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
Parse error: parse error, unexpected T_LNUMBER, expecting ',' or ';' in /home/ejnash/public_html/gallery/admin/settings.php on line 123
-
here is the code for settings.php
REMOVED
-
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 echo "> ".$val."<br size="20" />";
which supposed to be echo "> ".$val."<br />";
I have no idea why people trying put some size into <br /> ....:?
-
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:
-
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?
-
and where is the image pointing to? - that's a basic troubleshooting, u should do without anyone telling u to ;) :)
-
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
-
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.
-
Ok! thanks V@no u were right in this:
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
-
then I have only one explanation: u missed/miss-do/made a misstake in one or more steps (probably in member.php)
-
Thanks again! I would never noticed of this U forgot move {if userpic_img} and {endif userpic_img}
-
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 ;)
-
yes V@no, but I thought that the problem was in other part ofthe code. I will not do this again sorry.
-
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)
-
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 - -
-
What & where in details.php would I need to add something like $config['userpic'] etc.... ?
generaly, this should work:
in details.php find:$additional_sql = "";
Insert below:if (!empty($additional_user_fields)) {
foreach ($additional_user_fields as $key => $val) {
$additional_sql .= ", u.".$key;
}
}
Then in includes/functions.php find: if (!empty($additional_image_fields)) {
Insert above: 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);
}
}
-
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
{if userpic_img}<br>
<tr>
<td class="row1"><img src="{userpic_img}" width="65" height="68"></td>
</tr>
<br>{endif userpic_img}
-
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 //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{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 //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?
-
u can try add in functions.php above the code u've added (scroll up little bit, u'll see simular lines.
//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} )
-
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
"user_id" => $image_row['user_id'],
"user_name" => $user_name,
below it, add//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:
<tr>
<td valign="top" class="row1"><b>{lang_added_by}</b></td>
<td valign="top" class="row1">{user_name_link} {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 $comment_user_userpic = "";
and then also"comment_userpic" => ($config['comment_userpic']..........
Many thanks - this is getting close! 8)
-
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
-
avatar?
-
Sorry, avatar = personal photo ;]
-
and what is the code u've changed?
-
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.
-
this mod does not support comments, u'll need do changes posted by graficalicus on second page.
-
hm, but if it is possible to add a personal photo for guests, the problem (i think) will disapear.
So, is it possible? ;]
-
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
-
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.
-
I've added Step 10 - 13
try and see if it works. (I didnt not test those changes :oops:)
-
great!! it works. thanks ;]
-
by the way, can I somehow show picture in the header? My login box is in the header...
-
you *should* be able to use {userpic} in the header, wherever you want it - - - try it and see (didn't test it either :oops:)
-
I tried, no luck ;]
cant get id of image I think, because link to img not finished. .../
-
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
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
$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!
-
what i get
<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}
-
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
u.userpic
immediately after
c.comment_ip,
so it now looks like this
$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.
-
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)
-
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 executeUPDATE 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 ;)
-
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 ?
-
yes, its filtered by WHERE userpic = '' ;)
-
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
-
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 ;)
-
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)
-
maybe u could try use the same code from Step 1.1 ?
in register.php find: if (isset($HTTP_POST_VARS['user_name'])) {
Scroll down untill u find if (!empty($additional_user_fields)) {
Above that line insert: if (!$error)
{
<code from Step 1.1 goes here>
}
Obviosly u'll need udjust register_form.html template as well...
-
Thanks that worked
-
It did? that's good to hear :D
-
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
-
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
-
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 executeUPDATE 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?
-
oh, crap! you are right, I didnt think about that...:oops:
well, ok, first, restore the database with this query: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: "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
Replace it with: "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : ROOT_PATH."data/userpic/noimage.png",
Then find: "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
Replace it with: "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.
-
thanks V@no :) I hope not to upload that pic again :P
-
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? ;) :)
-
I upload that pic like 15 times lol
-
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
$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
-
try redo Step 1.2
-
When I delete the following code (regarding point 1.2), all the information about the user pic isn't displayed anymore on the memberprofile.
//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']." ".$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']." ".$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
-
the only line was changed is the "lang_userpic_upload" => ...
what if u try use this line instead: "lang_userpic_upload" => str_replace("{userpic_max_size}", $config['userpic_size']." ".$lang['kb'], str_replace("{userpic_max_width}", $config['userpic_width'], str_replace("{userpic_max_height}", $config['userpic_height'], $lang['userpic_upload']))),
-
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
-
what renaming problem?
the allowed extensions are set in member.php: $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.
-
I don't know I look in the userpic folder and I saw a gif called -1.gif and jpg -1.jpeg :S
-
thats not supposed to happend...
-
i know lol that's why i'm telling you :P
-
Hi V@no How can I insert the User personal picture here to see on the list?
$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"> <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);
-
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:
$last_action_user_list .= '<img border="0" src="http://69.56.196.226/~ascanio/templates/revolution/images/flecha.gif" width="13" height="10"> <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:
$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"> <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
-
u need get the userpic value from database for each member.
-
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
-
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.
-
V@no the name of the image is the same name of the id of the user so what i did was this:
<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 .'.jpg"
and work for the other formats
-
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.
-
Thanks V@no but how should i use this $row['userpic']
Like this?
<img src="'.ROOT_PATH.'/data/userpic/'.$row['userpic'].'." width="37" height="39">
-
yes, close ;)
<img src="'.ROOT_PATH.'/data/userpic/'.$row['userpic'].'" width="37" height="39">
(no dot at the end ;))
-
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
-
alrighty then:
<img src="'.ROOT_PATH.'/data/userpic/'.((empty($row['userpic'])) ? "noimage.png" : $row['userpic']).'" width="37" height="39">
-
Thanks that what i wanted :)
-
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?
-
hmmmm....actualy where and how do u get a user_id of a new registered user? That id is needed to save mpp.
-
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?
-
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
-
Help! Bitte - please
-
bug fixes
-
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.
-
Help! Bitte - please
i have same error.
-
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)
-
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.
-
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.
-
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
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"> {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:
-
but this do the same of avatar mod, i'm right ???
-
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.
-
i want show this on PMS , how can i do this ?
-
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?
-
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)
-
yes, thanks, but I want to use it with this mod, and if no picture is set, show big 200x300 females or males border.
-
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...
-
thanks for showing me the way :!: ;)
-
but if this can be used on comments , maybe the method for show on PM's will be similar....i think ... ?
-
Is it possible to add more than one photo?
-
@ 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 :|
-
In the settings.
-
thanks v@no...amazing mod... :D
-
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/
-
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 ?
-
another question ...
it's possible make the pic show in another pages ? (without be details.php) ...
-
I followed the steps .. all of them ..
but the personal photo didn't show up !!
can any one help ?
http://www.emarati.net/gallery
-
can't anyone help me .. please ?
-
Is it possible to view your site in english? :?
Does the upload work? -> Have you done CHMOD777 for the userpic folder ?
Cya by Flo2005
-
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.
-
Parse error: parse error, unexpected T_DOUBLE_ARROW in [...]member.php on line 1338
what to do??
line 1338 is: "userpic_allowed" => $config['userpic'],
-
2 lines above and below this line please.
-
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
-
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:
-
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!
-
i installed this mod but now it looks like this
http://partymetropole.de/jako/profile1.jpg
i don´t why
-
bug fix:
http://www.4homepages.de/forum/index.php?topic=7493.0
-
Thanks V@no! I'll try this bug fix.
Reggie
-
thanks now it works
-
why each time a new user upload a mpp (personal photo) this delete the default pic (noimage.png) from ..data/userpic ??? how stop it !?
:?:
-
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 ;)
-
i've get a query for mysql here posted ;)
http://www.4homepages.de/forum/index.php?topic=6797.msg34005#msg34005
Posted by you 8)
-
Posted by you 8)
Sorry, I'm not google with unlimited memory resources :lol:
Anyways, try this. In member.php find:if ($user_info['userpic'] != $userpic_name && file_exists($userpics_dir.$user_info['userpic']))
Replace with: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 ;)
-
My problem is that members cannot delete their picture to upload an new one. :cry:
Is it possible to overwrite a picture without deleting? :?:
-
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:
-
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
Я отображаю фото юзера при детализации его картинки. Когда я захожу в список пользователей и осуществляю поиск катринок добавленных этим пользователем, при детализации катринки получаю выше описанное сообщение.
-
search keywords: "mysql 5" (with qoutes)
-
I installed this MOD ..
but nothing changed ..
and when I upload a picture
nothing uploaded
?
-
I have installed MySQL 4.1.8-max, not MySQL 5.0?????
-
I have installed MySQL 4.1.8-max, not MySQL 5.0?????
oh, wait...what about integrations? maybe phpbb integration?
-
Not installed. I basically use your mod. Many thanks for them. Iam install (auto resize when upload, member list)
-
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.
-
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
-
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
-
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)
-
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?)
-
Thanks V@no. Can be it is necessary was look at first [Mod] Memberlist / Mitgliederliste> for/fur v 1.7.
My mistake. Thanks
-
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)) ? "&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)) ? "&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&".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&".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&comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&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&".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&".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&image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a> ";
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&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&".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a> ";
$admin_links .= ($config['user_delete_image'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&".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 = "&".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');
?>
-
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 $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: $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 ";
-
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.
-
any ideia of how make the userpic as link on (details.php) i mean in comments :?:
-
i've notice of how make Avatar (MOD) show in logininfo using this :
Page_Header.php
"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 ;)
-
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....
-
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 :
"userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
replace with :
"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. ;)
-
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.
-
weird... oracle... it hasn't worked...
-
it hasn't worked...
Could you PLEASE be more specific ??? :?
-
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 :
"userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
replace with :
"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
-
@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. :|
-
thanks :\
-
@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.
-
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)
-
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:
-
Sorry, I dont understand...what is the problem?
-
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
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);
}
}
...
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;
}
}
...
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
-
Try add
global $additional_user_fields;
above the new code you've added into functions.php
-
Try add 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
-
So? uset it inside your html...
-
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
-
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 :
//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
add above :
//--------------------------------------
//--- 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&".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&".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&".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 :
<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 :
//-----------------------------------------------------
//--- 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)
-
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.
-
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
-
@alex:
What vano mean, is to use it in your details.html in "<img>" Tag.
It should be then like this
<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.
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?
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
//-----------------------------------------------------
//--- Fields ------------------------------------------
//-----------------------------------------------------
below insert
// Mod Find Userpics
$lang['field_userpic'] = "User mit Userpic suchen";
$lang['field_showuserpic'] = "Userpics anzeigen";
or for english language
// Mod Find Userpics
$lang['field_userpic'] = "Find Users with Userpic";
$lang['field_showuserpic'] = "Show Userpics on Searchresults";
includes/constants.php
after
// Data paths
insert
define('USERPICS_DIR', 'data/userpic/');
admin/users.php
find
show_table_separator($lang['sort_options'], 2);
above insert
// Mod Find Userpics
show_radio_row($lang['field_userpic'], "user_userpic", 0);
show_radio_row($lang['field_showuserpic'], "user_showuserpic", 0);
Find
$orderby = trim($HTTP_POST_VARS['orderby']);
insert
// 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
$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
$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
echo "<td><b>".$show_user_name."</b></td>\n";
and add before
// Mod Find Userpics
$show_user_name .= ($user_showuserpic == 1 && $user_row['userpic']) ? " <img src=\"".ROOT_PATH.USERPICS_DIR.$user_row['userpic']."\">" : "";
-
@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
-
In the mean time, if I may suggest, rather than simply defining the userpic folder from includes/constants.php file,
this line :
<img src=\"".ROOT_PATH.USERPICS_DIR.$user_row['userpic']."\">
could simply become something like :
<img src=\"".get_userpic_image($user_row['userpic'])."\">
Then, in your includes/functions.php file,
find :
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 :
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. ;)
-
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.
-
@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.
-
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 ;)
-
// 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 :
$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 :
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$user_list['userpic'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".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 :
$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 :
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$result['userpic'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$result[$user_table_fields['user_id']])."\"><img src=\"".ROOT_PATH."data/userpic/".$result['userpic']."\"></a>" : "";
Then, find :
}
elseif ($row['pms_type'] != PMS_UNREAD){
$bstart = "";
$bend = "";
$new = "";
}
add below :
$userpic_img = ($config['userpic'] && @file_exists(ROOT_PATH."data/userpic/".$row['userpic'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$row[$user_table_fields['user_id']])."\"><img src=\"".ROOT_PATH."data/userpic/".$row['userpic']."\"></a>" : "";
Then, find :
$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&".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 :
$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&".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 :
"lang_delete_all" => $lang['pms_delete_all'],
add right below :
"lang_userpic" => $lang['userpic'],
// Step 2
In your templates/<your_template>/pms_folder.html file,
find :
<td width="20%"><b>{lang_who}</b></td>
add below :
<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 :
<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 !
-
// 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 :
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&".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 :
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&".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 !
-
A forgotten step was discovered this morning for the whos online above (as I have corrected it).
Please, find :
$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 :
$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.
-
how make it show for example 4 userpics by row 8) ?
-
how make it show for example 4 userpics by row
Please be more specific. For which one ? I have posted two different editions above. :?
-
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:
-
Replace <br /> with ,
-
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).
-
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 »
-
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.
-
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
-
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?
-
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
-
Thanks!
It solved ;)
-
great mod :D
this mod is installed in 4images 1.7.2 and it's works perfect :lol:
-
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
-
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
-
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)
:?:
-
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"> {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!
-
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?
-
I didnt understand...what is the problem again? maybe a screenshot or a link to the page would help ;)
-
hi i have the next error... maybe it is because i have phpbb integrated with 4images... could you help me to fix the problem?
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
-
error where?
anyways, I dont see any connections between the error you showed and this mod.
-
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?
-
remove the mod and I'm sure you'll see the same error - the mod is not the issue.
-
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
-
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..
-
How make it show for Guests/Users/Admin , since this didn«t show the usepic at guests....
//--------------------------------------
//--- 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&".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&".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&".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);
:?:
-
I dont understand the quesiton...guests cant have user pic...
-
Hello,
can someone post the userpic_install.php again? it doesn't seem to be available.
Thanks!
SIlver
-
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
-
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
-
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
-
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 :?
-
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.
-
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 :?
-
Using it at page_header.php would be nice , how do it ? :roll:
-
tried
$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
"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 :?
-
you are going in the right direction ;) just its not $row but $user_info ;)
-
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.
-
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 ;)
-
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?:
"from" => "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$next_prev_cache[$id]['user_id'])."\">".stripslashes($next_prev_cache[$id]['user_name']."</a>"),
-
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
-
well i'm trying know how :D
it works?
-
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?
-
I have the same problem... how can a user or I upload a picture ?
-
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
-
works in 1.7.4
-
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
-
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
-
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
-
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.
-
Hiya, how can we change the following code to show member.jpg if no user_pic exists?
//User Pic
"userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
//End User Pic
-
Hiya, how can we change the following code to show member.jpg if no user_pic exists?
//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 :!:
-
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
-
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.
-
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
-
Everything worked except one thing.
On details.html I can't show the user image. It appears the box with a X.
-
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
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
-
No need for add this line if use: {if user_loggedin}...{endif user_loggedin} in member_profile.html file. ;)
-
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!
-
hi
i have this error
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
Error enviando archivo de imagen: S2020007.JPG
S2020007.JPG: Copy error. Please check the directory permissions
i need you help
thanks
-
Please read this:
http://www.4homepages.de/forum/index.php?topic=19952.0
-
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
-
Ok so is permission problem:
http://www.4homepages.de/forum/index.php?topic=7400.0
;)
-
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
-
Check IIS setting.
-
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
-
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
-
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
-
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
-
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:
<!-- 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
-
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.
<!-- 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
-
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?
-
Mal ganz vorsichtig nach oben schieb :oops:
-
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 :?:
-
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 ?
-
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
-
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
-
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.
-
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!
-
Klappt wunderbar mit der Version 1.7.6!
Habs in der Liste mit aufgenommen!
http://www.4homepages.de/forum/index.php?topic=21849.0
-
@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
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic>= '0'
nor with
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?
-
can you explain with more details what EXACTLY have you done to the code besides the changes from first post.
-
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:
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic>= '0'
and:
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
WHERE ".get_user_table_field("", "user_level")." >= '".USER."' AND userpic > '0'
> instead of >=
-
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.
-
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.
-
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.
-
try attached template
-
Hi, thanks for this, but its still not perfect :(
-
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"> {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
-
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?
-
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
-
If you deleted user from DB, for deleting his userpic find in the file admin/users.php
$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']];
$userpic = $user_row['userpic'];
if (file_exists(ROOT_PATH."data/userpic/".$userpic)) {
unlink(ROOT_PATH."data/userpic/".$userpic);
}
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
{if captcha_registration}
add
{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
<form method="POST" action="{url_register}">
replace with
<form method="POST" action="{url_register}" enctype="multipart/form-data">
2. in the file register.php
find
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
add above
$userpic = "";
$userpics_dir = ROOT_PATH."data/userpic/";
2.1 find
} // end if
add above
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
$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
$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
"user_invisible_no" => $user_invisible_no,
add below
//User Pic
"userpic_allowed" => $config['userpic'],
"userpic_max_width" => $config['userpic_width'],
"userpic_max_height" => $config['userpic_height'],
"userpic_max_size" => $config['userpic_size']." ".$lang['kb'],
"lang_userpic_upload" => preg_replace("/".$site_template->start."userpic_max_size".$site_template->end."/siU", $config['userpic_size']." ".$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
-
Thanks alekinna. Added step 14
-
thank you so much, alekinna!!!
perfect additional codes to this great MOD !!! :thumbup: :thumbup: :thumbup:
-
@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
-
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: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: "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
Replace it with: "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : ROOT_PATH."data/userpic/noimage.png",
Then find: "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
Replace it with: "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
-
Problem solved
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:
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
-
Ops, my bad.
Please re-do Step 14. Should fix the error.
-
Ops.. I forgot step 1.1 :oops:
scluzern
bergblume
thanks for your feedback
V@no
thanks for correcting my pure code
-
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:
-
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.
-
Check Step 1.1 and Step 6
-
Supi! Hat geklappt! Danke :)
Hatte ein mal <form method="post" action="{url_member}"> noch vergessen zu ändern!
-
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
-
Are you sure what you see is not coming from your brower's cache? try clear your browser's cache.
-
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.
-
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_file, CHMOD_FILES);
With this:
@chmod($userpic_file, 0777);
if it's second.jpg, then to be sure, download that image from FTP (like in 9.)
P.S.
SIGE = see?
-
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?
-
noimage.png is not part of this mod...
-
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..,.
-
you can use {ifno userpic_img} ... {endifno userpic_img}
-
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 :
//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
add above :
//--------------------------------------
//--- 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&".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&".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&".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 :
<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 :
//-----------------------------------------------------
//--- 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.
-
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: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: "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : "",
Replace it with: "userpic_img" => ($config['userpic'] && $user_row['userpic']) ? ROOT_PATH."data/userpic/".$user_row['userpic'] : ROOT_PATH."data/userpic/noimage.png",
Then find: "userpic_img" => ($user_info['userpic']) ? ROOT_PATH."data/userpic/".$user_info['userpic'] : "",
Replace it with: "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
-
Does it show a broken image instead?
-
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?
-
try this then:
{if comment_userpic} <img src="{comment_userpic}">{endif comment_userpic}{ifno comment_userpic} <img src="<?=ROOT_PATH."data/userpic/noimage.png";?>">{endifno comment_userpic}
-
it is working . thanks V@no
try this then:
{if comment_userpic} <img src="{comment_userpic}">{endif comment_userpic}{ifno comment_userpic} <img src="<?=ROOT_PATH."data/userpic/noimage.png";?>">{endifno comment_userpic}
-
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 ...
-
@ arabcine
... at the very bottom of the first post ...
... find : userpic_install.zip ...
-
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 ?
-
did you click on the link?
the needed file is attached to the first post
-
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 ?
-
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)
-
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
-
@ 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 ...
-
sorry brother i saw it before and iwas think i have to download other file by this ,,
and thanks for your help
-
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
-
apparently IE doesn't like when in width/height used % values
-
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.
-
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
-
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.
-
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
-
...
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']
));
-
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
-
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)
-
mmmm what about step 10?
-
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 ;)
-
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)))
-
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:
{
$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:
$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.
-
I've updated my post above. Seems to work for me (at least no error messages)
-
Yepp, working now ;)
PS: Where to send you a six-pack of Heinecken? 8)