TinyPortal

Development => Block Codes => Topic started by: pvcblue on November 27, 2006, 04:49:16 PM

Title: Recent Topics Block Problem
Post by: pvcblue on November 27, 2006, 04:49:16 PM
*** Now before you start going "oh there is a thread on this", yes there is a thread about this block, BUT heck there are eight different problems going on and people repeating themselves over and over and OVER!***

I am using this version of the code -

global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
       $what=ssi_recentTopics('10', NULL, 'array');


        foreach ($what as $topic)
        {
                echo '
                                <tr>
                                        <td class="windowbg" valign="middle">
                                                ', $topic['link'];

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                echo '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="20%">
                                                ', $topic['poster']['link'], '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="35%">';
                if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
                        echo '
                                        <a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
                echo '
                                                <span class="smalltext">
                                                        ', $topic['time'], '
                                                </span>
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';



The problem is not with the block itself perse. The block "new" image dissapears after it has been read, BUT the new image on the forum itself does not change to the read image, you have to go back to the forum itself and "mark all as read" to get the images to switch. Can this be fixed?
Title: Re: Recent Topics Block Problem
Post by: rebelrose on November 27, 2006, 11:03:48 PM
Maybe we can get a coder to take a look at this for you. I am not good with code that way myself.
Title: Re: Recent Topics Block Problem
Post by: Techdomain on November 28, 2006, 12:02:19 AM
I had a go at it, and it works for me without any dramas (ie the "new" is removed from the forum and the recent box as it should)

Edit: do you want it to have the recycle bin appear?
Title: Re: Recent Topics Block Problem
Post by: Blue Steel on November 28, 2006, 12:05:19 AM
yes it marks it read for the recent msgs and also View unread msgs .. however its not marking it as read when you go to the main forum / catagory pages they still show their icons as New msgs in that area

it seems to me to be an SMF problem.. because when you read the topic SMF and NOT Tiny Portal does the marking of the message as read.. Tiny Portal is only displaying the new messages and providing a link to display them.. from there its SMF takes over..I could be wrong but i don't think so
Title: Re: Recent Topics Block Problem
Post by: Techdomain on November 28, 2006, 12:07:13 AM
ah - i c, in the main page view, not when you are looking at the topics in the individual board.
Title: Re: Recent Topics Block Problem
Post by: pvcblue on November 28, 2006, 12:43:56 AM
Quote from: BlueSteel on November 28, 2006, 12:05:19 AM
yes it marks it read for the recent msgs and also View unread msgs .. however its not marking it as read when you go to the main forum / catagory pages they still show their icons as New msgs in that area

it seems to me to be an SMF problem.. because when you read the topic SMF and NOT Tiny Portal does the marking of the message as read.. Tiny Portal is only displaying the new messages and providing a link to display them.. from there its SMF takes over..I could be wrong but i don't think so


I think you are wrong..... sorry.... but I did a test using the "recent block" that you can activate thru the Blocks Manager, and when you click on it the forum icons change to "read", so it is something in his code that is not doing it.
Title: Re: Recent Topics Block Problem
Post by: Techdomain on November 28, 2006, 03:51:30 AM
Would it be easier just to edit the tinyportal one to suit your tastes?
Title: Re: Recent Topics Block Problem
Post by: pvcblue on November 28, 2006, 04:02:22 AM
Quote from: JRW on November 28, 2006, 03:51:30 AM
Would it be easier just to edit the tinyportal one to suit your tastes?

No.........

This code that I am using was made to expand on the TP one originally as the Tp does not offer allot of the detail users were wanting, so this one was created and has been expanded on as well, but still no fix for the problem, I do not see why it cannot be adjusted to act like the "original" and mark the threads as read?
Title: Re: Recent Topics Block Problem
Post by: IchBin on November 28, 2006, 05:13:43 AM
Change this code:
if (!$topic['new'] && $context['user']['is_logged'])

To this:
if ($topic['new'] && $context['user']['is_logged'])
Title: Re: Recent Topics Block Problem
Post by: Techdomain on November 28, 2006, 05:40:11 AM
I tried that earlier and it didnt seem to make a difference.
Title: Re: Recent Topics Block Problem
Post by: pvcblue on November 28, 2006, 11:48:26 AM
Quote from: IchBinâââ,¬Å¾Ã,¢ on November 28, 2006, 05:13:43 AM
Change this code:
if (!$topic['new'] && $context['user']['is_logged'])

To this:
if ($topic['new'] && $context['user']['is_logged'])

Nope that doesn't fix it, all it did was change the way it shows "new" and even showed my own posts as "new" to me???
Title: Re: Recent Topics Block Problem
Post by: pvcblue on November 30, 2006, 11:15:13 AM
Quote from: pvcblue on November 27, 2006, 04:49:16 PM
*** Now before you start going "oh there is a thread on this", yes there is a thread about this block, BUT heck there are eight different problems going on and people repeating themselves over and over and OVER!***

I am using this version of the code -

global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
       $what=ssi_recentTopics('10', NULL, 'array');


        foreach ($what as $topic)
        {
                echo '
                                <tr>
                                        <td class="windowbg" valign="middle">
                                                ', $topic['link'];

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                echo '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="20%">
                                                ', $topic['poster']['link'], '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="35%">';
                if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
                        echo '
                                        <a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
                echo '
                                                <span class="smalltext">
                                                        ', $topic['time'], '
                                                </span>
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';



The problem is not with the block itself perse. The block "new" image dissapears after it has been read, BUT the new image on the forum itself does not change to the read image, you have to go back to the forum itself and "mark all as read" to get the images to switch. Can this be fixed?

Anyone??
Title: Re: Recent Topics Block Problem
Post by: pvcblue on December 02, 2006, 02:31:10 PM
bump
Title: Re: Recent Topics Block Problem
Post by: pvcblue on December 04, 2006, 12:23:01 PM
I am using this version of the code -

global $scripturl;

echo '
                        <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
                               <tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
       $what=ssi_recentTopics('10', NULL, 'array');


        foreach ($what as $topic)
        {
                echo '
                                <tr>
                                        <td class="windowbg" valign="middle">
                                                ', $topic['link'];

                // Is this topic new? (assuming they are logged in!)
                if (!$topic['new'] && $context['user']['is_logged'])
                        echo '
                                                <a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';

                echo '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="20%">
                                                ', $topic['poster']['link'], '
                                        </td>
                                        <td class="windowbg2" valign="middle" width="35%">';
                if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
                        echo '
                                        <a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
                echo '
                                                <span class="smalltext">
                                                        ', $topic['time'], '
                                                </span>
                                        </td>
                                </tr>';
        }

        echo '
                        </table>';



The problem is not with the block itself perse. The block "new" image dissapears after it has been read, BUT the new image on the forum itself does not change to the read image, you have to go back to the forum itself and "mark all as read" to get the images to switch. Can this be fixed?