• Resolved Halil ESEN

    (@halilesen)


    Hi, it’s me again. ??

    After the 2.6.8 update, the code to show the notification count still doesn’t work.

    I tried many php combinations. It didn’t work. plainly

    <?php global $w3all_phpbb_unotifications;
      echo count($w3all_phpbb_unotifications);
    ?>

    When it is used, it shows 0, but there is actually a notification.

    You know, I usually use it in two ways. First:

    function add_notification_count_to_menu($item_output, $item, $depth, $args)
        {
            if ($args->theme_location == 'primary' && $item->title == '<i class="fas fa-comment"></i> Forumlar') {
    global $w3all_phpbb_unotifications;
    			if (!empty($w3all_phpbb_unotifications) && count($w3all_phpbb_unotifications) > 0){
                $item_output .= '<span class="bildirimvarbaksana">'. count($w3all_phpbb_unotifications) .'</span>';
    
            }
    		}
    
            return $item_output;
        }
    add_filter('walker_nav_menu_start_el', 'add_notification_count_to_menu', 10, 4);
    

    latter:

    <?php global $w3all_phpbb_unotifications; if (!empty($w3all_phpbb_unotifications) && count($w3all_phpbb_unotifications) > 0){ echo'<span class="bildirimvarnokta"></span>'; } ?>

    Not working. Of course, these don’t show anything because they have an if. Because as I just said, notifications show 0.

    I cleared the cache. I tried from incognito tab.

    What do you think is the problem?

    Thanks.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author axew3

    (@axewww)

    Hello dear. It should work fine ever. But there is a problem with PM i see.

    The query to get PMs if option active, won’t work fine…. looking for the solution ?? in short

    Thinking to separate the two queries and merge results in case of PMs… mhhh s*it ??

    • This reply was modified 1 year, 10 months ago by axew3.
    Plugin Author axew3

    (@axewww)

    No, it is working fine. I had disabled on last test yesterday, all notifications options on the user control panel, with the user i was testing.

    The problem you may found is about IF the user have OR not set notifications into Edit notification options

    Access to Edit notification options on the User Control Panel and Activate all options on the NOTIFICATIONS column then test it.

    Should all work fine

    • This reply was modified 1 year, 10 months ago by axew3.
    • This reply was modified 1 year, 10 months ago by axew3.
    Thread Starter Halil ESEN

    (@halilesen)

    I can’t understand either. No problem with UCP. I wonder if it’s related to php, I upgraded to 8.1.x, it didn’t work, I rolled it back. I reviewed the settings. It didn’t work. Could something else be triggering it or a missing php module or something?

    Plugin Author axew3

    (@axewww)

    No it can’t be, the whole plugin code is suitable on php from 7 to 8> (and could be for 5.6 with really few line changes)

    Note that once an user visit the

    Board index -> User Control Panel ->Overview -> Manage notifications

    page, the $phpbb_user_session[0]->user_new_privmsg var become 0.

    So PMs notifications are not retrieved anymore.

    To force and get by the way, you could change this line

    if( $phpbb_user_session[0]->user_new_privmsg > 0 && $w3all_phpbb_unotifications_yn == 1 )

    into file class.wp.w3all-phpbb.php

    changing into:

    if( $w3all_phpbb_unotifications_yn == 1 )

    so that even after visited the Manage Notification page in phpBB, unread PMs will be by the way retrieved. I do not encourage this, but you can test that it work as mentioned. The above do not affect the Topics and Posts notifications that will be retrieved until not read.

    The file /wp-content/plugins/wp-w3all-phpbb-integration/views/wp_w3all_phpbb_unotifications_short.php

    has been just updated to add code into the condition

    elseif (  $nn == 'notification_type_name' && strpos($n,'type.forum') )

    when the notification is of type.forum.

    https://plugins.trac.www.ads-software.com/export/HEAD/wp-w3all-phpbb-integration/trunk/views/wp_w3all_phpbb_upm_short.php

    It still lack:

    notification.type.disapprove_post

    notification.type.disapprove_topic

    • This reply was modified 1 year, 10 months ago by axew3.
    • This reply was modified 1 year, 10 months ago by axew3.
    • This reply was modified 1 year, 10 months ago by axew3.
    Thread Starter Halil ESEN

    (@halilesen)

    Frankly all I want to do right now is to show the notification count. I don’t care about PMs, because if PM has already arrived, a notification comes. Then there is no need to get numbers for PM as an extra. I’m thinking of reporting later as in phpBB but not now.

    All notification options are active in UCP to be displayed on the board.

    ??

    Plugin Author axew3

    (@axewww)

    Do not remember if already asked: which phpBB version are you on? This should be the unique reason of why it is not working.

    the file /views/wp_w3all_phpbb_upm_short has been definitively and completely fixed under any aspect at date of this post

    https://plugins.trac.www.ads-software.com/export/HEAD/wp-w3all-phpbb-integration/trunk/views/wp_w3all_phpbb_upm_short.php

    have you try to use the shortcode and see if it work?

    Since you are sure that the user that should see notifications, activated notifications into his UCP, at moment i cannot imagine where the problem come out for your install..

    could you screenshot the phpBB phpbb_notification_types db table?

    Curious to see

    • This reply was modified 1 year, 10 months ago by axew3.
    Thread Starter Halil ESEN

    (@halilesen)

    phpBB version is 3.3.9. WordPress is 6.1.1.

    When I used the code in the file you gave, a link appeared that opened the page it was on when clicked: “You have unread forum PM”. I changed the setting to “Yes, also Private Messages” in case it works (Usually set to “Yes, but exclude Private Messages”.). Again the link was not working.

    Plugin Author axew3

    (@axewww)

    Only notification names that start with

    notification.type are default phpBB 33>

    and considered by the plugin query (others can be easily added), so you cannot expect that those coming from installed extensions are retrieved.

    Anyway, very strange because the query almost for defaults should surely work fine.

    Is it possible that those by extensions overwrite defaults? The screenshot list all existent types? If a pm or post notification data is stored, it is stored for the notification you want, into/as a default phpBB type?

    Have you try to disable extensions?… anyway, strange, extensions should not affect

    • This reply was modified 1 year, 10 months ago by axew3.
    • This reply was modified 1 year, 10 months ago by axew3.
    • This reply was modified 1 year, 10 months ago by axew3.
    Thread Starter Halil ESEN

    (@halilesen)

    We were able to do this before updating to 2.6.6, the first time I asked for help; I have the same things; I assume it counted all the notification types of this. However, in the last update, the default notification types mentioned are not counted either.

    Plugin Author axew3

    (@axewww)

    where you are using the code that should count?

    i start to assume that you are calling

    echo count($w3all_phpbb_unotifications);//exit;

    somewhere when it is still not populated

    • This reply was modified 1 year, 10 months ago by axew3.
    Thread Starter Halil ESEN

    (@halilesen)

    The first code that I said I used in the first message is in the functions.php file, and the other one in the header.php.

    Thread Starter Halil ESEN

    (@halilesen)

    Will I lose a lot if I go back to 2.6.5?

    Plugin Author axew3

    (@axewww)

    2.6.9 has been released and add option

    Only get the total notifications count, of any type, default phpBB and customs types created by extensions. If selected, then just use echo $w3all_phpbb_unotifications; in this case, to display the number of unread notifications, declaring it as global, into any Php template or (maybe) some other plugin.

    Read inline hints!

    Cheers! alessio

    Thread Starter Halil ESEN

    (@halilesen)

    But

    Plugin Author axew3

    (@axewww)

    You do not have to count nothing, just use echo

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘w3all_phpbb_unotifications doesn’t work’ is closed to new replies.