Warning: The author of this contribution does not provide support for it anymore.

Topic Text in Mouse Over

Hover on Top Five - Topic Text in Mouse Over

Hover on Top Five

by Wyu » Mon Oct 24, 2011 1:19 pm

A few years ago, I PM RMcGirr83 for the solution if you remmeber...
It worked splendid.

But recently I did a full install on a 3.0.9 and tried to do the same.
Somehow it didn't work anymore.
I suppose back then, both the Top Five and the phpBB versions were just much older eventhough the top5 haven't had new versions. It was since 3.0.4 or something.

All I had was this code to insert in the top_five.php in includes.

After:

Code: Select all

    while( $row = $db->sql_fetchrow($result) )
    {


Insert:

Code: Select all

             //BEGIN Topic Text Hover Mod
          if(!empty($row['post_text']))
          {
             // strip all bbcode
             if (!function_exists('bbcode_strip'))
             {
                include($phpbb_root_path . 'includes/topic_text_hover.' . $phpEx);
             }
             $text_hover = censor_text(bbcode_strip($row['post_text']));
             if (utf8_strlen($text_hover) >= $config['hover_char_limit'])
             {
                $text_hover = (utf8_strlen($text_hover) > $config['hover_char_limit'] + 3) ? utf8_substr($text_hover, 0, $config['hover_char_limit']) . '...' : $text_hover;
             }
          }
          // END Topic Text Hover MOD       


But yeap, it doesn't work anymore.
Any hints?
Wyu
Registered User
Posts: 44
Joined: Fri May 08, 2009 6:06 am
Contact:

Re: Hover on Top Five

by RMcGirr83 » Mon Oct 24, 2011 1:41 pm

You don't have the edits to the html file which is why it isn't working.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21061
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Hover on Top Five

by Wyu » Wed Oct 26, 2011 10:42 am

I found your instructions.
I think i manged to get it to work a few years ago and I still have the old php and html files.
The HTML parts are easy, its the changes in the 3.0.9 code which I can't seem to use your instructions in anymore that got me stucked.

Its here:
http://www.phpbb.com/community/viewtopic.php?p=9523175#p9523175

When comparing with my old source files, I managed to get through a few steps in the instructions, otherwise, even the first step is already non existent in the 3.0.9 files.

Step 1:
in includes/top_five.php
Find:

Code: Select all

    post_time,


In lin add

Code: Select all

    p.post_text,


In 3.0.9, those codes are no longer in use, but I manage to find section which its changed
From old code:

Code: Select all

// grab all posts that meet criteria and auths
   $sql_ary = array(
      'SELECT'   => 'MAX(p.post_time) as post_time, p.post_text, u.user_id, u.username, u.user_colour, t.topic_title, t.forum_id, t.topic_last_post_id',
      'FROM'      => array(TOPICS_TABLE => 't', POSTS_TABLE => 'p'),
      'LEFT_JOIN'   => array(
         array(
            'FROM'   => array(USERS_TABLE => 'u'),
            'ON'   => 't.topic_last_poster_id = u.user_id',
            ),
      ),
      'WHERE'      => 'p.topic_id = t.topic_id
            AND p.post_approved = 1
            AND t.topic_moved_id = 0' . $sql_and,
      'GROUP_BY'   => 't.topic_id',
      'ORDER_BY'   => 'post_time DESC',
   );

   $result = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_ary), 10);

    while( $row = $db->sql_fetchrow($result) )
    {   
   
             //BEGIN Topic Text Hover Mod
          if(!empty($row['post_text']))
          {
             // strip all bbcode
             if (!function_exists('bbcode_strip'))
             {
                include($phpbb_root_path . 'includes/topic_text_hover.' . $phpEx);
             }
             $text_hover = censor_text(bbcode_strip($row['post_text']));
             if (utf8_strlen($text_hover) >= $config['hover_char_limit'])
             {
                $text_hover = (utf8_strlen($text_hover) > $config['hover_char_limit'] + 3) ? utf8_substr($text_hover, 0, $config['hover_char_limit']) . '...' : $text_hover;
             }
          }
          // END Topic Text Hover MOD 


Thats what I got from you previously which worked.

In 3.0.9, it has been changed to.

Code: Select all

// grab all posts that meet criteria and auths
   $sql_ary = array(
      'SELECT'   => 'u.user_id, u.username, u.user_colour, t.topic_title, t.forum_id, t.topic_last_post_id, t.topic_last_post_time, t.topic_last_poster_name',
      'FROM'      => array(TOPICS_TABLE => 't'),
      'LEFT_JOIN'   => array(
         array(
            'FROM'   => array(USERS_TABLE => 'u'),
            'ON'   => 't.topic_last_poster_id = u.user_id',
            ),
      ),
      'WHERE'      => 't.topic_approved = 1 AND t.topic_status <> ' . ITEM_MOVED . ' ' . $sql_and,
      'ORDER_BY'   => 't.topic_last_post_time DESC',
   );

   $result = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_ary), 10);
   $is_row = false;
    while( $row = $db->sql_fetchrow($result) )
    { 


It doesn't use

Code: Select all

post_time
anymore, I still tried adding it in anyway, but it didn't work.
Below was what I tried to do

Code: Select all

   // grab all posts that meet criteria and auths
   $sql_ary = array(
      'SELECT'   => 'u.user_id, u.username, u.user_colour, t.topic_title, t.forum_id, t.topic_last_post_id, t.topic_last_post_time, t.topic_last_poster_name, p.post_text',
      'FROM'      => array(TOPICS_TABLE => 't'),
      'LEFT_JOIN'   => array(
         array(
            'FROM'   => array(USERS_TABLE => 'u'),
            'ON'   => 't.topic_last_poster_id = u.user_id',
            ),
      ),
      'WHERE'      => 't.topic_approved = 1 AND t.topic_status <> ' . ITEM_MOVED . ' ' . $sql_and,
      'ORDER_BY'   => 't.topic_last_post_time DESC',
   );

   $result = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_ary), 10);
   $is_row = false;
    while( $row = $db->sql_fetchrow($result) )
    {
          //BEGIN Topic Text Hover Mod
          if(!empty($row['post_text']))
          {
             // strip all bbcode
             if (!function_exists('bbcode_strip'))
             {
                include($phpbb_root_path . 'includes/topic_text_hover.' . $phpEx);
             }
             $text_hover = censor_text(bbcode_strip($row['post_text']));
             if (utf8_strlen($text_hover) >= $config['hover_char_limit'])
             {
                $text_hover = (utf8_strlen($text_hover) > $config['hover_char_limit'] + 3) ? utf8_substr($text_hover, 0, $config['hover_char_limit']) . '...' : $text_hover;
             }
          }
          // END Topic Text Hover MOD   
 


and I added:

Code: Select all

             'U_TOPIC'       => $view_topic_url,
               'POST_TEXT'      => (isset($text_hover)) ? $text_hover : '',



Then in top_five_body.html, which is also different from your intruction's version code.
I did:

Code: Select all

<tr class="bg2">
               <td valign="top"><!-- BEGIN top_five_topic --><!-- IF top_five_topic.NO_TOPIC_TITLE-->{top_five_topic.NO_TOPIC_TITLE}<!-- ELSE --><a href="{top_five_topic.U_TOPIC}"    <!-- IF top_five_topic.POST_TEXT -->title="{top_five_topic.POST_TEXT}"<!-- ENDIF -->>{top_five_topic.TOPIC_TITLE}</a><br />&nbsp;&nbsp;{top_five_topic.USERNAME_FULL}&nbsp;&nbsp;{top_five_topic.LAST_TOPIC_TIME}<br /><!-- ENDIF --><!-- END top_five_topic --></td>
               <td valign="top"><!-- BEGIN top_five_active -->{top_five_active.USERNAME_FULL}<br />&nbsp;&nbsp;{L_POSTS}: <a href="{top_five_active.S_SEARCH_ACTION}">{top_five_active.POSTS}</a><br /><!-- END top_five_active --></td>
               <td valign="top"><!-- BEGIN top_five_newest -->{top_five_newest.USERNAME_FULL}<br />&nbsp;&nbsp;{L_JOINED}: {top_five_newest.REG_DATE}<br /><!-- END top_five_newest --></td>
            </tr>


pretty much changed the name from hot_topic_row to top_five_topic.


Well, thats about all the things I did to change it to fit in the new version..
Unfortunately, it still didn't work, so I undid the changes...
I got a feeling that they can't be changed in the way i did, but I don't know how to change it otherwise...
Any help is much appreciated, i tried for several hours already.
Wyu
Registered User
Posts: 44
Joined: Fri May 08, 2009 6:06 am
Contact:

Re: Hover on Top Five

by Wyu » Wed Oct 26, 2011 11:20 am

Hey RMcGirr83,

Before I rant again, I just want to say I'm a big fan of your mods, so far, you gave me the feel of like the Apple brand of mods in the community.
I'm using your mchat, been using your top10(top_five mod),the text hover and top flags... for years.
You might have checked out my forum before, anyway its:
http://kigurumicosplay.com/social

Just did a major overhaul. All the partial updates in the past from 3.0.1 to 3.0.8-ish made many functions screw up... you know, legacy files mixed in with updated files. Its been like half a decade and still kicking. Do check it out to see what I have done to your mods.

Big thank you!

Anyway, was gonna rant this:

The new installation of your Topic Text Hover, it seems to only work when I onMouseOver the small "page icon" in the last post column. It doesn't show the text preview anywhere else in the row
.
You got any guesses what might be the problem?

Cheers buddy!
Wyu
Registered User
Posts: 44
Joined: Fri May 08, 2009 6:06 am
Contact: