lindsayanng Posted October 17, 2008 Posted October 17, 2008 I'm installing an attribute grid contribution, and i keep getting a unexpected T_string in general on line 942.. this is RIGHT inside of the code that was written from the contribution!! lines 939 - 945 $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array $element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); I CAN NOT FIGURE OUT WHAT MIGHT BE MISSING.. A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 ok.. nevermind.. AGAIN i jumped the gun.. if i had read ONE MORE google site i wold have realized what an explode actually was, and the element in explode SHOULD have been on the same line as the rest of the commented out line Stick around though.. i'm sure there will be more issues from installing this contribution A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 Oh yea.. I got an unexpected $end on the last line of the code.. I have been going through and looking at ALL of the code that i added, and i THOUGHT i found it in one particular section, but i'm not sure.. Anyone want to look here and see if I am missing a '}' function tep_get_uprid($prid, $params ,$gid=0) { if (is_numeric($prid)) { $uprid = $prid; if ($gid>0) {$uprid .= '{'.$gid . '}0';} if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 i tried using BBB to figure it out, but i cant even figure out how to use BBB! A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 I'd just like to make a request.. anyone coming up with complicated contributions.. PLEASE, just give the ENTIRE pages so i can do a comparisson OR just put instructions in a .txt file.. just PLEASE dont use PDF!! this is horrible! A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 oh dear god where is the batlight? A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 FYI i gave up for tonight.. if anyone is interested, you can take a look at this contribution and make it workd for RC2a i would LOVE you.. otherwise i have to attack this sunday night.. i go an AWESOME long weekend of PUNK ROCKIN ROLL!!!! NoFx show tomorrow! THE CONTRIBUTION OF HORROR!!!! A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 I need to go to bed for tonight.. i will revist this sunday though. my head is spinning.. even the contributor said you are a masocist if you do this by hand.. I DID IT.. and it BROKE A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
Guest Posted October 17, 2008 Posted October 17, 2008 Oh yea.. I got an unexpected $end on the last line of the code.. I have been going through and looking at ALL of the code that i added, and i THOUGHT i found it in one particular section, but i'm not sure.. Anyone want to look here and see if I am missing a '}' function tep_get_uprid($prid, $params ,$gid=0) { if (is_numeric($prid)) { $uprid = $prid; if ($gid>0) {$uprid .= '{'.$gid . '}0';} if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; I know it's late, but I thought I counted 7 open! I must be wrong, but that's what I counted.
lindsayanng Posted October 17, 2008 Author Posted October 17, 2008 See what i mean!!! its horrible!!! Then i looked into programs that are supposed to count them and fix them for ya, but learning THAT program proved to be an almost worse headache A great place for newbies to start Road Map to oscommerce File Structure DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways! HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you Proud Memeber of the CODE BREAKERS CLUB!!
Guest Posted October 17, 2008 Posted October 17, 2008 I think you should have a " } " at the end of that code. Something like this. function tep_get_uprid($prid, $params ,$gid=0) { if (is_numeric($prid)) { $uprid = $prid; if ($gid>0) {$uprid .= '{'.$gid . '}0';} if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; }
satish Posted October 17, 2008 Posted October 17, 2008 <? function tep_get_uprid($prid, $params ,$gid=0) { if (is_numeric($prid)) { $uprid = $prid; if ($gid>0) {$uprid .= '{'.$gid . '}0';} if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; } //added this by Satish ?> //also this was added if needed else remove this line Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
failsafe Posted October 17, 2008 Posted October 17, 2008 If I get a similar problem with "{", I find it much easier to find if I indent the code. That's a good idea anyway, it makes the code much easier to read. Also, see if your editor has a function whereby you can alternate between beginning and ending brackets/braces. Mine highlights the closing bracket if you put the cursor on the open bracket/brace. This again makes it easier to find & fix such problems. Here's the indented code, with the final closing brace added too of course: :) <?php function tep_get_uprid($prid, $params ,$gid=0) { if (is_numeric($prid)) { $uprid = $prid; if ($gid>0) { $uprid .= '{'. $gid . '}0'; } if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; } ?>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.