Propozycje modyfikacji - Avatar boczny panel
LCA:) - 25-08-2013, 11:10 Temat postu: Avatar boczny panel Witam poszukuje modyfikacji dzięki której będę mógł dodać avatar do bocznego panelu w "Ostatnie tematy, Najwięcej odpowiedzi, Najwięcej wyświetleń"
Chciałbym podkreślić że mam zrobione "Najwiecej postów, Najwiecej Piw, Najlepsi moderatorzy, Ostatni odwiedząjacy"
kooza - 25-08-2013, 15:41
http://www.przemo.org/php...ic.php?t=111926
a tu do wszystkich http://www.przemo.org/php...p=759936#759936
LCA:) - 25-08-2013, 19:41
Problem tkwi w tym że mam już Najwiecej postów, Najwiecej Piw, Najlepsi moderatorzy, Ostatni odwiedząjacy
a mi chodzi o to że chce dodać avatar do Ostatnie tematy, Najwięcej odpowiedzi, Najwięcej wyświetleń
a jeśli nie ma takiej modyfikacji to czy da rade zrobić?
Boltex - 25-08-2013, 20:39
LCA:) napisał/a: | a jeśli nie ma takiej modyfikacji to czy da rade zrobić? | to ją zleć komuś by ją napisał. Użytkownicy z działu zleceń płatnych przywitają Cię z otwartymi rękoma.
LCA:) - 26-08-2013, 15:43
Boltex, lepiej jak napisze w propozycjach modyfikacji -_- bo i tak mi to jest tylko potrzebne po to aby poprawić szablon i wystawić go w download
vianne - 26-08-2013, 16:05
W propozycjach modyfikacji z tego co zauwazyłam są propozycje NAPISANYCH modyfikacji, do momentu przeniesienia do gotowych
Jak Ty chcesz aby ktos jakąś napisał to poszukiwania lub zlecania
a co do tematu, bo po Ci avatary w tych sekcjach skoro nie ma w nich autora tematu ?
LCA:) - 26-08-2013, 18:26
vianne napisał/a: |
a co do tematu, bo po Ci avatary w tych sekcjach skoro nie ma w nich autora tematu ? |
a nie da się w ogóle zrobić w tzw sekcjach autora tematu ?
(coś próbuje robić ale nie wiem czy coś z tego wyjdzie -_-)
kooza - 27-08-2013, 17:12
w index.php znajdź:
Kod: | $template->assign_vars(array(
'FORUM_IMG' => $images['forum'], |
dodaj przed:
Kod: | //Najwiecej odpowiedzi w tematach
$sql = 'SELECT p.topic_id, p.topic_title, p.topic_replies, p.topic_views, a.user_id, a.username, a.user_level, a.user_jr, a.user_avatar_type, a.user_avatar
FROM ' . TOPICS_TABLE . ' p
LEFT JOIN ' . USERS_TABLE . ' a ON (a.user_id = p.topic_poster)
WHERE forum_id AND (topic_status <> 2) AND (topic_replies > 0)
ORDER BY topic_replies DESC
LIMIT 5';
$result = mysql_query($sql);
$i=0;
while ($row = $db->sql_fetchrow($result))
{
$i++;
if (strlen($row['topic_title']) > 15)
{
$topic_title = substr($row['topic_title'], 0, 15)." ...";
}
else
{
$topic_title = $row['topic_title'];
}
$colored_username = color_username($row['user_level'], $row['user_jr'], $row['user_id'], $row['username']);
$row_user_name = $colored_username[0];
$userAvatar = '';
if($row['user_avatar_type']) {
switch($row['user_avatar_type']) {
case USER_AVATAR_UPLOAD:
$userAvatar = ($board_config['allow_avatar_upload']) ? '<img style="width:35px; height:35px;" src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" width="35" height="35" />' : '';
break;
case USER_AVATAR_REMOTE:
$userAvatar = ($board_config['allow_avatar_remote']) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" style="width:35px; height:35px;"/>' : '';
break;
case USER_AVATAR_GALLERY:
$userAvatar = ($board_config['allow_avatar_local']) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" style="width:35px; height:35px;"/>' : '';
break;
}
}
else {
$userAvatar = '<img src="domslny_avatar.png" style="width:35px; height:35px;" border="0" />';
}
$poster = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '" class="gensmall"' . $colored_username[1] . '>' . $row_user_name . '</a>';
$template->assign_block_vars('odp', array(
'UZYTKOWNIK' => $poster,
'AVATAR' => $userAvatar,
'URL' => '<a href="'.append_sid("viewtopic.$phpEx?t=" . $row['topic_id']). '" class="gensmall" title="' . $row['topic_title'] . '">' . $topic_title . '</a>',
'REPLIES' => $row['topic_replies'])
);
}
//Najwięcej wyswietlane tematy
$sql = 'SELECT p.topic_id, p.topic_title, p.topic_views, p.topic_replies, p.topic_poster, a.user_id, a.username, a.user_level, a.user_jr, a.user_avatar_type, a.user_avatar
FROM ' . TOPICS_TABLE . ' p
LEFT JOIN ' . USERS_TABLE . ' a ON (a.user_id = p.topic_poster)
ORDER BY topic_views DESC
LIMIT 5';
$result = mysql_query($sql);
$i=0;
while ($row = $db->sql_fetchrow($result))
{
$i++;
if (strlen($row['topic_title']) > 15)
{
$topic_title = substr($row['topic_title'], 0, 15)." ...";
}
else
{
$topic_title = $row['topic_title'];
}
$colored_username = color_username($row['user_level'], $row['user_jr'], $row['user_id'], $row['username']);
$row_user_name = $colored_username[0];
$userAvatar = '';
if($row['user_avatar_type']) {
switch($row['user_avatar_type']) {
case USER_AVATAR_UPLOAD:
$userAvatar = ($board_config['allow_avatar_upload']) ? '<img style="width:35px; height:35px;" src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" width="35" height="35" />' : '';
break;
case USER_AVATAR_REMOTE:
$userAvatar = ($board_config['allow_avatar_remote']) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" style="width:35px; height:35px;"/>' : '';
break;
case USER_AVATAR_GALLERY:
$userAvatar = ($board_config['allow_avatar_local']) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" style="width:35px; height:35px;"/>' : '';
break;
}
}
else {
$userAvatar = '<img src="domslny_avatar.png" style="width:35px; height:35px;" border="0" />';
}
$poster = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '" class="gensmall"' . $colored_username[1] . '>' . $row_user_name . '</a>';
$template->assign_block_vars('wys', array(
'UZYTKOWNIK' => $poster,
'AVATAR' => $userAvatar,
'URL' => '<a href="'.append_sid("viewtopic.$phpEx?t=" . $row['topic_id']). '" class="gensmall" title="' . $row['topic_title'] . '">' . $topic_title . '</a>',
'VIEWS' => $row['topic_views'])
);
}
//Ostatnio napisane tematy
$sql = 'SELECT p.topic_id, p.topic_title, p.topic_poster, p.topic_time, a.user_id, a.username, a.user_level, a.user_jr, a.user_avatar_type, a.user_avatar
FROM ' . TOPICS_TABLE . ' p
LEFT JOIN ' . USERS_TABLE . ' a ON (a.user_id = p.topic_poster)
WHERE forum_id AND (topic_status <> 2)
ORDER BY topic_time DESC
LIMIT 5';
$result = mysql_query($sql);
$i=0;
while ($row = $db->sql_fetchrow($result))
{
$posttime = create_date($board_config['default_dateformat'], $row['topic_time'], $board_config['board_timezone']);
$colored_username = color_username($row['user_level'], $row['user_jr'], $row['user_id'], $row['username']);
$row_user_name = $colored_username[0];
$userAvatar = '';
if($row['user_avatar_type']) {
switch($row['user_avatar_type']) {
case USER_AVATAR_UPLOAD:
$userAvatar = ($board_config['allow_avatar_upload']) ? '<img style="width:35px; height:35px;" src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" width="35" height="35" />' : '';
break;
case USER_AVATAR_REMOTE:
$userAvatar = ($board_config['allow_avatar_remote']) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" style="width:35px; height:35px;"/>' : '';
break;
case USER_AVATAR_GALLERY:
$userAvatar = ($board_config['allow_avatar_local']) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" style="width:35px; height:35px;"/>' : '';
break;
}
}
else {
$userAvatar = '<img src="domslny_avatar.png" style="width:35px; height:35px;" border="0" />';
}
$poster = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '" class="gensmall"' . $colored_username[1] . '>' . $row_user_name . '</a>';
$i++;
if (strlen($row['topic_title']) > 25)
{
$topic_title = substr($row['topic_title'], 0, 25)."...";
}
else
{
$topic_title = $row['topic_title'];
}
$template->assign_block_vars('tem', array(
'POSTTIME' => $posttime,
'UZYTKOWNIK' => $poster,
'AVATAR' => $userAvatar,
'URL' => '<a href="' . append_sid("viewtopic.$phpEx?t=" . $row['topic_id']) . '" class="gensmall" title="' . $row['topic_title'] . '">' . $topic_title . '</a>')
);
} |
i w do pliku index_body.tpl dodaj sobie
Kod: | <table width="100%" border="0" cellspacing="1" cellpadding="3" class="forumline">
<tr>
<td class="catHead" colspan="3" width="10%">Najwiecej wyswietlen</td>
</tr>
<!-- BEGIN wys -->
<tr>
<td class="row2" align="center" valign="middle">{wys.AVATAR}</td>
<td width="100%" class="row1" align="left" valign="middle"><span class="gensmall">{wys.URL}<br /><b>Wswietlen:</b> {wys.VIEWS}<br /><b>Autor:</b> {wys.UZYTKOWNIK}</span></td>
</tr>
<!-- END wys -->
</table>
<br />
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="forumline">
<tr>
<td class="catHead" colspan="3" width="10%">Ostatnie tematy</td>
</tr>
<!-- BEGIN tem -->
<tr>
<td class="row2" align="center" valign="middle">{tem.AVATAR}</td>
<td width="100%" class="row1" align="left" valign="middle"><span class="gensmall">{tem.URL}<br /><b>Data:</b> {tem.POSTTIME}<br /><b>Autor:</b> {tem.UZYTKOWNIK}</span></td>
</tr>
<!-- END tem -->
</table>
<br />
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="forumline">
<tr>
<td class="catHead" colspan="3" width="10%">Najwiecej odpowiedzi</td>
</tr>
<!-- BEGIN odp -->
<tr>
<td class="row2" align="center" valign="middle">{odp.AVATAR}</td>
<td width="100%" class="row1" align="left" valign="middle"><span class="gensmall">{odp.URL}<br /><b>Odpowiedzi:</b> {odp.REPLIES}<br /><b>Autor:</b> {odp.UZYTKOWNIK}</span></td>
</tr>
<!-- END odp -->
</table> |
LCA:) - 27-08-2013, 17:54
Wielkie dzięęęęęęęęękiiii!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|