|
PHP in Templates and Template Conditionals
|
|
06-28-2009, 08:40 AM
(This post was last modified: 06-28-2009 08:53 AM by jnd52.)
Post: #41
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Hey everyone!
I am having trouble using php and conditionals in my templates. It used to work like a charm, but for some reason it stopped working. I am running MyBB 1.2.14 on www.maroonlife.com. I am trying to add the following code to my postbit template: Code: <!--Testing Share--->Here is a copy of my postbit template: Code: <tr>Here is a picture of one of the posts. After deactivating and reactivating multiple times, I tried to use the simple example: PHP Code: <?php echo "Hi from PHP"; ?>No luck though, it did not work. So I deactivated it and redownloaded it and reactivated it, still no luck. Here is the code for the plugin: PHP Code: <?phpThanks, jnd52 I fixed it. Sigh. ![]() Apparently, I had to set Board Settings-> Server and Optimization Options -> Output template start/end comments? to yes. Working like a charm again. Woot! www.maroonlife.com
|
|||
|
06-29-2009, 04:08 PM
Post: #42
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Nice Plugin,
Thanks for Release... vBulletin/Wordpress/Magento/MyBB Developer and Designer |
|||
|
07-21-2009, 04:01 AM
(This post was last modified: 07-21-2009 09:58 PM by Steve Moore.)
Post: #43
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
EDIT: Figured it out.
Official Site: http://mythotical.com Coming Soon: http://gifted-angels.com Follow me on twitter: @stevemoore28 |
|||
|
07-30-2009, 10:18 AM
Post: #44
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
hey this does not seem to work for me,
when i activate the plugin, it breaks my current theme "Bluefusion" Any help? Thanks in Advance |
|||
|
07-31-2009, 05:39 PM
Post: #45
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Thank you for this plugin!!! Solve my problem took me 2 whole days!~!! Can I donate to you?
|
|||
|
08-01-2009, 10:26 PM
Post: #46
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Ugh... I don't have a clue what I'm doing...
I got the plugin installed and activated. What I want to do: Disable the Member List and Calendar links unless the user is logged in; guests should not see these links. I realize I need to edit the 'header' template, as I see the links there. I just don't know what code to insert to check if a user is logged in or not... Thanks, Kerry Wano "True friends stab you in the front." - Oscar Wilde |
|||
|
08-01-2009, 10:32 PM
Post: #47
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
PHP Code: <?php if(!empty($mybb->user['uid'])){Should work... |
|||
|
08-01-2009, 11:12 PM
(This post was last modified: 08-01-2009 11:20 PM by kerrywano.)
Post: #48
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Parse error: syntax error, unexpected '{', expecting ',' or ';' in /home/content/62/4727962/html/forums/global.php(438) : eval()'d code(13) : eval()'d code on line 2
This is the error I see when I view the page. The links are not shown, but something about the error is also preventing the login function from working. Thanks, Kerry Wano "True friends stab you in the front." - Oscar Wilde EDIT: I figured it out. I was using php, and not the plugin. My code that works: Code: <if $mybb->user['uid'] > 0 then> |
|||
|
08-01-2009, 11:40 PM
Post: #49
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
oh yes, sorry. I didn't read exactly how this plugin turns it.
Glad you figured it out
|
|||
|
08-12-2009, 07:19 PM
Post: #50
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Thanks,
|
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)
Search
Member List
Calendar
Help






![[Image: mybbfacebook.png]](http://mybbaddons.com/mybbfacebook.png)