2021-08-18, 12:13 AM
(This post was last modified: 2021-08-24, 02:56 PM by dcamire11. Edited 1 time in total.)
edit: Nvm, got it!
PHP in Templates and Template Conditionals
|
2021-08-18, 12:13 AM
(This post was last modified: 2021-08-24, 02:56 PM by dcamire11. Edited 1 time in total.)
edit: Nvm, got it!
2021-09-18, 01:00 PM
(This post was last modified: 2021-09-18, 01:00 PM by PARADOX987.)
can't be it used for particular url ? like
<if a href="/index.php" then> blaahhhh <else> hhhhaalb </if>
2021-09-18, 08:30 PM
2022-01-01, 05:41 AM
(This post was last modified: 2022-01-01, 06:56 AM by Michael2014. Edited 3 times in total.)
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" 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" 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>
Hey man, what's up?
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
2023-02-02, 01:27 PM
Try this (untested):
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.
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. 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: to:
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
(This post was last modified: 2023-02-03, 02:16 PM by HLFadmin. Edited 1 time in total.)
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.
2023-02-21, 05:54 PM
Laird's fix worked for me too. Many Thanks
|
« Next Oldest | Next Newest »
|