2021-08-18, 12:13 AM
2021-09-18, 01:00 PM
can't be it used for particular url ? like
<if a href="/index.php" then>
blaahhhh
<else>
hhhhaalb
</if>
<if a href="/index.php" then>
blaahhhh
<else>
hhhhaalb
</if>
2021-09-18, 08:30 PM
<if constant('THIS_SCRIPT') == 'index.php' then>
yay!
</if>
2022-01-01, 05:41 AM
Is there a way to create an If else statement for member profiles, for example, if I am looking at my member profile, I will see "this", and if looking at someone else's member profile then I will see "that"
I've been trying, but can seem to get it.
any help?
<if $GLOBALS['mybb']->user['uid] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
Solved:
Again, something inside me just takes over, and answers the question, so why do I even ask?
<if $GLOBALS['mybb']->user['uid'] == $memprofile['uid'] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
But what if is a custom page?
wow, solved this again, so surprising, it just takes minutes once the higher mind takes over, to solve this for a custom page is to change
$memprofile['uid'] then>
to
$uid then>
I've been trying, but can seem to get it.
any help?
<if $GLOBALS['mybb']->user['uid] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
(2022-01-01, 05:41 AM)Michael2014 Wrote: [ -> ]Is there a way to create an If else statement for member profiles, for example, if I am looking at my member profile, I will see "this", and if looking at someone else's member profileĀ then I will see "that"
I've been trying, but can seem to get it.
any help?
<if $GLOBALS['mybb']->user['uid] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
Solved:
Again, something inside me just takes over, and answers the question, so why do I even ask?
<if $GLOBALS['mybb']->user['uid'] == $memprofile['uid'] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
But what if is a custom page?
(2022-01-01, 05:41 AM)Michael2014 Wrote: [ -> ]Is there a way to create an If else statement for member profiles, for example, if I am looking at my member profile, I will see "this", and if looking at someone else's member profileĀ then I will see "that"
I've been trying, but can seem to get it.
any help?
<if $GLOBALS['mybb']->user['uid] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
(2022-01-01, 05:41 AM)Michael2014 Wrote: [ -> ]Is there a way to create an If else statement for member profiles, for example, if I am looking at my member profile, I will see "this", and if looking at someone else's member profileĀ then I will see "that"
I've been trying, but can seem to get it.
any help?
<if $GLOBALS['mybb']->user['uid] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
Solved:
Again, something inside me just takes over, and answers the question, so why do I even ask?
<if $GLOBALS['mybb']->user['uid'] == $memprofile['uid'] then>looking at my member profile sees "this"<else> looking at someone else's profile sees "that"</if>
But what if is a custom page?
wow, solved this again, so surprising, it just takes minutes once the higher mind takes over, to solve this for a custom page is to change
$memprofile['uid'] then>
to
$uid then>
2023-02-02, 01:14 PM
Has anyone found the fix for using this plugin with PHP 8? Getting this error.
Warning [2] Undefined array key 2 - Line: 92 - File: inc/plugins/phptpl.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/phptpl.php 92 errorHandler->error_callback
[PHP] {closure}
/inc/plugins/phptpl.php 109 preg_replace_callback_array
/inc/plugins/phptpl.php(70) : eval()'d code 19 phptpl_parsetpl
/forumdisplay.php 1547 phptpl_templates->get
using a simple conditional in forumdisplay_threadlist template
Warning [2] Undefined array key 2 - Line: 92 - File: inc/plugins/phptpl.php PHP 8.0.27 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/phptpl.php 92 errorHandler->error_callback
[PHP] {closure}
/inc/plugins/phptpl.php 109 preg_replace_callback_array
/inc/plugins/phptpl.php(70) : eval()'d code 19 phptpl_parsetpl
/forumdisplay.php 1547 phptpl_templates->get
using a simple conditional in forumdisplay_threadlist template
<if $foruminfo["fid"] == "115" then>
 <a href="https://www.worldcommunitygrid.org/team/viewTeamMemberDetail.do?sort=name&teamId=xxxxxxxxxx" target="_blank">click for Team stats.</a>
</if>
2023-02-02, 01:27 PM
Try this (untested):
<if isset($foruminfo['fid']) && $foruminfo['fid'] == "115" then>
 <a href="https://www.worldcommunitygrid.org/team/viewTeamMemberDetail.do?sort=name&teamId=xxxxxxxxxx" target="_blank">click for Team stats.</a>
</if>
2023-02-02, 02:34 PM
No change. Thanks for looking.
The plugin logic is too dense for me, so I can't begin to make a guess.
The plugin logic is too dense for me, so I can't begin to make a guess.
2023-02-03, 08:33 AM
(2023-02-02, 01:14 PM)HLFadmin Wrote: [ -> ]Has anyone found the fix for using this plugin with PHP 8? Getting this error.
Warning [2] Undefined array key 2 - Line: 92 - File: inc/plugins/phptpl.php PHP 8.0.27 (Linux)
[...]
using a simple conditional in forumdisplay_threadlist template
<if $foruminfo["fid"] == "115" then>  <a href="https://www.worldcommunitygrid.org/team/viewTeamMemberDetail.do?sort=name&teamId=xxxxxxxxxx" target="_blank">click for Team stats.</a> </if>
It looks to me that the problem is that the regular expression on line 91 can match only "</if>", in which case the matches array
$m
will include entries only at index zero (</if>
) and one (/if
), and no entry will be set for index two. Without testing, it looks as though the fix, then, is to change line 192 from: return phptpl_if($m[1], phptpl_unescape_string($m[2]));
to: return phptpl_if($m[1], phptpl_unescape_string(isset($m[2]) ? $m[2] : ''));
An empty second parameter to
phptpl__if()
is fine in this scenario because it only uses the first for /if
s.2023-02-03, 01:30 PM
That's it. The fix is in and working.
Thanks. Will consider testing more of the plugin features. In this case have only used it for a simple <if then> </if>.
Maybe I spoke too soon. Forum display is fixed, but post display has gone wild.
Thanks. Will consider testing more of the plugin features. In this case have only used it for a simple <if then> </if>.
Maybe I spoke too soon. Forum display is fixed, but post display has gone wild.
2023-02-21, 05:54 PM
Laird's fix worked for me too. Many Thanks