gamershop Posted February 9, 2009 Share Posted February 9, 2009 Hi guys, I am having a problem adding a tooltip script. I am receiving the below error in my .../boxes/loginbox.php: Parse error: syntax error, unexpected T_STRING, expecting ')' I am trying to use http://www.walterzorn.com/tooltip/tooltip_e.htm tooltip. I have done everything correctly including uploading the .js script Below is the part of the codes in .../boxes/loginbox.php that i added the hyperlink to be tooltip enabled. I added <a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage </a>: <?php /* $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>'); new infoBoxHeading($info_box_contents); */ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<span style="FONT-FAMILY: Tahoma, Verdana, Arial, sans-serif;FONT-WEIGHT: bold; FONT-SIZE: 11px;color:#5c6e7a;"> Welcome, '.$customername.'</span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /><a href="shopping_cart.php"> <span style="color:#5b9ad6;">My Cart</span></a><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /><a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"> Order History</a><br>' . /* '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .*/ /* '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">Edit Profile</a><br>' .*/ '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">My Account</a><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <span class="content">Gosu Level : '.$levelname.'</span><br><a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage </a>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <span class="content">Discount : '.$discount.'%</span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <span class="content">Next Level By : '.$nextamount.'</span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">Change Password</a><br>' . /* '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .*/ '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>' ); new infoBox1($info_box_contents); if (TEMPLATE_INCLUDE_FOOTER =='true'){ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1') ); new infoboxFooter($info_box_contents); } ?> Can somebody help? Link to comment Share on other sites More sharing options...
gamershop Posted February 10, 2009 Author Share Posted February 10, 2009 Anybody able to help? Link to comment Share on other sites More sharing options...
germ Posted February 10, 2009 Share Posted February 10, 2009 I would have answered already but you neglected to say what line the error is on. :blush: I'm sure it's included in the error message. It sure makes it a lot easier to help when you supply as much information as possible about the problem... :huh: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
gamershop Posted February 11, 2009 Author Share Posted February 11, 2009 I would have answered already but you neglected to say what line the error is on. :blush: I'm sure it's included in the error message. It sure makes it a lot easier to help when you supply as much information as possible about the problem... :huh: Hi. Thanks for your willingness to help. The error is as per below: Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/mywebsite/public_html/templates/Sim/boxes/loginbox.php on line 256 If you cant find the error line, do a search for this code, its the same as where line 256 is: <a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage </a> Below is the entire code for loginbox.php: <body> <script type="text/javascript" src="wz_tooltip.js"></script> <table width="193" border="0" align="left" cellpadding="0" cellspacing="0"> <?php require(DIR_WS_LANGUAGES . 'english' . '/loginbox.php'); // WebMakers.com Added: Do not show if on login or create account /*if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) {*/ if (!tep_session_is_registered('customer_id') ) { ?> <!--D loginbox //--> <script language="Javascript"> function showdiv(mode,a) { //alert(a); if(a!=""){ switch(a) { case 1: document.getElementById('username1').className='loginbox'; break; case 2: document.getElementById('pass').className='loginbox'; break; } } //alert(document.getElementById('username1').value.length); } /* function smart() { if(document.getElementById('username1').value.length!="0" && document.getElementById('pass').value.length!="0") { document.getElementById('enable1').style.display = 'block'; document.getElementById('disable1').style.display = 'none'; } else { document.getElementById('enable1').style.display = 'none'; document.getElementById('disable1').style.display = 'block'; } } */ //alert(document.getElementById('username1').value.length); //alert(document.getElementById('pass').value.length); // /*if(mode.length == "0") { document.getElementById('username1').className=''; } else { document.getElementById('username1').className='loginbox'; }*/ /*function showpass(mode) { //alert(mode.length); if(mode.length == "0") { document.getElementById('pass1').className=''; } else { document.getElementById('pass1').className='loginbox'; }*/ </script> <?php if (!tep_session_is_registered('customer_id')) { ?> <tr> <td bgcolor="#E9EFF0" valign="top"> <?php //$info_box_contents = array(); /*$info_box_contents[] = array('align' => 'left', 'text' => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN . '</font>'); new infoBoxHeading($info_box_contents);*/ $loginboxcontent = " <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\"> <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" > <tr> <td height=\"23\" align=\"left\" valign=\"bottom\" class=\"link-padding\"> USERNAME </td> </tr> <tr> <tr> <td align=\"left\" class=\"link-padding\" valign=\"middle\" > <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"24\" value=\"\" id=\"username1\" onClick=\"showdiv(this.value,1);\" class=\"loginbox2\" onBlur=\"document.getElementById('username1').className='loginbox2';\"> </td> </tr> <tr> <td height=\"23\" align=\"left\" valign=\"bottom\" class=\"link-padding\"> PASSWORD </td> </tr> <tr> <td align=\"left\" class=\"link-padding\" valign=\"middle\"> <input class=\"loginbox2\" type=\"password\" name=\"password\" id=\"pass\" maxlength=\"40\" size=\"24\" value=\"\" onClick=\"showdiv(this.value,2)\" onBlur=\"document.getElementById('pass').className='loginbox2';\" > </td> </tr> <tr> <tr> <td colspan=\"2\" style=\"line-height:1px;\"> </td> </tr> <tr> <td align=\"right\" height=\"26\" valign=\"middle\" style=\"padding-right:16px;\" colspan=\"2\"> <input id=\"enable1\" src=\"templates/Sim/images/buttons/english/button_login.gif\" alt=\"Sign In\" title=\"Sign In\" type=\"image\" border=\"0\"> </td> </tr> <tr> <td height=\"20\" align=\"left\" valign=\"middle\" class=\"c2\"><img src=\"images/arrow.gif\" alt=\"ARROW\" width=\"10\" height=\"11\" /><a href=\"create_account.php\" class=\"link1-padding\">Register !</a></td> </tr> <tr> <td align=\"left\" valign=\"middle\"><img src=\"images/line.gif\" alt=\"line\" /></td> </tr> <tr> <td height=\"20\" align=\"left\" valign=\"middle\" class=\"c2\"><img src=\"images/arrow.gif\" alt=\"arrow\" width=\"10\" height=\"11\" /><a href=\"password_forgotten.php\" class=\"link1-padding\">Forgot your Password?</a></td> </tr> <tr> <td align=\"left\" valign=\"middle\"><img src=\"images/line.gif\" alt=\"line\" /></td> </tr> <tr> <td align=\"left\" valign=\"middle\"> </td> </tr> </table></form>"; $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $loginboxcontent ); new infoBox1($info_box_contents); if (TEMPLATE_INCLUDE_FOOTER =='true'){ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1') ); new infoboxFooter($info_box_contents); } ?> </td> </tr> <?php } else { // If you want to display anything when the user IS logged in, put it // in here... Possibly a "You are logged in as :" box or something. } ?> <!--D loginbox_eof //--> <?php // WebMakers.com Added: My Account Info Box } else { if (tep_session_is_registered('customer_id')) { // print $customer_id; $sql="select * from customers where customers_id='$customer_id'"; //print $sql;exit; $res=mysql_query($sql); $row=mysql_fetch_array($res); //print_r($row);exit; $firstname=$row[customers_firstname]; $lastname=$row[customers_lastname]; $customername=$firstname.' '.$lastname; //print $name; $sql2="SELECT sum(p.value) as sum FROM orders o, orders_total p,orders_status os where o.orders_id=p.orders_id and os.orders_status_id=o.orders_status and os.paid=1 and p.class ='ot_total' and o.customers_id='$customer_id'"; //print $sql2; $result2=tep_db_query($sql2); $row2=mysql_fetch_assoc($result2); //print $row2[sum];exit; if($row2['sum']!='') { $customerprice=$row2['sum']; } else { $customerprice='0.00'; } //$customerprice='25.2467'; $qry = "select * from membership order by discount"; $res=mysql_query($qry); $i=0; while($member = mysql_fetch_array($res)) { $id[]=$member[id]; $name=$member[name]; $amount=$member[amount]; $discount=$member[discount]; if($customerprice<$amount) break; $i++; } //print $i; //print_r($id); //print $discount; //print $id[i]; $sql="select * from membership where id='$id[$i]'"; //print $sql; $res=mysql_query($sql); $row=mysql_fetch_array($res); $amount1=$row[amount]; if($amount1>$customerprice) { $nextamount=$amount1-$customerprice; } else { $nextamount=0.00; } $nextamount = number_format($nextamount, 2, '.', ''); $nextamount=$currencies->format($nextamount); //echo $string{0}; //print $nextamount; //$id1=$id-1; $j= $i-1; $sql="select * from membership where id='$id[$j]'"; //print $sql; $res=mysql_query($sql); $row=mysql_fetch_array($res); $levelname=$row[name]; $discount=$row[discount]; $discount1='-'.$discount; //print $discount;exit; $sql3="update customers set customers_discount='$discount1' where customers_id='$customer_id'"; //print $sql3;exit; $qry3=mysql_query($sql3); ?> <!--D my_account_info //--> <tr> <td> <?php /* $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<font color="' . $font_color . '">' . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT . '</font>'); new infoBoxHeading($info_box_contents); */ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<span style="FONT-FAMILY: Tahoma, Verdana, Arial, sans-serif;FONT-WEIGHT: bold; FONT-SIZE: 11px;color:#5c6e7a;"> Welcome, '.$customername.'</span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /><a href="shopping_cart.php"> <span style="color:#5b9ad6;">My Cart</span></a><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /><a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"> Order History</a><br>' . /* '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /><a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .*/ /* '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">Edit Profile</a><br>' .*/ '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">My Account</a><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <span class="content">Gosu Level : '.$levelname.' <a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage </a></span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <span class="content">Discount : '.$discount.'%</span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <span class="content">Next Level By : '.$nextamount.'</span><br>' . '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">Change Password</a><br>' . /* '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .*/ '<img src="images/arrow.gif" alt="ARROW" width="10" height="11" /> <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>' ); new infoBox1($info_box_contents); if (TEMPLATE_INCLUDE_FOOTER =='true'){ $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_separator('pixel_trans.gif', '100%', '1') ); new infoboxFooter($info_box_contents); } ?> </td> </tr> <!--D my_account_info_eof //--> <?php } } //require('currencies.php'); ?> </table> </body> Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2009 Share Posted February 11, 2009 Move the code on that line and see if the error follows. index.htm? RU using osc? Link to comment Share on other sites More sharing options...
gamershop Posted February 11, 2009 Author Share Posted February 11, 2009 Move the code on that line and see if the error follows. index.htm? RU using osc? Yes i am using OSC. Removing, <a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage </a> will solve the problem for sure because this is what i am implementing. As per http://www.walterzorn.com/tooltip/tooltip_e.htm, there are only 2 lines of codes that i need to input to my OSC page in order for the tooltip to work. So ya. Link to comment Share on other sites More sharing options...
gamershop Posted February 11, 2009 Author Share Posted February 11, 2009 Yes i am using OSC. Removing, <a href="index.htm" onmouseover="Tip('Some text')" onmouseout="UnTip()">Homepage </a> will solve the problem for sure because this is what i am implementing. As per http://www.walterzorn.com/tooltip/tooltip_e.htm, there are only 2 lines of codes that i need to input to my OSC page in order for the tooltip to work. So ya. Oh, and index.htm is fine. Where i hyperlink to is find and does not concern the codes. I have tried hyperlinking to a correct URL and its the same. Link to comment Share on other sites More sharing options...
lastblackjellybean Posted February 11, 2009 Share Posted February 11, 2009 try <a href="index.htm" onmouseover="Tip(\'Some text\')" onmouseout="UnTip()">Homepage </a> Link to comment Share on other sites More sharing options...
gamershop Posted February 12, 2009 Author Share Posted February 12, 2009 try <a href="index.htm" onmouseover="Tip(\'Some text\')" onmouseout="UnTip()">Homepage </a> You are a genius! Do you have a website or do you do any freelance programming? Link to comment Share on other sites More sharing options...
lastblackjellybean Posted February 12, 2009 Share Posted February 12, 2009 no i don't, I'm actually a complete beginner with php, just happened to spot this. By the way, be careful about linking to non-osc pages from within the cart, it will cause loss of cart contents etc unless you use tep_href_link and include application_top on your external pages (...i think) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.