Is it possible to use the user's facebook display pic as his avatar with his comments?
That'd be cool.
[MOD ADDON] facebook avatar addonThis add on will display the facebook users profile picture as their avatar in the comments section of 4images.
see attached file to see how it will look.
I looked through the policy on facebook and they are wanting the user to be able to turn off/on this option so I had to give them the option in thier control panel on 4images.
The add on does not store anything on your server so facebook should not be upset over anything.
I tried to make it as simple as possible but there a a few files that will be changed
(backup first)details.php
includes/sessions.php
includes/db_field_definitions.php
lang/english/main.php
templates/yourtemplatefolder/member_editprofile.html
unzip attached file and place installer in your gallery root drive and run it once and the delete it
(backup your database first!)or if you know how to user phpadmin on your database you can just do this.
ALTER TABLE `4images_users` ADD `user_fbavatar` TINYINT( 1 ) NOT NULL DEFAULT '1'
in your
details.php file...
look for
$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")."
insert at end of the line
before the last " mark
get_user_table_field(", u.", "user_fbavatar").get_user_table_field(", u.", "fb_userid").
finished line should look something 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, 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").get_user_table_field(", u.", "user_fbavatar").get_user_table_field(", u.", "fb_userid")."
look for
elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
$comment_user_info = $lang['userlevel_admin'];
}
insert
after //facebook avatar addon
if ($comment_row[$i][$user_table_fields['user_fbavatar']] && $comment_row[$i][$user_table_fields['fb_userid']]){
$comment_user_info .='<br /><img src="http://graph.facebook.com/'.$comment_row[$i][$user_table_fields['fb_userid']].'/picture" /><br />';
}
//end facebook avatar addon
in the
includes/sessions.php file...
look for near the top of the file
"user_icq" => "user_icq",
"fb_userid" => "fb_userid"
replace with
"user_icq" => "user_icq",
"fb_userid" => "fb_userid",
"user_fbavatar" => "user_fbavatar" //facebook avatar addon
in the
includes/db_field_definitions.php file
look for
?>
insert
before$additional_user_fields['fb_userid'] = array($lang['fb_userid'], "text",1);
$additional_user_fields['user_fbavatar'] = array($lang['user_fbavatar'], "radio",1);
in the
lang/english/main.php file
look for
?>
insert
before//facebook avatar addon
$lang['fb_userid']="Facebook User ID:";
$lang['user_fbavatar']= "Use your facebook pic as an avatar:";
in the
templates/yourtemplatefolder/member_editprofile.html file (yours may be different, looking to place this below the invisible selection)
look for
<tr>
<td class="row1"><b>{lang_invisible}</b></td>
<td class="row1">
<input type="radio" name="user_invisible" value="1" {user_invisible_yes} />
{lang_yes}
<input type="radio" name="user_invisible" value="0" {user_invisible_no} />
{lang_no}
</td>
</tr>
insert
after {if fb_userid}
<tr>
<td class="row2"><b>{lang_user_fbavatar}</b></td>
<td class="row2">
<input type="radio" name="user_fbavatar" value="1" {user_fbavatar_yes} />
{lang_yes}
<input type="radio" name="user_fbavatar" value="0" {user_fbavatar_no} />
{lang_no}
</td>
</tr>
{endif fb_userid}
Your users using facebook will now have avatars under their names in the comment section of 4images!