Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 07-19-2009, 05:51 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,183
Tequila is on a distinguished road
Default [Lock Please] Account changes

I'm working on a MOD to set up an image to use for linking to a user's profile using the GD images. I can't figure out why it's giving me the current error, so I figured I'd post up my WIP code and see if anyone can spot what my eyes are missing.

Here's the error:
Quote:
Parse error: syntax error, unexpected T_ELSE in /home/enddayne/public_html/beta/mods/account.php on line 261
And the code:
PHP Code:
<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include(
"inc/config.php");
include(
"lang/lang.php");

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads getads("account");

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content];
$article_content nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle grabanysetting("browsertitle");
$sitename grabanysetting("sitename");
$slogan grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************

$act $_GET["act"];
$act preg_replace("/[^a-zA-Z0-9\\040.]/"""$act);
$act secure($act);

$more $_GET["more"];
$more preg_replace("/[^a-zA-Z0-9\\040.]/"""$more);
$more secure($more);

if(
$isloggedin == "yes"){

// We are logged in, so we must have an account
// Now we switch through our actions...

if($act == ""){

// No action specified

$article_title $loggedinname."'s Account";
$article_content $lang_account_manage."<br><br>
<b><u>Account Settings:</u></b><br><br>
<a href='myadopts.php'>Manage Adoptables</a><br>
<a href='profile.php?user="
.$loggedinname."'>View Profile</a><br>
<a href='account.php?act=changeemail'>Change Email Address</a><br>
<a href='account.php?act=changepass'>Change Password</a><br>
<a href='account.php?act=changesettings'>Change Settings and Profile Info</a><br />
<a href='account.php?act=bbcode'>Get Profile Image Code</a>"
;

}
else if(
$act == "changeemail"){

// We are changing the user's email address

$article_title $lang_email_change_title;
$article_content $lang_email_change."<br><form name='form1' method='post' action='accountpost.php'>
  <p>New Email Address : 
    <input name='email' type='text' id='email'>
    <input name='act' type='hidden' id='act' value='changeemail'>
</p>
  <p>
    <input type='submit' name='Submit' value='Change Email Address'>
</p>
</form>"
;

}
else if(
$act == "changepass"){

// We are changing the password

$article_title $lang_changepass_title;
$article_content $lang_changepass."<br><form name='form1' method='post' action='accountpost.php'>
  <p>Your Current Password: 
    <input name='cpass' type='password' id='cpass'>
</p>
  <p>Your New Password: 
    <input name='np1' type='password' id='np1' maxlength='20'>
</p>
  <p>Confirm New Password: 
    <input name='np2' type='password' id='np2' maxlength='20'>
    <input name='act' type='hidden' id='act' value='changepass'>
  </p>
  <p>
    <input type='submit' name='Submit' value='Change Password'>
</p>
</form>"
;

}
else if(
$act == "changesettings"){

// We are changing the settings

$article_title $lang_changesettings_title;
$article_content $lang_changesettings."<br>";

// Get the user's account details from the database...

$query "SELECT * FROM ".$prefix."users WHERE username='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$newmessagenotify=@mysql_result($result,$i,"newmessagenotify"); 
$website=@mysql_result($result,$i,"website");
$aim=@mysql_result($result,$i,"aim");
$yahoo=@mysql_result($result,$i,"yahoo");
$msn=@mysql_result($result,$i,"msn");

$website stripslashes($website);
$aim stripslashes($aim);
$yahoo stripslashes($yahoo);
$msn stripslashes($msn);


$i++;
}

// Show the form...

if($newmessagenotify == 1){
$box "<input name='newmsgnotify' type='checkbox' id='newmsgnotify' value='1' checked>";
}
else{
$box "<input name='newmsgnotify' type='checkbox' id='newmsgnotify' value='1'>";
}

$article_content $article_content."<form name='form1' method='post' action='accountpost.php'>
  <p>"
.$box."
  Notify me via email when I receive a new message or reward code</p>
  <p><u>Publically Viewable Details: </u></p>
  <p>Website: 
    <input name='website' type='text' id='website' value='"
.$website."'>
</p>
  <p>AIM Username: 
    <input name='aim' type='text' id='aim' value='"
.$aim."'>
</p>
  <p>YIM Username: 
    <input name='yim' type='text' id='yim' value='"
.$yahoo."'>
</p>
  <p>MSN Username: 
    <input name='msn' type='text' id='msn' value='"
.$msn."'>
    <input name='act' type='hidden' id='act' value='changesettings'>
</p>
  <p>
    <input type='submit' name='Submit' value='Submit Details'>
  </p>
</form>"
;



}
else if(
$act == "bbcode"){

if(
is_numeric($id)){

// Now we see if the adoptable actually exists...

$query "SELECT * FROM ".$prefix."users WHERE username = '".$user."'";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$uid=@mysql_result($result,$i,"uid"); //The adoptable's ID


$i++;
}

if(
$uid == $id){

$altbb grabanysetting("usealtbbcode");

// Adoptable exists, so show the BBCode:

$article_title "Codes for ".$name;
$article_content $lang_bbcode_explain."<br>
<p><u>Forum Codes / BBCode: </u></p>
<p>
  <textarea name='textarea' cols='50' rows='4'>[url=http://www."
.$domain."".$scriptpath."/profile.php?user=".$user."][img]http://www.".$domain."".$scriptpath."/siggy1.php?id=".$uid."[/img][/url]
</textarea>
</p>"
;

if(
$altbb == "yes"){

// Use the seo friendly alternate bbcodes...

$article_content $article_content."<p><u>Alternate BBCodes (Use if the above do not work on a forum): </u></p>
<p>
  <textarea name='textarea' cols='50' rows='4'>[url=http://www."
.$domain."".$scriptpath."/profile.php?user=".$user."][img]http://www.".$domain."".$scriptpath."/get/".$uid.".gif\"[/img][/url]
</textarea>
</p>"
;

}



$article_content $article_content."<p><u>HTML Code</u>:</p>
<p>
<textarea name='textarea' cols='50' rows='4'><a href=\"http://www."
.$domain."".$scriptpath."/profile.php?user=".$user."\" target=\"_blank\">
<img src=\"http://www."
.$domain."".$scriptpath."/siggy1.php?id=".$uid."\" border=0></a>
  </textarea>
   
</p>"
;

}
else{

// No valid action specified...

$article_title "No Valid Action Specified";
$article_content "Invalid Action";

}
else{

// Guest access to this page is forbidden

$article_title $accden;
$article_content $nopriv." ".$reqlogin;


}



// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file $themeurl;

// Do the template changes and echo the ready template
$template file_get_contents($file);

$template replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':ARTICLEDATE:',$article_date,$template);

$template replace(':BROWSERTITLE:',$browsertitle,$template);
$template replace(':SITENAME:',$sitename,$template);

//Define our links
$template replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...

$sidebar getsidebar();
$template replace(':SIDEFEED:',$sidebar,$template);

//Get the ad content...
$template replace(':ADS:',$ads,$template);

//Get the slogan info
$template replace(':SLOGAN:',$slogan,$template);


echo 
$template;

// **********************************************************************
// End Template Definition
// **********************************************************************



?>
and my modified Siggy file:
PHP Code:
<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
//
// File ID: siggy.php
// Purpose: Show signature images for users
// **********************************************************************

// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include(
"inc/config.php");
include(
"lang/lang.php");

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads getads("any");

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content];
$article_content nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle grabanysetting("browsertitle");
$sitename grabanysetting("sitename");
$slogan grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************

// We need to grab an user ID

$id $_GET["id"];
$id preg_replace("/[^a-zA-Z0-9s]/"""$id);
$id secure($id);

// Check that ID exists and is valid

if(is_numeric($id)){

// The ID appears to be valid, so double check...

$query "SELECT * FROM ".$prefix."users WHERE uid='$id'";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$aid=@mysql_result($result,$i,"uid"); //The user's ID

$i++;
}

if(
$uid == $id){

// The user exists, so let's try and show the image

$usingimage "no";

$image getcurrentimage($id);

    
// Let's see if the server has support for GD or not
    // Also to use fancy images the image must be a gif and fancy images must be enabled...

    
$usegd grabanysetting("gdimages");
    
$imageinfo = @getimagesize($image);
    
$imagemime $imageinfo["mime"]; // Mime type of the image file, should be a .gif file...

    
if(function_exists('imagegif') and $usegd == "yes" and $imagemime == "image/gif")
    {

    
$usingimage "yes"//Turn the template system off

    // BEGIN NEW CODE

    
list($width$height$type$attr) = getimagesize($image); // The size of the original adoptable image

    // Begin the fancy outputs...

    // Lets create the new target image, with a size big enough for the text for the adoptable

    
$newheight $height 72;

    if(
$newwidth 250){
    
$newwidth 250;
    }
    else{
    
$newwidth $width;
    }

      
$img_temp imagecreatetruecolor($newwidth$newheight); 


      
$alphablending true;  


        
// Lets create the image and save its transparency  
      
$img_old = @imagecreatefromgif($image);  
      
imagealphablending($img_oldtrue);  
      
imagesavealpha($img_oldtrue);
   
     
// Lets copy the old image into the new image with  
     // the given size  
     
ImageCopyResampled(  
         
$img_temp,  
         
$img_old,  
         
0000,  
         
$width,  
         
$height,  
         
$width,  
         
$height  
     
);  
   
    
    
$textheight $width 2;

    
$image $img_temp;

    
$bgi imagecreatetruecolor($newwidth$newheight);

    
$color imagecolorallocate($bgi515151);


    
$str1 ".$user's Familiars

    imagestring (
$image, 12, 0, $textheight,  $str1$color);


    
$background = imagecolorallocate($image, 0, 0, 0);  
      ImageColorTransparent(
$image$background);  
 
    header("
Content-Typeimage/GIF");
    ImageGif (
$image);
    imagedestroy(
$image);
    imagedestroy(
$img_temp);
    imagedestroy(
$img_old);
    imagedestroy(
$bgi);

    }
    else{
    
    // We are going to try and get this image the old fashioned way...
    // Define a list of allowed file extentions...

    
$extList = array();
    
$extList['gif'] = 'image/gif';
    
$extList['jpg'] = 'image/jpeg';
    
$extList['jpeg'] = 'image/jpeg';
    
$extList['png'] = 'image/png';

    //Define the output file type
    
$contentType = 'Content-type: '.$extList[ $imageinfo['extension'] ];

    if(
$imageinfo['extension'] =! "image/gif" and $imageinfo['extension'] =! "image/jpeg" and $imageinfo['extension'] =! "image/png"){

    // The file type is NOT ALLOWED
    die("
Hacking Attempt!");

    }
    else{

    // File type is allowed, so proceed
    // Try and read the file in

    
$status = "";

    header (
$contentType);
    
$status = readfile($image);

    if(
$status == "" or $status == "false" or $status == "FALSE"){

    // Reading the file failed, so show an error...    
    header ("
text/plain");
    die("
Readfile appears to be disabled on your host.");

    }
    


    } 

    }


}
else{

// Bogus ID

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;


}
}
else{

// Bogus ID

$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;

}


// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file = $themeurl;

// Do the template changes and echo the ready template
$template = file_get_contents($file);

$template = replace(':ARTICLETITLE:',$article_title,$template);
$template = replace(':ARTICLECONTENT:',$article_content,$template);
$template = replace(':ARTICLEDATE:',$article_date,$template);

$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);

//Define our links
$template = replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...

$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);

//Get the ad content...
$template = replace(':ADS:',$ads,$template);

//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);


if(
$usingimage != "yes"){
echo 
$template; // Only echo the template if we are not showing an image... 
}

// **********************************************************************
// End Template Definition
// **********************************************************************



?>
Reply With Quote
  #2  
Old 07-21-2009, 04:40 AM
Ashje Ashje is offline
Member
 
Join Date: Jan 2009
Posts: 179
Credits: 10,061
Ashje
Default RE: Account changes

It's an error with the word "else". Which else is what escapes me. If you could just post line 261, I could help.
Reply With Quote
  #3  
Old 07-21-2009, 10:12 AM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,183
Tequila is on a distinguished road
Default RE: Account changes

Quote:
Originally Posted by Ashje
It's an error with the word "else". Which else is what escapes me. If you could just post line 261, I could help.
261 is:
PHP Code:
else{ 
But when I removed it it still gave the same error... Good thing I'm getting the book.

Actually when removed it gives this error:
Quote:
Parse error: syntax error, unexpected $end in /home/enddayne/public_html/beta/mods/account.php on line 312
Reply With Quote
  #4  
Old 07-21-2009, 01:08 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,564
Seapyramid
Default RE: Account changes

That error means you are missing an } somewhere

Sea
Reply With Quote
  #5  
Old 07-21-2009, 01:19 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,183
Tequila is on a distinguished road
Default RE: Account changes

Quote:
Originally Posted by Seapyramid
That error means you are missing an } somewhere

Sea
I know, I can't figure out where. I'm going to take a break from looking over the code to do some more adoptables up... update the portfolio and all that jazz as well. :/
[size=x-small]Should stay as an artist...[/size]
Reply With Quote
  #6  
Old 08-01-2009, 10:36 AM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,183
Tequila is on a distinguished road
Default RE: [Lock Please] Account changes

I am looking into a different way to do this, please feel free to lock this thread.
Reply With Quote
  #7  
Old 08-01-2009, 02:27 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,696
BMR777 is on a distinguished road
Default RE: [Lock Please] Account changes

Locked by request.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IP Tracking/Account Limiter ipengu Mys v1.2.x Mods 6 10-19-2011 09:54 PM
Multi Account jcga Questions and Supports 3 11-12-2009 12:39 PM
[Lock Please] Integrate script with php safe includes? Tequila Questions and Supports 10 04-03-2009 03:27 PM
Account managemnt 12345 Questions and Supports 5 03-11-2009 03:27 AM
Add Special Pets to Account Blue Icebox Questions and Supports 4 02-20-2009 10:45 PM


All times are GMT -5. The time now is 12:43 AM.

Currently Active Users: 3403 (0 members and 3403 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636