<? $page = "profile"; include "header.php";if ($user->user_exists 0 & $setting[setting_permission_profile] 0) { $page = "error"; $smarty->assign('error_header', $profile[1]); $smarty->assign('error_message', $profile[40]); $smarty->assign('error_submit', $profile[43]); include "footer.php"; } if ($owner->user_exists == 0) { $page = "error"; $smarty->assign('error_header', $profile[1]); $smarty->assign('error_message', $profile[2]); $smarty->assign('error_submit', $profile[43]); include "footer.php"; } $privacy_level = $owner->user_privacy_max($user, $owner->level_info[level_profile_privacy]); $allowed_privacy = $owner->user_info[user_privacy_profile]; $is_profile_private = 0; if ($privacy_level < $allowed_privacy) { $is_profile_private = 1; } if ($is_profile_private == 0) { $profile_views = $owner->user_info[user_views_profile] + 1; $database->database_query("UPDATE se_users SET user_views_profile='$profile_views' WHERE user_id='" . $owner->user_info[user_id] . "'"); } $owner->user_fields(0, 0, 0, 0, 1); $comment = new se_comment('profile', 'user_id', $owner->user_info[user_id]); $total_comments = $comment->comment_total(); $comments = $comment->comment_list(0, 10); $friends = $owner->user_friend_list(0, 5, 0, 1, "RAND()"); $total_friends = $owner->user_friend_total(0); $allowed_to_comment = 1; $comment_level = $owner->user_privacy_max($user, $owner->level_info[level_profile_comments]); $allowed_comment = $owner->user_info[user_privacy_comments]; if ($comment_level < $allowed_comment) { $allowed_to_comment = 0; } if ($user->level_info[level_profile_style] != 0 & $is_profile_private == 0) { $profilestyle_info = $database->database_fetch_assoc($database->database_query("SELECT profilestyle_css FROM se_profilestyles WHERE profilestyle_user_id='" . $owner->user_info[user_id] . "' LIMIT 1")); $global_css = $profilestyle_info[profilestyle_css]; } $is_friend = $user->user_friended($owner->user_info[user_id]); $friendship_allowed = 1; switch ($setting[setting_connection_allow]) { case "3": break; case "2": if ($user->user_info[user_subnet_id] != $owner->user_info[user_subnet_id]) { $friendship_allowed = 0; } break; case "1": if ($user->user_friend_of_friend($owner->user_info[user_id]) == FALSE) { $friendship_allowed = 0; } break; case "0": $friendship_allowed = 0; break; } if ($is_friend) { $friendship_allowed = 1; } $online_users_array = online_users(); if (in_array($owner->user_info[user_username], $online_users_array)) { $is_online = 1; } else { $is_online = 0; } $actions = $actions->actions_display(); $actions_total = count($actions); $smarty->assign('tabs', $owner->profile_tabs); $smarty->assign('comments', $comments); $smarty->assign('total_comments', $total_comments); $smarty->assign('friends', $friends); $smarty->assign('total_friends', $total_friends); $smarty->assign('friend_ofs', $friend_ofs); $smarty->assign('total_friend_ofs', $total_friend_ofs); $smarty->assign('is_friend', $is_friend); $smarty->assign('friendship_allowed', $friendship_allowed); $smarty->assign('is_profile_private', $is_profile_private); $smarty->assign('is_online', $is_online); $smarty->assign('allowed_to_comment', $allowed_to_comment); $smarty->assign('total_views', $profile_views); $smarty->assign('actions', $actions); $smarty->assign('actions_total', $actions_total); include "footer.php"; ?>
{include file='header.tpl'} {* JAVASCRIPT FOR ADDING COMMENT *} {literal} <script type='text/javascript'> <!-- var comment_changed = 0; var first_comment = 1; var last_comment = {/literal}{$comments|@count}{literal}; var next_comment = last_comment+1; var total_comments = {/literal}{$total_comments}{literal}; function removeText(commentBody) { if(comment_changed == 0) { commentBody.value=''; commentBody.style.color='#000000'; comment_changed = 1; } } function addText(commentBody) { if(commentBody.value == '') { commentBody.value = '{/literal}{$profile44}{literal}'; commentBody.style.color = '#888888'; comment_changed = 0; } } function checkText() { if(comment_changed == 0) { var commentBody = document.getElementById('comment_body'); commentBody.value=''; } var commentSubmit = document.getElementById('comment_submit'); commentSubmit.value = '{/literal}{$profile45}{literal}'; commentSubmit.disabled = true; } function addComment(is_error, comment_body, comment_date) { if(is_error == 1) { var commentError = document.getElementById('comment_error'); commentError.style.display = 'block'; if(comment_body == '') { commentError.innerHTML = '{/literal}{$profile46}{literal}'; } else { commentError.innerHTML = '{/literal}{$profile47}{literal}'; } var commentSubmit = document.getElementById('comment_submit'); commentSubmit.value = '{/literal}{$profile48}{literal}'; commentSubmit.disabled = false; } else { var commentError = document.getElementById('comment_error'); commentError.style.display = 'none'; commentError.innerHTML = ''; var commentBody = document.getElementById('comment_body'); commentBody.value = ''; addText(commentBody); var commentSubmit = document.getElementById('comment_submit'); commentSubmit.value = '{/literal}{$profile48}{literal}'; commentSubmit.disabled = false; var commentSecure = document.getElementById('comment_secure'); commentSecure.value='' var secureImage = document.getElementById('secure_image'); secureImage.src = secureImage.src + '?' + (new Date()).getTime(); total_comments++; var totalComments = document.getElementById('total_comments'); totalComments.innerHTML = total_comments; if(total_comments > 10) { var oldComment = document.getElementById('comment_'+first_comment); if(oldComment) { oldComment.style.display = 'none'; first_comment++; } } var newComment = document.createElement('div'); var divIdName = 'comment_'+next_comment; newComment.setAttribute('id',divIdName); var newTable = ""; {/literal} {if $user->user_info.user_id != 0} newTable += "url_create('profile',$user->user_info.user_username)}'>user_photo('./images/nophoto.gif')}' class='photo' border='0' width='{$misc->photo_size($user->user_photo('./images/nophoto.gif'),'75','75','w')}'>, <table cellpadding='0' cellspacing='0' width='100%'>----, url_create('profile',$user->user_info.user_username)}'>{$user->user_info.user_username} - {$datetime->cdate(\"`$setting.setting_timeformat` `$profile20` `$setting.setting_dateformat`\", $datetime->timezone($smarty.now, $global_timezone))}</td>url_create('profile',$user->user_info.user_username)}#comments'>{$profile26}&nbsp;|&nbsp;user_info.user_username}'>{$profile34}, \"; {else} newTable + = \"</td><table cellpadding= '0' cellspacing='0' width='100%'>----, {$profile33} - {$datetime->cdate(\"`$setting.setting_timeformat` `$profile20` `$setting.setting_dateformat`\", $datetime->timezone($smarty.now, $global_timezone))}</td>&nbsp;, \"; {/if} newTable + = \"---- "+comment_body+" </td></tr></table>"; {literal} newComment.innerHTML = newTable; var profileComments = document.getElementById('profile_comments'); var prevComment = document.getElementById('comment_'+last_comment); profileComments.insertBefore(newComment, prevComment); next_comment++; last_comment++; } } function action_delete(action_id) { var divname = 'action_' + action_id; var newsrc = 'action_delete.php?action_id=' + action_id; hidediv(divname); document.getElementById('actionimage').src = newsrc; document.getElementById('actions_total').value--; if(document.getElementById('actions_total').value == 0) { document.getElementById('actions').style.display = "none"; } } //--> </script> {/literal} ---- {$profile6} {$owner->user_info.user_username}, &nbsp;, {$profile16} {$total_views} {$profile17}, {* BEGIN LEFT COLUMN *} {* SHOW USER PHOTO *} <table cellpadding='0' cellspacing='0' width='100%' style='margin-bottom: 10px;'> ---- , user_photo(\"./images/nophoto.gif\")}' border='0'> {if $total_albums == 0} {else} user_info.user_username}'>Voir ses albums photos {/if} </td> {* SHOW BUTTONS IF LOGGED IN AND VIEWING SOMEONE ELSE *} {if $owner->user_info.user_username != $user->user_info.user_username} {* SHOW VIEW FRIENDS MENU ITEM *} {if $total_friends != 0} ---- user_info.user_username}'>{$profile7} {$owner->user_info.user_username|truncate:10:"...":true}, {/if} {* SHOW ADD OR REMOVE FRIEND MENU ITEM *} {if $friendship_allowed != 0} {if $is_friend == TRUE} ---- user_info.user_username}&return_url={$url->url_create('profile', $owner->user_info.user_username)}'>{$profile41}, {else} ---- user_info.user_username}'>{$profile9}, {/if} {/if} {* SHOW SEND MESSAGE MENU ITEM *} {if $user->level_info.level_message_allow 2 | ($user->level_info.level_message_allow 1 & $is_friend == TRUE)} ---- user_info.user_username}'>{$profile10}, {/if} {* SHOW REPORT THIS PERSON MENU ITEM *} ---- url_current()}'>{$profile11}, {* SHOW BLOCK OR UNBLOCK THIS PERSON MENU ITEM *} {if $user->level_info.level_profile_block != 0} {if $user->user_blocked($owner->user_info.user_id) == TRUE} ---- user_info.user_username}'>{$profile42}, {else} ---- user_info.user_username}'>{$profile12}, {/if} {/if} {/if} {* DISPLAY IF PROFILE IS PRIVATE TO VIEWING USER *} {if $is_profile_private != 0} {* END LEFT COLUMN *} </td> <td class='profile_rightside'> {* BEGIN RIGHT COLUMN *} {$profile3} {$profile4} {* DISPLAY ONLY IF PROFILE IS NOT PRIVATE TO VIEWING USER *} {else} {* BEGIN STATUS *} {if ($owner->level_info.level_profile_status != 0 AND $owner->user_info.user_status != "") } ---- {$profile36}, ---- {if $owner->level_info.level_profile_status != 0 AND $owner->user_info.user_status != ""} <table cellpadding='0' cellspacing='0'{if $is_online == 1} style='margin-top: 5px;'{/if}> ---- , </td> {$owner->user_info.user_username} {$profile14} {$owner->user_info.user_status|choptext:12:" "}, {/if} </td> </tr> </table> {/if} {* END STATUS *} {* BEGIN STATS *} {* END STATS *} {* BEGIN PLUGIN RELATED PROFILE SECTIONS *} {section name=profile_loop loop=$global_plugins}{include file="profile_`$global_plugins[profile_loop]`.tpl"}{/section} {* END LEFT COLUMN *} </td> <td class='profile_rightside'> {* BEGIN RIGHT COLUMN *} {* SHOW RECENT ACTIVITY *} {if $actions_total > 0} {literal} <script language="JavaScript"> <!-- Rollimage0 = new Array() Rollimage1 = new Array() Rollimage0['join']= new Image(10,12); Rollimage0['join'].src = "./images/icons/action_delete1.gif"; Rollimage1['join'] = new Image(10,12); Rollimage1['join'].src = "./images/icons/action_delete2.gif"; function SwapOut(imgname, imgsrc) { imgname.src = Rollimage1[imgsrc].src; return true; } function SwapBack(imgname, imgsrc) { imgname.src = Rollimage0[imgsrc].src; return true; } //--> </script> {/literal} ---- {$profile24}, ---- {* SHOW RECENT ACTIONS *} {section name=actions_loop loop=$actions} <table cellpadding='0' cellspacing='0' width='100%'> ---- , <table cellpadding='0' cellspacing='0'> ---- , {$datetime->time_since($actions[actions_loop].action_date)} {* DISPLAY DELETE LINK IF NECESSARY *} {if $setting.setting_actions_selfdelete 1 AND $actions[actions_loop].action_user_id $user->user_info.user_id} {/if} {$actions[actions_loop].action_text|choptext:50:" "} , </td> </tr> </table> {/section} </td> </tr> </table> {/if} {* END RECENT ACTIVITY *} ---- , ---- <table cellpadding='0' cellspacing='0'> {if $owner->user_info.user_dateupdated != ""}----, {$profile22}</td> {$datetime->time_since($owner->user_info.user_dateupdated)}, {/if} {if $owner->user_info.user_signupdate != \"\"}---- {$profile23}, {$datetime->cdate("`$setting.setting_dateformat`", $datetime->timezone("`$owner->user_info.user_signupdate`", $global_timezone))}, ---- Pr&eacute;sentement :, {if $is_online != 0} En ligne {else} Hors-ligne {/if}, {/if} </td> </tr> </table> {* SHOW PROFILE TABS AND FIELDS *} {section name=tab_loop loop=$tabs} ---- , ---- <table cellpadding='0' cellspacing='0'> {* LOOP THROUGH FIELDS IN TAB, ONLY SHOW FIELDS THAT HAVE BEEN FILLED IN *} {section name=field_loop loop=$tabs[tab_loop].fields} ---- , {$tabs[tab_loop].fields[field_loop].field_title}: </td> {$tabs[tab_loop].fields[field_loop].field_value_profile} {if $tabs[tab_loop].fields[field_loop].field_birthday == 1} ({$datetime->age($tabs[tab_loop].fields[field_loop].field_value)} {$profile37}){/if} , {/section} </td> </tr> </table> {/section} {* END PROFILE TABS AND FIELDS *} {* BEGIN FRIEND LIST *} {if $total_friends != 0} ---- {$profile35} ({$total_friends}) &nbsp;[ user_info.user_username}'>{$profile25} {$profile19} ] , ---- {* LOOP THROUGH FRIENDS *} {section name=friend_loop loop=$friends} {* START NEW ROW *} {cycle name="startrow2" values="<table cellpadding='0' cellspacing='0'>---- ,,,,"} , url_create('profile',$friends[friend_loop]->user_info.user_username)}'>user_photo('./images/nophoto.gif')}' class='photo' border='0' width='{$misc->photo_size($friends[friend_loop]->user_photo('./images/nophoto.gif'),'75','75','w')}'> {$friends[friend_loop]->user_info.user_username}</td> {* END ROW AFTER 4 RESULTS *} {if $smarty.section.friend_loop.last == true} {else} {cycle name="endrow2" values=",,,,</tr></table>"} {/if} {/section} </td> </tr> </table> {/if} {* END FRIEND LIST *} {* BEGIN COMMENTS *} ---- {$profile38} ({$total_comments}) &nbsp;[ user_info.user_username}'>{$profile25} {$profile32} ] , {if $allowed_to_comment != 0} ---- <form action='profile_comments.php' method='post' target='AddCommentWindow' onSubmit='checkText()'> <textarea name='comment_body' id='comment_body' rows='2' cols='65' onfocus='removeText(this)' onblur='addText(this)' style='color: #888888; width: 100%;'>{$profile44}</textarea> <table cellpadding='0' cellspacing='0' width='100%'> ---- {if $setting.setting_comment_code == 1} , </td> , , {/if} user_info.user_username}'> </form> , </td> </tr> {/if} <tr> <td class ='profile' id='profile_comments'> {* LOOP THROUGH PROFILE COMMENTS *} {section name=comment_loop loop=$comments} ---- {if $comments[comment_loop].comment_author->user_info.user_id != 0} url_create('profile',$comments[comment_loop].comment_author->user_info.user_username)}'>user_photo('./images/nophoto.gif')}' class='photo' border='0' width='{$misc->photo_size($comments[comment_loop].comment_author->user_photo('./images/nophoto.gif'),'75','75','w')}'> {else} {/if} , <table cellpadding='0' cellspacing='0' width='100%'> ---- , {if $comments[comment_loop].comment_author->user_info.user_id != 0}url_create('profile',$comments[comment_loop].comment_author->user_info.user_username)}'>{$comments[comment_loop].comment_author->user_info.user_username}{else}{$profile33}{/if} </td> {$datetime->cdate("`$setting.setting_timeformat` `$profile20` `$setting.setting_dateformat`", $datetime->timezone($comments[comment_loop].comment_date, $global_timezone))}, ---- {$comments[comment_loop].comment_body|choptext:50:" "}, </td> </tr> </table> {/section} </td> </tr> </table> {* END COMMENTS *} {/if} {* END PRIVACY IF STATEMENT *} {* END RIGHT COLUMN *} </td> </tr> </table> {include file ='footer.tpl'}
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question#1064 - 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 '['user'])' at line 1 Je dois créer dans ma base de donnéuser_id_visitor user_id_visited mais je met quoi dans ses table ??