Jump to content

Greywacke

Members
  • Posts

    510
  • Joined

  • Last visited

Everything posted by Greywacke

  1. hi there i have the following xml which needs parsing... <?xml version="1.0" encoding="utf-8"?><root> <lvdk akid="267" ak="Requirement" kw="0.075"> <lvdv avid="267" av="Purchasing a new phone system to save costs" vw="8.000"/> </lvdk> <lvdk akid="279" ak="Extentions" kw="0.250"> <lvdv avid="279" av="Less than 5" vw="0.200"/> <lvdv avid="280" av="5 to 10" vw="0.500"/> <lvdv avid="281" av="11 to 20" vw="1.000"/> </lvdk></root> then sofar i have the following piece of script which does the parsing once the xml is received: // load attribute keys & weighting / 1, containing attribute values & weighting / 10 var lvdk = xmldoc.getElementsByTagName("lvdk"); for (var k = 0; k < lvdk.length; k++) { var i = 0; var arr = new Array(); for (var v = 0; v < lvdk[k].attributes.length; v++) { arr[v] = lvdk[k].attributes[v].value; } for (var v = lvdk[k].attributes.length; v < lvdk[k].childNodes.length; v++) { var lvd = lvdk[k].childNodes[v]; arr[k][v] = new Array(); if (lvd.nodeName == "lvdv" && lvd.attributes) { for (var i = 0; i < lvd.attributes.length; i++) { arr[k][v][i] = lvd.attributes[i].value; } } } salert(arr); //getlvds(arr); } salert displays the array on my page, yet the array does not contain the rest of the <lvdv> tags and their properties from the xml, in a multidimentional array... it just populates with the attributes of <lvdk> can anybody see what is wrong with this block of code, and why it does not parse the rest of the xml document above? the array returned should look like follows: '0' => "267" '1' => "Requirement" '2' => "0.075" '3' .. '0' => "267" '1' => "Purchasing a new phone system to save costs" '2' => "8.000" and '0' => "279" '2' => "Extentions" '3' => "0.250" '3' .. '0' => "279" '1' => "Less than 5" '2' => "0.200" '4' .. '0' => "280" '1' => "5 to 10" '2' => "0.500" '5' .. '0' => "281" '1' => "11 to 20" '2' => "1.000" as there are two instances of the lvdk tag... somebody please help????
  2. unfortunately not that clear (submits and reloads the js error log once submitting to the new page and i can hardly read in a splitsecond what displays...) but think i am going to make the function temporarily return with false every time, just to see what is going on, on monday... thanks for the tip justsomeguy ^^ ps: will respond here with results
  3. hi there, the following validation function is no longer working - it is supposed to halt submission if any of the conditions met, evaluates to false. function validate(frm) { var selcfg = false; var selunq = false; var selnam = frm.text_formname.value; var selarr = new Array(frm.text_formurls.value.split("|")); var selurl = true; for (var i = 0; i < frm.list_copyfrom.options.length; i++) { if (frm.list_copyfrom.options[i].selected) { selcfg = true; break; } } for (var i = 0; i < frm.list_copyfrom.options.length; i++) { if (selnam.toLowerCase()==frm.list_copyfrom.options[i].text.toLowerCase()) { selunq = true; break; } } for (var i = 0; i < selarr.length; i++) { var urlregex = new RegExp("^(http://|https://){1}([0-9A-Za-z]+.)"); if (!urlregex.test(selarr[i])) { selurl = false; } } if (!selcfg) { alert("At least one form needs torbe selected to copy from."); frm.list_copyfrom.focus(); return false; } if (frm.menu_formservice.selectedIndex < 1) { alert("Please select a service forrthe new form configuration to use."); frm.menu_formservice.focus(); return false; } if (frm.text_formname.value.length < 5) { alert("Please enter a formnamerlonger than 4 chars in length."); frm.text_formname.focus(); return false; } if (selunq) { alert("Please enter a form name whichris unique regardless of casing."); frm.text_formname.focus(); return false; } if (frm.text_formurls.value=="") { alert("All url's specified need torbe valid, including protocol."); frm.text_formurls.focus(); return false; } if (!sellurl) { alert("All url's specified need torbe valid, including protocol."); frm.text_formurls.focus(); return false; } if (frm.menu_copyfrmcfg1.selectedIndex < 1) { alert("Please select a Form Configuration Dataset!"); frm.menu_copyfrmcfg1.focus(); return false; } if (frm.menu_copyfrmcfg2.selectedIndex < 1) { if (!confirm("Certain to populate Fields Requested manually?")) { frm.menu_copyfrmcfg2.focus(); return false; } } if (frm.menu_copyfrmcfg3.selectedIndex < 1) { if (!confirm("Certain to populate Field Translations manually?")) { frm.menu_copyfrmcfg3.focus(); return false; } } if (frm.menu_copyfrmcfg4.selectedIndex < 1) { if (!confirm("Certain to populate Form Extentions manually?")) { frm.menu_copyfrmcfg4.focus(); return false; } } if (frm.menu_copyfrmcfg5.selectedIndex < 1) { if (!confirm("Certain to populate Get Expected Values manually?")) { frm.menu_copyfrmcfg5.focus(); return false; } } return true;} however - it does not behave as expected. this "wizard" is on an htaccess protected .php page, the contents of which are as follows. <?phpinclude("includes/content/performatix.php");$echo = "";if (isset($_POST["list_copyfrom"]) && isset($_POST["menu_formservice"]) && isset($_POST["text_formname"])) { // request copy headers $copyfrom = $_POST["list_copyfrom"]; $formservice = $_POST["menu_formservice"]; $formname = $_POST["text_formname"]; $formurls = $_POST["text_formurls"]; $formid = 0; // request copy subsets $copyfrmcfg = array(6); $copyfrmcfg[1] = intval($_POST["menu_copyfrmcfg1"]); $copyfrmcfg[2] = intval($_POST["menu_copyfrmcfg2"]); $copyfrmcfg[3] = intval($_POST["menu_copyfrmcfg3"]); $copyfrmcfg[4] = intval($_POST["menu_copyfrmcfg4"]); $copyfrmcfg[5] = intval($_POST["menu_copyfrmcfg5"]); // process copy subsets if ($copyfrmcfg[1]>0) { // Copy Form Configuration Datasets (Creates $formid required in fieldsets below) $tsql2 = "INSERT INTO 32_webformconfigs (bigint_FormService, tinyint_FormDefault, text_FormName, text_FormWebLocation, text_FormLogo, text_WebFormTAFUrl, text_WebFormTAFImage, text_FormMailerFromName, text_FormMailerFromAddress, text_FormHandlerInclude, text_Redirect, tinyint_GetMethod, text_LoadingAnimation, text_ElementPrefix, text_ElementSuffix) SELECT ".$formservice." AS bigint_FormService, tinyint_FormDefault, "".mysql_real_escape_string($formname)."" AS text_FormName, text_FormWebLocation, text_FormLogo, text_WebFormTAFUrl, text_WebFormTAFImage, text_FormMailerFromName, text_FormMailerFromAddress, text_FormHandlerInclude, text_Redirect, tinyint_GetMethod, text_LoadingAnimation, text_ElementPrefix, text_ElementSuffix FROM 32_webformconfigs WHERE bigint_FormID = ".$copyfrmcfg[1].";"; $result2 = mysql_query_errors($tsql2, $conn, __FILE__, __LINE__); $formid = mysql_insert_id($conn); } if ($copyfrmcfg[2]>0 && $formid > 0) { // Copy Fields Requested (Fields Requested, requires formid from first fieldset) $tsql3 = "INSERT INTO 33_webformdetails (bigint_FormID, text_DetailDescription, text_DetailValue) SELECT ".$formid." AS bigint_FormID, text_DetailDescription, text_DetailValue FROM 33_webformdetails WHERE bigint_FormID = ".$copyfrmcfg[2]." AND text_DetailDescription = "FIELD";"; $result3 = mysql_query_errors($tsql3, $conn, __FILE__, __LINE__); } elseif ($copyfrmcfg[3]>0 && $formid > 0) { // Copy Field Translations (Field Translation, requires formid from first fieldset) $tsql4 = "INSERT INTO 33_webformdetails (bigint_FormID, text_DetailDescription, text_DetailValue) SELECT ".$formid." AS bigint_FormID, text_DetailDescription, text_DetailValue FROM 33_webformdetails WHERE bigint_FormID = ".$copyfrmcfg[2]." AND text_DetailDescription = "TRANS";"; $result4 = mysql_query_errors($tsql4, $conn, __FILE__, __LINE__); } elseif ($copyfrmcfg[4]>0 && $formid > 0) { // Copy Form Extentions (vTiger/Leads360 Population, requires formid from first fieldset) $tsql5 = "INSERT INTO 33_webformdetails (bigint_FormID, text_DetailDescription, text_DetailValue) SELECT ".$formid." AS bigint_FormID, text_DetailDescription, text_DetailValue FROM 33_webformdetails WHERE bigint_FormID = ".$copyfrmcfg[2]." AND (text_DetailDescription = "VTIGR OR text_DetailDescription = "L360F");"; $result5 = mysql_query_errors($tsql5, $conn, __FILE__, __LINE__); } elseif ($copyfrmcfg[5]>0 && $formid > 0) { // Copy Get Expected Date (Variable Name & Variable Values & Offsets, requires formid from first fieldset) $tsql6 = "INSERT INTO 33_webformdetails (bigint_FormID, text_DetailDescription, text_DetailValue) SELECT ".$formid." AS bigint_FormID, text_DetailDescription, text_DetailValue FROM 33_webformdetails WHERE bigint_FormID = ".$copyfrmcfg[2]." AND (text_DetailDescription = "GEDAT OR text_DetailDescription = "GEDVO");"; $result6 = mysql_query_errors($tsql6, $conn, __FILE__, __LINE__); } // if errors print them in formatted text if (count($GLOBALS["sql"])) { $echo = "<pre>".print_r($GLOBALS["sql"],true)."</pre>"; } else { header('Location: http://www.performatix.co/production/1000.php'); }}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Form Config Wizard</title><script language="javascript"><!--// above function goes herefunction loadformconfigs(frm) { var opt = new Array(); var sel = frm["list_copyfrom"]; frm.menu_copyfrmcfg1.options.length = 1; frm.menu_copyfrmcfg2.options.length = 1; frm.menu_copyfrmcfg3.options.length = 1; frm.menu_copyfrmcfg4.options.length = 1; frm.menu_copyfrmcfg5.options.length = 1; for (var i = 0; i < sel.options.length; i++) { opt[i] = new Array(); for (var o = 1; o <= 5; o++) { opt[i][o] = document.createElement("option"); if (sel.options[i].selected) { var to = frm["menu_copyfrmcfg"+o]; //alert(to.name); opt[i][o] = document.createElement("option"); opt[i][o].text = sel.options[i].text; opt[i][o].value = sel.options[i].value; opt[i][o].selected = false; try { to.add(opt[i][o], null); // standards compliant; doesn't work in IE } catch (ex) { to.add(opt[i][o]); // IE only } } } }}//--!></script></head><body><?php echo $echo; ?><form action="" method="post" enctype="multipart/form-data" name="frmwiz" onsubmit="return validate(this);"><fieldset><legend><strong>Required Form Configuration Values</strong></legend><?php$tsql0 = "SELECT * FROM 32_webformconfigs WFC ORDER BY WFC.bigint_FormService, WFC.bigint_FormID;";$result0 = mysql_query_errors($tsql0, $conn, __FILE__, __LINE__);?><label for="list_copyfrom"><strong>Copy From: </strong> <select name="list_copyfrom" id="list_copyfrom" multiple="multiple" size="10" style="width: 256px;" onmouseup="return loadformconfigs(this.form);"><?phpif ($result0) { while ($row = mysql_fetch_assoc($result0)) { echo "<option value="".$row["bigint_FormID"]."">".$row["text_FormName"].(($row["tinyint_FormDefault"]==1)?" (Default)":"")."</option>rn"; } mysql_free_result($result0);}?></select></label><br /><br/><?php$tsql1 = "SELECT * FROM 2_servicescatalogue SC ORDER BY SC.bigint_ServiceID ASC;";$result1 = mysql_query_errors($tsql1, $conn, __FILE__, __LINE__);?><label for="menu_formservice"><strong>For Service: </strong> <select name="menu_formservice" id="menu_formservice" size="1" style="width: 256px;"><option value=""></option><?phpif ($result0) { while ($row = mysql_fetch_assoc($result1)) { echo "<option value="".$row["bigint_ServiceID"]."">".$row["text_ServiceDescription"]."</option>rn"; } mysql_free_result($result0);}?></select></label><br/><br/><label for="text_formname"><strong>For Form Name: </strong> <input name="text_formname" id="text_formname" type="text" value="" style="width: 256px;" /></label><br/><br/><label for="text_formurls"><strong>From URL's ( | delimited): </strong> <input name="text_formurls" id="text_formurls" type="text" value="" style="width: 256px;" /></label></fieldset> <br/><fieldset><legend><strong>Form Configuration Datasets</strong> (Creates <em>$formid</em> required in fieldsets below):</legend><label for="menu_copyfrmcfg1">Base Upon: <select name="menu_copyfrmcfg1" id="menu_copyfrmcfg1" size="1" style="width: 256px; height: 18px;"><option value="0"><-- MANUAL POPULATION --></option></select></label></fieldset> <br/><fieldset><legend><strong>Fields Requested</strong> (Requires <em>$formid</em> from <b>Form Configuration Datasets</b>):</legend><label for="menu_copyfrmcfg2">Base Upon: <select name="menu_copyfrmcfg2" id="menu_copyfrmcfg2" size="1" style="width: 256px; height: 18px;"><option value="0"><-- MANUAL POPULATION --></option></select></label></fieldset> <br/><fieldset><legend><strong>Field Translations</strong> (Requires <em>$formid</em> from <b>Form Configuration Datasets</b>):</legend><label for="menu_copyfrmcfg3">Base Upon: <select name="menu_copyfrmcfg3" id="menu_copyfrmcfg3" size="1" style="width: 256px; height: 18px;"><option value="0"><-- MANUAL POPULATION --></option></select></label></fieldset> <br/><fieldset><legend><strong>Form Extentions</strong> (Requires <em>$formid</em> from <b>Form Configuration Datasets</b>):</legend><label for="menu_copyfrmcfg4">Base Upon: <select name="menu_copyfrmcfg4" id="menu_copyfrmcfg4" size="1" style="width: 256px; height: 18px;"><option value="0"><-- MANUAL POPULATION --></option></select></label></fieldset> <br/><fieldset><legend><strong>Get Expected Values</strong> (Requires <em>$formid</em> from <b>Form Configuration Datasets</b>):</legend><label for="menu_copyfrmcfg">Base Upon: <select name="menu_copyfrmcfg5" id="menu_copyfrmcfg5" size="1" style="width: 256px; height: 18px;"><option value="0"><-- MANUAL POPULATION --></option></select></label></fieldset> <br/><input name="btn_submit" type="submit" value="Submit" /><input name="btn_reset" type="reset" value="Reset" /></form></body></html> i cannot see how or why the function has stopped working and as result not halting the form submission on error detection anymore. sincerely, Pierre du Toit. 1000.php
  4. ah i discovered the issue it was in the outer SUBSTRING_INDEX when text_EnquiryRequirement is selected - there is no comma before the delimiter of ' = '! the code has been updated as follows - and now works perfectly! SELECT IFNULL(S.text_OnePageData, ";;") AS text_OnePageData, PFX2.text_OnePageID AS text_ContactID, (PFX1.bigint_LeadID + 11001000) AS bigint_EnquiryID, PFX0.text_ConsumerName AS text_EnquiryFullName, PFX2.text_Duplicates AS text_EnquiryDuplicates, PFX0.text_ConsumerCity AS text_EnquiryCityTown, R.text_RegionDescription AS text_EnquiryRegion, PFX0.text_ConsumerCity AS text_EnquiryZip, CONCAT_WS( ' ', SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',1),' = ',-1), SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',2),' = ',-1) ) AS text_EnquiryMakeModel, SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',3),' = ',-1) AS text_EnquiryYear, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',-5),'<br />',1),' = ',-1) AS text_EnquiryRequirement, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',-8),'<br />',1),' = ',-1) AS text_EnquiryBudget, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',-7),'<br />',1),' = ',-1) AS text_EnquiryFitment, IF( SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',4),' = ',1)="Accessories", SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',4),' = ',-1), "" ) AS text_EnquiryAccessories, PFX1.text_LeadMessage AS text_EnquiryComments, PFX0.text_ConsumerPhone AS text_EnquiryPhone, PFX0.`text_ConsumerE-Mail` AS text_EnquiryEmail, PFX1.timestamp_ExpectedBy AS text_EnquiryExpectedFitmentBy FROM performatix.5_suppliers S LEFT JOIN performatix.19_consumers PFX0 ON (PFX0.`text_ConsumerE-Mail` = "jaap@performatix.net") LEFT JOIN performatix.25_serviceleads PFX1 ON (PFX0.bigint_ConsumerID = PFX1.bigint_ConsumerID) LEFT JOIN 27_leadssent PFX2 ON (PFX1.bigint_LeadID = PFX2.bigint_LeadID AND PFX2.bigint_SupplierID = S.bigint_SupplierID) LEFT JOIN 1_regions R ON (PFX0.bigint_ConsumerRegion = R.bigint_RegionID) WHERE S.bigint_SupplierID = 192 ORDER BY bigint_EnquiryID DESC LIMIT 1; cheers!
  5. hi all, i am attempting to debug the following query, but there is little success. the substring_indexes are set so, due to only one substring that is not always there (accessories). however, i cannot see a substring_index with an invalid parameter count, as this error specifies... SELECT IFNULL(S.text_OnePageData, ";;") AS text_OnePageData, PFX2.text_OnePageID AS text_ContactID, (PFX1.bigint_LeadID + 11001000) AS bigint_EnquiryID, PFX0.text_ConsumerName AS text_EnquiryFullName, PFX2.text_Duplicates AS text_EnquiryDuplicates, PFX0.text_ConsumerCity AS text_EnquiryCityTown, R.text_RegionDescription AS text_EnquiryRegion, PFX0.text_ConsumerCity AS text_EnquiryZip, CONCAT_WS( ' ', SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',1),' = ',-1), SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',2),' = ',-1) ) AS text_EnquiryMakeModel, SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',3),' = ',-1) AS text_EnquiryYear, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',-6),'<br />',1)' = ',-1) AS text_EnquiryRequirement, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',-9),'<br />',1),' = ',-1) AS text_EnquiryBudget, SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',-8),'<br />',1),' = ',-1) AS text_EnquiryFitment, IF( SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',4),' = ',1)="Accessories", SUBSTRING_INDEX(SUBSTRING_INDEX(PFX1.text_LeadAttributes,'<br />',4),' = ',-1), "" ) AS text_EnquiryAccessories, PFX1.text_LeadMessage AS text_EnquiryComments, PFX0.text_ConsumerPhone AS text_EnquiryPhone, PFX0.`text_ConsumerE-Mail` AS text_EnquiryEmail, PFX1.timestamp_ExpectedBy AS text_EnquiryExpectedFitmentBy FROM performatix.5_suppliers S LEFT JOIN performatix.19_consumers PFX0 ON (PFX0.`text_ConsumerE-Mail` = "jaap@performatix.net") LEFT JOIN performatix.25_serviceleads PFX1 ON (PFX0.bigint_ConsumerID = PFX1.bigint_ConsumerID) LEFT JOIN 27_leadssent PFX2 ON (PFX1.bigint_LeadID = PFX2.bigint_LeadID AND PFX2.bigint_SupplierID = S.bigint_SupplierID) LEFT JOIN 1_regions R ON (PFX0.bigint_ConsumerRegion = R.bigint_RegionID) WHERE S.bigint_SupplierID = 192 ORDER BY bigint_EnquiryID DESC LIMIT 1; if somebody can see what is causing this error #1582 - please let me know on which line it is! sincerely, Pierre du Toit.
  6. ok - success at last! seeing as jquery is not compliant with the version of joomgallery used, it had to be done in a cross-browser compliant, oldschool flavour, javascript. <script language="javascript"><!--window.onload = function(){ // add to onload of document var q = "option=com_joomgallery&view=category&catid=3&Itemid=3"; // the querystring to check for if (location.search.indexOf(q)>=0) { // if querystring matches eg. valid page var clicky = document.createEvent("HTMLEvents"); // create event object clicky var targetElement = document.getElementsByClassName('jg_catelem_photo'); // get target element clicky.initEvent("click", true, true); // initiate event targetElement[0].dispatchEvent(clicky); // dispatch event targetElement[0].click(); // trigger click on link }};//--></script> this script, which is located in the body element after the elements to click have loaded, works in the following browsers: CHROME 23.0.1271.97 mFIREFOX 17.0.1SAFARI 5.1.7INTERNET EXPLORER 9.0.8112.16421 (64-bit)OPERA 12.11 if one is encountered where it does not work - please let me know, in this thread (at least it has been updated to work accross all 5 major browsers update versions and tested - with only ie9 being the exception)
  7. ok, after a quick google - i have come up with the following solution found at http://stackoverflow...it-were-clicked <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script language="javascript"> <!-- var q = "option=com_joomgallery&view=category&catid=3&Itemid=3"; // the querystring to check for $(document).ready(function(){ // perform onload of document if (location.search.indexOf(q)>=0) { // if querystring matches eg. valid page $("a.jg_catelem_photo[rel='lightbox[joomgallery];']").trigger('click'); // trigger jquery click on link } }); //--> </script> lets see if this works, i'll report back as soon as i know edit: unfortunately it does not, what am i doing wrong? 0o
  8. hi there again... battling a bit with this issue, the category "contact us" from the joomgallery in the following joomla page loads:http://www.gamersedg...atid=3&Itemid=3but i am however, trying to make the single image in the category, automatically clicked on page load. i know triggering this is possible with jquery - but here follows my attempt after the page is loaded: <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script language="javascript"> <!-- var q = "option=com_joomgallery&view=category&catid=3&Itemid=3"; // the querystring to check for $(document).ready(function(){ // perform onload of document if (location.search.indexOf(q)>=0) { // if querystring matches eg. valid page $(".jg_catelem_photo").trigger('click'); // trigger jquery click on link } }); //--> </script> however, it instead breaks all the loading into lightbox as would happen if a thumbnail is clicked. i need to trigger this click onload, as if the user did it - eg that the image loads within the lightbox as currently happens when you go to the url and click on the thumbnail.... how would i emulate a click, but pass the rel="lightbox[joomgallery];" attribute of the link? 0o any help - asap, would be appreciated... thanks in advance,Pierre "Greywacke" du Toit
  9. alignment was updated cross-browser, with this tiny little script // JavaScript Documentfunction relocate() {var sub = document.getElementById("more");var pagewidth = document.body.clientWidth;var gutter = (pagewidth - 959) / 2;sub.style.right = gutter + "px";sub.style.width = "170px";return true;}window.onload = function () {return relocate();}window.onresize = function () {return relocate();} this document can be viewed at http://www.greywacke.co.za/feverparties/
  10. well guess no other web developers around this festive season - thanks anyhow, decided to add a background image (jpeg) which does display. this topic is now closed! :Doh yeah, and the text shadows were left out of ie9's compatibility - it just messes around with the layout using directX filters - and it doesn't even look that good.
  11. hi there,i have a horizontal menu, with one dropdown submenu on the rightmost item, as can be seen with the screenshots.now my first problem is how do i specify through css that the dark red ul background, wraps around the li elements of the subitem, INCLUDING the bullets.also, how do i get the dark red background to stay on the menu item once the mouse is moving over the submenu items...one last thing - the submenu should be right aligned with the main menu's "More >" list item. why is it left aligned, and where would i change this?the current xhtml, and css for the entire menu structure, is as follows: <div class="menu"> <div class="quote">“Currently country's golden ticket”<br />The Times Magazine</div> <ul class="nav"> <li><a href="#">More<img src="images/dnarr.png" class="dnarr" width="9" height="9" border="0" align="middle" /></a> <ul> <li><a href="#">First-timers guide</a></li> <li><a href="#">Fever cartoon strip</a></li> <li><a href="#">Guide to Cap D'Agde</a></li> <li><a href="#">Banners and links</a></li> <li><a href="#" class="last">Contact Fever</a></li> </ul> </li> <li><a href="#">Fever in the media</a></li> <li><a href="#">Last Party</a></li> <li><a href="#">Next Party</a></li> <li><a href="#">About Fever</a></li> </ul></div> .menu { width: 790px; height: 98px; float: right;}.menu ul.nav { clear: both; font: 16px 'Verdana'; font-weight: 500; list-style: none;}.menu ul.nav li { float: right; margin-left: 5px;}.menu ul.nav a, ul.nav a:visited { padding: 5px 6px 5px 5px; display: block; text-decoration: none; color: #FFF; text-shadow: 2px 2px 2px #000000;}.menu ul.nav a:hover, ul.nav a:active, ul.nav a:focus { background: #621804; color: #FFF; text-shadow: 2px 2px 2px #000000;}.menu ul.nav li ul { display: none; position: absolute; overflow: hidden;}.menu ul.nav li:hover ul { display: block; overflow-x: hidden; background: #771d06; padding: 8px 0px 8px 0px; box-shadow: 0px 0px 136px 27px rgba(0, 0, 0, 0.21) inset;}.menu ul.nav li ul li { clear: both; font: 12px 'Verdana'; font-weight: 200; list-style: url(images/bull_linkout.png); float: right; padding: 0; margin-left: 30px;}.menu ul.nav li ul li:hover { clear: both; font: 12px 'Verdana'; font-weight: 200; list-style: url(images/bull_linkovr.png); float: right; padding: 0; margin-left: 30px;}.menu ul.nav li ul li a.last { background: transparent; }.menu ul.nav li ul li a.last:hover { background: transparent; }.menu ul.nav li ul li a { background: transparent url(images/hr_menu.png) center bottom no-repeat; padding: 10px 10px 10px 30px; margin: 0px 0px 0px -30px; width: 130px; height: 100%; color: #fff; text-decoration: none;}.menu ul.nav li ul li a:hover { background: transparent url(images/hr_menu.png) center bottom no-repeat; padding: 10px 10px 10px 30px; margin: 0px 0px 0px -30px; width: 130px; height: 100%; color: #db8f17; text-decoration: none;}.dnarr { position: relative; z-index: 60; top: -3px; left: 5px; margin: 0px 5px;}:root .dnarr {top: 2px \0/IE9;}@media not screen and (1) { /* OP 11 */.menu ul.nav li ul li {list-style: url(images/bull_linkouto.png);}.menu ul.nav li ul li:hover {list-style: url(images/bull_linkovro.png);}.dnarr {top:3px}} thanks in advance for the help - not sure how to get this down as the alignment via float is already set and only misaligns the menu items if done as suggested on the sites google returned.also, the current page can be viewed at greywacke.co.za/feverparties/ in windows internet explorer 9, mozilla firefox 8, google chrome 15, apple safari 5 or opera 11.
  12. and here is the screenshot of the page with the background and inner box-shadow on the bodycont class, which is where it is intended to be...also, this page can be viewed at http://www.greywacke.co.za/feverparties/ in windows internet explorer 9, mozilla firefox 8, google chrome 15, apple safari 5 or opera 11.
  13. i have been struggling with this for quite a while now... any suggestions? i am about to start tampering with the z-index...the html snippet is as follows: <div class="bodycont"> <div class="sidebar1"> </div> <div class="content"> <h1>Heading Here (as text H1 Chaparral Pro)<hr align="center" color="#c3c1ae" noshade size="1" width="98%" /></h1> <h2>Blah Blah (as text H2 Chaparral Pro)</h2> <p>Trebuchet MS - size 14 - Editable text in here Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p> <p>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur.</p> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p> </div> </div> and the relative css is as follows: .bodycont {background: #fffde3;box-shadow: 0px 0px 136px 27px rgba(0, 0, 0, 0.42) inset;}.content {top: 10px;float: left;width: 649px;height: 700px;color: #343434;background: inherit;}.sidebar1 {top:10px;float: right;width: 310px;height: 700px;color: #343434;background: inherit;} the document is xhtml 1.0 transitional - and supposed to work in internet explorer, mozilla firefox, google chrome and apple safari, as well as opera. the latest versions will do which seems to work quite well, only i can just get the background and box-shadow to display on the topmost elements. if i make the background of the two children transparent or none - then the bodycont class does not have any background either. how would i get the bodycont class to display it's tan color with the inner box-shadow as specified?it's acting the same in all 5 browsers, thus it is something i do not know about, but what??? the screenshot displays with the content and sidebar1 classes having the box-shadow and it displaying, but only there and not on the bodycont class as the css specifies (see second screenshot).
  14. lol nvm - misread a reference earlier to retrieving the style attributes as $parent->$style instead of $parent->getAttribute('style')
  15. ok the value returned seems to be false :(there HAS to be something wrong with the regular expression! :/ the form i am testing with is https://lmx.leads360.../web/Login.aspx - and look at the source for yourself - the element emailTextBox's topmost parent is as follows: <div id="passwordDialog" style="position:absolute;visibility:hidden;height:;width:;" class="dialog"><div id="passwordDialog_HeaderSpan" class="header"> Forgot Password </div><div id="passwordDialog_InnerSpan" class="content password"> <p>Please enter the email address you signed up with and we will send you a new login link.</p> <dl> <dt>Email:</dt> <dd><input name="emailTextBox" type="text" id="emailTextBox" class="bigtextbox" /></dd> </dl> <div class="buttons submitcancel"> <a class="submit left" id="submitPasswordRest" onclick="RequestPasswordReset();">Submit</a> <a class="cancel right" onclick="passwordDialog.Close();">Close</a> </div> </div><div id="passwordDialog_FooterSpan" class="footer"> </div></div>[/codeBOX]yet for some strange reason it is not echoing the parent styles or returning true with the following two functions (the second retrieves an array of form elements but prints the hidden field as displayed - the problem could also be in the [b]"input"[/b] case below, in the [b]switch($element[1])[/b]): [codeBOX]function ishidden($name,$html) { $str = str_get_html($html); $parent = $str->find("[name=".$name."]",0); while ($parent = $parent->parent()) { if (preg_match("/(display|visibility)\s*:\s*(none|hidden)/i",$parent->$style,$match)) { //print_r($parent); echo "style = ".$parent->$style."\n"; return $match[0]; } } return false;}function getforms($html) { /* - load form as: array( [type], [name], [value], [checked], [disabled] ); */ $ret = array(); $forms = array(); preg_match_all("/\<form [^\>]+\>.*\<\/form\>/ims", $html, $out); //print_r($out); foreach ($out[0] as $form) { array_push($forms,$form); } foreach ($forms as $form) { //echo $form."\n"; $pattern = '/<(form)(?=(?:[^>]*name="([^"]*))?)(?=(?:[^>]*action="([^"]*))?)' . '|<(input)(?=(?:[^>]*type="([^"]*))?)(?=(?:[^>]*name="([^"]*))?)(?=(?:[^>]*value="([^"]*))?)(?=(?:[^>]*checked="([^"]*))?)(?=(?:[^>]*disabled="([^"]*))?)' . '|<(textarea)(?=(?:[^>]*name="([^"]*))?)[^>]*>([^<]|<(?!\/textarea))(?=(?:[^>]*disabled="([^"]*))?)' . '|<(select)(?=(?:[^>]*name="([^"]*))?)(?=(?:[^>]*disabled="([^"]*))?)' . '|<(button)(?=(?:[^>]*name="([^"]*))?)(?=(?:[^>]*disabled="([^"]*))?)/i'; //$pattern = '/\<(form).*name="([^"]+)".*action="([^")".*\>'. // '|\<(input).*type="([^"]+)".*name="([^"]+)".*value="([^"]+)".*checked="([^"]+)".*\/\>'. // '|\<(textarea).*name="([^"]+)".*\>(.*)*\<\/textarea\>'. // '|<(select).*name="([^"]+)".*>'. // '|<(button).*name="([^"]+)".*value="([^"]+)".*>/ims'; preg_match_all($pattern, $form, $out, PREG_SET_ORDER); $out = array_non_empty_items($out); $i = 0; foreach ($out as $element) { $ret[$i] = array(); switch ($element[1]) { case "form": array_push($ret[$i], array( "type" => $element[1], "name" => $element[2], "action" => $element[3] ) ); break; case "input": array_push($ret[$i], array( "input" => $element[1], "type" => $element[2], "name" => $element[3], "value" => $element[4], "checked" => ((($element[2]=="radio"||$element[2]=="checkbox")?true:false)?"true":"false"), "disabled"=> (($element[2]=="radio"||$element[2]=="checkbox")?(($element[6]=="true"||$element[6]=="disabled")?true:false)($element[5]=="true"||$element[5]=="disabled")?true:false))||(ishidden($element[3],$form))?"true":"false" ) ); print_r(ishidden($element[3],$form)); break; case "textarea": array_push($ret[$i], array( "input" => $element[1], "name" => $element[2], "value" => $element[3], "disabled"=> ($element[4]=="true"||$element[4]=="disabled"||ishidden($element[2],$form))?"true":"false" ) ); break; case "select": array_push($ret[$i], array( "input" => $element[1], "name" => $element[2], "value" => getoption($element[2],$form), "disabled"=> ($element[4]=="true"||$element[4]=="disabled"||ishidden($element[2],$form))?"true":"false" ) ); break; case "button": array_push($ret[$i], array( "input" => $element[1], "name" => $element[2], "value" => $element[3], "disabled"=> ($element[4]=="true"||$element[4]=="disabled"||ishidden($element[2],$form))?"true":"false" ) ); break; } $i++; } } return $ret;}[/codeBOX]
  16. hi, yet another regex issue, meh -_-to match the following PCRE (or similar) within the style attribute of a parent element to an element passed by name, using the preg_match function in line 7./display\s*:\s*none|visibility[\s]*:[\s]*hidden/inow to my knowledge, that will match either display:none, display :none, display : none or display: none as well as either visibility:hidden, visibility :hidden, visibility : hidden or visibility: hidden.the function below uses the extracted form html section and the dom is parsed using the PHP Simple HTML DOM Parser API Class. function ishidden($name,$html) {$str = str_get_html($html);//print_r($str);$parent = $str->find("[name=".$name."]",0);//print_r($parent);while ($parent = $parent->parent()) { if (preg_match("/display\s*:\s*none|visibility[\s]*:[\s]*hidden/i",$parent->$style,$match)) { return $match[0]; }}return false;} somebody please help asap on this issue, i have a deadline to meet.
  17. ah i get it now... the referer is not the form (this is where it identifies the form from). hmmm, wrote a query to identify the form by the form id now passed in the leads. also put a copy of the logo on the intellisource domain for download by the form. this issue is now officially sorted! the logo displays and no images "break" the https anymore...
  18. hi there,the following piece of php was recommended on the one accurately targeted site out of very few that were resulting from my search. <?php/*SURVEY MANAGER FORM GENERATORVersion 2.2.5*/function encrypt($string, $key) { $result = ''; for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1); $char = chr(ord($char)+ord($keychar)); $result.=$char; } return base64_encode($result);}function decrypt($string, $key) { $result = ''; $string = base64_decode($string); for($i=0; $i<strlen($string); $i++) { $char = substr($string, $i, 1); $keychar = substr($key, ($i % strlen($key))-1, 1); $char = chr(ord($char)-ord($keychar)); $result.=$char; } return $result;}// load installation db by passing encrypted include path in querystring$key = "JapieMySkapie101";$qs_encr = explode('?',$_SERVER['QUERY_STRING'],2);$qs_decr = explode('&',decrypt($qs_encr[0], $key),2);//print_r($qs_decr);$p = $qs_decr[0]; // installation path$q = $qs_decr[1]; // consumer survey idif (file_exists($p)) include($p); // call global includefunction getquestions($surveytype,$consumerid,$leadid=0,$refid=0) { global $conn; $sql = "SELECT * FROM 22_surveyquestions LEFT JOIN 23_surveyoptions ON ( 22_surveyquestions.bigint_QuestionID = 23_surveyoptions.bigint_QuestionID ) WHERE 22_surveyquestions.bigint_TypeID = ".$surveytype." ORDER BY 22_surveyquestions.smallint_SortOrder ASC, 23_surveyoptions.smallint_SortOrder ASC;"; $result = mysql_query_errors($sql, $conn , __FILE__ , __LINE__ ); $html = "<form id=\"form_survey\" name=\"form_survey\" method=\"post\" accept-charset=\"UTF-8\" action=\"survey_handler.php\" onsubmit=\"return valform(this);\">". "<input name=\"consumersurveyid\" id=\"consumersurveyid\" type=\"hidden\" value=\"".$GLOBALS["q"]."\" />". "<input name=\"includepath\" id=\"includepath\" type=\"hidden\" value=\"".$GLOBALS["p"]."\" />\n"; $q = array(); $q[0] = ""; $q[1] = ""; $shtml = ""; $i = 0; if ($result) { while ($row = mysql_fetch_array($result)) { $q[1] = $row["text_QuestionContent"]; if ($q[0] != $q[1]) { $i++; $n = 0; if ($q[0] != "") { $html .= " </p>\n"; } $q[0] = $q[1]; $html .= " <p><label for=\"radio_answer_".$i."_1\"><strong>".$i."). ".$q[1]."</strong></label></p>\n". " <p>\n"; $shtml = ""; } $n++; $a = xmlentities($row["text_OptionContent"]); $sid = 0; switch ($row["tinyint_OptionType"]) { case 1: // radio select + text input $html .= " <input type=\"radio\" name=\"group_".$i."\" id=\"radio_".$i."_".$n."\" value=\"".$row["bigint_OptionID"].";.0\" onfocus=\"document.form_survey.text_".$row["bigint_OptionID"].".focus();\" />". "<label for=\"radio_".$i."_".$n."\" > ".$a."<br /> ". "<input type=\"text\" name=\"text_".$row["bigint_OptionID"]."\" id=\"text_".$row["bigint_OptionID"]."\" value=\"\" /></label><br />\n"; break; case 2: // checkbox $html .= " <input type=\"checkbox\" name=\"group_".$i."[]\" id=\"check_".$i."_".$n."\" value=\"".$row["bigint_OptionID"].";.0\" />". "<label for=\"check_".$i."_".$n."\" > ".$a."</label><br />\n"; break; case 3: // checkbox + text input $html .= " <input type=\"checkbox\" name=\"group_".$i."[]\" id=\"check_".$i."_".$n."\" value=\"".$row["bigint_OptionID"].";.0\" onfocus=\"document.form_survey.text_".$row["bigint_OptionID"].".focus();\" />". "<label for=\"check_".$i."_".$n."\" > ".$a."<br /> ". "<input type=\"text\" name=\"text_".$row["bigint_OptionID"]."\" id=\"text_".$row["bigint_OptionID"]."\" value=\"\" /></label><br />\n"; break; case 4: // supplier names listing radio $sql0 = "SELECT 5_suppliers.bigint_SupplierID, 5_suppliers.text_SupplierName FROM 5_suppliers LEFT JOIN ( 27_leadssent, 13_prospectleadsent ) ON ( 5_suppliers.bigint_SupplierID = 27_leadssent.bigint_SupplierID AND 5_suppliers.bigint_SupplierID = 13_prospectleadsent.bigint_SupplierID ) WHERE 27_leadssent.bigint_LeadID = ".$leadid." OR 13_prospectleadsent.bigint_ProspectID = ".$refid." GROUP BY 5_suppliers.text_SupplierName;"; $result0 = mysql_query_errors($sql0, $conn , __FILE__ , __LINE__ ); if ($result0) { while ($row0 = mysql_fetch_array($result0)) { $a = $row0["text_SupplierName"]; $html .= " <input type=\"radio\" name=\"group_".$i."\" id=\"supplier_".$i."_".$n."\" value=\"".$row["bigint_OptionID"].";.".$row0["bigint_SupplierID"]."\" />". "<label for=\"supplier_".$i."_".$n."\" > ".$a."</label>". "<input type=\"hidden\" name=\"text_".$row0["bigint_SupplierID"]."\" id=\"text_".$row0["bigint_SupplierID"]."\" value=\"".$a."\" /><br />\n"; if ($n<mysql_num_rows($result0)) $n++; } } break; case 5: // supplier names listing checkbox $sql0 = "SELECT 5_suppliers.bigint_SupplierID, 5_suppliers.text_SupplierName FROM 5_suppliers LEFT JOIN ( 27_leadssent, 13_prospectleadsent ) ON ( 5_suppliers.bigint_SupplierID = 27_leadssent.bigint_SupplierID AND 5_suppliers.bigint_SupplierID = 13_prospectleadsent.bigint_SupplierID ) WHERE 27_leadssent.bigint_LeadID = ".$leadid." OR 13_prospectleadsent.bigint_ProspectID = ".$refid." GROUP BY 5_suppliers.text_SupplierName;"; $result0 = mysql_query_errors($sql0, $conn , __FILE__ , __LINE__ ); if ($result0) { while ($row0 = mysql_fetch_array($result0)) { $a = $row0["text_SupplierName"]; $html .= " <input type=\"checkbox\" name=\"group_".$i."[]\" id=\"supplier_".$i."_".$n."\" value=\"".$row["bigint_OptionID"].";.".$row0["bigint_SupplierID"]."\" />". "<label for=\"supplier_".$i."_".$n."\" > ".$a."</label>". "<input type=\"hidden\" name=\"text_".$row0["bigint_SupplierID"]."\" id=\"text_".$row0["bigint_SupplierID"]."\" value=\"".$a."\" /><br />\n"; if ($n<mysql_num_rows($result0)) $n++; } } break; default: // radio select $html .= " <input type=\"radio\" name=\"group_".$i."\" id=\"radio_".$i."_".$n."\" value=\"".$row["bigint_OptionID"].";.0\" />". "<label for=\"radio_".$i."_".$n."\" > ".$a."</label><br />\n"; } } mysql_free_result($result); } $html .= " </p>\n"; $html .= " <p><input type=\"submit\" value=\"Submit!\" /><input type=\"reset\" value=\"Reset...\" /></p>\n"; $html .= "</form>"; return array($i, $html);}if (is_numeric($q)) { // retrieve consumer survey created with cronjob $sql0 = "SELECT * FROM 21_consumersurveys LEFT JOIN ( 19_consumers, 20_surveytypes, 2_servicescatalogue, 10_serviceprospects, 25_serviceleads ) ON ( 25_serviceleads.bigint_ConsumerID = 19_consumers.bigint_ConsumerID AND ( 21_consumersurveys.bigint_ReferenceID = 10_serviceprospects.bigint_ProspectID OR 21_consumersurveys.bigint_LeadID = 25_serviceleads.bigint_LeadID) AND 21_consumersurveys.bigint_SurveyType = 20_surveytypes.bigint_SurveyID AND 25_serviceleads.bigint_ServiceID = 2_servicescatalogue.bigint_ServiceID ) WHERE 21_consumersurveys.bigint_ConsumerSurveysID = ".$q." LIMIT 0, 1;"; $result0 = mysql_query_errors($sql0, $conn , __FILE__ , __LINE__ ); if ($result0) { if ($row = mysql_fetch_array($result0)) { // initiate variables $service = $row["bigint_ServiceID"]; $consumerfullname = $row["text_ConsumerName"]; $consumeremail = $row["text_ConsumerE-Mail"]; $region = $row["bigint_ConsumerRegion"]; $attribs = $row["text_LeadAttributes"]; $attribsarr = formattribs($attribs); $surveytype = $row["text_SurveyDescription"]; $surveyq = getquestions($row["bigint_SurveyType"],$row["bigint_ConsumerID"],$row["bigint_LeadID"],$row["bigint_ReferenceID"]); $qcnt = $surveyq[0]; $surveyquestions = $surveyq[1]; $servicename = xmlentities($row["text_ServiceDescription"]); $surveyurl = "https://www.intellisource.co.za/survey.php?".$qs_encr[0]; $referer = (isset($_SERVER['HTTP_REFERER']))?$_SERVER['HTTP_REFERER']:""; $prospecting = 0; $recipient[6] = 0; $tsql0 = "SELECT * FROM 32_webformconfigs WHERE text_FormWebLocation LIKE \"".$referer."%\";"; $tresult0 = mysql_query_errors($tsql0, $conn, __FILE__, __LINE__ ); $trow0 = mysql_fetch_array($tresult0); $formid = $trow0["bigint_FormID"]; $formname = $trow0["text_FormName"]; $formlogo = $trow0["text_FormLogo"]; $formfromname = $trow0["text_FormMailerFromName"]; $formfrommail = $trow0["text_FormMailerFromAddress"]; $redirect = $trow0["text_Redirect"]; $pmail = $trow0["text_FormMailerFromAddress"]; $tafurl = $trow0["text_WebFormTAFUrl"]; $tafimg = $trow0["text_WebFormTAFImage"];?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="robots" content="none" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title><?php echo populateflags("%SURVEYHEADER%"); ?></title><script language="javascript" defer="defer"><!--function valform(form) { for (var i = 0; i < form.elements.length; i++) { var elm = form.elements[i]; var type = elm.type; var name = elm.name; var val = elm.value; var sele = false; //alert(name); switch (type) { case "radio": var q = parseInt(name.split("_")[1]); for (var n = 0; n < form[name].length; n++) { if (form[name][n].checked) { sele = true; } } if (!sele) { alert("An answer is required for question "+q+")."); form.elements[i].focus(); return false; } break; case "text": if (form.elements[i-1].checked && elm.value == "") { alert("Input text is required for checked or selected options."); form.elements[i].focus(); return false; } break; } } return true;}//--></script><style type="text/css"><!--body { background: #ffffff url('https://www.intellisource.co.za/images/mail_bg.jpg') repeat-x fixed top left;}* { margin: 0px; padding: 0px;}h1, h2, div { font: 10pt Tahoma, Verdana, Arial, Helvetica, sans-serif;}p { clear: both; margin: 12px;}a { font-weight: bold; text-decoration: none;}div.gw000 { /* container */ width: 90%; margin: 0 auto;}div.gw001 { /* header */ text-align: left; vertical-align: top;}div.gw002 { /* tools */ text-align: justify;}div.gw003 { /* data listing */ }A.gw000:hover { color: #008000;}A.gw001:hover { color: #800000;}div.gw004 { /* footer */ padding: 12px; font-size: 9pt; text-align: right; border-top: #b0b0b0 solid 1px;}div.gw005 { /* lead cost / balance */ float: left; text-align: left;}div.colleft { color: inherited; width: 65%; float: left;}div.colright { color: inherit; width: 30%; float: right;}.cleart { clear: both; margin: 12px;}.clearb { clear: both; color: #606060; margin: 12px;}input[type="text"] { margin-left: 21px; width: 260px;}//--></style></head><body><div class="gw000"> <div class="gw001"><img src="<?php echo populateflags("%LOGO%"); ?>" alt="" hspace="5" border="0" align="left" /></div> <div class="gw002"><?php echo populateflags("%SURVEYINTRO%"); ?></div> <div class="gw003"><?php echo populateflags("%SURVEYSIGNATURE%"); ?></div> <div class="gw004"><div class="gw005"><?php echo ((count($sql))?"SQL DEBUGGING INFO:<br />\n<br />\n".join("<br />\n<br />\n",$sql):""); ?></div></div></div></body></html><?php } }}?>
  19. ah thank you for your clarity there dsoneuk i did not even notice that in firebug! xDbut sadly, removing those styles from the css definitions did not do the trick :(ps: the MAIN problem all along was that the image file was defined as jpg and i had created png backgrounds for a "fading out effect" into the header background... thanks for your help though it brought me closer to the final solution!
  20. unfortunately this does not change a thing... :)how will i get a background image to display in an absolute positioned anchor, with a z-index over the scrolling menu??? 0o
  21. just had a thought - perhaps i should specify the backgrounds to the larr and rarr anchors CSS 3.0 style - and not CSS 2.1 style...noticed on the w3schools site, that the specification is in a completely different order for the shorthand 0o i believe using the border-radius declarations might have made the default.css document register as CSS 3.0 by the browse: background: #dddddd 0px -119px 1px 163px repeat-x padding-box padding-box scroll url("../images/bg_header.jpg"); this was converted from the following CSS 2.1 specification: background: #dddddd url("../images/bg_header.jpg") left bottom scroll repeat-x; will report back after testing
  22. hi there.i have the menu as follows, an include mainmenu.php, included within the div with id container. <a id="larr" href="java script:void(0);" onmouseover="scroll(0,1);" onmouseout="stop(0,1);" onmousedown="scroll(0,10);" onmouseup="stop(0,10);" title="Scroll Menu Left">«</a> <div id="cont"><span id="menu"><ul> <li<?php echo ($p==10)?" class=\"current\"":""; ?>><a href="?p=10" title="Configuration Manager" accesskey="g" tabindex="1" target="_parent">Configuration</a></li> <li<?php echo ($p==1)?" class=\"current\"":""; ?>><a href="?p=1" title="Region Manager" accesskey="r" tabindex="2" target="_parent">Regions</a></li> <li<?php echo ($p==2)?" class=\"current\"":""; ?>><a href="?p=2" title="Service Manager" accesskey="s" tabindex="3" target="_parent">Services</a></li> <li<?php echo ($p==3)?" class=\"current\"":""; ?>><a href="?p=3" title="Supplier Manager" accesskey="s" tabindex="4" target="_parent">Suppliers</a></li> <li<?php echo ($p==9)?" class=\"current\"":""; ?>><a href="?p=9" title="Price Manager" accesskey="p" tabindex="5" target="_parent">Prices</a></li> <li<?php echo ($p==11)?" class=\"current\"":""; ?>><a href="?p=11" title="Data Manager" accesskey="d" tabindex="6" target="_parent">Data</a></li> <li class="spacer"></li> <li<?php echo ($p==12)?" class=\"current\"":""; ?>><a href="?p=12" title="Consumer Manager" accesskey="c" tabindex="7" target="_parent">Consumers</a></li> <li<?php echo ($p==13)?" class=\"current\"":""; ?>><a href="?p=13" title="Survey Manager" accesskey="s" tabindex="8" target="_parent">Surveys</a></li> <li class="spacer"></li> <li<?php echo ($p==4)?" class=\"current\"":""; ?>><a href="?p=4" title="Premium Lead Manager" accesskey="p" tabindex="7" target="_parent">Premium</a></li> <li<?php echo ($p==6)?" class=\"current\"":""; ?>><a href="?p=6" title="Transaction Manager" accesskey="t" tabindex="8" target="_parent">Transactions</a></li> <li class="spacer"></li> <li<?php echo ($p==7)?" class=\"current\"":""; ?>><a href="?p=7" title="Freemium Lead Manager" accesskey="f" tabindex="9" target="_parent">Freemium</a></li> <li<?php echo ($p==8)?" class=\"current\"":""; ?>><a href="?p=8" title="Opportunity Manager" accesskey="o" tabindex="10" target="_parent">Opportunities</a></li> <li class="spacer"></li> <li<?php echo ($p==5)?" class=\"current\"":""; ?>><a href="?p=5" title="Blacklist Manager" accesskey="b" tabindex="11" target="_parent">Blacklist</a></li> <li<?php echo ($p==0)?" class=\"current\"":""; ?>><a href="?p=0" title="Documentation" accesskey="d" tabindex="12" target="_parent">Documentation</a></li> </ul></span></div> <a id="rarr" href="java script:void(0);" onmouseover="scroll(1,1);" onmouseout="stop(1,1);" onmousedown="scroll(1,10);" onmouseup="stop(1,10);" title="Scroll Menu Right">»</a> then in the stylesheet for this page, default.css i have the following css 3.0 for the rounded corners of the tabs: div#cont { position: relative; top: -18px; overflow-x: visible; overflow-y: visible; width: 100%; height: 26px;}#container span#menu { position: absolute; z-index: 50; top: 0px; left: 0px; width: 1162px; height: 26px; display: inline;}#container a#larr { position: absolute; z-index: 60; top: 119px; left: 0px; display: inline-block; height: 18px; color: #acacac; background: #DDDDDD url("../images/bg_header.jpg") left bottom scroll repeat-x; font: normal normal bolder 12px/16px 'Verdana'; text-decoration: none; padding: 5px 2px 3px; background: none; margin: 0px; cursor: default;}#container a#larr:hover { color: #808080;}#container a#rarr { position: absolute; z-index: 61; top: 119px; right: 0px; display: inline-block; height: 18px; color: #acacac; background: #DDDDDD url("../images/bg_header.jpg") left bottom scroll repeat-x; font: normal normal bolder 12px/16px 'Verdana'; text-decoration: none; padding: 5px 2px 3px; background: none; margin: 0px; cursor: default;}#container a#rarr:hover { color: #808080;}#container ul { position: relative; top: -10px; left: -26px; width: auto; height: 26px; list-style-type: none;}#container li { float: left; background: #7fc241; border-radius: 5px 5px 0px 0px; margin: 0px 2px 0px 0px; height: 26px;}#container li a { display: block; color: #ffffff; font: normal normal bolder 12px/16px 'Verdana'; text-decoration: none; padding: 5px;}#container li a:hover { text-decoration: underline;}#container li.current { float: left; background: #2d540a; border-radius: 5px 5px 0px 0px; margin: 0px 2px 0px 0px; height: 26px;}#container li.current a { display: block; color: #ffffff; font: normal normal bolder 12px/16px 'Verdana'; text-decoration: none; padding: 5px;}#container li.current a:hover { text-decoration: underline;}#container li.spacer { float: left; background: none; margin: 0px; width: 5px; height: 36px;} this is all run clientside via a defer script sessionticker.php with the following java script: var ts;var scr;var s = 0;var smlr = 0; // Scroll Menu on Larger Resolutions (1 / 0)var larr = document.getElementById("larr");var rarr = document.getElementById("rarr");if (!smlr) { window.onresize = function () { s = 0; menu.style.left = s+'px'; if (document.body.clientWidth>menu.children[0].clientWidth) { larr.style.visibility = 'hidden'; rarr.style.visibility = 'hidden'; } else { larr.style.visibility = ''; rarr.style.visibility = ''; } } window.onresize();}function scroll(dir,amt) { window.clearInterval(ts); switch (dir) { case 0: // scroll left scr = function() { if (document.body.clientWidth>menu.children[0].clientWidth) { if (s > 0) { s -= amt; if (s < 0) s = 0; menu.style.left = s+'px'; } } else { if (s > document.body.clientWidth - menu.children[0].clientWidth + larr.clientWidth) { s -= amt; if (s < document.body.clientWidth - menu.children[0].clientWidth + larr.clientWidth) s = document.body.clientWidth - menu.children[0].clientWidth + larr.clientWidth; menu.style.left = s+'px'; } } } break; case 1: // scroll right scr = function() { if (document.body.clientWidth>menu.children[0].clientWidth) { if (s < document.body.clientWidth - menu.children[0].clientWidth + larr.clientWidth) { s += amt; if (s > document.body.clientWidth - menu.children[0].clientWidth + larr.clientWidth) s = document.body.clientWidth - menu.children[0].clientWidth + larr.clientWidth; menu.style.left = s+'px'; } } else { if (s < 0) { s += amt; if (s > 0) s = 0; menu.style.left = s+'px'; } } } break; } ts = window.setInterval(scr,18);}function stop(dir,amt) { window.clearInterval(ts);} with the default setting, this scrolls the horizontal menu bar if the document body width is wider than the menu width.my problem is CSS. i need to apply the header background image to the anchors with id's larr and rarr, so the menu does not display under their z-order. how would i get - in firefox 4, a background image on a color to be defined for those two absolute positioned anchors? i've been struggling with this for the past 5 hours after googling, attempting relative positions, inline as well as inline-block displays for the anchors yet no success. not even block displays work! the larr and rarr anchors do not want to have a background applied, nor a background color - despite the position and colors being applied in the shorthand style definitions...(i do not want the horizontal menu bar to display under the z-order of the left and right arrows) please help - i am at my wits ends here!
  23. hi there,i've built this imageloader script to be plugged into webpages with the purpose of being used for image galleries (for the likes of photographers who choose to have a static webpage).the page designed by a tertiary party, is below: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- Generated by Avanquest Technology v:6.0. For information please visit: [url="http://www.v-com.com"]http://www.v-com.com[/url] --><html lang="en"><head> <title> Commitment </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css;"> <link rel="stylesheet" href="lizelle_g.css" type="text/css" media="screen,projection"> <!--// Document Style //--> <link rel="stylesheet" href="lizelle_003_p.css" type="text/css" media="screen,projection"> <!--// Page Style //--> <script src="lizelle_g.js" type="text/javascript" language="JavaScript1.2"></script> <!--// Document Script //--> <script src="gw_imageloader_003.js" type="text/javascript" language="javascript"></script> <!--// Imageloader Script //--></head><body id="page"> <div id="t0"><div id="t999"> </div></div> <div id="e7" class="cc08"> <a href="index.htm"> Home</a> </div> <div id="e6" class="cc08"> <a href="lizelle_002.htm"> Portfolio</a> </div> <div id="e5" class="cc08"> <a href="lizelle_011.htm"> Recent Work</a> </div> <div id="e4" class="cc08"> <a href="lizelle_012.htm"> Contact Us</a> </div> <div id="e3" class="cc09"> Commitment </div> <span id="e2" class="cc10"></span><span id="e1" class="cc10"></span><a href="java script:void(0);"><div id="t1"></div></a><a href="java script:void(0);"><div id="t2"></div></a><a href="java script:void(0);"><div id="t3"></div></a><a href="java script:void(0);"><div id="t4"></div></a><a href="java script:void(0);"><div id="t5"></div></a><a href="java script:void(0);"><div id="t6"></div></a><a href="java script:void(0);"><div id="t7"></div></a><a href="java script:void(0);"><div id="t8"></div></a><a href="java script:void(0);"><div id="t9"></div></a><a href="java script:void(0);"><div id="t10"></div></a><a href="java script:void(0);"><div id="t11"></div></a><a href="java script:void(0);"><div id="t12"></div></a></body></html> and the script i wrote overnight, as follows: // JavaScript Documentvar page = "commitment";var count = 60;var limit = 12;var loaded = false;var timeout = null;var thumbs = new Array();var rnd = new Array(limit);var pg = null;for (var i = 1; i < limit + 1; i++) { rnd[i] = -1;}var img = new Array(count);for (var i = 0; i < count; i++) { img[i] = new Image(); img[i].src = "thumbs/" + page + "/" + pad(i, 4) + ".jpg";}function preload(number) { pg.style.visibility = "visible"; var ret = false; var container = document.getElementById("e1"); ret = setthumbs(number); if (!ret) alert("function \"setthumbs();\" failed."); pg.style.visibility = "hidden"; return ret; var file = "images/" + page + "/image_" + pad(rnd[number], 4) + ".jpg"; var pht = new Image(); ret = (pht.src = file); if (!ret) alert("loading \"" + file + "\" failed."); pg.style.visibility = "hidden"; return ret; ret = (container.style.backgroundImage = pht.src); pg.style.visibility = "hidden"; return ret;}function setthumbs(number) { var ret = false; // get distinct random set for (var i = 1; i < limit + 1; i++) { if (i != number && i < count) { var rnd = getrandom(count-1); var tdiv = document.getElementById("t"+i); ret = (tdiv.style.backgroundImage = img[i].src); if (!ret) return ret; ret = (rnd[i] = rnd); if (!ret) return ret; } } return true;}function pad(number, padding) { var ret = String(number); for (var i = 0; i < padding - number.length; i++) { ret = "0" + ret; } return ret;}function getrandom(limit) { var rnd = Math.round(Math.random()*count)-1; for (var i = 1; i < limit + 1; i++) { while (rnd[i] == -1 || rnd[i] == rnd && i < count) { var rnd = Math.round(Math.random()*count)-1; } } return rnd;}window.onload = function () { var ret = false; pg = document.getElementById("t0"); if (pg != null) { ret = setthumbs(0); if (ret) { loaded = true; clearTimeout(timeout); pg.style.visibility = "hidden"; } else { if (confirm("thumbnail loading failed.")) { timeout = window.setTimeout("window.onload();", 5000); } else { loaded = true; clearTimeout(timeout); pg.style.visibility = "hidden"; } } } else { alert("pg = null!"); timeout = window.setTimeout("window.onload();", 5000); } return ret;}if (pg != null) pg.style.visibility = "visible"; the "startup"or css to load, is as follows: /*--- Avanquest WebEasy Page Style ---*/.cc08 { /* Common */ font : italic 16pt 'Vivaldi'; color : #c0c0c0; }.cc09 { /* Common */ font : italic 48pt 'Vivaldi'; color : #ffffff; }.cc10 { /* Common */ border : 0.00pt solid #c0c0c0; /* clip : rect("0.00pt,681.00pt,0.75pt,0.00pt"); */ }div#e7 { /* Home */ position : absolute; left : 463.50pt; top : 66.75pt; width : 51.00pt; height : 18.75pt; }div#e6 { /* Portfolio */ position : absolute; left : 518.25pt; top : 66.00pt; width : 58.50pt; height : 18.75pt; }div#e5 { /* Recent Work */ position : absolute; left : 581.25pt; top : 66.75pt; width : 87.75pt; height : 18.75pt; }div#e4 { /* Contact Us */ position : absolute; left : 672.00pt; top : 67.50pt; width : 73.50pt; height : 21.75pt; }div#e3 { /* Commitment */ position : absolute; left : 41.25pt; top : 34.50pt; width : 277.50pt; height : 71.25pt; }span#e2 { /* lizelle003002.gif */ background : transparent url("lizelle003002.gif") no-repeat center center; position : absolute; left : 45.00pt; top : 102.00pt; width : 681.00pt; height : 0.75pt; }span#e1 { /* lizelle003002.gif */ position : absolute; left : 27.75pt; top : 117pt; width : 800px; height : 800px; background : transparent url("lizelle003001.jpg") no-repeat top left; }div#t999 { /* AJAX Loader Animation */ width : 100%; height : 100%; background : transparent url("ajax_loader.gif") no-repeat center center; visibility : inherit;}div#t12 { /* image_0007.jpg */ position : absolute; width : 100px; height : 100px; top : 460px; left : 812px; z-index : 10; background : transparent no-repeat center center; }div#t11 { /* image_0000.jpg */ position : absolute; width : 100px; height : 100px; top : 460px; left : 662px; z-index : 10; background : transparent no-repeat center center; }div#t10 { /* image_0017.jpg */ position : absolute; width : 100px; height : 100px; top : 460px; left : 512px; z-index : 10; background : transparent no-repeat center center; }div#t9 { /* image_0022.jpg */ position : absolute; width : 100px; height : 100px; top : 460px; left : 362px; z-index : 10; background : transparent no-repeat center center; }div#t8 { /* image_0007.jpg */ position : absolute; width : 100px; height : 100px; top : 310px; left : 812px; z-index : 10; background : transparent no-repeat center center; }div#t7 { /* image_0000.jpg */ position : absolute; width : 100px; height : 100px; top : 310px; left : 662px; z-index : 10; background : transparent no-repeat center center; }div#t6 { /* image_0017.jpg */ position : absolute; width : 100px; height : 100px; top : 310px; left : 512px; z-index : 10; background : transparent no-repeat center center; }div#t5 { /* image_0022.jpg */ position : absolute; width : 100px; height : 100px; top : 310px; left : 362px; z-index : 10; background : transparent no-repeat center center; }div#t4 { /* image_0007.jpg */ position : absolute; width : 100px; height : 100px; top : 160px; left : 812px; z-index : 10; background : transparent no-repeat center center; }div#t3 { /* image_0000.jpg */ position : absolute; width : 100px; height : 100px; top : 160px; left : 662px; z-index : 10; background : transparent no-repeat center center; }div#t2 { /* image_0017.jpg */ position : absolute; width : 100px; height : 100px; top : 160px; left : 512px; z-index : 10; background : transparent no-repeat center center; }div#t1 { /* image_0022.jpg */ position : absolute; width : 100px; height : 100px; top : 160px; left : 362px; z-index : 10; background : transparent no-repeat center center; }div#t0 { /* Ajax Loader Background */ position : fixed; left : 0px; top : 0px; width : 100%; height : 100%; background : transparent url("ajax_loader.png") repeat top left; z-index : 999;}body#page { /* Page Body */ background-color: #000000; }/*--- EndOfFile ---*/ i have chosen to load a random set of images from the onload event, and subsequently onclick for each thumbnail excepting the clicked thumbnails however.unfortunately i do not see why the setthumbs function keeps returning the following error - each time a thumbnail is attempted population for display. this is all a favour i am doing for a friend's photographer sister.any chance some other "guru" might be able to see what i do not?
  24. oh this was relatively easy... removed the for iteration, but kept $i and $j being passed. function getsiblings($children,$j = 0,$level = 0) { $i = $j; if ($j == 0) echo " <binds level=\"1\">\n"; $sql = "SELECT * FROM 1_regions WHERE bigint_ParentRegionID = (SELECT bigint_ParentRegionID FROM 1_regions WHERE bigint_RegionID = ".$children[$i].") ORDER BY text_RegionDescription ASC;"; $result = mysql_query_errors($sql , $conn , __FILE__ , __LINE__ , false); if ($result) { while ($row = mysql_fetch_array($result)) { $selected = ""; if ($children[$i] == $row["bigint_RegionID"] && $i == count($children) - 1) $selected = "selected=\"selected\" "; echo " <bind name=\"".xmlentities($row["text_RegionDescription"])."\" value=\"".$row["bigint_RegionID"]."\" level=\"".$level."\" ".$selected."/>\n"; if ($children[$i] == $row["bigint_RegionID"]) getsiblings($children,$i+1,$level+1); } mysql_free_result($result); } if ($j == 0) echo " </binds>\n";}
  25. ok... the problem generating the http 500 error was somehow linked to calling the subfunction passing $i into it and not $i + 1.the problem now is it is printing out the siblings down the array for each getsiblings call. how could i make it only print out the relevant section of the tree?the page can be viewed at http://www.intellisource.co.za/test.php, and does not get a http 500 error any more.
×
×
  • Create New...