close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help with t_string error in PowerStore 3

Thread began 2/08/2010 5:02 pm by lucyland400306 | Last modified 2/17/2010 4:40 pm by Jason Byrnes | 3257 views | 10 replies |

lucyland400306

Help with t_string error in PowerStore 3

Hi, I'm a PowerStore newbie with very little PHP experience. I just downloaded PS3 today and am having issues with setting up my site. I've tried to find miss-matched punctuation in the offending .php doc but don't understand enough PHP to uncover the error.

I was able to set up the back end using the wizard but only have a partial display of functions. The customer service rep at my hosting company suggested I contact Web Assist.

Here is a screen shot with the error message.

Thanks...

Sign in to reply to this post

Jason ByrnesWebAssist

the error suggests that there is a bad setting in the WA_Globals.php file.

I am starting a support ticket so you can send me a copy of that file so I can investigate.
To view and edit your support ticket, please log into your support history:
login.php

Sign in to reply to this post

lucyland

It doesn't seem like the .php file ever attached

Hi, Here's the code form the offending PHP file:

<?php
//need to run installation wizard
if(!file_exists('../Connections/installed.txt') && (!file_exists('Connections/installed.txt'))) {
if(file_exists('../install/index.php')) {
header('Location: ../install/index.php');
} else {
header('Location: install/index.php');
}
exit();
}
?>
<?php
function replaceTokens($encodedVal,$Arr) {
$tokens = preg_match("/\\[([^\\]]*)\\]/",$encodedVal,$subMatch);
$retVal = $encodedVal;
if (sizeof($subMatch)>0) {
$ArrIndex = $subMatch[1];
$ArrPos = explode(":",$ArrIndex);
if (isset($Arr[$ArrPos[0]])) {
for ($x=0; $x<sizeof($Arr[$ArrPos[0]]); $x++) {
if ($Arr[$ArrPos[0]][$x][0] == $ArrPos[1]) {
$retVal = str_replace($subMatch[0],$Arr[$ArrPos[0]][$x][1],$retVal);
}
}
}
}
return $retVal;
}
?>
<?php
$thisDir = realpath(dirname(__FILE__));
if(strpos($thisDir,"/") !== false) {
$thisDir = substr($thisDir,0,strrpos($thisDir,"/"));
} else {
$thisDir = substr($thisDir,0,strrpos($thisDir,"\\"));
}
require_once($thisDir."/Connections/PowerStoreConnection.php");

mysql_select_db($database_PowerStoreConnection, $PowerStoreConnection);
$query_WAGlobals = "SELECT * FROM wa_settings";
$WAGlobals = mysql_query($query_WAGlobals, $PowerStoreConnection);
$row_WAGlobals = mysql_fetch_assoc($WAGlobals);

$tabs = array();
while ($row_WAGlobals) {
if ($row_WAGlobals['grp'] != "None") {
if (!isset($tabs[$row_WAGlobals['grp']])) {
$tabs[$row_WAGlobals['grp']] = array();
}
$tabs[$row_WAGlobals['grp']][] = array($row_WAGlobals['name'],$row_WAGlobals['value'],$row_WAGlobals['type'],$row_WAGlobals['options'],$row_WAGlobals['variable']);
}
$row_WAGlobals = mysql_fetch_assoc($WAGlobals);
}


foreach ($tabs as $key => $value) {
for ($x=0; $x<sizeof($value); $x++) {
eval("\$WAGLOBAL_".$value[$x][4]."='".replaceTokens($value[$x][1],$tabs)."';");
}
}

//root url
$WAGLOBAL_Root_URL = ((isset($_SERVER['SERVER_PROTOCOL']) && strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS') !== false) ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . $WAGLOBAL_localRoot;

mysql_free_result($WAGlobals);
?>

Sign in to reply to this post

Jason ByrnesWebAssist

the file attached correctly to the post in your support history, I provided additional instructions there:
please log into your support history:
login.php

to see my last response.

Sign in to reply to this post

elton

T_STRING error in PowerStore 3 CMS update page

I get this (same?) error when trying to update in CMS Update page, on any tab.

Parse error: syntax error, unexpected T_STRING in /home3/sensible/public_html/unicornphotographics/WA_Globals/WA_Globals.php(58) : eval()'d code on line 1

Sign in to reply to this post

elton

PowerStore 3 and sub-domains issue

Originally Said By: elton
  I get this (same?) error when trying to update in CMS Update page, on any tab.

Parse error: syntax error, unexpected T_STRING in /home3/sensible/public_html/unicornphotographics/WA_Globals/WA_Globals.php(58) : eval()'d code on line 1  



There was one other problem I was having related to my unsuccessful attempts to work on the mirgration testing and validation from a sub-domain. It just would not work. Ex: I used testing.domain.com instead of domain.com. No matter what kind of redirect I used, it would not "find" the image files. Only when I bit the bullet and put the files right on top of my production system was I able to get the PowerStore 3 implementation to actually see the correct directories. I am not knowledgable enough to know how, but the what seems to be in the routines for breaking down and substringing the directory paths...there is just something not right there.

Sign in to reply to this post

Jason ByrnesWebAssist

change line 58 of the WA_Globals.php file:

php:
eval("\$WAGLOBAL_".$value[$x][4]."='".replaceTokens($value[$x][1],$tabs)."';");




to:

php:
eval("\$WAGLOBAL_".$value[$x][4]."='".addslashes(replaceTokens($value[$x][1],$tabs))."';");
Sign in to reply to this post

elton

Another apparent WA_Global.php error related to paths...(Please see attach)

Process to duplicate

In Admin, Go to Products, Select existing product.
Select Update
Select Upload image
from Image Properties
Attempt to select a local file...

Boom.

PLEASE HELP FIX THESE PROBLEMS ASAP

I am not a paid crash dummy....just don't have time for it.
I am no longer an IT guru...don't have the mind for it any more.

Just trying to make a living and that is getting harder all the time

Sign in to reply to this post

Jason ByrnesWebAssist

I cannot read the error message in the screen shoot, can you please copy the error text into your reply so I can see what the error message is.

Sign in to reply to this post

elton

The error I am getting is not at first stated. It occurs when I try to edit an exiting image in the HTML Editor for the CMS maintentance screen, not the Products screen as first stated.. As soon as

this is in the URL bar
index.php?lang=default&kfm_caller_type=fck&type=Image

It occurs when using the Browse Server buton. It does not seem to matter what if anything is in the image Info field .....but this error does NOT occur if I use the Upload tab and upload from a local source...again something strange with the way your sub-stringing of the directory paths is working????

This is the body text of the error message
Parse error: syntax error, unexpected T_STRING in /home3/sensible/public_html/unicornphotographics/HTMLEditor/editor/plugins/kfm/WA_Globals.php(39) : eval()'d code on line 1

Warning: Cannot modify header information - headers already sent by (output started at /home3/sensible/public_html/unicornphotographics/HTMLEditor/editor/plugins/kfm/WA_Globals.php(39) : eval()'d code:1) in /home3/sensible/public_html/unicornphotographics/HTMLEditor/editor/plugins/kfm/includes/session.class.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home3/sensible/public_html/unicornphotographics/HTMLEditor/editor/plugins/kfm/WA_Globals.php(39) : eval()'d code:1) in /home3/sensible/public_html/unicornphotographics/HTMLEditor/editor/plugins/kfm/index.php on line 75

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...