hello i keep getting this error on blocks and articles PHP and html
article:
Parse error: syntax error, unexpected T_STRING in /home/mattb/public_html/Sources/TPSubs.php(1720) : eval()'d code on line 1
block:
Parse error: syntax error, unexpected T_STRING in /home/mattb/public_html/Sources/Load.php(2092) : eval()'d code(48) : eval()'d code on line 1
im using tinyportal5.1 smf 2.0 rc3
trying to install this code
__int64 GetFriendID( const char *pszAuthID )
{
if(!pszAuthID)
return 0;
int iServer = 0;
int iAuthID = 0;
char szAuthID[64];
strcpy_s(szAuthID, 63, pszAuthID);
char *szTmp = strtok(szAuthID, ":");
while(szTmp = strtok(NULL, ":"))
{
char *szTmp2 = strtok(NULL, ":");
if(szTmp2)
{
iServer = atoi(szTmp);
iAuthID = atoi(szTmp2);
}
}
if(iAuthID == 0)
return 0;
__int64 i64friendID = (__int64)iAuthID * 2;
//Friend ID's with even numbers are the 0 auth server.
//Friend ID's with odd numbers are the 1 auth server.
i64friendID += 76561197960265728 + iServer;
return i64friendID;
}
anyway i can install this i need it for my community
thanks
By the looks of it, its missing some code. So unless you got the whole code portion in there, it will simply not work.
heres the original code:
<?php
function get_steam_stats($id){
$mc=new Memcache;
if (!$mc->connect('localhost', 11211)) return false;
$ret=$mc->get('xd'.$id);
if (!$ret){
$data=file_get_contents("http://steamcommunity.com/profiles/".$id);
$ret=array();
if (strpos($data,'<h2>Private Profile</h2>')!==false) {
$ret['private']=1;
}else{
if (strpos($data,'status_online.gif')!==false){
$ret['online']=1;
}else if (($p1=strpos($data,'<p id="statusInGameText">'))!==false){
$p2=strpos($data,'<',$p1+25);
$tmp=substr($data,$p1+25,$p2-$p1-25);
$ret['ingame']=$tmp;
$ret['join']='steam://friends/joingame/'.$id;
}else{
if (($p1=strpos($data,'<p id="statusOfflineText">'))!==false){
$p2=strpos($data,'<',$p1+26);
$tmp=substr($data,$p1+26,$p2-$p1-26);
$ret['offline']=$tmp;
}
}
if (($p1=strpos($data,'<div class="avatarFull">'))!==false){
$p1=strpos($data,'<',$p1+24);
$p2=strpos($data,'>',$p1+1);
$tmp=substr($data,$p1,$p2-$p1+1);
$link_full=get_link_src($tmp);
gaben_downloadz0r($link_full,'/home/lol/public_html/avatars/lol_full'.$id.'.jpg');
$ret['img_full']=$tmp;
$tmp=str_replace('_full','',$tmp);
$link_small=get_link_src($tmp);
gaben_downloadz0r($link_small,'/home/lol/public_html/avatars/lol_small'.$id.'.jpg');
$ret['img_small']=$tmp;
}
if (($p1=strpos($data,'Steam Rating:</div>'))!==false){
$p2=strpos($data,'<',$p1+19);
$tmp=substr($data,$p1+19,$p2-$p1-19);
$ret['rating']=trim($tmp);
}
if (($p1=strpos($data,'Member since:</div>'))!==false){
$p2=strpos($data,'<',$p1+19);
$tmp=substr($data,$p1+19,$p2-$p1-19);
$ret['member']=trim($tmp);
}
if (($p1=strpos($data,'Playing time:</div>'))!==false){
$p2=strpos($data,'<',$p1+19);
$tmp=substr($data,$p1+19,$p2-$p1-19);
$ret['time']=trim($tmp);
}
}
$mc->set('xd'.$id,$ret,MEMCACHE_COMPRESSED,1800);
}
return $ret;
}
function get_link_src($data){
$p1=strpos($data,chr(34));
$p2=strpos($data,chr(34),$p1+1);
return substr($data,$p1+1,$p2-$p1-1);
}
function gaben_downloadz0r ($url,$target){
$data=file_get_contents($url);
if ($data) {
file_put_contents($target,$data);
}
}
?>
still same error and sometimes it would go blank no errors with different codes.
could it be the lack of bcmath support?
Are you trying the code without the php tags? <?php and ?>
are you sure your using TP1.00 beta 5-1
this sounds like a bug that was in TP 1.00 beta5
<?php
function get_steam_stats($id){
$mc=new Memcache;
if (!$mc->connect('localhost', 11211)) return false;
$ret=$mc->get('xd'.$id);
if (!$ret){
$data=file_get_contents("http://steamcommunity.com/profiles/".$id);
$ret=array();
if (strpos($data,'<h2>Private Profile</h2>')!==false) {
$ret['private']=1;
}else{
if (strpos($data,'status_online.gif')!==false){
$ret['online']=1;
}else if (($p1=strpos($data,'<p id="statusInGameText">'))!==false){
$p2=strpos($data,'<',$p1+25);
$tmp=substr($data,$p1+25,$p2-$p1-25);
$ret['ingame']=$tmp;
$ret['join']='steam://friends/joingame/'.$id;
}else{
if (($p1=strpos($data,'<p id="statusOfflineText">'))!==false){
$p2=strpos($data,'<',$p1+26);
$tmp=substr($data,$p1+26,$p2-$p1-26);
$ret['offline']=$tmp;
}
}
if (($p1=strpos($data,'<div class="avatarFull">'))!==false){
$p1=strpos($data,'<',$p1+24);
$p2=strpos($data,'>',$p1+1);
$tmp=substr($data,$p1,$p2-$p1+1);
$link_full=get_link_src($tmp);
gaben_downloadz0r($link_full,'/home/lol/public_html/avatars/lol_full'.$id.'.jpg');
$ret['img_full']=$tmp;
$tmp=str_replace('_full','',$tmp);
$link_small=get_link_src($tmp);
gaben_downloadz0r($link_small,'/home/lol/public_html/avatars/lol_small'.$id.'.jpg');
$ret['img_small']=$tmp;
}
if (($p1=strpos($data,'Steam Rating:</div>'))!==false){
$p2=strpos($data,'<',$p1+19);
$tmp=substr($data,$p1+19,$p2-$p1-19);
$ret['rating']=trim($tmp);
}
if (($p1=strpos($data,'Member since:</div>'))!==false){
$p2=strpos($data,'<',$p1+19);
$tmp=substr($data,$p1+19,$p2-$p1-19);
$ret['member']=trim($tmp);
}
if (($p1=strpos($data,'Playing time:</div>'))!==false){
$p2=strpos($data,'<',$p1+19);
$tmp=substr($data,$p1+19,$p2-$p1-19);
$ret['time']=trim($tmp);
}
}
$mc->set('xd'.$id,$ret,MEMCACHE_COMPRESSED,1800);
}
return $ret;
}
function get_link_src($data){
$p1=strpos($data,chr(34));
$p2=strpos($data,chr(34),$p1+1);
return substr($data,$p1+1,$p2-$p1-1);
}
function gaben_downloadz0r ($url,$target){
$data=file_get_contents($url);
if ($data) {
file_put_contents($target,$data);
}
}
?>
version: TinyPortal 1.0 beta 5-1 what it said
could you try out the code and give me a link or, just don`t know how to try it out to see.
Quote from: IchBinâ„¢ on May 11, 2010, 03:14:05 AM
Are you trying the code without the php tags? <?php and ?>
??
i don`t want to make and waste threads so ill ask here how can i make a shoutout box :)
We'd prefer you start your own topics for different subjects. This will help others when they are searching for issues so that they don't have to read through a topic that covers 10 different subjects. But to answer your question, the shoutbox is a standard feature in TP. You simply enable the module if it is not in the TP admin. Then you create a tpmodule type block and select shoutbox.