TinyPortal

Development => Support => Topic started by: Akyhne on March 23, 2009, 03:22:15 PM

Title: How does the php code block work?
Post by: Akyhne on March 23, 2009, 03:22:15 PM
Tinyportal 1.0 beta 3:

I tried to add some php code to a php code block, but I get no options on where it should be displayed!

How does this work?
Title: Re: How does the php code block work?
Post by: IchBin on March 23, 2009, 03:23:28 PM
You have to click the show/hide links to get the options to appear.
Title: Re: How does the php code block work?
Post by: Renegd98 on March 23, 2009, 03:24:13 PM
If you look near the bottom of the block you will see an area that has:  

Choose where the block should appear. [Show] [Hide], choose show.
Title: Re: How does the php code block work?
Post by: JPDeni on March 23, 2009, 05:02:14 PM
To further answer your question about the php block specifically (because the question actually refers to any block), the php block works by using the eval php function. This is why it does not work to start the code in a php block with the usual


<? php


and end with


?>


as you would do on an independent php page.
Title: Re: How does the php code block work?
Post by: Akyhne on March 23, 2009, 05:19:07 PM
Quote from: Renegd98 on March 23, 2009, 03:24:13 PM
If you look near the bottom of the block you will see an area that has:  

Choose where the block should appear. [Show] [Hide], choose show.

The show/hide isn't there. That's my issue.
Title: Re: How does the php code block work?
Post by: JPDeni on March 23, 2009, 07:14:17 PM
Then it would probably be best to read and follow Posting Guidelines.html (http://www.tinyportal.net/index.php/topic,581) so that we can better diagnose your problem.
Title: Re: How does the php code block work?
Post by: Akyhne on March 23, 2009, 07:59:19 PM
Posting Guidelines

Please think real hard about whether your issue is TP or SMF related. We can only support TinyPortal here with limited time and staff. If your issue is SMF related please post at SMF first. Thanks!
My question it TP related, so I post here.

Choose an appropriate subject line. Use the issue you are having as your topic. Try to summarise the problem briefly in the subject, and elaborate in the message itself.
My question is still "How does the php code block work?"


Keep all posts on-topic.
I do

Post your comment/question to the most appropriate place.
I did.

Any posts deemed to be in the wrong forum will be moved.
Feel free to...

Do not cross-post the same question to multiple places.
I didn't...

Keep all posts on-topic.
I did

Please do not ask your own question in a topic. In other words, please don't hijack the topic and make it  yours. Start your own topic and reference the other topic related to your issue.
If your topic is resolved, please mark it solved by changing the icon in your original post to reflect its status. (the check icon)
I didn't...

If a topic is marked as SOLVED, don't post in that topic. Start a new one with your question even if it's similar to the topic thats marked solved. This is for us to better know and keep track on whats working or not. A solved topic has a working solution to the topics question.

Besides your search engine doesn't seem to work in any browser... well sometimes it works and sometimes it doesn't.

Are you guys willing to help with your software, or just continueing to tell me to read the posting guidelines. It's getting pretty annoying!

I know I might not doing it the right way every time, but I haven't time to read the posting guidelines every time i go here.

And when I spend several hours trying to figure out how the mod works and searching your forum here to find an answer without success, I'm beginning to run out of time!

So it would be fairly easy for you to just ask about missing information, instead of bothering people.

I also posted one or two bugs in the software, but never got as much as a thanks for the work, or an apply that you noticed or confirmed the bug!
Title: Re: How does the php code block work?
Post by: Ken. on March 23, 2009, 08:08:54 PM
If you wish you can send me a PM with a temp admin login and I'll take a look for you.



EDIT: Here's a s/s of the show-hide link bty:
Title: Re: How does the php code block work?
Post by: JPDeni on March 23, 2009, 09:19:08 PM
This was the part that I was referring to:

QuoteHere's is a posting template for your to copy and paste into your post.

[b]Link to my site:[/b] http://www.yourdomain.com
[b]SMF version:[/b] SMF ver. here
[b]TP version:[/b] TP ver. here
[b]Theme name and version:[/b] Theme name here
[b]Mods installed:[/b] Mods listed here
[b]Related Error messages:[/b] Error message here


You see, your problem could be theme-related. It could also be language=related. What is the default language that you have active on your site?
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 12:03:12 AM
It is not theme related, as I have the issue in all themes.
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 12:10:21 AM
Link to my site: http://forum.teamhd.org
SMF version: SMF 1.1.8
TP version: TP 1.0 beta 3
Theme name and version: all themes
Mods installed:
1.     E-Arcade      2.5.7
2.    Aeva ~ Auto-Embed Video & Audio    6.0.71
3.    Regular smileys to dark background smiley set    1.0
4.    SMF 1.0.16 / 1.1.8 Update    1.0
6.    SMF 1.0.14 / 1.1.6 Update    1.0
7.    TinyPortal    1.075
8.    Avatar Verification    1.0 beta 2 rev. 2
9.    PlaySation Network ID    1.2
10.    SMF 1.0.14 / 1.1.6 Update    1.0
11.    SMF 1.0.15 / 1.1.7 Update    1.0
Related Error messages: *none*
Title: Re: How does the php code block work?
Post by: Renegd98 on March 24, 2009, 12:13:27 AM
Have you pm'd a temp admin account to Ken so he can look at your blocks and site to try and help as he asked?
Title: Re: How does the php code block work?
Post by: JPDeni on March 24, 2009, 12:18:45 AM
Quote from: akyhne on March 24, 2009, 12:03:12 AM
It is not theme related, as I have the issue in all themes.

I understand. However, you need to understand that we need to ask you that sort of thing because, unless you tell us, we won't know and we'll give you answers that aren't appropriate. The posting guidelines are to save all of us time -- you as well as us.

In addition to setting up an admin account for Ken, you might consider taking a screen shot of the block similar to what Ken did so we can see what it is that you see. It's hard to know what's going on unless we can see it somehow.
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 12:24:14 AM
I can't provide a snapshot right now. Corel Photopaint went dead on me. PM will be sent in a moment.

I know how it is with support as I have helped others a lot. It's just the way some of you are speaking to people here. Seems rude to me to a degree.
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 12:38:48 AM
Ok, here's the snapshot. The missing links are in all other blocks as far as I know. Just not in the PHP Code block.
Title: Re: How does the php code block work?
Post by: JPDeni on March 24, 2009, 12:44:50 AM
Is this the only php block you have? If not, is it the same with all of the others?
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 12:48:15 AM
It is the only one, and the only I ever tried to create.
Title: Re: How does the php code block work?
Post by: JPDeni on March 24, 2009, 01:05:04 AM
Try another one, then. Just put in it something like


echo "Hello.";


You can always delete it later. The thing you want to do is to see whether it's a systemic thing or just some odd fluke with that one block.
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 01:12:40 AM
Worked.. but - I created it in the "Bottom Panel Blocks". When I moved it to the "Front Panel Blocks", the option "Choose where the block should appear" dissapeared. When I moved it back to the "Bottom Panel Blocks", the option went back!!?!?
Title: Re: How does the php code block work?
Post by: Ken. on March 24, 2009, 02:10:00 AM
Quote from: akyhne on March 24, 2009, 01:12:40 AM
Worked.. but - I created it in the "Bottom Panel Blocks". When I moved it to the "Front Panel Blocks", the option "Choose where the block should appear" dissapeared. When I moved it back to the "Bottom Panel Blocks", the option went back!!?!?

That's because when you assign it to Front Panel Blocks it follows that you've just told it where to appear. :)
... and it will only appear there.
Place it in some other category and then you can tell it to show anywhere you wish, including the front page.
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 07:59:40 AM
Ok, I understand that. But it just didn't show. When ever I enabled it, it just didn't appear. When I then returned to the block admin section, the green indicator had turned red.
The new ones I created for testing, had the same issue. I played around a little and in the end I deleted the original created. Then the other suddently started to work.

All 3 of them worked in the buttom block at any time.
Title: Re: How does the php code block work?
Post by: Renegd98 on March 24, 2009, 10:20:49 AM
akyhne, remember to check your frontpage settings for what will show on frontpage.  Admin --> Settings and Frontpage ---> Frontpage
Title: Re: How does the php code block work?
Post by: Akyhne on March 24, 2009, 11:23:12 AM
I did, but it was only that code block that didn't work.