Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 14:37

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 2 posts ] 
Author Message
PostPosted: 14 Oct 2011, 01:00 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
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:
Attachment:
Jump_to_my_latest_post_v.0.0.2.zip [37.51 KiB]
Downloaded 410 times

* Download: (de/subsilver2)
Attachment:
Jump_to_my_latest_post_v.0.0.2_subsilver.zip [33.18 KiB]
Downloaded 378 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


Top
 Profile  
 
PostPosted: 16 Oct 2011, 17:35 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
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:
        }

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


before add

Code:
        // 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:
        unset($rowset);


after add

Code:
        // 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:
    <!-- IF not S_IS_BOT --><a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF -->


after add

Code:
                            <!-- 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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.016s | 22 Queries | GZIP : Off ]