can someone help me with an error im getting from a php block ?

i make a chatroll php block and it looks like it wants to work but it is giving me this error

 

Parse error: syntax error, unexpected '<' in /home/thegetto/public_html/inc/classes/BxDolPageView.php(607) : eval()'d code on line 1

 

any idea what it means?

MY SITES http://viptopia.net general social networking | http://www.rangerschat.com/ niche site
Quote · 11 Feb 2012

Syntax error means exactly what is says. There is an error in the syntax. We would need to see the code.

Giving it's showing a syntax error having to do with a < i would have to say you have placed starting and ending php tags in the block.

Example.

<?php
Your code
?>

Should be

your code.


Starting and ending tags are not to be included in php blocks.


This of course is just a guess. In the future, post your code. We cannot determine what is causing a syntax error without seeing the actual syntax.



https://www.deanbassett.com
Quote · 11 Feb 2012

ty deano this is the php code n the block

 

<?php
// Chatroll Single Sign-On (SSO) Parameters
$uid = 1;                   // Current user id
$uname = 'test';            // Current user name
$ulink = 'http://example.com/profile/test';   // Current user profile URL (leave blank for none)
$upic = '';                 // Current user profile picture URL (leave blank for none)
$ismod = 0;                 // Is current user a moderator?
$sig = md5($uid . $uname . $ismod . 'v4oehcdetcq2amc1');
$ssoParams = '&uid=' . $uid . "&uname=" . urlencode($uname) . "&ulink=" . urlencode($ulink) . "&upic=" . urlencode($upic) . "&ismod=" . $ismod . "&sig=" . $sig;
?>
<iframe width='450' height='350' src='http://chatroll.com/embed/chat/thegettogetherlobby?id=kaxaE3I3pm1&platform=php<?= $ssoParams ?>&w=$0' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' allowtransparency='true'></iframe>
<div style='font-size:0.9em;text-align:center;'><a href="http://chatroll.com/solutions/live-chat-software">PHP Live Chat Software</a></div>

MY SITES http://viptopia.net general social networking | http://www.rangerschat.com/ niche site
Quote · 11 Feb 2012

Your mixing php and html. There are a couple of ways to handle it. But keep in mind that a php block assumes php and the starting tag is already done before the code is evaluated, so it will have to be rewritten with this taking into consideration.

Like so.


// Chatroll Single Sign-On (SSO) Parameters
$uid = 1;                   // Current user id
$uname = 'test';            // Current user name
$ulink = 'http://example.com/profile/test';   // Current user profile URL (leave blank for none)
$upic = '';                 // Current user profile picture URL (leave blank for none)
$ismod = 0;                 // Is current user a moderator?
$sig = md5($uid . $uname . $ismod . 'v4oehcdetcq2amc1');
$ssoParams = '&uid=' . $uid . "&uname=" . urlencode($uname) . "&ulink=" . urlencode($ulink) . "&upic=" . urlencode($upic) . "&ismod=" . $ismod . "&sig=" . $sig;
?>
<iframe width='450' height='350' src='http://chatroll.com/embed/chat/thegettogetherlobby?id=kaxaE3I3pm1&platform=php<?= $ssoParams ?>&w=$0' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' allowtransparency='true'></iframe>
<div style='font-size:0.9em;text-align:center;'><a href="http://chatroll.com/solutions/live-chat-software">PHP Live Chat Software</a></div>
<?php


I remove the starting php tag and left the ending php tag to switch it to html. then at the end of the html added a starting php tag to switch the block back into php.

When writing code for a php block you need to treat it as if your inserting code into the middle of code that is already there. I know it's confusing.

There are other things that can be done as well such as removing the tags alltogether and putting the html part into a php variable and using a php echo to display it which is the way i normally write code for use in a php block.


A lot of people make this mistake. Taking code written for a php page and trying to put it in a block which in most cases will not work as written. Blocks are different than pages.


https://www.deanbassett.com
Quote · 11 Feb 2012

deano you are a freaking genius!!!   AND IT WORKS NOW!!

 

if ever i can do anything for you sir feel free to let me know

MY SITES http://viptopia.net general social networking | http://www.rangerschat.com/ niche site
Quote · 11 Feb 2012

deano can you or anyone else tell me why this "$upic = get_member_thumbnail($iID, 'none');" is not pulling the members pics in the new lobby?

MY SITES http://viptopia.net general social networking | http://www.rangerschat.com/ niche site
Quote · 11 Feb 2012

I believe your script is looking for a URL for the pic. I am not 100% positive but i don't believe the function get_member_thumbnail returns a URL. I believe it returns html data.



https://www.deanbassett.com
Quote · 11 Feb 2012

well do you know of a fix for this?

MY SITES http://viptopia.net general social networking | http://www.rangerschat.com/ niche site
Quote · 11 Feb 2012

Hello! why did you not continued this in the chatroll topic??

By the way why didn't you use the code i posted before. That thumbnail problem can be caused for two reason

1st. The thumbnail is very big in size and chatroll uses 38*38 px size but if you try this get_member_icon($iID);

but this returns 32*32px size.

2nd Deano's idea maybe it requires a url.

so much to do....
Quote · 11 Feb 2012

Can someone enlighten me on what the code was used to add the members photos please? I've tried everything above, but I must be missing something here.

 

Thank you.

Quote · 6 May 2012

i have the same problem with "include"

 

include ("http://shop.ilove-magdeburg.de/startseite.html");                      error

include ("http://shop.ilove-magdeburg.de/startseite.html");                      error
<?php

<? include ("http://shop.ilove-magdeburg.de/startseite.html"); ?>           error
<?php

<? include ("http://shop.ilove-magdeburg.de/startseite.html"); ?>          error

 

/inc/classes/BxDolPageView.php(607) : eval()'d code on line 12

Quote · 4 Sep 2012

Provide the exact code and the exact error. Your post confuses me. The word error is completely meaningless.

And don't use <? tags. you cannot use them in php blocks.

So to include.

include 'filename.php';

https://www.deanbassett.com
Quote · 4 Sep 2012

 

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /mnt/webe/b2/96/52511896/htdocs/hupendudler/inc/classes/BxDolPageView.php(607) : eval()'d code on line 3

Warning: include(http://preisvergleich.hupendudler.de/startseite.html) [function.include]: failed to open stream: no suitable wrapper could be found in /mnt/webe/b2/96/52511896/htdocs/hupendudler/inc/classes/BxDolPageView.php(607) : eval()'d code on line 3

Warning: include() [function.include]: Failed opening 'http://preisvergleich.hupendudler.de/startseite.html' for inclusion (include_path='.:/opt/RZphp52/lib/php') in /mnt/webe/b2/96/52511896/htdocs/hupendudler/inc/classes/BxDolPageView.php(607) : eval()'d code on line 3


include 'http://preisvergleich.hupendudler.de/startseite.html';


what i must fixed? or what is wrong?

Quote · 6 Sep 2012

I should have known that without haveing to see the error.

I forgot you cannot include remote files using a URL. allow_url_include is disabled on the server, and it should be. The first line of the error tells you it's disabled.

If you do not know how to lookup PHP errors on your own, then you should not be using PHP blocks.

Here. I looked up that error for you googling the error Warning: include() [function.include]: URL file-access is disabled in the server configuration and this is one of the first pages i got. It explains it better than i could.

http://blog.everymanhosting.com/php-coding/warning-include-functioninclude-url-file-access-is-disabled-in-the-server-configuration/

https://www.deanbassett.com
Quote · 6 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.