None of my mods, wherever you find them, are abandoned.
All of them are in developement, even if i am not active on phpbb.com.

[DEV] Jump to my latest post v.0.0.2

[DEV] 3.0.* Mod Base

[DEV] Jump to my latest post v.0.0.2

Postby Sekuro » 14 Oct 2011, 01:00

Jump to my latest post

MOD-Title: Jump to my latest post
MOD-Version: 0.0.2
MOD-Author: 4seven

Credits: Erik Frèrejean (for assistance to make this perfect)

Request by: cyblost
Request Thread: http://www.phpbb.com/community/viewtopi ... #p12805047

License: GNU General Public License v2

phpBB-Version: phpBB 3.0.x
phpBB-Languages: en/de*
phpBB-Styles: prosilver/subsilver2*

MOD-Description:
This Mod adds an extra icon Image Image in viewforum, where u can jump to your latest post in topic

Features:
- Jump to your latest post in each topic, where u have posted
- Jump to your latest post in each forum, where u have posted (extra ModX in contrib folder)

Main Demo: (User Guest)
http://4seven.bplaced.net/forum/media/index.php

Demo Search Addition: (User Guest / login)
http://4seven.bplaced.net/forum/media/index.php

Same address, but as Guest only these links are visible
View unanswered posts • View active topics

More you see as logged in user
login (un: test / pw: testuser),
go to index and click on:
View unanswered posts • View unread posts • View new posts • View active topics
or
View your posts

Download:
Jump_to_my_latest_post_v.0.0.2.zip
(37.51 KiB) Downloaded 314 times

* Download: (de/subsilver2)
Jump_to_my_latest_post_v.0.0.2_subsilver.zip
(33.18 KiB) Downloaded 267 times

Image

Image

----------------------

New in v.0.0.2:
- New significant Mod Name
- Reduce too much Querys to one (thx to Erik Frèrejean)
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900



Re: [DEV] Jump to my latest post v.0.0.2

Postby Sekuro » 16 Oct 2011, 17:35

Search Addition
for v.0.0.2

Works for
• View new posts
• View unanswered posts
• View active topics
• View your posts
• Advanced search (Display results as: [x] Topics)

Demo: View unanswered posts (User Guest)
http://4seven.bplaced.net/forum/media/index.php

As Guest only these links are visible
View unanswered posts • View active topics

More you see as logged in user (login (un: test / pw: testuser))
Go to index and click on: View unanswered posts • View unread posts • View new posts • View active topics
or
View your posts
or
Use named search mode

Installation

open

search.php

find

Code: Select all
        }

        if ($topic_id && ($topic_id == $result_topic_id))


before add

Code: Select all
        // Jump to my latest post / Search Addition / 4seven / 2011    
        if (!isset($topic_ids))
        {
           $topic_ids = array();
        }

        $topic_ids[] = $result_topic_id;
        // Jump to my latest post / Search Addition / 4seven / 2011             


find

Code: Select all
        unset($rowset);


after add

Code: Select all
        // Jump to my latest post / Search Addition / 4seven / 2011    
        if ((isset($topic_ids) && ($user->data['user_id'] != ANONYMOUS)))
        {
            $sql = 'SELECT max(post_id) as post_id, topic_id, forum_id, poster_id
                    FROM '
 . POSTS_TABLE . '
                    WHERE poster_id = '
 . $user->data['user_id'] . '
                    AND '
 . $db->sql_in_set('topic_id', $topic_ids) . '
                    GROUP BY topic_id'
;
            $result = $db->sql_query_limit($sql, sizeof($topic_ids));

            $linkformat = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, array('f' => '%1$s', 't' => '%2$s', 'p' => '%3$s', '#' => 'p' . '%3$s'));

            $topic_ids = array_flip($topic_ids);

        while ($row = $db->sql_fetchrow($result)){
     
            $rownr 
= $topic_ids[$row['topic_id']];
          
            $url 
= sprintf($linkformat, $row['forum_id'], $row['topic_id'], $row['post_id']);

            $template->alter_block_array('searchresults', array(
           
                     
'U_LATEST_POST' => $url,
                     
            
), $rownr, 'change');}
     
            $db
->sql_freeresult($result);
                    
            $template
->assign_vars(array(
                     'WROTE_IMG'     => $phpbb_root_path . '/images/arrw.png',
            ));
        }
        // Jump to my latest post / Search Addition / 4seven / 2011               


open

styles/prosilver/template/search_results.html

find

Code: Select all
    <!-- IF not S_IS_BOT --><a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF -->


after add

Code: Select all
                            <!-- IF searchresults.U_LATEST_POST --> &nbsp;<a href="{searchresults.U_LATEST_POST}" title="{L_VIEW_MY_LATEST_POST}"><img src="{WROTE_IMG}" alt="" /></a><!-- ENDIF -->


• Clear all Board-, Template-, Style- and Browser-Caches
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900



Return to phpbb 3.0.* St@ff

Who is online

Users browsing this forum: No registered users and 1 guest

cron