PHP in Templates and Template Conditionals - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Plugins (https://community.mybb.com/forum-73.html) +---- Forum: Plugin Support (https://community.mybb.com/forum-72.html) +---- Thread: PHP in Templates and Template Conditionals (/thread-31860.html) |
RE: PHP in Templates and Template Conditionals - SvePu - 2015-12-21 URL is working => http://mybbhacks.zingaburga.com/showthread.php?tid=260 RE: PHP in Templates and Template Conditionals - Dr_The_One - 2016-01-30 i use below code
But it show 'Protected Forum' under all forum last post rather than in forum id 168. Is there any issue with code? RE: PHP in Templates and Template Conditionals - Destroy666 - 2016-01-30 Probably because "Protected Forum" is in the <else> part? If you want it the other way round, just place it the other way round. RE: PHP in Templates and Template Conditionals - Dr_The_One - 2016-01-30 How to play bro? It giving to all members same text. i dont know? pls guide. i want to show last post on forum n forum 168 to only usergroup 4,8,9. and other usergroup to show Protected forum. Please help me guys, if you want give me solution in PM. Please. Any helping guy please? RE: PHP in Templates and Template Conditionals - laie_techie - 2016-02-03 (2016-01-30, 08:30 AM)Dr_The_One Wrote: i use below code Look at your if statement. If the user is in group 4, 8, or 9 and is viewing forum 168 then display the last post information; else (meaning user is not in group 4, 8, or 9 or the forum isn't 168), then display Protected Forum.
My modified code shows the last post information if the user is in a privileged group OR the user is viewing a non-protected forum. RE: PHP in Templates and Template Conditionals - alfred702 - 2016-09-13 Help please! I tried <?php echo "Hello World"; ?> it's not working? RE: PHP in Templates and Template Conditionals - .m. - 2016-09-13 ^ which plugin you have used ? there are two variants - one for using php codes and the other is for the conditionals RE: PHP in Templates and Template Conditionals - alfred702 - 2016-09-13 (2016-09-13, 02:57 AM).m. Wrote: ^ which plugin you have used ? there are two variants - one for using php codes and the other is for the conditionals The first one that allows everything. I tried putting it in my main and inc folders and nothing worked :/ RE: PHP in Templates and Template Conditionals - DjPrison - 2016-12-08
I have this code but it doesnt work on Mybb 1.8. I did download the PHP plugin and activate it from ACP. Im guessing problems are these ">" at "->user" and ">0) then" RE: PHP in Templates and Template Conditionals - Senya - 2017-01-05 I have the same problem as DjPrison above. This code works fine in 1.6.* for everybody but in 1.8.9 it doesn't: Usually this error is screened but: Quote:Fatal error: Call to a member function parse_message() on a non-object in .../memberlist.php(428) : eval()'d code(7) : eval()'d code on line 1 I also think that it might be connected to the "->" bit because the if-part alone works and I can also use random words to echo However I can't think of a workaround for the parse-bit I need the mycode to be parsed... Any ideas? Side note/fun fact: I have found two random accounts where the code works and no error is displayed (meaning i log into the account an can view the memberlist with no problem). Those two accounts are in no way different from the others where it doesn't work (same usergroup, same rights, same entries in the profilefields...) so i'm running out of ideas there, too. |