Profil z informacjami w PF v7 z wygłądem z v6
|
Nie zdradze nicka |
Dodany dnia 04.10.2008 19:16:13
|
Przedszkolak
Postów: 92 Pomógł: 3 Ostrzeżeń: 1
Data rejestracji: 13.09.2008 17:17
|
Witam
Chciałbym zaproponować zmodyfikowanie plików lub stworzenie wtyczki zmieniającą wygląd tabelki z informacjami o użytkowniku (wyświetlanej po kliknięciu na nick usera) w PHP-Fusion 7 na ten z v6. Według mnie był dużo lepszy.
Jeżeli już coś takiego było to proszę o link.
Zdaje sobie sprawę z tego, że zbyt jasno się nie wyraziłem, ale wydaje mi się, że łatwo się domyślić o co chodzi.
PW od moderatora:
- Odświeżenie Tematu - hoopak 25.12 - 13:05
|
|
|
|
Wścibski Gość |
Dodany dnia 22.12.2024 15:39:16
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
Fenix |
Dodany dnia 04.10.2008 20:20:04
|
Przedszkolak
Postów: 32
Data rejestracji: 01.12.2007 12:41
|
Pobawię się tym wieczorem bo jak zobaczyłem różnicę to trochę pracy przy tym będzie choć nie obiecuje.
|
|
|
|
Szapko |
Dodany dnia 05.10.2008 05:04:28
|
Bywalec
Postów: 888 Pomógł: 66
Data rejestracji: 19.08.2007 19:49
|
Wklej to w profile.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: profile.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."view_profile.php";
include LOCALE.LOCALESET."user_fields.php";
if (!isset($_GET['group_id']) || !isnum($_GET['group_id'])) {
if (!isset($_GET['lookup']) || !isnum($_GET['lookup'])) { redirect("index.php"); }
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='$lookup'");
if (dbrows($result)) { $user_data = dbarray($result); } else { redirect("index.php"); }
if ($user_data['user_status'] > "0") { redirect("index.php"); }
if (iADMIN && checkrights("UG") && $user_data['user_id'] != $userdata['user_id']) {
if ((isset($_POST['add_to_group'])) && (isset($_POST['user_group']) && isnum($_POST['user_group']))) {
if (!preg_match("(^\.{$_POST['user_group']}$|\.{$_POST['user_group']}\.|\.{$_POST['user_group']}$)", $user_data['user_groups'])) {
$result = dbquery("UPDATE ".DB_USERS." SET user_groups='".$user_data['user_groups'].".".$_POST['user_group']."' WHERE user_id='".$user_data['user_id']."'");
}
redirect(FUSION_SELF."?lookup=".$user_data['user_id']);
}
}
add_to_title($locale['global_200'].$locale['400'].$locale['global_201'].$user_data['user_name']);
opentable($locale['400']);
echo "<table align='center' cellpadding='0' cellspacing='1' width='400' class='tbl-border'>
<tr>
<td colspan='3'>
<table align='center' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='tbl2'><b>".$data['user_name']."</b></td>";
echo "<td align='right' class='tbl2'><!--profile_user_level-->".getuserlevel($user_data['user_level'])."</td>
</tr>
</table>
</td>
<tr>
<td align='center' width='150' rowspan='5' class='tbl2'>\n";
if ($user_data['user_avatar'] && file_exists(IMAGES."avatars/".$user_data['user_avatar'])) {
echo "<!--profile_user_avatar--><img src='".IMAGES."avatars/".$user_data['user_avatar']."' alt='' /></td>";
}
echo "<td width='1%' class='tbl1' style='white-space:nowrap'><b>Miejscowość:</b></td>";
echo "<td class='tbl1'>".$user_data['user_location']."</td>";
echo "</tr>
<tr>
<td width='1%' class='tbl2' style='white-space:nowrap'><b>Data Urodzenia <span class='small2'>(mm/dd/yyyy)</span>:</b></td>
<td class='tbl2'>";
$months = explode("|", $locale['months']);
$user_birthdate = explode("-", $user_data['user_birthdate']);
echo $months[number_format($user_birthdate['1'])]." ".number_format($user_birthdate['2'])." ".$user_birthdate['0'];
echo "</td>
</tr>
<tr>
<td width='1%' class='tbl1' style='white-space:nowrap'><b>AIM ID:</b></td>
<td class='tbl1'>".$user_data['user_aim']." <img style='vertical-align:middle;border:none' src='http://www.IMStatusCheck.com/status/aim/".$user_data['user_aim']."' alt='".$user_data['user_aim']."' /></td>
</tr>
<tr>
<td width='1%' class='tbl2' style='white-space:nowrap'><b>ICQ#:</b></td>
<td class='tbl2'>".$user_data['user_icq']." <img style='vertical-align:middle;border:none' src='http://www.IMStatusCheck.com/status/icq/".$user_data['user_icq']."' alt='".$user_data['user_icq']."' /></td>
</tr>
<tr>
<td width='1%' class='tbl1' style='white-space:nowrap'><b>MSN ID:</b></td>
<td class='tbl1'>".hide_email($user_data['user_msn'])."</td>
</tr>
<tr>
<td align='center' class='tbl1'>";
$urlprefix = !strstr($user_data['user_web'], "http://") ? "http://" : "";
echo "[<a href='".$urlprefix.$user_data['user_web']."' title='".$urlprefix.$user_data['user_web']."' target='_blank'>WWW</a>]\n";
echo "[<a href='mailto:".$user_data['user_email']."' title='".$user_data['user_email']."' target='_blank'>Email</a>]\n";
echo "[<a href='messages.php?msg_send=".$user_data['user_id']."' title='Prywatna Wiadomość'>PW</a>]\n";
echo "</td>
<td width='1%' class='tbl2' style='white-space:nowrap'><b>Yahoo ID:</b></td>
<td class='tbl2'>".$user_data['user_yahoo']." <img style='vertical-align:middle;border:none' src='http://www.IMStatusCheck.com/status/yahoo/".$user_data['user_yahoo']."' alt='".$user_data['user_yahoo']."' /></td>
</tr>
</table>\n";
tablebreak();
echo "<table align='center' cellpadding='0' cellspacing='1' width='400' class='tbl-border'>
<tr>
<td class='tbl2' colspan='2'><b>Statystyki</b></td>
</tr>
<tr>
<td width='1%' class='tbl1' style='white-space:nowrap'><b>Data rejestracji:</b></td>
<td class='tbl1'>".showdate("longdate", $user_data['user_joined'])."</td>
</tr>
<tr>
<td width='1%' class='tbl2' style='white-space:nowrap'><b>Ostatnia wizyta:</b></td>
<td class='tbl2'>".($user_data['user_lastvisit'] != 0 ? showdate("longdate", $user_data['user_lastvisit']) : $locale['u049'])."</td>
</tr>
<tr>
<td width='1%' class='tbl1' style='white-space:nowrap'><b>Postów w Shoutbox:</b></td>
<td class='tbl1'>".number_format(dbcount("(shout_id)", DB_SHOUTBOX, "shout_name='".$user_data['user_id']."'"))."</td>
</tr>
<tr>
<td width='1%' class='tbl2' style='white-space:nowrap'><b>Komentarzy:</b></td>
<td class='tbl2'>".number_format(dbcount("(comment_id)", DB_COMMENTS, "comment_name='".$user_data['user_id']."'"))."</td>
</tr>
<tr>
<td width='1%' class='tbl1' style='white-space:nowrap'><b>Postów na Forum:</b></td>
<td class='tbl1'>".number_format($user_data['user_posts'])."</td>
</tr>
</table>\n";
if (iADMIN && checkrights("M")) {
echo "<div style='margin:5px'></div>\n";
echo "<table cellpadding='0' cellspacing='1' width='400' class='tbl-border center'>\n<tr>\n";
echo "<td colspan='2' class='tbl2'><strong>".$locale['u048']."</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".$locale['u049']."</td>\n";
echo "<td align='right' class='tbl1'>".$user_data['user_ip']."</td>\n";
echo "</tr>\n</table>\n";
}
if ($user_data['user_groups']) {
echo "<div style='margin:5px'></div>\n";
echo "<table cellpadding='0' cellspacing='1' width='400' class='center tbl-border'>\n<tr>\n";
echo "<td class='tbl2'><strong>".$locale['401']."</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl1'>\n";
$user_groups = (strpos($user_data['user_groups'], ".") == 0 ? explode(".", substr($user_data['user_groups'], 1)) : explode(".", $user_data['user_groups']));
for ($i = 0; $i < count($user_groups); $i++) {
echo "<div style='float:left'><a href='".FUSION_SELF."?group_id=".$user_groups[$i]."'>".getgroupname($user_groups[$i])."</a></div><div style='float:right'>".getgroupname($user_groups[$i], true)."</div><div style='float:none;clear:both'></div>\n";
}
echo "</td>\n</tr>\n</table>\n";
}
if (iADMIN && checkrights("M") && $user_data['user_id'] != $userdata['user_id']) {
$user_groups_opts = "";
if ($user_data['user_level'] < 102) {
echo "<div style='margin:5px'></div>\n";
echo "<form name='admin_form' method='post' action='".FUSION_SELF."?lookup=".$user_data['user_id']."'>\n";
echo "<table cellpadding='0' cellspacing='0' width='400' class='center tbl-border'>\n<tr>\n";
echo "<td class='tbl2' colspan='2'><strong>".$locale['402']."</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl1'><!--profile_admin_options-->\n";
echo "<a href='".ADMIN."members.php".$aidlink."&step=edit&user_id=".$user_data['user_id']."'>".$locale['410']."</a> ::\n";
echo "<a href='".ADMIN."members.php".$aidlink."&step=ban&act=on&user_id=".$user_data['user_id']."&status=1' onclick=\"return confirm('".$locale['413']."');\">".$locale['411']."</a> ::\n";
echo "<a href='".ADMIN."members.php".$aidlink."&step=delete&status=0&user_id=".$user_data['user_id']."' onclick=\"return confirm('".$locale['414']."');\">".$locale['412']."</a></td>\n";
$result = dbquery("SELECT * FROM ".DB_USER_GROUPS." ORDER BY group_id ASC");
if (dbrows($result)) {
while ($data2 = dbarray($result)) {
if (!preg_match("(^\.{$data2['group_id']}|\.{$data2['group_id']}\.|\.{$data2['group_id']}$)", $user_data['user_groups'])) {
$user_groups_opts .= "<option value='".$data2['group_id']."'>".$data2['group_name']."</option>\n";
}
}
if (iADMIN && checkrights("UG") && $user_groups_opts) {
echo "<td align='right' class='tbl1'>".$locale['415']."\n";
echo "<select name='user_group' class='textbox' style='width:100px'>\n".$user_groups_opts."</select>\n";
echo "<input type='submit' name='add_to_group' value='".$locale['416']."' class='button' onclick=\"return confirm('".$locale['417']."');\" /></td>\n";
}
}
echo "</tr>\n</table>\n</form>\n";
}
}
} else {
$result = dbquery("SELECT * FROM ".DB_USER_GROUPS." WHERE group_id='".$_GET['group_id']."'");
if (dbrows($result)) {
$data = dbarray($result);
$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$') ORDER BY user_level DESC, user_name");
opentable($locale['420']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl1'><strong>".$data['group_name']."</strong> (".sprintf((dbrows($result) == 1 ? $locale['421'] : $locale['422']), dbrows($result)).")</td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl2'><strong>".$locale['423']."</strong></td>\n";
echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['424']."</strong></td>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;
echo "<tr>\n<td class='$cell_color'>\n<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>\n";
echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getuserlevel($data['user_level'])."</td>\n</tr>";
}
echo "</table>\n";
} else {
redirect("index.php");
}
}
closetable();
require_once THEMES."templates/footer.php";
?> Kliknij i zaczekaj na załadowanie kodu ...
Mogą występować pewne błędy, ale ja takich nie zauważyłem przy testach. A i mogą nie działać niektóre opcje z PF 7, np. włączanie i wyłączanie pól w profilu.
Edytowane przez Pieka dnia 25.12.2008 13:11:43
|
|
|
|
Nie zdradze nicka |
Dodany dnia 25.12.2008 13:06:31
|
Przedszkolak
Postów: 92 Pomógł: 3 Ostrzeżeń: 1
Data rejestracji: 13.09.2008 17:17
|
Dzięki dan_0803, ale po w klejeniu tego do profile.php profil w ogóle się nie wyświetla. Po kliknięciu na nick zostaje przekierowany na stronę główną.
Jeżeli dałby ktoś radę to zrobić z działającą opcją "Pola profilu" to byłbym bardzo wdzięczny.
Edytowane przez Nie zdradze nicka dnia 12.10.2008 20:47:17
|
|
|