, Guest!
Already a Member? Login or Register.

Menu



Showcase


Due to the volume of spam happening on our forums, posting is now restricted to verified members only.  If you're not verified, drop us a note with your username.

Home > FlexCMS Support Forum > User Help > General Support Requests > ftp wont upload install.php saying virus?

FlexCMS Support Forum


ftp wont upload install.php saying virus?
Started November 7, 2008 @ 7:27pm by Rory
Post Message 
Pages:  1  [2]  

DCSun
Administrator



Posts: 625
 
November 22, 2008 @ 3:45pm
Personally that seems like more work than just adding in the string you want in your script, but that's just my opinion. The only reason they're in a separate area in FlexCMS is so they can be translated into other languages.

Regarding your other problem with the block only sometimes displaying the currency symbol correctly, add the following to the top of your block:

Code

$query = "select * from `".$Settings['DBPrefix']."ec-Settings`";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)) {
$ecSettings[$row['Name']] = $row['Value'];
}


I'll get back to you soon about the other areas the currency symbol still isn't displaying properly (checkout, etc).

David


FlexCMS v3.2 Has Been Released!
 
Rory


Posts: 30
 
Block £ sortedNovember 22, 2008 @ 6:51pm
Many thanks
R
 
Rory


Posts: 30
 
$TemplateTagsNovember 24, 2008 @ 6:29am
I have managed to recreate the header identically (with your help) and I have recreated the footer, but so far soley in html. I would like to have the
'.$TemplateTags['bottomfullblocks'].' in the my footer and
'.$TemplateTags['rightblocks'].' in any of my php pages that dont work in the iframe so a link to them wont look out of place and it will help with any other pages I create outside of flex. Could you let me know what php is required for both in order for them to work please?
Many thanks
R
 
DCSun
Administrator



Posts: 625
 
November 26, 2008 @ 4:43pm
You're going to run into a lot of different issues with what you're trying to do. FlexCMS wasn't really designed to have its content pulled into other scripts outside of it. The blocks code you're looking for is in index.php, starting around line 2410. There's just under 1000 lines of code there that deal with processing of blocks.

David


FlexCMS v3.2 Has Been Released!
 
DCSun
Administrator



Posts: 625
 
November 29, 2008 @ 8:04pm

Quote (Rory)

Finally how do I stop say a £3.00 item showing up as 1 @ £3.0000 in the checkout section?


Here's an updated file that should solve those display problems you were having: [removed, see below for updates]. Just rename the one you've got there now, unzip and upload this to your site.


David


FlexCMS v3.2 Has Been Released!
 

Last Edit: December 1, 2008 @ 5:39pm by DCSun
Rory


Posts: 30
 
December 1, 2008 @ 5:48am
Cheers for that, still a couple of small things like the $ sign is still showing in
Home > Control Panel > View Reports and Statistics > Store Sales

Store Sales By Month:
and in
Pricing/Options:

Item ID Price Stock Options
1 $3.00 0 Modify
and in
Handling:
Add $ per order.

and is it possible to have the eNewsletter block disappear once the member has signed up for it, so it disappears like the login block?
many thanks
R
 
DCSun
Administrator



Posts: 625
 
December 1, 2008 @ 5:37pm
Download this file http://www.flexcms.com/downloads/flexcms_v2.5_inc-currencyfix.zip to correct those other issues you mentioned.

I can't think of any easy way to make the newsletter block do what you're suggesting, but it's a good idea. We'll see what we can do about that in the future.


David


FlexCMS v3.2 Has Been Released!
 

Last Edit: December 1, 2008 @ 5:38pm by DCSun
Rory


Posts: 30
 
MySql connecting?December 16, 2008 @ 11:17am
Sorry to say I'm back with another ?

Using flex I can not connect to my data in the database even though in mysql admin all the tables are in with all the flex files (i.e your tables: core-blocks, core-countries, core-users etc with mine: clubs, regions etc)
my script works perfect outside of flex using the mysql_connect.php but my script will not work outside of flex with your settings.php ( require_once('settings.php'); ).
and vice versa in flex my script will not work even with a " require_once('mysql_connect.php'); " statement placed in the flex page.
And if I use the text from mysql_connect.php and replace your settings text with it, even though the info contained within, use the same (user, pass, server and database) words then Flex dont work. again vice versa your settings text in my mysql_connect wont work my script.

mysql_connect.php
<?
ini_set ('display_errors', 1); // lets me learn wher mistakes are
error_reporting (E_ALL & ~E_NOTICE); // dont show notices

if ($dbc = @mysql_connect ('localhost', 'myusername', 'mypassword')) {
if (!@mysql_select_db ('databasename')) {
die ('<p>Could not connect to Database because: <b>' . mysql_error() .'</b></p>');
}
} else {
die ('<p>Could not connect to MYSQL because: <b>' . mysql_error() .'</b></p>');
}
?>

settings.php
<?
$DBUser = 'myusername';
$DBPass = 'mypassword';
$DBServer = 'localhost';
$DBDatabase = 'databasename';
$DBPrefix = '';
?>
Has the missing $DBPrefix in mine have anything to do with it?

Basically my question is;
what is needed for my data to work within flex (remembering they are in the same mysql database) please?
Many thanks R
 

Last Edit: December 16, 2008 @ 11:21am by Rory
DCSun
Administrator



Posts: 625
 
December 16, 2008 @ 11:49am
If you're inside of FlexCMS already (ie PHP enabled block or page), you don't need to do anything to connect. It's already connected to that database to access the needed parts for Flex, so just go ahead and run your query.


David


FlexCMS v3.2 Has Been Released!
 
Rory


Posts: 30
 
Still no luckDecember 17, 2008 @ 1:16pm

This is coming up:

Access denied for user 'apache'@'localhost' (using password: NO)
and
this is the script I put in the flex pages and ticked the php box;

If (isset($_POST['submit'])) { //handle the form

//this script veiws the stored values on database

$query = "INSERT INTO clubs (club_id, name, region_id, memb_id, sport_id, date_added)
VALUES (0, '{$_POST['name']}','{$_POST['region_id']}','{$_POST['memb_id']}','{$_POST['sport_id']}', NOW())";

if (@mysql_query ($query)) {
print 'The Club has been added';

} else {

print 'Could not add the data because:<br />
' .mysql_error()." The query was $query.";
}
mysql_close();
}

print '
<form action="add_club.php" method="post">
Club Name: <input type="text" name="name" size="40" maxsize="70" />
<input type="hidden" name="region_id" value="23" />
<input type="hidden" name="memb_id" value="1" />
<input type="hidden" name="sport_id" value="1" />
<input type="submit" name="submit" value="Add Club" />
</form>';
~~~~~

The "clubs" table shows in mysql along with Flex's core-users , core-settings etc etc
The club info is added to the database but Flex disappears and a white page with the above "Access denied etc" showing. Any ideas?
What am I missing?
~~~~
Is there any way of showing the hidden folders in ftp that the pages scripts go to?
i.e. The "index.php(now renamed md thanks to htacess)/pages" folders?
 
DCSun
Administrator



Posts: 625
 
December 17, 2008 @ 3:58pm
I think your problem there might be the mysql_close function you're calling at the end. FlexCMS still needs that connection it started for the rest of the processing that happens after the page, so that would be my best guess, especially if you say the data is making it into the desired table from your query.

Regarding the pages, there's no actual folder, it's all processed through the index.php file. If you do a search for "core-Pages" you'll see the part where if the first argument in the query string is "pages", it goes and looks in the core-Pages table for one called whatever the next part is.


David


FlexCMS v3.2 Has Been Released!
 
Rory


Posts: 30
 
Spot onDecember 17, 2008 @ 7:04pm
Excellent it was the mysql_close causing that problem.

Nows heres the dooosy
how to get it showing again?
what is wrong with this please as it works quite well out of flex?

i.e. this what it should do
www.doorstep.co.uk/phpscripts/php/dropmenus.php

this is the script less the start and close <? ?> and the mysql_connect command.

//this script veiws the stored values on database

$regions = 'regions';
$clubs = 'clubs';
$sport_id = '1';


$query = "SELECT DISTINCT(region) FROM {$regions} ORDER BY region_order ASC"; // query.
$query_result = mysql_query ($query);
$num_records = @mysql_num_rows ($query_result);


if (isset($_POST['submit'])) { // Handle the form.

$st = $_POST['st'];

if ($_POST['region'] != "") {
if ($_POST['county'] != "") {
$co = $_POST['county'];
$MD_error_co_txt = "";
} else {
$co = FALSE;
$MD_error_county = "*";
$MD_error_co_txt = "Select a county<br>";
}
} else {
$co = FALSE;
$MD_error_county = "*";
$MD_error_co_txt = "Select a county<br>";
}

} // END SUBMIT FORM


?>
<script language="javascript" src="js/chainedselects.js">

</script>
<script type="text/javascript">
//var hide_empty_list=true; //uncomment this line to hide empty selection lists

var disable_empty_list=true; //uncomment this line to disable empty selection lists

addListGroup("place", "place-region");

addOption("place-region", "Select a region", "", "", 1); //Empty starter option
<?php
while ($row = mysql_fetch_array($query_result, MYSQL_NUM)) {
echo "addList(\"place-region\", \"{$row[0]}\", \"{$row[0]}\", \"{$row[0]}\"); ";

echo "addOption(\"{$row[0]}\", \"Select county\", \"\", 1); "; //Empty option

$query = "SELECT region_id, county FROM {$regions} WHERE region='$row[0]'"; // query.
$query_results = mysql_query ($query);
$num_county = @mysql_num_rows ($query_results);

if ($num_county == "0") {
} else {
while ($county = mysql_fetch_array($query_results, MYSQL_NUM)) {
echo "addOption(\"{$row[0]}\", \"{$county[1]}\", \"{$county[0]}\"); ";
}
}
}
?>
</script>

<body onload="initListGroup('place', document.forms[0].region, document.forms[0].county, 'cs')">

<form action="dropmenus.php" method="post">

<table><tr>
<td>Select area: </td>
<td><select name="region" style="width:160px;"></select></td>
<td><select name="county" style="width:160px;"></select></td>
<td><input type="button" value="Reset" onclick="resetListGroup('place')">

</tr></table>
<input type="submit" name="submit" value="Clubs in County">
</form>

<?php

$query = "SELECT club_id, name FROM {$clubs} WHERE region_id='$co' AND sport_id='$sport_id' ORDER BY name ASC"; // query.
$query_result = mysql_query ($query);
$countid="1";

?><script language="JavaScript">

<!-- hide contents from old browsers

var Cost;

function tally()
{
Cost = 0;
<?php while ($club = mysql_fetch_array($query_result, MYSQL_NUM)) {
echo "if (document.form.count{$countid}.checked) { Cost = Cost + 1; }
";
$countid++;
}
?>

document.form.Total.value = "" + Cost;
document.form.Total2.value = "" + Cost;

}

//-->

</script>
<form action="dropmenus.php" method="post" name="form">
<?php if (isset($MD_error)) echo $MD_error;

$query = "SELECT club_id, name FROM {$clubs} WHERE region_id='$co' AND sport_id='$sport_id' ORDER BY name ASC"; //query.
$query_results = mysql_query ($query);
$num_clubs = @mysql_num_rows ($query_results);

$query = "SELECT county FROM {$regions} WHERE region_id='$co'";
$result = @mysql_query ($query); // Run the query.
$regiontxt = mysql_fetch_array($result, MYSQL_NUM);

if ($num_clubs == "0") {
echo "There are no clubs listed in the database for this region.<p>";
} else {
$countid="1";
$numsplit = ceil($num_clubs / 3);
$numsplit2 = $numsplit * 2;
echo "<b>{$num_clubs} clubs listed within the {$regiontxt[0]} region.</b><p>
Total <INPUT TYPE=\"text\" id=\"Total\" value=\"0\" size=\"2\"><p>
<TABLE cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\"><tr><td align=\"left\" vAlign=\"top\">";
while ($clubs = mysql_fetch_array($query_results, MYSQL_NUM)) {
echo "<input name=\"club[]\" type=\"radio\" id=\"count{$countid}\" value=\"{$clubs[0]}\" onClick=\"tally()\">{$clubs[1]}<br>";
if ($countid == $numsplit OR $countid == $numsplit2) {
echo "</td><td align=\"left\" vAlign=\"top\">";
}
$countid++;
}
echo "</td></tr></table><br>Total <INPUT TYPE=\"text\" id=\"Total2\" value=\"0\" size=\"2\"><p><input type=\"submit\" name=\"submit\" value=\"Select and go to Club\">
</form>
";
}
~~~~~~~~~~~
All I can say is many many thanks and if you get this one to work well Happy xmas may all your pressies be big 'uns
Cheers
R
 

Last Edit: December 17, 2008 @ 7:07pm by Rory
DCSun
Administrator



Posts: 625
 
December 17, 2008 @ 9:09pm
I don't think I have enough to go on there. What's the error message and/or problem you're having with it in a page? Can I see it somewhere in action in a FlexCMS page?

One thing that stands out is the form actions, those would definitely need to be changed for it to work within a FlexCMS page. If it's just a straight page with nothing else in the query string, you can replace
Code

<form action="dropmenus.php" method="post">
with
Code

<form action="'.$MainURL.$QSData.'" method="post">


You'll also need to adjust the JavaScript source URLs, because the FlexCMS query string with slashes will confuse it for folders and those will fail. So this
Code

<script language="javascript" src="js/chainedselects.js">
could be changed to
Code

<script language="javascript" src="'.$BaseURL.'/js/chainedselects.js">
if the "js" folder is at the same level as the FlexCMS installation.

If that doesn't solve it for you I'm going to need more information.


David


FlexCMS v3.2 Has Been Released!
 
Rory


Posts: 30
 
Error is the yellow triangle ..Error on page.. in bottom barDecember 18, 2008 @ 9:26am
http://www.mydivision.co.uk/md/pages/dropmenus.php and
http://www.mydivision.co.uk/md/pages/dropmenus.php.html (include your MAIN and Baseurl changes) Please check out what happens when you click on "Clubs in County".
I've made another copy in flex without the post changes and to me seems to go forward better? (the js link has been changed to your script above)
http://www.mydivision.co.uk/md/pages/dropmenus2.php.html

You can compare with the working version
http://www.doorstep.co.uk/phpscripts/php/dropmenus.php
These links show what I get at the moment in flex. The page comes up but with no database in them.

As you can see from the url's I haven't deleted the extra cosmetic .html in the script yet. Not that I think that makes any difference as it still comes up the same without the .html

As for the folders, the js folder is at the same level as the templates and languages folders.
Once again thanks for your support
R
 

Last Edit: December 18, 2008 @ 9:55am by Rory
DCSun
Administrator



Posts: 625
 
December 19, 2008 @ 11:55am
The form post address portion is just HTML at the moment (outside the PHP tags in your script), so you'll need to either a) hard code that URL, or b) move that inside PHP tags and change it to a print or echo statement.

There also seems to be a JavaScript issue there now, with the "initListGroup" function you're calling when the page loads. I don't see that defined anywhere in the page, and the JavaScript file being included doesn't look to be there anywhere now. Maybe you removed it trying to fix that, part I'm not sure.

David


FlexCMS v3.2 Has Been Released!
 
Rory


Posts: 30
 
re: js file December 19, 2008 @ 9:29pm
Yep the js folder went walkabout and I dont know how or why? However it is now back in place if you would like to recheck?
Many thanks
R
 
DCSun
Administrator



Posts: 625
 
December 19, 2008 @ 9:38pm
I don't see any changes there. The form post URL is still wrong because it's not in a section being processed as PHP code (or just hard code the URL of that page in there if you'd prefer).

I also don't see the <script language="javascript" src="js/chainedselects.js"> or anything similar in there that would call the required external JavaScript code.


David


FlexCMS v3.2 Has Been Released!
 

Pages:  1  [2]  

Post Message 




Try & Buy FeedForAll - Easy to use RSS Feed Creator - great for iTunes users!

MEMBERS




All Contents, Code, Scripts and Technologies Copyright 2003-2009 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.15290 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS