4images Forum & Community
4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: cloe on August 04, 2007, 03:54:11 PM
-
Is there someone that can help me with this?
When someone register, I want to ask for full name before username, in two fields:
Name:
Lastname:
I want the user to login with their username.. But when they are logged inn.. they are not visible with there usernames.. but with the full name??
And in member profile, is not the username visible, but the full name.
I hope someone can help me with this?
Best Reguards
-Cecilie-
-
If no done:
// Step 1
In includes/db_field_definitions.php file, add before ?>:
$additional_user_fields['user_firstname'] = array($lang['user_firstname'], "text", 1);
$additional_user_fields['user_lastname'] = array($lang['user_lastname'], "text", 1);
// Step 2
Go to lang/your_lang/main.php file, add before ?>:
$lang['user_firstname'] = "Firstname: ";
$lang['user_lastname'] = "Lastname: ";
// Step 3
Go to templates/your_template/register_form.html file.
Find:
<tr>
<td class="row1"><b>{lang_user_name}</b></td>
<td class="row1">
<input type="text" name="user_name" size="30" value="{user_name}" class="input" />
</td>
</tr>
Add after:
<tr>
<td class="row1"><b>{lang_user_firstname}</b></td>
<td class="row1">
<input type="text" name="user_firstname" size="30" value="{user_firstname}" class="input" />
</td>
</tr>
<tr>
<td class="row1"><b>{lang_user_lastname}</b></td>
<td class="row1">
<input type="text" name="user_lastname" size="30" value="{user_lastname}" class="input" />
</td>
</tr>
// Step 4
Go to includes/sessions.php file,
Find:
$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")."
Replace:
$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").", u.user_firstname, u.user_lastname
// Step 5
Find:
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
Replace:
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? $row['user_firstname'] . REPLACE_EMPTY . $row['user_lastname'] : $username;
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".((isset($full_name)) ? trim($full_name) : "")."</a>".$invisibleuser;
// Step 6
Add in USERS_TABLE (phpmyadmin):
- user_firstname, varchar(255)
- user_lastname, varchar(255)
See full name in whos online. ;)
-
Nothing works after this... blank pages :(
Where and what to put in database?? Mysql
-
Sorry ... step 6 add. ;)
-
Sorry ... step 6 add. ;)
Oki.. done that.... and when i insert the code in : sessions.php.. I get this error: An unexpected error occured. Please try again later. (red text in the left corner of the page)
And when i insert the code in main.php the site is going completly blank??
-
Sorry ... step 6 add. ;)
Oki.. done that.... and when i insert the code in : sessions.php.. I get this error: An unexpected error occured. Please try again later. (red text in the left corner of the page)
And when i insert the code in main.php the site is going completly blank??
And this error when I am logged in:
DB Error: Bad SQL Query: SELECT s.session_user_id, s.session_lastaction, s.session_ip, u.user_id, u.user_level, u.user_name, u.user_invisible, u.user_firstname, u.user_lastname FROM 4images_sessions s LEFT JOIN 4images_users u ON (u.user_id = s.session_user_id) WHERE s.session_lastaction >= 1186243795 ORDER BY u.user_id ASC, s.session_ip ASC
Unknown column 'u.user_firstname' in 'field list'
-
Unknown column 'u.user_firstname' in 'field list'
This mean no added in USERS_TABLE or content empty by use account (if empty - go edit profile) ...
-
Oki.. Ive added this in 4images_users... What you mean is that if the full name is not filled in by any users, this error will acure??
Is there In any more tables i should add these fields?
-
this error will acure??
Update step 5. Do again.
-
Im sorry.. But I have done all twice now.. It dosent work.
Ive updated member_editprofile.html so I can edit the full name... But all the errors are still here..
And after I installed this.. there is 0 users online... but i am logged in.
Are you sure this code dont miss anything, because it really dont work.
And when I install in main.php Everything goes comletly blank (just white pages)
-
And when I install in main.php Everything goes comletly blank (just white pages)
Added top of ?> tag (no after) ?
-
And when I install in main.php Everything goes comletly blank (just white pages)
Added top of ?> tag (no after) ?
No everything is before ?>
-
See content in USERS_TABLE for first, last names (phpmyadmin) ?
1. If not, register new user.
2. Content (phpmyadmin) ?
3. 4images version ?
-
And after I installed this.. there is 0 users online... but i am logged in.
Edit: Ok, patch. Step 5.
-
I shall try to install it again, from scrach...
I found out about the problem on main.php (when it goes blank)
This is what u wrote:
$lang['user_firstname'] = "Firstname: ":
$lang['user_lastname'] = "Lastname: ";
It can not be a space betwen : ":
The correct way is:
$lang['user_firstname'] = "Firstname:":
$lang['user_lastname'] = "Lastname:";
I will try it all again...
-
Done all again... And all problems begin when changing sessions.php..
And there is no users online, but I am online...
Is there anyone that have any suggestions??
-
Sorry. Can not reproduce. No 4images version answer yet too ...
-
I shall try to install it again, from scrach...
I found out about the problem on main.php (when it goes blank)
This is what u wrote:
$lang['user_firstname'] = "Firstname: ":
$lang['user_lastname'] = "Lastname: ";
It can not be a space betwen : ":
The correct way is:
$lang['user_firstname'] = "Firstname:":
$lang['user_lastname'] = "Lastname:";
I will try it all again...
False. In string, space no matter.
-
I shall try to install it again, from scrach...
I found out about the problem on main.php (when it goes blank)
This is what u wrote:
$lang['user_firstname'] = "Firstname: ":
$lang['user_lastname'] = "Lastname: ";
It can not be a space betwen : ":
The correct way is:
$lang['user_firstname'] = "Firstname:":
$lang['user_lastname'] = "Lastname:";
I will try it all again...
False. In string, space no matter.
But it works when there is no space... :?
The page is not blank then...
-
Version ?
-
Version ?
phpMyAdmin - 2.9.2
-
Is it anyone here that know how I can achive this??
Please someone help :cry:
-
phpMyAdmin - 2.9.2
4images version - say here:
See content in USERS_TABLE for first, last names (phpmyadmin) ?
1. If not, register new user.
2. Content (phpmyadmin) ?
3. 4images version ?
-
phpMyAdmin - 2.9.2
4images version - say here:
See content in USERS_TABLE for first, last names (phpmyadmin) ?
1. If not, register new user.
2. Content (phpmyadmin) ?
3. 4images version ?
I have 4 images v.1.7.4
-
Hello;
didn't you notice this error:
$lang['user_firstname'] = "Firstname:":
$lang['user_lastname'] = "Lastname:";
The good syntax should be: $lang['user_firstname'] = "Firstname:";
Don't know if it has something to do with your annoyance.
Regards
-
Hello;
didn't you notice this error:
$lang['user_firstname'] = "Firstname:":
$lang['user_lastname'] = "Lastname:";
The good syntax should be: $lang['user_firstname'] = "Firstname:";
Don't know if it has something to do with your annoyance.
Regards
Corrected the error... But it still dosent work :(
I have this error on index page:
DB Error: Bad SQL Query: SELECT s.session_user_id, s.session_lastaction, s.session_ip, u.user_id, u.user_level, u.user_name, u.user_invisible, u.user_firstname, u.user_lastname FROM 4images_sessions s LEFT JOIN 4images_users u ON (u.user_id = s.session_user_id) WHERE s.session_lastaction >= 1186256905 ORDER BY u.user_id ASC, s.session_ip ASC
Unknown column 'u.user_firstname' in 'field list'
and it says that nobody is online... But I AM ONLINE
-
Don't know if it has something to do with your annoyance.
Care explain ? Report prob about space - not : (no notice - period).
-
and it says that nobody is online... But I AM ONLINE
If all step follow, can not say ... for me ... login - see my username ... logout - see the session window close. Can not reproduce ... :|
-
Is there some php guru here, that can make this work for me??
-
Is there some php guru here, that can make this work for me??
Speak to one now ... dont believe ? Sorry... mine works well.
-
Is there some php guru here, that can make this work for me??
Speak to one now ... dont believe ? Sorry... mine works well.
Thats really strange :?
I've followd your instruction several times now... And it dont work.
Can you someway make a download to the files that has been modified.. so I can se your files?
And a install.php to mysql?
And yes Thunderstrike, I believe that you know php well :)...
-
Thats really strange Confused
I've followd your instruction several times now... And it dont work.
Way it implement ...
And a install.php to mysql?
If ask this, is because you dont know how create fields ...
Anyway, here - no problem - create install.php file - upload with content:
<?php
define('ROOT_PATH', './');
include(ROOT_PATH . 'global.php');
require(ROOT_PATH . 'includes/sessions.php');
if ($user_info['user_level'] == ADMIN) {
$sql = "
ALTER TABLE " . USERS_TABLE . " ADD user_firstname VARCHAR(255) NOT NULL,
ALTER TABLE " . USERS_TABLE . " ADD user_lastname VARCHAR(255) NOT NULL
";
$result = $site_db->query($sql);
if (isset($result) && !$result) {
echo "Error altering field.";
}
if (isset($result) && $result) {
echo "Field install success !";
}
}
?>
This for field. Should work. (Login ADMIN - no USER).
-
Thats really strange Confused
I've followd your instruction several times now... And it dont work.
Way it implement ...
And a install.php to mysql?
If ask this, is because you dont know how create fields ...
Anyway, here - no problem - create install.php file - upload with content:
<?php
define('ROOT_PATH', './');
include(ROOT_PATH . 'global.php');
require(ROOT_PATH . 'includes/sessions.php');
if ($user_info['user_level'] == ADMIN) {
$sql = "
ALTER TABLE " . USERS_TABLE . " ADD user_firstname VARCHAR(255) NOT NULL,
ALTER TABLE " . USERS_TABLE . " ADD user_lastname VARCHAR(255) NOT NULL
";
$result = $site_db->query($sql);
if (isset($result) && !$result) {
echo "Error altering field.";
}
if (isset($result) && $result)) {
echo "Field install success !";
}
?>
This for field. Should work. (Login ADMIN - no USER).
Where do you create user_lastname and user user_lastname?
In table 4images_users or in another table?
The install.php give an error:
Parse error: syntax error, unexpected ')' in C:\wamp\www\fresh_fotoonline_skal_paa_web\install.php on line 22
-
Code correct now. Try. ;)
-
Code correct now. Try. ;)
Opps... Sorry but i get this now:
Parse error: syntax error, unexpected $end in C:\wamp\www\fresh_fotoonline_skal_paa_web\install_user.php on line 25
-
Done. Try again (for good). ;)
-
Hey.. looks like it finnaly works.. Dont know how...but its works..
Thank you Thunderstrike for your patient.. I hope that you dont give up on me, but have the patient to help me again soon :wink:
Edit: I found out why It didnt worked for me, and I am imbaressed :oops:
I have 2 databases with rather similar names, well the rest speak for it self :?
I've put the fields in the wrong database...
Im SOOOOOOOO SORRY... It will not happend again.. I will learn from my mistakes.
Please forgive me :cry:
All respect for you thunderstrike (My PHP Guru)
-
Now remains the last question :)
I got this working now.. so this I sholuld understand quick :wink:
How do I display the full name (user_firstname and user_lastname) here:
Logged in as: Full name here
Under Thumbnails
Under Random Image
User profile of: Full name here
Display all images added by: Full name here
In Menberlist
In Top Images
In Comments
Image Added by: Full Name here
I dont remember anywhere else.. But I mean everywhere the username shows up.. I want the Full Name to be there instead.
Is it a way to make a "rule" theat anywhere the username shows up, will it show The full name first and last name.
So if i install other mods I dont have to think about changing it?
I want username only to be in use when members login... Is this possible??
Oh and another thing, I want Admin to be bold in whos online like it used to be :)
-
All respect for you thunderstrike (My PHP Guru)
Exacllent. ;)
Logged in as: Full name here
Ahhh ! yes. Luky you - did for my site too. ;)
In includes/page_header.php file, easy -
Find:
$site_template->register_vars("lang_loggedin_msg", preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU", format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
Replace:
$site_template->register_vars("lang_loggedin_msg", preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU", format_text(stripslashes($user_info['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($user_info['user_lastname']), 2), $lang['lang_loggedin_msg']));
Under Thumbnails
Under Random Image
User profile of: Full name here
Display all images added by: Full name here
In Menberlist
In Top Images
In Comments
Image Added by: Full Name here
Wow ... huge demand ... do no help MOD (examp: memberlist). Only core.
Under Thumbnails
Which PHP file + action ? (examp: categories.php?cat_id ... index.php ... details.php ... which one ?)
Under Random Image
Core ? MOD ? (If MOD, no help for it sorry).
User profile of: Full name here
Ahh ! yes - in member.php file,
find:
"lang_show_user_images" => preg_replace("/".$site_template->start."user_name".$site_template->end."/siU", format_text($user_row['user_name'], 2), $lang['show_user_images']),
Replace:
"lang_show_user_images" => preg_replace("/".$site_template->start."user_name".$site_template->end."/siU", format_text(stripslashes($user_row['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($user_info['user_lastname']), 2), $lang['show_user_images']),
In Top Images
Umm .. never did it ... make backup top.php file (safe) ...
In top.php file,
find:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name")."
replace:
// Rating
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname
find:
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
replace:
$register_array['image_rating_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($top_list[$i]['user_lastname']), 2)."</a>";
find:
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name")."
replace:
// Votes
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname
find:
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
replace:
$register_array['image_votes_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($top_list[$i]['user_lastname']), 2)."</a>";
find:
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
replace:
// Hits
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname
find:
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
replace:
$register_array['image_hits_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . $top_list[$i]['user_lastname']), 2)."</a>";
find:
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field(", u.", "user_name")."
replace:
// Downloads
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name".get_user_table_field(", u.", "user_name").", u.user_firstname, u.user_lastname
find:
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($top_list[$i][$user_table_fields['user_name']])."</a>";
replace:
$register_array['image_downloads_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text(stripslashes($top_list[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($top_list[$i]['user_lastname']), 2)."</a>";
In Comments
Custom contract only.
Image Added by: Full Name here
Custom contract only.
-
You are good thunderstrike... It works perfect... Almost... Just one error in member.php this:
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\fresh_fotoonline_skal_paa_web\member.php on line 998
The only mod I have is memberlist.. The rest is core :)
And Image Added by: Full Name here is core.. It is under the info.. when a image is uploaded
In Thumbnails, I mean all pages there are thumbnails... I'm not sure on every page they are.. But It is all core there to :)
-
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\fresh_fotoonline_skal_paa_web\member.php on line 998
Correct. Topic update. ;)
And Image Added by: Full Name here is core.. It is under the info.. when a image is uploaded
In Thumbnails, I mean all pages there are thumbnails... I'm not sure on every page they are.. But It is all core there to
Take longer. Would do it - custom coding only.
Actual:
In Comments
This one no need custom coding. Short. ;)
In details.php file,
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:
$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.user_firstname, u.user_lastname
find:
$comment_user_name = format_text($comment_row[$i]['comment_user_name'], 2);
replace:
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
;)
-
And Image Added by: Full Name here is core.. It is under the info.. when a image is uploaded
Actual, not long (function show_image code already. ;)).
In details.php file,
find:
$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")."
replace:
$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").", u.user_firstname, u.user_lastname
In includes/functions.php file,
find:
if (isset($image_row[$user_table_fields['user_name']]) && $image_row['user_id'] != GUEST) {
$user_name = format_text($image_row[$user_table_fields['user_name']], 2);
replace:
if (isset($image_row['user_firstname']) && isset($image_row['user_lastname']) && $image_row['user_id'] != GUEST) {
$user_name = format_text($image_row['user_firstname'] . REPLACE_EMPTY . $image_row['user_lastname'], 2);
In Thumbnails, I mean all pages there are thumbnails... I'm not sure on every page they are.. But It is all core there to
This one, only one longer. ;)
-
Thanks a lot :)
Some problems... Under thumbnail.. is it showing "guest" in all images...
Edit: Random Image is core.. Its the box on the left side, under registred users, it is a thumbnail there that shows random images :)
-
Edit: Random Image is core.. Its the box on the left side, under registred users, it is a thumbnail there that shows random images
Screenshot / Precise URL (include PHP filename) ?
-
Edit: Random Image is core.. Its the box on the left side, under registred users, it is a thumbnail there that shows random images
Screenshot / Precise URL (include PHP filename) ?
I am not sure in witch php file it is in.. but this random image is visible in every page.
If you se the other thumbs is it saying (gjest) = guest on norwegian
And there is some other bugs here.. I will findt it and tell you ;)
-
This is other places that full name dont work...
-
And here:
-
This is the code on my details.php.. I did some changes with the commet function.. (NO MOD)
Just did it so I could place username userinfo where I wanted it to be:
<?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.4 *
* *
* 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. *
* *
*************************************************************************/
$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) {
redirect($url);
}
$additional_sql = "";
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").", u.user_firstname, u.user_lastname
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) {
redirect($url);
}
$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 Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
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 image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND image_id IN ($image_id_sql) AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$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;
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
$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;
}
}
}
}
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id IN ($cat_id_sql)" : "";
}
else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id NOT IN (".$cat_id_sql.")" : "";
}
if (!empty($sql_where_query)) {
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1
$sql_where_query
$cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
$in_mode = 1;
}
}
if (!$in_mode || empty($sql)) {
$sql = "SELECT image_id, cat_id, image_name, image_media_file, image_thumb_file
FROM ".IMAGES_TABLE."
WHERE image_active = 1 AND cat_id = $cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$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 = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
$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 = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
$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']));
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
// 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_text == "") {
$msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
$error = 1;
}
if ($captcha_enable_comments && !captcha_validate($captcha)) {
$msg .= (($msg != "") ? "<br />" : "").$lang['captcha_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) {
$site_template->register_vars(array(
"has_rss" => true,
"rss_title" => "RSS Feed: ".$image_name." (".str_replace(':', '', $lang['comments']).")",
"rss_url" => $script_url."/rss.php?action=comments&".URL_IMAGE_ID."=".$image_id
));
$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.user_firstname, u.user_lastname
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 = format_text($comment_row[$i]['user_firstname'] . REPLACE_EMPTY . $comment_row[$i]['user_lastname'], 2);
$comment_user_info = $lang['userlevel_guest'];
$comment_user_id = $comment_row[$i]['user_id'];
$user_row_comment = get_user_info($comment_user_id);
if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2);
$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']])) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : "";
if (!empty($comment_user_icq)) {
$comment_user_icq_button = "<a href=\"http://www.icq.com/people/about_me.php?uin=".$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 = format_text($comment_row[$i][$user_table_fields['user_email']]);
$comment_user_email_save = format_text(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_date = (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_comments = (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'],
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row_comment['user_avatar'] == "") ? "blank.gif" : $user_row_comment['user_avatar']). "\" name=\"icons\" border=\"0\" hspace=\"0\" alt=\"\">" : "",
"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_date" => $comment_user_date,
"comment_user_comments" => $comment_user_comments,
"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) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
$comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";
$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'],
"lang_captcha" => $lang['captcha'],
"lang_captcha_desc" => $lang['captcha_desc'],
"captcha_comments" => (bool)$captcha_enable_comments
));
$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,
"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']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
-
All gjest text mean no entry found for firstname lastname (user no fill). :mrgreen:
-
All gjest text mean no entry found for firstname lastname (user no fill). :mrgreen:
I dont understand what you mean??
-
1 thing when image upload by user. If user no fill firstname lastname from editprofile, when upload image, no go - it return guest - you ask 4images apper 'firstname lastname' but empty. ;)
Force upload by checking firstname lastname first is must.
-
Hmmm... I begin to wonder what to do with this...
Its just not working like I wat it to be :(
I just register a new user, with the new system... And the user is called by the lastname only everywhere..
And I dont understand compleatly about this "guest" thin under each user...
I've uploaded a image with the new user i created... and it says guest there to + that the user is not registerd with the full name where it should be... only by lastname :(
Have a wish that someone create a MOD with this... That the user that is registering... are using there username ONLY to log in.. and on the rest of the page is visible by their full name, that they fill inn under registration ...
-
Do You want to create a complet MOD with this Thunder???
-
well this is possible, but would work better if its fresh gallery, or this ill show "guest" like thunderstrike said, until the users re-update their accounts,of course the new members ill work fine ;)
-
Stoleti suggest is correct. Fresh start with such project is a go.
Do You want to create a complet MOD with this Thunder???
If not, custom coding possible.
-
Do You want to create a complet MOD with this Thunder???
For now, go to member.php file,
find:
if ($action == "uploadform") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
show_error_page($lang['no_permission']);
exit;
}
add after:
if (isset($user_info['user_firstname']) && isset($user_info['user_lastname']) && empty($user_info['user_firstname']) || empty($user_info['user_lastname'])) {
show_error_page($lang['user_firstname_lastname_missing']);
}
Go to your lang/english/main.php file,
top of ?>:
$lang['user_firstname_lastname_missing'] = "Missing firstname and / or lastname. Please visit profile account.";
This check for firstname and lastname fill before using upload form. ;)
-
Hmm-... I think I wait, and hope that someone can create a complet MOD of this, so it works right from the box. ;)
Hope that it is possible 8)
-
Like say before - no posting result - no can do.
-
Like say before - no posting result - no can do.
Oki.. :) .... We just forget this thunderstrike ;)... Most probably this is something that cant be done... Better to use energi of something that can be done :)
Anyway, thanks for trying... You did your best.. And you are really good at this "respect".. I dont understand how you understand all this coding :wink:
Maybe this will be a feature in next version of 4images..
And I think we misunderstand echother a lot... Im not english, and I believe you are not either... It is not easy to comunicate then ;)
-
Ok so for bold (whos online):
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? $row['user_firstname'] . REPLACE_EMPTY . $row['user_lastname'] : $username;
replace:
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? "<b>" . $row['user_firstname'] . "</b>" . REPLACE_EMPTY . "<b>" . $row['user_lastname'] . "</b>" : "<b>" . $username . "</b>";
-
Thanks thunderstrike...
Do u have a recipt of how make user_firstname and user_lastname required field, so it dosent say "guest" on every thumb?
And how to display the full name in comments, and under post comments.
Your bold recipt works... But I dont think you have read my question correct... If you read again, you will se that I asked for Admin to be bold under "whos online", not thr users ;)
-
Do u have a recipt of how make user_firstname and user_lastname required field, so it dosent say "guest" on every thumb?
That better. In includes/db_field_definitions.php file,
at end of each line (firstname, lastname), change 0 to 1. Field be require.
Your bold recipt works... But I dont think you have read my question correct... If you read again, you will se that I asked for Admin to be bold under "whos online", not thr users
Note that not very good english me ... doing best to assist. :?
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? "<b>" . $row['user_firstname'] . "</b>" . REPLACE_EMPTY . "<b>" . $row['user_lastname'] . "</b>" : "<b>" . $username . "</b>";
change:
if ($row[$user_table_fields['user_level']] == ADMIN) {
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? "<b>" . $row['user_firstname'] . "</b>" . REPLACE_EMPTY . "<b>" . $row['user_lastname'] . "</b>" : "<b>" . $username . "</b>";
} elseif ($row[$user_table_fields['user_level']] >= USER) {
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? $row['user_firstname'] . REPLACE_EMPTY . $row['user_lastname'] : $username;
}
-
Note that not very good english me ... doing best to assist. :?
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? "<b>" . $row['user_firstname'] . "</b>" . REPLACE_EMPTY . "<b>" . $row['user_lastname'] . "</b>" : "<b>" . $username . "</b>";
change:
if ($row[$user_table_fields['user_level']] == ADMIN) {
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? "<b>" . $row['user_firstname'] . "</b>" . REPLACE_EMPTY . "<b>" . $row['user_lastname'] . "</b>" : "<b>" . $username . "</b>";
} elseif ($row[$user_table_fields['user_level']] >= USER) {
$full_name = (isset($row['user_firstname']) && isset($row['user_lastname']) && !empty($row['user_firstname']) && !empty($row['user_lastname'])) ? $row['user_firstname'] . REPLACE_EMPTY . $row['user_lastname'] : $username;
}
[/quote]
I think that u are great thunder... And your help is priceless... And my english is no better than your ;)
Admin bold are sorted... NICE :)
But in In includes/db_field_definitions.php file.. Ive already have it set with 1.. This is my file:
$additional_user_fields['user_firstname'] = array($lang['user_firstname'], "text", 1);
$additional_user_fields['user_lastname'] = array($lang['user_lastname'], "text", 1);
?>
But it still stays guest on every thumbnail :(
-
Ok so apply this step so no one upload ?
http://www.4homepages.de/forum/index.php?topic=18257.msg97474#msg97474
(if empty first name and last name ?) If so, what is say when try upload with empty ?
-
Ok so apply this step so no one upload ?
http://www.4homepages.de/forum/index.php?topic=18257.msg97474#msg97474
(if empty first name and last name ?)
I have aplied that :|
-
what is say when try upload with empty ?
-
what is say when try upload with empty ?
It says nothing, just upload the image, and the image is with "guest" after upload 8O
Ive made an account for you: Username: thunder Password: test
Try it yourself.. :? http://www.fotoonline.no/ (http://www.fotoonline.no/)
-
Isnt there a way to force that the name is getting under the thumbs automaticly like usernames are??
-
Ok, in member.php file,
find:
if ($action == "uploadimage") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
show_error_page($lang['no_permission']);
exit;
}
add after:
if (isset($user_info['user_firstname']) && isset($user_info['user_lastname']) && empty($user_info['user_firstname']) || empty($user_info['user_lastname'])) {
show_error_page($lang['user_firstname_lastname_missing']);
}
Try upload again (full).
-
Ok, in member.php file,
find:
if ($action == "uploadimage") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
show_error_page($lang['no_permission']);
exit;
}
add after:
if (isset($user_info['user_firstname']) && isset($user_info['user_lastname']) && empty($user_info['user_firstname']) || empty($user_info['user_lastname'])) {
show_error_page($lang['user_firstname_lastname_missing']);
}
Try upload again (full).
Still Guest under thumnail... the image "test again" http://www.fotoonline.no/index.php (http://www.fotoonline.no/index.php)
-
But on my uolpad screen the full name is not anywhere?? Sholdt it be that before upload??
Or is it a way to force it to be there ... It would be nice if the members dont have to fill out there own name each time.. But The best is if the full name ia beeing made automaticly under thumbs :?:
-
From account you test, is no empty first name + last name or empty ?
-
From account you test, is no empty first name + last name or empty ?
No its not empty... Go in to my site: http://www.fotoonline.no
And log in
Username: thunder
Password: test
And try it yourself...
-
Ok so is a bug from categories / details file. To see, remove firstname lastname from account and upload. See error message when try upload ?
-
Ok so is a bug from categories / details file. To see, remove firstname lastname from account and upload. See error message when try upload ?
If I try to remove firstname and lastname from controlpanel I get this:
Please fill out the Firstname field!
Please fill out the Lastname field!
It will not alow me to remove that.. And that is the point to.. because users must fill in their full name..
-
Must just ask... It is possible for the full name to come under thumbs automaticly??
Or do the user have to fill it out themself??
Its best if it is automaticly :wink:
-
Ok so this work:
http://www.4homepages.de/forum/index.php?topic=18257.msg97738#msg97738
Must be bug somewhere for thumbnails. When I have time, I take a look. During, please no post 50 thread. Yes, automate thumbnails - firstname lastname. No need fill anything manual ...
-
Ok so this work:
http://www.4homepages.de/forum/index.php?topic=18257.msg97738#msg97738
Must be bug somewhere for thumbnails. When I have time, I take a look. During, please no post 50 thread. Yes, automate thumbnails - firstname lastname. No need fill anything manual ...
Oki... I will wait for your solution there :)
Last there is One thing thats missing... exept from thumbs.. The full name in comments and post comments, you se here where I have the red circle..
When that is fixed there is only the thumbs again :) :)
-
Ok, replace firstname lastname from account. Just patch:
http://www.4homepages.de/forum/index.php?topic=18257.msg97367#msg97367
http://www.4homepages.de/forum/index.php?topic=18257.msg97394#msg97394
Re-do.
-
Ok, replace firstname lastname from account. Just patch:
http://www.4homepages.de/forum/index.php?topic=18257.msg97367#msg97367
http://www.4homepages.de/forum/index.php?topic=18257.msg97394#msg97394
Re-do.
Ohhh... Im so sorry... I dont understand what u mean with pach :(
Dont understand what to fill inn and where :(
I AM SO SORRY
-
Re-do all steps of two topic I post . . .
-
Re-do all steps of two topic I post . . .
Sorry.. didnt.. understand what patch was :?
Get en error:
Parse error: syntax error, unexpected ';' in /var/www/virtual/fotoonline.no/htdocs/details.php on line 353
-
Ok, correct (patch):
http://www.4homepages.de/forum/index.php?topic=18257.msg97394#msg97394
Do last replace on topic. Should work.
-
Ok, correct (patch):
http://www.4homepages.de/forum/index.php?topic=18257.msg97367#msg97367
Do last replace on topic. Should work.
Nope... Still same errro
Parse error: syntax error, unexpected ';' in /var/www/virtual/fotoonline.no/htdocs/details.php on line 353
This line:
$comment_user_name = format_text(stripslahes($comment_row[$i]['user_firstname'], 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
-
Point wrong topic. Sorry - this one: http://www.4homepages.de/forum/index.php?topic=18257.msg97394#msg97394 (last replace)
(and yes ... the line post you show)
-
Point wrong topic. Sorry - this one: http://www.4homepages.de/forum/index.php?topic=18257.msg97394#msg97394 (last replace)
(and yes ... the line post you show)
insert this code:
$comment_user_name = format_text(stripslahes($comment_row[$i]['user_firstname'], 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
and get the same error..
-
Did no save ...
Ok, use this:
$comment_user_name = format_text(stripslahes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
-
Did no save ...
Ok, use this:
$comment_user_name = format_text(stripslahes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
Sorry :( Still error.. :
Fatal error: Call to undefined function: stripslahes() in /var/www/virtual/fotoonline.no/htdocs/details.php on line 353
-
stripslashes()
Typo.
-
stripslashes()
Typo.
Inserted this line:
$comment_user_name = format_text(stripslashes()$comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes()$comment_row[$i]['user_lastname']), 2);
Get still an error: Parse error: syntax error, unexpected T_VARIABLE in /var/www/virtual/fotoonline.no/htdocs/details.php on line 353
-
No !!
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
:?
-
No !!
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
:?
Sortet... No errors now... But the full name is not showing in comments or post comments... Its still the username :?
-
Details.php
if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2);
change:
if (isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname']) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
} elseif (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i][$user_table_fields['user_name']]), 2);
}
-
Details.php
if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text($comment_row[$i][$user_table_fields['user_name']], 2);
change:
if (isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname']) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
} elseif (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i][$user_table_fields['user_name']]), 2);
}
I think we soon have sorted this out :)... U are really good at this thunderstrike...
For now, get an error:
Parse error: syntax error, unexpected '}' in /var/www/virtual/fotoonline.no/htdocs/details.php on line 484
-
Remove last } at before block ... my error.
-
Remove last } at before block ... my error.
Oki... error gone... It make the full name apear in comments... But suddenly im "guest" not admin..
And in post comments.. still username.
Se attachment:
-
Yes - normal this time. No fresh gallery (before user upload - before make modifiction of my last) - content same. Only new upload will start change (if no fresh). Old upload (before change), need manual change in database / ACP - > add / edit images (and / or comments).
-
Yes - normal this time. No fresh gallery (before user upload - before make modifiction of my last) - content same. Only new upload will start change (if no fresh). Old upload (before change), need manual change in database / ACP - > add / edit images (and / or comments).
Created a new user, and uploaded an image from new user.. And comment with new user.. And it still look like this:
-
Comment user id show GUEST level (-1) ?
-
Comment user id show GUEST level (-1) ?
I guess it does that yes...
-
Then no good ... user ID no capture.
-
Then no good ... user ID no capture.
Hmmm... thats strange..
Is there a fix for this??
Maybe thats the problem under thumbnails to?
-
If upload only users - no guest allow. Will show user ID ?
-
If upload only users - no guest allow. Will show user ID ?
I have the setting that ONLY members can upload.. But still it shows guest
-
Sorry - no idea.
-
Maybe something in comment_bit.html??
-
if (isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname']) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
} elseif (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i][$user_table_fields['user_name']]), 2);
change:
if (!isset($comment_row[$i][$user_table_fields['user_name']]) && isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname']) && $comment_user_id != GUEST) {
$comment_user_name = (isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname'])) ? format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2) : format_text(stripslashes($comment_row[$i][$user_table_fields['user_name']]), 2);
Try (details.php)
-
if (isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname']) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2);
} elseif (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
$comment_user_name = format_text(stripslashes($comment_row[$i][$user_table_fields['user_name']]), 2);
change:
if (!isset($comment_row[$i][$user_table_fields['user_name']]) && isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname']) && $comment_user_id != GUEST) {
$comment_user_name = (isset($comment_row[$i]['user_firstname']) && isset($comment_row[$i]['user_lastname'])) ? format_text(stripslashes($comment_row[$i]['user_firstname']), 2) . REPLACE_EMPTY . format_text(stripslashes($comment_row[$i]['user_lastname']), 2) : format_text(stripslashes($comment_row[$i][$user_table_fields['user_name']]), 2);
Try (details.php)
Nope... Still says guest.. Maybe this is a no can do :(
-
If only I test live with code from server your ... might see defect . . .
-
If only I test live with code from server your ... might see defect . . .
I have my site live, (not local)... but it dosent work :( sorry
-
No, I mean work on site direct ...
-
No, I mean work on site direct ...
Ok.. I edit my files direct from server... Shoudent I do that?
Do you mean I should edit all this files before I upload and install 4images on my server?
-
Do you mean I should edit all this files before I upload and install 4images on my server?
I mean: I should to see direct. :?
-
Do you mean I should edit all this files before I upload and install 4images on my server?
I mean: I should to see direct. :?
If you mean what I think you mean ;)
I have removed the password to enter my site..
Open now: http://www.fotoonline.no/ (http://www.fotoonline.no/)
-
Like say ... need work direct from server to see what be wrong ... PM me access if like ... other - can no lot ...
-
Like say ... need work direct from server to see what be wrong ... PM me access if like ... other - can no lot ...
oki... I send u a personal message :)
-
Ok, no perm for upload image so upload new. Check image_id + user_id in IMAGES_TABLE (phpmyadmin) of last upload image ...
-
Ok, no perm for upload image so upload new. Check image_id + user_id in IMAGES_TABLE (phpmyadmin) of last upload image ...
I send you login to my phpadmin on PM.. and you can se it yourself ;)
Made an acount for you to on my gallery
username: thunder
Password: test
Its better if you se it because you understand it better :)
-
No idea why do that ... will check later when time ... now - have MODs code. ;)
For now, restore backup . . .
-
No idea why do that ... will check later when time ... now - have MODs code. ;)
For now, restore backup . . .
Oki.. ;)
If u want just go in a fix it.. But is ut like this now, if I create a new user, and upload images... It will work??
With comments and thumbnail to??
I see that you have fixed random image on my site
-
if I create a new user, and upload images... It will work??
With comments and thumbnail to??
Try it ? :?
I see that you have fixed random image on my site
Correct.
-
if I create a new user, and upload images... It will work??
With comments and thumbnail to??
Try it ? :?
I see that you have fixed random image on my site
Correct.
Created new user (Lille Fille) Uploaded a new image from this account: Imagename: testttttttttttttttt Post a comment on it... And it still displaying guest under thumbnail and in comments :(
se here: http://www.fotoonline.no/details.php?image_id=4 (http://www.fotoonline.no/details.php?image_id=4)
-
So - like say - I work it later.
-
So - like say - I work it later.
Oki :) .... I will wait pacently ;)
You are the best thunderstrike :D
-
I have read through this entire post... all 9 pages to this point! I thought I'd help a little bit as I noticed a recurrent step on many of the files mentioned.
I still don't see answers to how to add the firstname, lastname under the thumbnails on all the screens, so I discovered that once you've done the changes provided by thunderstrike up to this point, all you have to do is the following (thank you for all this great work, btw!!!):
This procedure will change the username link to display the firstname lastname below each thumbnail (thumbnail_bit.html) on each of the screens indicated below.
Follow these procedures on the following files:
- categories.php
- search.php
- index.php
- lightbox.php
- If you followed thunderstrike's directions, you should have already done top.php and details.php
Find:
$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")."
Replace with:
$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").", u.user_firstname, u.user_lastname
Short cut to above:
Find:
$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")."
Add to end of the line, after the ":
, u.user_firstname, u.user_lastname
*Don't forget that this only works if you've already followed all of thunderstrike's directions up to this point, starting from the first page of this thread.
This is the only part I was trying to fix, not all the other occurrences of the username (only the publicly viewed info). I just wanted visitors to be able to see the member's full name instead of their username with all occurrences of their image. So, as far as the rest of what cloe is looking for, sorry I can't help with that as I'm not a php guru like thunderstrike... lol!
Hope I've helped a little. And again, thanks thunderstrike for all the very hard work you've done on these procedures! Great job! What a huge help you've been!
-
This is while post from me now ... use this for additional user fields with details:
http://www.4homepages.de/forum/index.php?topic=19297.0
Is easy for add firstname and lastname in details now. ;)
-
You'll also need to modify the member.php file (as I've directed above) if you are adding any other mods in which you will need to display the firstname and last name on the member's profile page.
Example of a mod in which you will need to add this is the [MOD] Show user images in profile, located at: http://www.4homepages.de/forum/index.php?topic=15390
-
how to display Autor user_firstname user_lastname in title on details and profile pages?
http://www.4homepages.de/forum/index.php?topic=6613.new#new