Pagina 20 din 27

Scris: 03-Ian-2007, 23:48:24
de ZooMLess
Dar aici
// NEWS FORUM ID
$glance_news_forum_id = 6; // SET TO ZERO IF YOU DO NOT HAVE A NEWS FORUM
Ce trebuie sa pun ? Scuze ca am postat 2 mesaje nu am fost atent ! :roll:

Scris: 04-Ian-2007, 00:03:53
de cip
acolo pui id-ul forumului din care vrei sa apara noutatile (news).

fiecare forum are, pe langa nume, si un id (un numar). ca sa nu o iei "pe ghicite", poti afla id-ul forumului tau daca ai acces la phpmyadmin, si implicit, la baza de date. deci, intri in phpmyadmin, alegi din stanga phpbb_forums, apoi te duci pe tabul Navigare (Navigate) si cauti forumul pe care il doresti (numele se afla in coloana forum_name). id-ul este cu doua coloane in stanga numelui, in coloana forum_id.

Scris: 04-Ian-2007, 00:09:45
de ZooMLess
Gata am pus merge dar cum fac sa scrie acolo la Recent Discutions si autorul topicului ?

Scris: 04-Ian-2007, 00:30:35
de cip
uite, nu mai stau sa despic firul in patru in glance.php-ul meu, deci iti ofer ceva mai complex :D si anume: autor, nr raspunsuri, si autorul ultimului raspuns.

cauta in glance.php:
$sql = "SELECT t.topic_title, t.topic_id, p2.post_time
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p2
WHERE t.forum_id NOT IN (" . $forumsignore . $glance_news_forum_id . ")
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND t.topic_type <> " . POST_ANNOUNCE . "
AND t.topic_moved_id = 0
ORDER BY t.topic_last_post_id DESC
LIMIT " . $glance_num_recent;
si inlocuieste cu:
$sql = "SELECT t.topic_title, t.topic_id, t.topic_time, t.topic_replies, p2.post_time, p2.poster_id, u.username, u.user_id, u.user_level, u2.username as user2, u2.user_id as id2, u2.user_level as level2
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u, " . USERS_TABLE . " u2
WHERE t.forum_id NOT IN (" . $forumsignore . $glance_news_forum_id . ")
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND p2.poster_id = u2.user_id
AND t.topic_poster = u.user_id
AND t.topic_moved_id = 0
ORDER BY t.topic_last_post_id DESC
LIMIT " . $glance_num_recent;
apoi cauta:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? '_new' : '_old' );

$newest_code = ( $unread_topics && $glance_show_new_bullets ) ? '&view=newest' : '';

$topic_link = $glance_forum_dir . 'viewtopic.php?t=' . $latest_topics[$i]['topic_id'] . $newest_code;

$template->assign_block_vars('recent', array(
'BULLET' => $$bullet_full,
'TOPIC_LINK' => $topic_link,

'TOPIC_TITLE' => $latest_topics[$i]['topic_title'])
);
}
si inlocuieste cu:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? '_new' : '_old' );

$newest_code = ( $unread_topics && $glance_show_new_bullets ) ? '&view=newest' : '';

$topic_link = $glance_forum_dir . 'viewtopic.php?t=' . $latest_topics[$i]['topic_id'] . $newest_code;

// INCEPUT adaugare
$topic_autor_id = $glance_forum_dir . 'profile.php?mode=viewprofile&u=' . $latest_topics[$i]['user_id'];

$topic_autor = $latest_topics[$i]['username'];

if ( $latest_topics[$i]['user_level'] == ADMIN )
{
$topic_autor = '<b><span style="color:#'. $theme['fontcolor3'] .'">'. $latest_topics[$i]['username'] .'</span></b>';
}
else if ( $latest_topics[$i]['user_level'] == MOD )
{
$topic_autor = '<b><span style="color:#'. $theme['fontcolor2'] .'">'. $latest_topics[$i]['username'] .'</span></b>';
}

$last_post_autor_id = $glance_forum_dir . 'profile.php?mode=viewprofile&u=' . $latest_topics[$i]['id2'];

$last_post_autor = $latest_topics[$i]['user2'];
if ( $latest_topics[$i]['level2'] == ADMIN )
{
$last_post_autor = '<b><span style="color:#'. $theme['fontcolor3'] .'">'. $latest_topics[$i]['user2'] .'</span></b>';
}
else if ( $latest_topics[$i]['level2'] == MOD )
{
$last_post_autor = '<b><span style="color:#'. $theme['fontcolor2'] .'">'. $latest_topics[$i]['user2'] .'</span></b>';
}

$topic_replies = $latest_topics[$i]['topic_replies'];
// SFARSIT adaugare

$template->assign_block_vars('recent', array(
'BULLET' => $$bullet_full,
'TOPIC_LINK' => $topic_link,

// INCEPUT adaugare
'TOPIC_AUTOR_ID' => $topic_autor_id,
'TOPIC_AUTOR' => $topic_autor,
'TOPIC_REPLIES' => $topic_replies,
'LAST_POST_AUTOR_ID' => $last_post_autor_id,
'LAST_POST_AUTOR' => $last_post_autor,
// SFARSIT adaugare

'TOPIC_TITLE' => $latest_topics[$i]['topic_title'])
);
}
acum cauta in glance_body.tpl:
<!-- BEGIN recent -->
<tr>
<td nowrap valign="top">{recent.BULLET}</td><td valign="top" width="100%"><span class="genmed">
<a href="{recent.TOPIC_LINK}" class="genmed">{recent.TOPIC_TITLE}</a></span></td>
</tr>
<!-- END recent -->
si inlocuieste cu:
<!-- BEGIN recent -->
<tr>
<td valign="top">{recent.BULLET}</td>
<td>
<span><a href="{recent.TOPIC_LINK}" class="genmed">{recent.TOPIC_TITLE}</a></span>
<span><br>scris de: <a href="{recent.TOPIC_AUTOR_ID}" class="genmed">{recent.TOPIC_AUTOR}</a>
<br>raspunsuri: {recent.TOPIC_REPLIES}<br>ultimul raspuns: <a href="{recent.LAST_POST_AUTOR_ID}" class="genmed">{recent.LAST_POST_AUTOR}</span>
</td>
</tr>
<!-- END recent -->

l.e. am revizuit una bucata cod, incurcasem ceva. :)

Scris: 04-Ian-2007, 00:39:38
de ZooMLess
Am facut asta dar apare scrisul imens ! :roll:

Scris: 04-Ian-2007, 01:02:49
de cip
uite aici un glance.txt (redenumeste-l in glance.php) si aici un glance_body.txt (redenumeste-l in glance_body.tpl) care iti adauga la noutati, pe langa data - autor si autorul ultimul raspuns, iar la discutii recente - autor, numar comentarii, autorul ultimului raspuns.

in mod normal nu ar trebui sa iti apara scrisul imens, dar asta depinde de stil. pune-ti si tu forumul in semnatura, mi-e mai usor sa vad cu ochii mei decat sa-ti citesc (si analizez :lol: ) cuvintele..

Scris: 04-Ian-2007, 12:19:36
de ZooMLess
Mersi mult dar... akum imi da o eroare shy nu inrta pe forum am remediat asta dar vreau doar sa scrie autorul atat !

Scris: 04-Ian-2007, 13:44:56
de cip
atunci:

in glance.php, cauta:
$sql = "SELECT t.topic_title, t.topic_id, p2.post_time
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p2
WHERE t.forum_id NOT IN (" . $forumsignore . $glance_news_forum_id . ")
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND t.topic_type <> " . POST_ANNOUNCE . "
AND t.topic_moved_id = 0
ORDER BY t.topic_last_post_id DESC
LIMIT " . $glance_num_recent;
si inlocuieste cu
$sql = "SELECT t.topic_title, t.topic_id, p2.post_time, u.username, u.user_id
FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u
WHERE t.forum_id NOT IN (" . $forumsignore . $glance_news_forum_id . ")
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND t.topic_poster = u.user_id
AND t.topic_type <> " . POST_ANNOUNCE . "
AND t.topic_moved_id = 0
ORDER BY t.topic_last_post_id DESC
LIMIT " . $glance_num_recent;
apoi cauta:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? '_new' : '_old' );

$newest_code = ( $unread_topics && $glance_show_new_bullets ) ? '&view=newest' : '';

$topic_link = $glance_forum_dir . 'viewtopic.php?t=' . $latest_topics[$i]['topic_id'] . $newest_code;

$template->assign_block_vars('recent', array(
'BULLET' => $$bullet_full,
'TOPIC_LINK' => $topic_link,

'TOPIC_TITLE' => $latest_topics[$i]['topic_title'])
);
si inlocuieste cu:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? '_new' : '_old' );

$newest_code = ( $unread_topics && $glance_show_new_bullets ) ? '&view=newest' : '';

$topic_link = $glance_forum_dir . 'viewtopic.php?t=' . $latest_topics[$i]['topic_id'] . $newest_code;

$topic_autor_id = $glance_forum_dir . 'profile.php?mode=viewprofile&u=' . $latest_topics[$i]['user_id'];

$topic_autor = $latest_topics[$i]['username'];

$template->assign_block_vars('recent', array(
'BULLET' => $$bullet_full,
'TOPIC_LINK' => $topic_link,
'TOPIC_AUTOR_ID' => $topic_autor_id,
'TOPIC_AUTOR' => $topic_autor,

'TOPIC_TITLE' => $latest_topics[$i]['topic_title'])
);
iar in glance_body.tpl cauta:
<!-- BEGIN recent -->
<tr>
<td nowrap valign="top">{recent.BULLET}</td><td valign="top" width="100%"><span class="genmed">
<a href="{recent.TOPIC_LINK}" class="genmed">{recent.TOPIC_TITLE}</a></span></td>
</tr>
<!-- END recent -->
si inlocuieste cu:
<!-- BEGIN recent -->
<tr>
<td nowrap valign="top">{recent.BULLET}</td><td valign="top" width="100%"><span class="genmed">
<a href="{recent.TOPIC_LINK}" class="genmed">{recent.TOPIC_TITLE}</a></span>
<span><br>scris de: <a href="{recent.TOPIC_AUTOR_ID}" class="genmed">{recent.TOPIC_AUTOR}</a></span></td>
</tr>
<!-- END recent -->

modificarile le faci in fisierele glance.php si glance_body.tpl originale, din arhiva modului.

Scris: 04-Ian-2007, 15:19:28
de ZooMLess
Merge Mersi Mult !

Scris: 04-Ian-2007, 15:41:50
de ZooMLess
O mica problema apare <b>scris de</b> cu scrisu foarte mare ! :(