MyBB Community Forums

Full Version: [Page Manager] Share your custom pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
I think my problem is mixing php with html. Is it possible? I am no html/php expert but I know that if I disable the MyBB page header the php will work, but ho do I get the page to look normal again?
If you want to use HTML inside a PHP page it's possible.

If you want the PHP code to spit out some HTML, use the echo command in your PHP script.
Is there an easier way to prevent guests from viewing pages using html? (I just don't know php)

ie...can this code be rewritten in html?

if(!$mybb->user['uid']) error_no_permission();

I use all html for my custom pages.
There should be a way to hide links in the header to those who shouldn't be able to see them.
(2012-09-20, 09:13 PM)MadComp Wrote: [ -> ]There should be a way to hide links in the header to those who shouldn't be able to see them.

^^This^^ would be even better! Anyone know how to hide a header link?
(2012-09-20, 09:17 PM)RocketFoot Wrote: [ -> ]
(2012-09-20, 09:13 PM)MadComp Wrote: [ -> ]There should be a way to hide links in the header to those who shouldn't be able to see them.

^^This^^ would be even better! Anyone know how to hide a header link?

I'm certain there's a way via CSS... but I forgot where I saw how!BlushSad
Yes, you use the mybb user uid variable as part of an inline style.

so

class="thead hide_{$mybb->user['uid']} in the inline with a css class of .hide_0{display:none;} would hide it to guests as guests have a uid of 0.
Could that be modified to show links to specific groups only? (like for a premium members only link)
well, it works on user id, I have never tried it on usergroups.

It might work, so

class="thead hide_{$mybb->user['usergroup']} in the inline with a css class of .hide_7{display:none;} might hide it to banned as banned have a usergroup of 7.

NOT TESTED.

Be aware though, that things hidden in this way are DISPLAY ONLY. You can still see all the data on a view source and probably in archive too.

For things I REALLY want to hide - I use conditional templates or a plugin.
(2012-09-20, 11:06 PM)Leefish Wrote: [ -> ]well, it works on user id, I have never tried it on usergroups.

It might work, so

class="thead hide_{$mybb->user['usergroup']} in the inline with a css class of .hide_7{display:none;} might hide it to banned as banned have a usergroup of 7.

NOT TESTED.
That's not the right code as it looks the same as the code above. It'll just hide that link from user #7.
(2012-09-20, 11:06 PM)Leefish Wrote: [ -> ]Be aware though, that things hidden in this way are DISPLAY ONLY. You can still see all the data on a view source and probably in archive too.

For things I REALLY want to hide - I use conditional templates or a plugin.

Got any suggestions for plugins or what condition to use in my template (as I have that plugin installed)?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49