Welcome to Geeklog, Anonymous Sunday, September 01 2024 @ 12:10 am EDT
Geeklog Forums
right phpblock
Smokey
Anonymous
![hopeful hopeful](https://www.geeklog.net/forum/image_set/moods/hopeful.gif)
Hi,
I made a phpblock, used the phpblock_prefix and updated the lib-custom.php No problem here, all works fine (on the left)
When changing the block to the right only the tittle is showing.
Can someone tell me what I am missing, or doing wrong?
Thanks in advance,
Smokey
I made a phpblock, used the phpblock_prefix and updated the lib-custom.php No problem here, all works fine (on the left)
When changing the block to the right only the tittle is showing.
Can someone tell me what I am missing, or doing wrong?
Thanks in advance,
Smokey
6
6
Quote
Smokey
Anonymous
This is the code i'm talking about.
{
$retval .= "<?php include 'http://www.mydomain.nl/mypage.php'; ?> ";
return $retval;
}
It works when the block is on the left side but it doesn't work when i change the block to the right.
Cheers,
Smokey
Text Formatted Code
function phpblock_spons(){
$retval .= "<?php include 'http://www.mydomain.nl/mypage.php'; ?> ";
return $retval;
}
It works when the block is on the left side but it doesn't work when i change the block to the right.
Cheers,
Smokey
5
6
Quote
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
by design the left blocks will parse the php that you've inserted into it because they are loaded from within the header.thtml, which will have its php parsed whereas no other thtml files will. So any php in the right blocks, which are typically loaded from the footer will not be parsed.
you might as well have used a normal block on the left and put your php in the content area--that's basically what you did by returning the php open and close thingies. Try this function instead:
{
include 'http://www.mydomain.nl/mypage.php';
}
you might as well have used a normal block on the left and put your php in the content area--that's basically what you did by returning the php open and close thingies. Try this function instead:
Text Formatted Code
function phpblock_spons(){
include 'http://www.mydomain.nl/mypage.php';
}
6
7
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by machinari: by design the left blocks will parse the php that you've inserted into it because they are loaded from within the header.thtml, which will have its php parsed whereas no other thtml files will.
This was actually never intended and fixed in 1.4.0. So with 1.4.0, the above would have consistently not worked on both sides
![Wink Wink](http://www.geeklog.net/images/smiles/icon_wink.gif)
bye, Dirk
5
7
Quote
Smokey
Anonymous
Thanks for your help but changing te function you suggested doesn't include the page in a block, but at the top of the page.
If you have any other suggestions i will be glad to try them.
Thanks again,
Smokey
If you have any other suggestions i will be glad to try them.
Thanks again,
Smokey
3
7
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
PHP blocks have to return the content they want displayed to Geeklog. So you have to read the output of that included file into a variable and return it at the end of the function.
bye, Dirk
bye, Dirk
10
5
Quote
zephyrius
Anonymous
Even if i return the data at the end of the php function, it is still not displayed if it's a "right block." It works fine as a left block. I am using 1.4.0sr3.
Is there a way to get the returned HTML from that function to display in a right block?
Thanks,
Zephyrius
Is there a way to get the returned HTML from that function to display in a right block?
Thanks,
Zephyrius
6
6
Quote
All times are EDT. The time is now 12:10 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content