Pagina 1 din 1

MOD`ul "at a glance" prea simplu!

Scris: 18-Dec-2003, 12:00:11
de AgLiAn
Salutare!
Am adaugat MOD`ul glance pe www.sabotaj.as.ro/forum
Primu` meu MOD, si l`am si rezolvat cam in 5 minute!
Totusi am vazut un mod la fel, dar era ceva mai complicat. Iata o imagine:
Imagine
Si.. as vrea sa`l fac si eu acest MOD ca in imagine, dar nu prea stiu ce sa`ti fac sa apara asa.
Poate ma ajutati... VA ROG!
O zi buna!

Scris: 18-Dec-2003, 15:00:51
de BuGsY
Acesta seamna oarecum cu Mesajele scrise de la ultima vizită

Scris: 18-Dec-2003, 15:03:33
de AgLiAn
Da, asta asa`i... oare sa fie Mesajele scrise de la ultima vizită pus pe prima pagina, atata tot?
Nu prea as crede!

Scris: 18-Dec-2003, 15:04:03
de AgLiAn
Da, asta asa`i... oare sa fie Mesajele scrise de la ultima vizită pus pe prima pagina, atata tot?
Nu prea as crede, pentru ca Mesajele scrise de la ultima vizită nu apare daca nu esti logat, deci totusi e un MOD.

Scris: 18-Dec-2003, 18:44:44
de dorin
O sugestie: poate ar fi bine sa pui tabelul acestui MOD in top-ul paginii :idea:

Scris: 18-Dec-2003, 19:55:44
de mihaitza
Unde este in realitate ceea ce ai tu în imagine?

Poate aflăm de acolo ceva date;

Scris: 19-Dec-2003, 08:43:38
de AgLiAn
`neatza....
Mi`ai dat de lucru mihaitza, pentru ca nu mai stiam unde am vazut acel MOD, si a trebuit sa caut... dar pana la urma l`am gasit: http://www.forumtopics.com/phpBBDemo/index.php
Sper sa ma puteti ajuta, asa mai si aducem un nou MOD!
Have a nice day!

Scris: 19-Dec-2003, 14:14:40
de mihaitza
Toate datele despre mod [beta] şi codul sursă îl găseşti la :

http://www.forumtopics.com/phpBBDemo/viewtopic.php?t=37

Scris: 20-Dec-2003, 14:27:56
de AgLiAn
www.sabotaj.ro/forum
Am resit sa pun acest mod din prima, cam in... 5 minute!
Iata traducerea:

Cod: Selectaţi tot

############################################################## 
## MOD Title: Recent Topics on Index 
## MOD Author: drathbun < drathbun@forumtopics.com > (Dave Rathbun) www.forumtopics.com/phpBBDemo 
## MOD Description: Display the 5 most recent topics from (authorized) forums on index.php 
## MOD Version: 1.0.0 
## 
## Installation Level: Intermediate 
## Installation Time: 20 Minutes 
## Files To Edit: index.php, search.php, index_body.tpl, lang_main.php 
## Included Files: n/a 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## This mod places the five topics with the most recent activity on 
## the index.php page (index of your forum). It does not provide a 
## way to put topics on some other page (htm / html). It does not 
## replicate the "newest post" logic. If you want more (or fewer) 
## topics on your index, find this line: 
## 
## LIMIT  5"; 
## 
## ... and replace the number 5 with whatever number you want. 
## 
## As written, this mod is not compatible with phpBB 2.0.3 or earlier. 
## The way the authorized forum list is generated changed from 
## 2.0.3 to 2.0.4, and this mod requires 2.0.4. Please don't 
## email me / PM me / contact me asking me to write it for 2.0.3 
## as I'm not going to take the time to do it. :-) 
## 
## I originally wrote this code on 2.0.3, and as such, a lot of the 
## code was lifted from the basic code from index.php. I did not rewrite 
## that portion of the code for 2.0.4, as the only thing that did not 
## work when I upgraded was the authentication check. I rewrote that, 
## but the basic code to build the list of topics and jump urls and 
## paging logic is vanilla 2.0.3. It does work for 2.0.4, so I didn't 
## change it. 
## 
############################################################## 
## MOD History: 
## 
##   2003-05-28 - Version 1.0.0 
##      - First beta release at www.phpBB.com 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ SE DESCHIDE ]------------------------------------------ 
# 
language/lang_english/lang_main.php 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
$lang['A_critical_error'] = 'A Critical Error Occurred'; 

# 
#-----[ DUPA, ADAUGA ]------------------------------------------ 
# 

// BEGIN Recent Topics mod (drathbun) 
$lang['Most_recent_activity'] = 'Most recent activity (all forums)'; 
// END Recent Topics mod (drathbun) 

# 
#-----[ SE DESCHIDE ]------------------------------------------ 
# 
index.php 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
        // 
        // Okay, let's build the index 
        // 

# 
#-----[ DUPA, ADAUGA ]------------------------------------------ 
# 

        // BEGIN Recent Topics mod (drathbun) 
        $auth_view_forum_sql = ''; 
        // END Recent Topics mod (drathbun) 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
                                $display_forums = true; 

# 
#-----[ DUPA, ADAUGA ]------------------------------------------ 
# 
                                // BEGIN Recent Topics mod (drathbun) 
                                // This line builds this list of forums 
                                // a user is "auth'd" to view, to be used 
                                // later as a where clause 

                                $auth_view_forum_sql .= ($auth_view_forum_sql == '' ? '' : ', ' ) . $forum_data[$j]['forum_id']; 
                                // END Recent Topics mod (drathbun) 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
}// if ... total_categories 

# 
#-----[ INAINTE, ADAUGA ]------------------------------------------ 
# 
// BEGIN Recent Topics mod (drathbun) 
// The main code for the mod begins here. Earlier on the list of 
// authorized forums was built. First, check to see if there are any, 
// and if not, use (0) as a substitute. Otherwise we have a comma-delimted 
// list of forums which we then bracket with parenthesis (). The input might 
// be 1, 2, 3 and the output will be (1, 2, 3). This will later be used 
// in the sql used to retrieve the recent activity. 

$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')'); 

$template->assign_vars(array( 
        'L_MOST_RECENT_ACTIVITY' => $lang['Most_recent_activity'], 
        'URL_MOST_RECENT_ACTIVITY' => append_sid("search.$phpEx?search_id=recent"), 
        'AUTH_SQL' => $auth_view_forum_sql 
        )); 

$sql = "SELECT t.topic_id topic_id, 
        t.topic_title topic_title, 
        t.topic_last_post_id topic_last_post_id, 
        p.post_time post_time, 
        p.poster_id last_post_user_id, 
        t.topic_replies topic_replies, 
        t.topic_views topic_views, 
        f.forum_name forum_name, 
        f.forum_id forum_id, 
        u.username username 
FROM " . TOPICS_TABLE . " t, " 
       . POSTS_TABLE . " p, " 
       . FORUMS_TABLE . " f, " 
       . USERS_TABLE . " u 
WHERE t.forum_id IN " . $auth_view_forum_sql . " AND (t.topic_status <> 2) 
AND t.topic_last_post_id = p.post_id 
AND t.forum_id = f.forum_id 
AND t.forum_id = f.forum_id 
AND p.poster_id = u.user_id 
ORDER BY p.post_time DESC, t.topic_replies DESC 
LIMIT  5"; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
        message_die(GENERAL_ERROR, "Couldn't retrieve topic data for recent replies", "", __LINE__, __FILE__, $sql); 
} 

$topic_count = $db->sql_numrows($result); 
$recent_topics = $db->sql_fetchrowset($result); 

for ($i = 0; $i < $topic_count; $i++) 
{ 
        $class = ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1']; 

        // set local copy of variables from sql result set 
        $topic_post_time = create_date($board_config['default_dateformat'], $recent_topics[$i]['post_time'], $board_config['board_timezone']); 
        $topic_last_post_id = $recent_topics[$i]['topic_last_post_id']; 
        $topic_replies = $recent_topics[$i]['topic_replies']; 
        $topic_views = $recent_topics[$i]['topic_views']; 
        $topic_id = $recent_topics[$i]['topic_id']; 
        $forum_id = $recent_topics[$i]['forum_id']; 

        // Build url to jump to last post in topic, 
        // need to add "page" information, this was borrowed from 
        // existing phpBB code for generating topic listings from 
        // viewforums.php 

        $topic_jump_url = $topic_post_time . '<br />'; 

        $topic_jump_url .= ( $recent_topics[$i]['last_post_user_id'] == ANONYMOUS ) ? ( ($recent_topics[$i]['post_username'] != '' ) ? $recent_topics[$i]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $recent_topics[$i]['last_post_user_id']) . '">' . $recent_topics[$i]['username'] . '</a> '; 
        $topic_jump_url .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $recent_topics[$i]['topic_last_post_id']) . '#' . $recent_topics[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; 

        // build url to jump to various pages of topic if 
        // longer than board limit 

        if( ( $topic_replies + 1 ) > $board_config['posts_per_page'] ) 
        { 
                $total_pages = ceil( ( $topic_replies + 1 ) / $board_config['posts_per_page'] ); 
                $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': '; 

                $times = 1; 
                for($j = 0; $j < $topic_replies + 1; $j += $board_config['posts_per_page']) 
                { 
                        $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>'; 
                        if( $times == 1 && $total_pages > 4 ) 
                        { 
                                $goto_page .= ' ... '; 
                                $times = $total_pages - 3; 
                                $j += ( $total_pages - 4 ) * $board_config['posts_per_page']; 
                        } 
                        else if ( $times < $total_pages ) 
                        { 
                                $goto_page .= ', '; 
                        } 
                        $times++; 
                } 
                $goto_page .= ' ] '; 
        } 
        else 
        { 
                $goto_page = ''; 
        } 
        $template->assign_block_vars('topicrecent', array( 
                'CLASS' => $class, 
                'TITLE' => $recent_topics[$i]['topic_title'], 
                'TIME' => $topic_post_time, 
                'FORUM' => $recent_topics[$i]['forum_name'], 
                'FORUM_URL' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), 
                'JUMP_URL' => $topic_jump_url, 
                'GOTO_PAGE' => $goto_page, 
                'REPLIES' => $topic_replies, 
                'VIEWS' => $topic_views, 
                'TOPIC_URL' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id")) 
        ); 
} 

// END Recent Topics mod (drathbun) 


# 
#-----[ SE DESCHIDE ]------------------------------------------ 
# 
search.php 


# 
#-----[ CAUTA LINIA ]------------------------------------------ 
# 
        if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' ) 

# 
#-----[ INLOCUIESTE-O CU ]------------------------------------------ 
# 
        if ( $search_id == 'recent' || $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' ) 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
                if ( $search_id == 'newposts' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' )  ) 


# 
#-----[ INLOCUIESTE-O CU ]------------------------------------------ 
# 
                if ( $search_id == 'recent' || $search_id == 'newposts' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' )  ) 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
                        else if ( $search_id == 'egosearch' ) 

# 
#-----[ DUPA, ADAUGA ]------------------------------------------ 
# 
                        else if ( $search_id == 'recent' ) 
                        { 
                                $temptime = time() - 604800; // 604800 seconds is 7 days 

                                $sql = "SELECT post_id 
                                        FROM " . POSTS_TABLE . " 
                                        WHERE post_time >=$temptime "; 

                                $show_results = "topics"; 
                                $sortby = 0; 
                                $sortby_dir = "DESC"; 
                        } 

# 
#-----[ SE DESCHIDE ]------------------------------------------ 
# 
templates/subSilver/index_body.tpl 

# 
#-----[ CAUTA ]------------------------------------------ 
# 
<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> 
  <tr> 
        <td align="left"><span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a></span></td> 
        <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> 
  </tr> 
</table> 

# 
#-----[ DUPA, ADAUGA ]------------------------------------------ 
# 
<!-- inceput Topics MOD -->
<!-- Recent Topics Mod (drathbun) --> 
<br clear="all" /> 

<table width="100%" border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> 
<tr> 
   <td class="catHead" colspan="5" height="28"><a href="{URL_MOST_RECENT_ACTIVITY}" class="cattitle">Ultimele discutii</a></td> 
</tr> 
<tr> 
        <th class="thCornerL" align="center" nowrap="nowrap"><strong>{L_FORUM}</strong></th> 
        <th class="thTop" align="center" width="100%"><strong>Subiect</strong></th> 
        <th class="thTop" align="center" width="50"><strong>{L_REPLIES}</strong></th> 
        <th class="thTop" align="center" width="50"><strong>{L_VIEWS}</strong></th> 
        <th class="thCornerR" align="center"><strong>Ultimul mesaj</strong></th> 
</tr> 
<!-- BEGIN topicrecent --> 
<tr> 
        <td class="row1" align="left" valign="middle" nowrap="nowrap"><span class="genmed"><a href="{topicrecent.FORUM_URL}" class="topictitle">{topicrecent.FORUM}</a></span></td> 
        <td class="row1" align="left" valign="middle"><span class="genmed"><a href="{topicrecent.TOPIC_URL}" class="topictitle">{topicrecent.TITLE}</a></span><span class="gensmall"><br />{topicrecent.GOTO_PAGE}</a></span></td> 
        <td class="row2" align="center" valign="middle"><span class="gensmall">{topicrecent.REPLIES}</span></td> 
        <td class="row2" align="center" valign="middle"><span class="gensmall">{topicrecent.VIEWS}</span></td> 
        <td class="row3right" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{topicrecent.JUMP_URL}</span></td> 
</tr> 
<!-- END topicrecent --> 
</table> 

<br clear="all" /> 
<!-- Recent Topics Mod (drathbun) --> 
<!-- sfarsit Topics MOD -->

# 
#-----[ SALVEAZA ]------------------------------------------ 
# 
# ! succes !
#-----[ TRADUS DE www.sabotaj.ro ]-----------------------------