1
goffy
Warning with xoInboxCount
  • 2019/7/26 7:47

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


hi

I am currently redesigning myxoops.org and I have a problem with "xoInboxCount" where I need support
Quote:
Warning: Use of undefined constant xoInboxCount - assumed 'xoInboxCount' (this will throw an Error in a future version of PHP) in Datei /.../myxoops.org/myxoops/secure/xoops_data/caches/smarty_compile/e7ff34f6-system-myxoops2019-default^%%C2^C23^C2339D63%%nav-menu.tpl.php

how can I solve this?

2
iHackCode
Re: Warning with xoInboxCount

Do you have a function.xoInboxCount.php file in htdocs/class/smarty/xoops_plugins ?

3
goffy
Re: Warning with xoInboxCount
  • 2019/7/28 12:38

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


hi

yes, and it provides the number of unread messages in a proper way

4
geekwright
Re: Warning with xoInboxCount

I've not seen this. Can you email me the nav-menu.tpl template file and the nav-menu.tpl.php compiled version so I can look at what it is doing?

5
goffy
Re: Warning with xoInboxCount
  • 2019/7/29 5:46

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


sent

6
geekwright
Re: Warning with xoInboxCount

Here is a quick review of the problem Goffy experienced for anyone following along. This will NOT work and triggers the warning:
<{if xoInboxCount}> ... <{/if}>
This will work:
<{xoInboxCount assign="unreadCount"}> <{if $unreadCount}> ... <{/if}>
The output of xoInboxCount goes straight to the page output. Using the assign parameter assigns the count to variable that can be used with the "if" function.

7
goffy
Re: Warning with xoInboxCount
  • 2019/7/30 5:11

  • goffy

  • Just can't stay away

  • Posts: 543

  • Since: 2010/12/27


hi geekwright

many thanks for help and explanation

8
alain01
Re: Warning with xoInboxCount
  • 2019/12/8 0:29

  • alain01

  • Just can't stay away

  • Posts: 536

  • Since: 2003/6/20


Yes, thanks,
but another question :

How can i subtract <{$inbox_total}>-<{$unread_count}>

It 's display : "4-3", not"1"


<li class="nav-item">
            <
class="nav-link" href="<{$xoops_url}>/viewpmsg.php">
            <{if 
$unread_count}> 
                <
span style="font-size: 20px;" class="mx-auto xoopsinactive-color fas fa-envelope">span> <span class="badge badge-pill badge-danger align-text-top"><{$unread_count}>span>
            <{/if}>
                <
span style="font-size: 20px;" class="mx-auto xoopsinactive-color fas fa-envelope-open">span> <span class="badge badge-pill badge-secondary"><{$inbox_total}>-<{$unread_count}>span>
            a>
        li>

9
alain01
Re: Warning with xoInboxCount
  • 2019/12/8 0:32

  • alain01

  • Just can't stay away

  • Posts: 536

  • Since: 2003/6/20


Link to the file /class/smarty/xoops_plugins/function.xoInboxCount.php
https://github.com/XOOPS/XoopsCore25/blob/master/htdocs/class/smarty/xoops_plugins/function.xoInboxCount.php

With this subject, i discover the directory /class/smarty/xoops_plugins.
So cool !

Ok ok, i could discovered 10 years ago...

10
alain01
Re: Warning with xoInboxCount
  • 2019/12/8 0:51

  • alain01

  • Just can't stay away

  • Posts: 536

  • Since: 2003/6/20


Yesssssss, found !

Quote:
Math and embedding tags:

{$x+$y} // will output the sum of x and y.
{assign var=foo value=$x+$y} // in attributes
{$foo[$x+3]} // as array index
{$foo={counter}+3} // tags within tags
{$foo="this is message {counter}"} // tags within double quoted strings


so i can use : <{$inbox_total-$unread_count}>

Resized Image


Now code is :
<{xoInboxCount assign="unread_count" total='inbox_total'}>
        <
li class="nav-item">
            <
class="nav-link" href="<{$xoops_url}>/viewpmsg.php">
            <{if 
$unread_count}> 
                <
span style="font-size: 20px;" class="mx-auto xoopsinactive-color fas fa-envelope">span> <span class="badge badge-pill badge-danger align-text-top"><{$unread_count}>span>
            <{/if}>
                <
span style="font-size: 20px;" class="mx-auto xoopsinactive-color fas fa-envelope-open">span> <span class="badge badge-pill badge-secondary align-text-top"><{$inbox_total-$unread_count}>span>
            a>
        li>

Login

Who's Online

246 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 246


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits