1.3.2 - the tabs...

Forum
Last Post
Threads / Messages

draugluin

Member
Member
Joined
Oct 26, 2011
Messages
120
Points
16
Location
germany
Mysidian Dollar
7,683
I've installed it yet, but If I want to take a look at "profile.php" I get this

Parse error: syntax error, unexpected $end in /var/www/clients/client161/web331/web/b-adoptables/inc/tabs.php on line 20

:ohnoes: why

I've no modification, it's all original.
 
probaly you can fix it by going to that line and see if a closing tag is missing

so far i can see it only includes a JS script ( javascript ) and are the tags closed like they need to be

maybe i see the problem

do you got short tags enabled or disabled ??

if disabled then use this change

open the file
search for this text
Code:
<? 
}

?>
and change it to
PHP:
<?php
}

?>

as you see , i added the text "php" after the first tag , so the script reconise it as a php script

let me know if that works

Greetings From PowerChaos
 
Weird, if this is a glitch the others would have spotted it a long time ago. Did you install the script or upgrade from it? If you did an upgrade, make sure to overwrite all old files.
 
@Hall of Farmer

most hosts got short tags enabled in there php settings
there are always exeptions and based on the error code i read ( on line 20 ) aka end of the file or the closing tag ?> does it seems that short tags are not enabled

if you start php with <? then it is a short tag , so it is better to always start with <?php

there is nothing more i can see in the script or that file

Greetings From PowerChaos
 
I see, I will keep this in mind then, thanks for bringing this up. It just never happens before, guess thats because I build my site on a dedicated host while most users are running with Nemesis' 99webs.info. I believe only a small number of webhosts disable short tags?
 
short tags are enabled by default but can provide some compatibility problems

because it is enabled by default do i think that only a small number of company's disable it

Greetings From PowerChaos
 
Last edited:
first ... thank you both for brainstorming :D

@ Powerchaos

it startet with <?php and ends with ?>
unfortunately that’s not the problem. :(

@ HoF

I installed it new. no upgrade. I only use the database from Mys 1.3.1.
all the other side run perfect… only the profle don’t want to work …

mhhh… any idea, how to solve this ?
 
Well the database from Mys v1.3.1 wont work since there are differences in database structure, you have to run the upgrader.
 
ohhhhh... I started the upgrade an got this

Cannot alter table prefix.adoptables



edit: okay, I've changed the tables manually. But the problem with the tabs still exist. :cfrown:
 
Last edited:
if it is a fresh install , can you try somehting for me to debug it a bit more

can you install version 1.3.1 complete and see if the tabs give that problem

if yes , can i take then a look at your php info file to see if some settings are enabled that should be disabled ( like magic quotes )

if that solves the error , then we know it is a bug in the version 1.3.2 script and probaly not even in tabs.php but a possibility that it is in the js script file

php only returns the error code it founds in the php script , it says line 20 and that is the end of the script (unexpted end ... sounds normal that it is on end of the script )

that part also means that there is a closing tag missing , so it loops true all code and never close the final code and provide that error

also you say it is only on the profile page
so it is also possible that the profile page is generating that error and not the tabs.php , but the tabs.php does not get closed
it depends when the tabs.php get called ( start or end of the website )

if it get called after the profile script get called , then it means that the profile script does not close a tag

anyway , before we start to search we need to be sure if it is only on 1.3.2 or that it is also before and not related to php that open/close tags with there rewrite rules/safety rules ( like magic_quotes and stuff )

to make a php info file use the folllowing information

PHP:
<?php
phpinfo();
?>

also remove that file after we are done , as it can be a security risk to leave those information public (it says what mods are installed and not and hackers use that to see what security bugs are left :p )

Greetings From PowerChaos
 
@ powerchaos

yes, the tabs seems to be the main problem. I've a running site with mys 1.3.1 and just deleted this part, which defines the tabs.

PHP:
// First let's initiate tab system!
    include("inc/tabs.php");
    include("css/tabs.css");
    $article_content = "<div id='page-wrap'><div id='profile'>       			
            <ul class='nav'>
            <li class='nav0'><a href='#visitormessage'>Visitor Message</a></li>
            <li class='nav1'><a href='#aboutme' class='current'>About Me</a></li>
            <li class='nav2'><a href='#adopts'>Adoptables</a></li>
            <li class='nav3'><a href='#friends'>Friends</a></li>
            <li class='nav4 last'><a href='#contactinfo' class='last'>Contact Info</a></li>
            </ul><div class='list-wrap'>";

looks not very nice, but works :happycbig:

by the way ... at mys 1.3.1 the overview works, but not the detailed view at the user.
in mys 1.3.2 works not even the overview :catfish:

I actually use the original-profile-php. (1.3.1)

PHP:
<?php  

$filename = "profile";
include("functions/functions.php");
include("functions/functions_users.php");
include("functions/functions_adopts.php");
include("functions/functions_friends.php");
include("inc/lang.php");
include("inc/bbcode.php");

//***************//
//  START SCRIPT //
//***************//

// This page handles user profiles and shows the site members...

$user = $_GET["user"];
$page = $_GET["page"];
	
if($user != ""){

  // We have specified a specific user who we are showing a profile for...
  // See if the user exists...
  $article_title = "{$user}'s Profile";
  $row = $adopts->join("users_status", "users_status.uid = users.uid")->join("users_profile", "users_profile.uid = users.uid")
				->join("users_options", "users_options.uid = users.uid")->join("users_contacts", "users_contacts.uid = users.uid")
			    ->select("users", array(), constant("PREFIX")."users.username = '{$user}'")->fetchObject();
  if($row->username == $user){
    // First let's initiate tab system!
    include("inc/tabs.php");
    include("css/tabs.css");
    $article_content = "<div id='page-wrap'><div id='profile'>       			
            <ul class='nav'>
            <li class='nav0'><a href='#visitormessage'>Visitor Message</a></li>
            <li class='nav1'><a href='#aboutme' class='current'>About Me</a></li>
            <li class='nav2'><a href='#adopts'>Adoptables</a></li>
            <li class='nav3'><a href='#friends'>Friends</a></li>
            <li class='nav4 last'><a href='#contactinfo' class='last'>Contact Info</a></li>
            </ul><div class='list-wrap'>";
  
    // Format user profile information...
	$id = $row->uid;
    $ccstat = cancp($row->usergroup);
    $website = (empty($row->website))?"No Website Information Given":"<a href='http://{$row->website}' target='_blank'>{$row->website}</a>";
    $facebook = (empty($row->facebook))?"No Facebook Information Given":"<a href='{$row->facebook}' target='_blank'>{$row->facebook}</a>";
    $twitter = (empty($row->twitter))?"No Twitter Information Given":"<a href='{$row->twitter}' target='_blank'>{$row->twitter}</a>";
	$msn = (empty($row->msn))?"No MSN Information Given":$row->msn;
    $aim = (empty($row->aim))?"No AIM Information Given":$row->aim;
    $yahoo = (empty($row->yahoo))?"No YIM Information Given":$row->yahoo;
	$skype = (empty($row->skype))?"No YIM Information Given":$row->skype;
    $row->username = ($ccstat == "yes")?"<img src='templates/icons/star.gif' /> {$row->username}":$row->username; 
    $row->favpet = ($row->favpet == 0)?"None Selected":"<a href='http://www.".constant("DOMAIN").constant("SCRIPTPATH")."/levelup.php?id={$row->favpet}' target='_blank'><img src='http://www.".constant("DOMAIN").constant("SCRIPTPATH")."/siggy.php?id={$row->favpet}' border=0></a>";  	

    // Here we go with the first tab content: Visitor Message
    $article_content .= "<ul id='visitormessage' class='hide'><strong><u>{$user}'s Profile Comments:</u></strong><br /><br /><table>";
    $stmt = $adopts->select("visitor_messages", array(), "touser = '{$user}' ORDER BY vid DESC LIMIT 0, 15");	
    while($vmessage = $stmt->fetchObject()){ 
      $date = substr_replace($vmessage->datesent," at ",10,1);
      $sender = $adopts->join("users_profile", "users_profile.uid = users.uid")
				       ->select("users", array(), constant("PREFIX")."users.username = '{$vmessage->fromuser}'")
				       ->fetchObject();        
      $article_content .= "<tr>
           <td><img src='{$sender->avatar}' width='40' height='40'></br></td>
           <td><a href='profile.php?user={$sender->username}'>{$vmessage->fromuser}</a> ({$date}) <a href='vmessage.php?act=view&user1={$user}&user2={$vmessage->fromuser}'> <img src='templates/icons/status.gif'> </a>
           </br>{$vmessage->vmtext} </br></td>
           <td><a href='vmessage.php?act=edit&vid={$vmessage->vid}'> <img src='templates/icons/cog.gif'> </a>
           <a href='vmessage.php?act=delete&vid={$vmessage->vid}'> <img src='templates/icons/delete.gif'> </a></br></td></tr>";
      }
    if($isloggedin == "yes"){ 
      if(isbanned($loggedinname) == 1) $article_content .= "</table>It seems that you have been banned from this site and thus cannot send profile comment.";
      else{    
        $article_content .= "</table> To Post a profile comment, please write your message in the text area below:
        <form action='profile.php?user={$user}' method='post'>
        <textarea rows='10' cols='50' name='vmtext' wrap='physical' ></textarea><br>
        <input type='submit' name='Submit' value='Submit'></form>";
        $vmcontent = $_POST["vmtext"]; 
        // Now check if the two users are friends...
        if($vmcontent != ""){
          $datesent = date("Y-m-d H:i:s");
          // $date = "2010-23-03 21:02:35";
          $fromuser = $loggedinname;
          $touser = $user;
          $adopts->insert("visitor_messages", array("vid" => NULL, "fromuser" => $fromuser, "touser" => $touser, "datesent" => $datesent, "vmtext" => $vmcontent));
          $article_content .= "<p>Your comment for user has been posted. You may now view your conversation with {$user} from <a href='vmessage.php?act=view&user1={$fromuser}&user2={$touser}'>here</a>.</p>";
        }
      }
	}
    else{
        $article_content .= "</table>Guests cannot post profile comment, sorry..."; 
    }

    // Now the second tab: About me...

    $article_content .= "</ul><ul id='aboutme'><li><strong><u>{$lang_basic_info} {$user}</u></strong><br /><br />
							<img src='{$row->avatar}' border=0 width='100' height=100 /><br />
							<strong>Member Since:</strong> {$row->membersince}<br /><br />
							Gender: {$row->gender}<br />
							Favorite Color: {$row->color}<br />
							Nickname: {$row->nickname}<br />
							Bio: <br />
							{$row->bio}<br /></li>";
							
    
	// The third tab: Adopts...						
	$article_content .= "</ul><ul id='adopts' class='hide'><h2>.:AdoptSpotlight:.</h2><br />
						{$row->favpet}<br />{$row->about}<br /><br />
						<strong><u>{$user}'s Pets:</u></strong><br /><br />";

	$query = "SELECT COUNT(*) AS pets FROM ".constant("PREFIX")."owned_adoptables WHERE owner = '{$user}'";
	$stmt = $adopts->query($query);
	$total = $stmt->fetch(PDO::FETCH_ASSOC);
						
	if($total['pets'] > 0){
		$rowsperpage = 15;
		$totalpages = ceil($total['pets'] / $rowsperpage);
		if(is_numeric($page)) $currentpage = $page;
		else $currentpage = 1;
		
		if($currentpage > $totalpages) $currentpage = $totalpages;  
		if($currentpage < 1) $currentpage = 1;   
		$offset = ($currentpage - 1) * $rowsperpage; 
		$stmt = $adopts->select("owned_adoptables", array(), "owner = '{$user}' LIMIT {$offset}, {$rowsperpage}");
        while($row = $stmt->fetchObject()){
			$image = getcurrentimage($row->aid);
			$article_content .= "<a href='levelup.php?id={$row->aid}'><img src='{$image}' border='0' /></a>";
		}
		$article_content .= "<br />";
			
		if($currentpage > 1){
			$newpage = $currentpage - 1;
			$article_content .= "<strong><a href='profile.php?user={$user}&page={$newpage}'><img src='templates/icons/prev.gif' border=0> Previous Page</a></strong> ";
		}
		else $article_content .= "<strong><img src='templates/icons/prev.gif' border=0> Previous Page</strong> ";
		
		if($currentpage < $totalpages){
			$newpage = $currentpage + 1;
			$article_content .= " ::  <strong><a href='profile.php?user={$user}&page={$newpage}'>Next Page <img src='templates/icons/next.gif' border=0></a></strong> ";
		}
		else $article_content .= " ::  <strong>Next Page <img src='templates/icons/next.gif' border=0></strong>";
	}
	else{
		$article_content .= "This user currently does not have any pets.";
	}						
						
    // The fourth tab: Friends...
	
	$friendlist = getfriendid($user);
    $friendnum = getfriendnum($user);	
    $article_content .= "</ul><ul id='friends' class='hide'>{$user} currently have {$friendnum} friends.<br /><table>";
	
	if($friendnum != 0){
	  foreach($friendlist as $friendid){
        $friendinfo = $adopts->join("users_profile", "users_profile.uid = users.uid")
				             ->select("users", array(), constant("PREFIX")."users.uid = '{$friendid}'")
				             ->fetchObject();
        $uid = $friendinfo->uid;  
        $username = $friendinfo->username;
        $friendgender = getfriendgender($username); 
        $onlinestatus = getonlinestatus($username);    
        $article_content .= "<tr><td style='text-align: left'><img src='{$friendinfo->avatar}' border=0 width='60' height =60></td>
        <td><strong><a href='profile.php?user={$username}'>{$username}</a></strong>  {$friendgender}<br />{$friendinfo->nickname}<br />{$onlinestatus}
        <a href='{$friendinfo->website}' target='_blank'><img src='templates/icons/web.gif'></a>
        <a href='messages.php?act=newpm&user={$username}'><img src='templates/icons/title.gif'></a></td>";
        $article_content .= ($user == $loggedinname)?"<td style='text-align: right'><br /><br /><br /><a href='friends.php?act=delete&uid={$uid}'>Break Friendship </td></tr>":"</tr>";
      }
	}
	
	$article_content .= "</table>";

	// The last tab: Contact Info!			 
				 
    $article_content .= "</ul><ul id='contactinfo' class='hide'><img src='templates/icons/web.gif' /> {$website}<br />
	                    <img src='templates/icons/facebook.gif' /> {$facebook}<br />
						<img src='templates/icons/twitter.gif' /> {$twitter}<br />
                    	<img src='templates/icons/aim.gif' /> {$aim}<br />
						<img src='templates/icons/msn.gif' /> {$msn}<br />
						<img src='templates/icons/yahoo.gif' /> {$yahoo}<br />
						<img src='templates/icons/skype.gif' /> {$skype}<br />
						<img src='templates/icons/title.gif' /> <a href='messages.php?act=newpm&user={$user}'>Send {$user} a Private Message</a><br />
						<img src='templates/icons/fr.gif' /><a href='friends.php?act=request&uid={$id}'>Send {$user} a Friend Request</a><br />
						<br /></div></div>"; 						
  }       
		 
   else{
     $article_content .= "Sorry, but we could not find a user in the system with the name {$user}.  
							Please make sure you have the username right.  The user's account may also have been deleted by the system admin.";
  }
	 
}
else{

	// We did not specify a user, so show the memberlist
	$article_title = "Memberlist";
	$article_content = "Here are all of the members of this site, sorted by registration date.<br /><br />";
    include("css/pagination.css");
	$query = "SELECT * FROM ".constant("PREFIX")."users ORDER BY uid ASC";
	$stmt = $adopts->query($query);
	$rowsperpage = 15;
    $pagination = new Pagination($adopts, $query, $rowsperpage, "http://www.".constant("DOMAIN").constant("SCRIPTPATH")."/profile.php");
    $pagination->setPage($_GET[page]);

	$stmt = $adopts->select("users", array(), "1 ORDER BY uid ASC LIMIT {$pagination->getLimit()},{$rowsperpage}");	
	while ($row = $stmt->fetchObject()){
		$status = cancp($row->usergroup);
        $star = ($status == "yes")?"<img src='templates/icons/star.gif' border=0' /> ":"";
		$article_content .= "<strong><a href='profile.php?user={$row->username}'>{$star}{$row->username}</a></strong><br />";
	}

	$article_content .= "<br />{$pagination->showPage()}</div>";

}



//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title, $article_content, $date);

?>

and here's the info.php

thank you for helping :smile:
 
well i got the same problem at 1.3.1
but that is because the css is out of his context in first place and for the rest i dit not debug it

the only thing i see in the php info is the short open tags

Code:
short_open_tag	Off
so all code that start with <? code ?> will not work and need to be replaced with <?php code ?>

the thing you could try in the code is to define the real location of the files

for example
profile.php is located in the home dir ( website/profile.php )

so you can put this text before it to get it working in case it gives errors

../profile.php ( for main root )
or ./profile.php (same as profile.php but still a bit differend as it returns back to home instead adding profile.php to it )

example of what i mean

Code:
<img src='templates/icons/star.gif'
replace to
Code:
<img src='../templates/icons/star.gif'
or the best way
Code:
<img src='http://".$_SERVER['SERVER_NAME']."/templates/icons/star.gif'>

the above code will always go back to the main website (with out http , $_SERVER['SERVER_NAME'] will provide 'earth.demonpower.com' on the webite earth.demonpower.com

hopely this can help to debug

Greetings From PowerChaos
 
@ powerchaos

and did you solve the problem at your own site ?
Maybe another css would be helpful ?

all codes start with "<?php" I suppose, that's not the problem. :el:
mmmmmmhhhhh.....

I've changed profile.php to
../profile.php
but no success. :desudesudesu:
 
i use version 1.3.1 and i am doing a rewrite of the script , so i got no idea what bugs are left in the current script

for the css , use the same fix

Code:
http://".$_SERVER['SERVER_NAME']."

on that way the css will always point to the right location

i putted that variable in the array for easy include , but the template of me looks like this

Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>:BROWSERTITLE:</title>
<link rel="stylesheet" href=":URL:/templates/main/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href=":URL:/css/menu.css" type="text/css" />
</head>


:URL: = ".$_SERVER['SERVER_NAME']."

also i am not sure if it is fixed for me , if you go to the profile page then it is still out of his context ( seems to be in a wrong table or it is just the tempalte )

i only fixed a part so the seo url would work with out messing up the context ( like pets.demonpower.com/1/test_egg ) as it refused to load the css file , the above fix force the css file to be loaded from the http:// instead of just trying to find it in a folder

after that i started to write from scratch , so i dit not solve any other bugs in it at current moment

Greetigns From PowerChaos
 
ok, I found out, that the problem obviously in inc/tabs.php

PHP:
<?php

if($filename == "profile"){

?>

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script>
<script src="js/tabs.js"></script>
<script>
        $(function() {
    
            $("#profile").organicTabs();            
    
        });
    </script>

<? 
}

?>

but why ? :ooo:

First I thought, the problem is on my webspace, but it works fine with another tabs script.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top