Jump to content

work_it_work

Members
  • Posts

    110
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Contact Methods

  • Yahoo
    tataee1990

work_it_work's Achievements

Member

Member (2/5)

0

Reputation

  1. thanks for your reply.... i tried something and i think the issue is caused by the hosting provider: if (file_exists("/proc/loadavg")) { echo "The file /proc/loadavg exists"; } else { echo "The file /proc/loadavg does not exist"; } the result is "The file /proc/loadavg does not exist" .... now i found another way to call the server load if(function_exists("sys_getloadavg")) { // sys_getloadavg() will return an array with [0] being load within the last minute. $serverload = sys_getloadavg(); $serverload[0] = round($serverload[0], 4); } this one seems to work.... let me know if i am wrong in the first case where the file is missing....
  2. The function worked just fine until yesterday. it showed the actual avg server load. now it's displaying N/A. I have no idea why it's not working anymore. Is it possible the hosting company to ban this function or something? The function is the same as 2 months ago when it worked. I do not receive any error message, just instead of Server Load : 3.87 (example) it shows now N/A (not available)
  3. well, i have removed the all the @ in there and nothing happens... checked the error log of the hosting provider and no errors... what else should i do?
  4. thanks for your reply. please excuse my typing errors, i'm tired because i am trying to fix this from yesterday without sleeping. this script is not is a part from a larger project which was bought 3 months ago... in the server error log can't find anything. it's empty, i just looked. also the cpu usage is low and there are no processes... this mean the script it's not working at all... please help me to debug and show errors maybe the script will work again.
  5. I AM SORRY THE CORRECT TOPIC IS GET_SERVER_LOAD FUNCTION STOPPED WORKING - MODERATOR PLEASE EDIT IF POSSIBLE this function was working for 3 months and yesterday stopped working... please help me to understand why here's the function: define ('GMSG_NA', 'actual load is:'); function get_server_load() { $output = GMSG_NA; $os = strtolower(PHP_OS); if(strpos($os, "win") === false) { if(@file_exists("/proc/loadavg")) { $load = @file_get_contents("/proc/loadavg"); $load = @explode(' ', $load); $output = $load[0]; } else if(@function_exists("shell_exec")) { $load = @explode(' ', `uptime`); $output = $load[count($load)-1]; } } return ($output > 0) ? $output : GMSG_NA; } and here's the output $site_status['server_load'] = get_server_load(); please help me understand why stopped working suddenly
  6. here is the java code (function($){var AWSGlobalNavDefaults={contentBaseURL:"//localhost",getContentBaseURL: function(){ return $.trim(this.contentBaseURL).replace(/\/+$/g,"");}, }; window.AWSGlobalNav=$.extend({}, AWSGlobalNavDefaults,window.AWSGlobalNav); AWSGlobalNav.returns=(function(){ var $=jQuery; var run=function(){ AWSGlobalNav.DDFO.makeAsyncDDFO();}; return{run:run};})(); AWSGlobalNav.DDFO=( function($){ var DDFO_MOUSELEAVE_TIMEOUT="ddfo-mouseleave-timeout", DDFO_MOUSELEAVE_TIMEOUT_MS=300, DDFO_MOUSEENTER_TIMEOUT="ddfo-mouseenter-timeout", DDFO_MOUSEENTER_TIMEOUT_MS=400, DDFO_MOUSEMOVE_MINOR_DELAY_MS=100, DDFO_MOUSEMOVE_MAJOR_DELAY_MS=250, DDFO_MOUSETRACKER_REGIONS="ddfo-mousetracker-regions", DDFO_OTHER_REF="ddfo-other-ref", DDFO_CLICK_NAMESPACE=".ddfo-click-off", DDFO_ORIG_WIDTH="ddfo-orig-width", DDFO_INDICATOR_CLASS="ddfo-cat-indicator", DDFO_INDICATOR_ACTIVE_CLASS="ddfo-cat-indicator-active", DDFO_BTN_CLASS="ddfo-btn", DDFO_BTN_ACTIVE_CLASS="ddfo-btn-active", DDFO_CAT_LI_CLASS="ddfo-cat-li", DDFO_CAT_LI_ACTIVE_CLASS="ddfo-cat-li-active", DDFO_ATTACH="ddfo-attach", DDFO_ATTACH_RIGHT="right", DDFO_ATTACH_LEFT="left", DDFO_ACTIVE_CAT_ID="ddfo-active-cat-id", DDFO_ACTIVE_CAT_RECT="ddfo-active-cat-rect", DDFO_SHOW_CLASS="ddfo-show", DDFO_ACTIVE="ddfo-active", DDFO_TARGET_SLOP=20, DDFO_DELAYED_CHANGE_TIMEOUT="ddfo-delayed-change-timeout", DDFO_PRIOR_CURSOR="ddfo-prior-cursor", DDFO_IFRAME_SHIM="ddfo-iframe-shim", DISABLED_CLASS="disabled", HIDDEN_FLASH_ELS=[]; var isIE6=$.browser.msie&&parseInt($.browser.version)<=6; var applyButtonSkin=function($ddfoBtn){ var $downArrow=$("<div class='nav-down-arrow nav-sprite'/>");$ddfoBtn.append($downArrow).addClass(DDFO_BTN_CLASS);}; var enterClearLeaveTimeout=function($ddfo){ var timeout=$ddfo.data(DDFO_MOUSELEAVE_TIMEOUT); if(timeout){clearTimeout(timeout);$ddfo.removeData(DDFO_MOUSELEAVE_TIMEOUT);}}; var leaveClearEnterTimeout=function($ddfo){ var timeout=$ddfo.data(DDFO_MOUSEENTER_TIMEOUT); if(timeout){clearTimeout(timeout);$ddfo.removeData(DDFO_MOUSEENTER_TIMEOUT);}}; var hideDDFOAfterTimeout=function($ddfo){ if(!$ddfo.data(DDFO_ACTIVE))return; var timeout=setTimeout(function(){hideDDFO($ddfo);},DDFO_MOUSELEAVE_TIMEOUT_MS);$ddfo.data(DDFO_MOUSELEAVE_TIMEOUT,timeout);}; var hideDDFO=function($ddfo){ if(!$ddfo.data(DDFO_ACTIVE)) return;var $ddfoBtn=$ddfo.data(DDFO_OTHER_REF); $ddfoBtn.removeClass(DDFO_BTN_ACTIVE_CLASS); $ddfo.removeClass(DDFO_SHOW_CLASS).data(DDFO_ACTIVE,false); $ddfo.find("."+DDFO_INDICATOR_ACTIVE_CLASS).removeClass(DDFO_INDICATOR_ACTIVE_CLASS); $(document).unbind(DDFO_CLICK_NAMESPACE); $ddfo.css({width:$ddfo.data(DDFO_ORIG_WIDTH)+"px"}); $ddfo.css({width:"210px"}); teardownCatShowAndChange($ddfo); $ddfo.css({overflow:"hidden"});showFlash(); if(isIE6){ var $iframeShim=$ddfo.data(DDFO_IFRAME_SHIM);if($iframeShim){$iframeShim.hide();}}}; var showDDFOAfterTimeout=function($ddfo){ if($ddfo.data(DDFO_ACTIVE))return; var timeout=setTimeout(function(){showDDFO($ddfo);},DDFO_MOUSEENTER_TIMEOUT_MS);$ddfo.data(DDFO_MOUSEENTER_TIMEOUT,timeout);}; var hideFlash=function(){$("object:visible, iframe:visible").css("visibility","hidden").each(function(){HIDDEN_FLASH_ELS.push($(this));});}; var showFlash=function(){$.each(HIDDEN_FLASH_ELS,function(index,$el){$el.css("visibility","visible")});HIDDEN_FLASH_ELS=[];}; var showDDFO=function($ddfo){ if($ddfo.data(DDFO_ACTIVE)) return;$(".ddfo").each(function(){hideDDFO($(this));});hideFlash();$(document).bind("click"+DDFO_CLICK_NAMESPACE,function(e){hideDDFO($ddfo);}); var $ddfoBtn=$ddfo.data(DDFO_OTHER_REF); var ddfoOuterWidth=$ddfo.outerWidth(); var ddfoTotalBorderWidth=pxToInt($ddfo.css("borderRightWidth"))+pxToInt($ddfo.css("borderLeftWidth")); var ddfoBtnOuterWidth=$ddfoBtn.outerWidth();if(ddfoOuterWidth<ddfoBtnOuterWidth){ var newWidth=ddfoBtnOuterWidth-ddfoTotalBorderWidth;$ddfo.css({width:newWidth});$ddfo.data(DDFO_ORIG_WIDTH,newWidth);} else{$ddfo.data(DDFO_ORIG_WIDTH,ddfoOuterWidth-ddfoTotalBorderWidth);} var newTop=$ddfoBtn.position().top+$ddfoBtn.outerHeight()-1,attach=$ddfo.data(DDFO_ATTACH),newPos; if(attach===DDFO_ATTACH_RIGHT){newPos={"left":$ddfoBtn.position().left+pxToInt($ddfoBtn.css("marginLeft"))-($ddfo.outerWidth()-$ddfoBtn.outerWidth()),"top":newTop};} else{newPos={"left":$ddfoBtn.position().left+pxToInt($ddfoBtn.css("marginLeft")),"top":newTop};} $ddfoBtn.addClass(DDFO_BTN_ACTIVE_CLASS);$ddfo.css(newPos).addClass(DDFO_SHOW_CLASS).data(DDFO_ACTIVE,true); if(isIE6){ var $iframeShim=$ddfo.data(DDFO_IFRAME_SHIM); if(!$iframeShim){$iframeShim=$("<iframe src='javascript:false;' frameborder='0' scrolling='no' />").css({ border:0,display:"none",zIndex:(parseInt($ddfo.css("zIndex"))-1)||-1, position:"absolute", filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"}).insertAfter($ddfo);$ddfo.data(DDFO_IFRAME_SHIM,$iframeShim);} $iframeShim.css(newPos).css({width:$ddfo.outerWidth(),height:$ddfo.outerHeight()}).show();} if($ddfo.find("."+DDFO_CAT_LI_CLASS).length>0){ if($ddfo.find("."+DDFO_INDICATOR_CLASS).length===0){ var $indicator=$("<div class='nav-sprite'/>").addClass(DDFO_INDICATOR_CLASS);$ddfo.append($indicator);} setupCatShowAndChange($ddfo);}}; var mouseTracker=function(){ var regions=[],n=3,cursor=[{x:0,y:0}],c=0,scroll=[0,0],listening=false; var callbackArgs=function(){ var pCursors=[]; for(var i=1;i<n;i++){pCursors.push(cursor[(c-i+n)%n]);} return $.extend(true,{},{cursor:cursor[c],priorCursors:pCursors});} var check=function(immediately){ for(var i=0;i<regions.length;i++){ var r=regions[i]; var inside=$.grep(r.rects,function(n){ return cursor[c].x>=n[0]&&cursor[c].y>=n[1]&&cursor[c].x<n[0]+n[2]&&cursor[c].y<n[1]+n[3];}).length>0; if(r.inside!==null&&inside&&!r.inside&&r.mouseEnter){r.inside=r.mouseEnter(callbackArgs());} else if(r.inside!==null&&!inside&&r.inside&&r.mouseLeave){r.inside=!r.mouseLeave(immediately,callbackArgs());}}} var startListening=function(){scroll=[$(window).scrollLeft(),$(window).scrollTop()]; $(document).mousemove(function(e){c=(c+1)%n;cursor[c]={x:e.pageX,y:e.pageY};check();}); $(document).scroll(function(e){cursor[c].x+=($(window).scrollLeft()-scroll[0]); cursor[c].y+=($(window).scrollTop()-scroll[1]);scroll=[$(window).scrollLeft(),$(window).scrollTop()];check();});listening=true;} return{add:function(rectsArray,options){if(!listening){startListening();} var r=$.extend({rects:rectsArray},options);regions.push(r); return r;},remove:function(region){ for(var i=0;i<regions.length;i++){ if(regions[i]===region){regions.splice(i,1); return;}}},checkNow:function(){check(true);},getCallbackArgs:function(){ return callbackArgs();}};}(); var rectRelation=function(cursor,rect){ var h='c',v='c'; if(cursor&&rect){ if(cursor.x<rect.x1)h='l'; else if(cursor.x>rect.x2)h='r'; if(cursor.y<rect.y1)v='t'; else if(cursor.y>rect.y2)v='b';} return v+h;}; var notInRect=function(cursor,rect){ return rectRelation(cursor,rect)!=='cc';}; var calcChangeDelay=function(args,rect){ var delay=0,c=args.cursor,p1=args.priorCursors[0]||{},p2=args.priorCursors[1]||{}; if(c.x==p1.x&&Math.abs(c.y-p1.y)<2&&c.x>p2.x){delay=DDFO_MOUSEMOVE_MINOR_DELAY_MS;} else{ var r=rect,pts=[c,p1]; switch(rectRelation(c,r)){ case'tl':pts.push({x:r.x1,y:r.y2},{x:r.x2,y:r.y1}); break; case'bl':pts.push({x:r.x1,y:r.y1},{x:r.x2,y:r.y2}); break; case'cl':pts.push({x:r.x1,y:r.y1},{x:r.x1,y:r.y2}); break; default:pts.push({x:0,y:0},{x:0,y:0});delay=-1;} if(delay==0){ var b0=(pts[2].x-pts[1].x)*(pts[3].y-pts[1].y)-(pts[3].x-pts[1].x)*(pts[2].y-pts[1].y),b1=((pts[2].x-pts[0].x)*(pts[3].y-pts[0].y)-(pts[3].x-pts[0].x)*(pts[2].y-pts[0].y))/b0,b2=((pts[3].x-pts[0].x)*(pts[1].y-pts[0].y)-(pts[1].x-pts[0].x)*(pts[3].y-pts[0].y))/b0,b3=((pts[1].x-pts[0].x)*(pts[2].y-pts[0].y)-(pts[2].x-pts[0].x)*(pts[1].y-pts[0].y))/b0;delay=(b1>0&&b2>0&&b3>0?DDFO_MOUSEMOVE_MAJOR_DELAY_MS:0);}} return delay;}; var setupCatShowAndChange=function($ddfo){$ddfo.find("."+DDFO_CAT_LI_CLASS).each(function(){ var $catLi=$(this),catId=$catLi.attr("id"); var mouseEnter=function(args){clearTimeout($ddfo.data(DDFO_DELAYED_CHANGE_TIMEOUT)); var activeCatId=$ddfo.data(DDFO_ACTIVE_CAT_ID); if(activeCatId!==catId){ var changeDelay=calcChangeDelay(args,$ddfo.data(DDFO_ACTIVE_CAT_RECT)); if(activeCatId&&changeDelay>0){ var doDelayedChange=function(){clearTimeout($ddfo.data(DDFO_DELAYED_CHANGE_TIMEOUT)); var delayedArgs=mouseTracker.getCallbackArgs(),delayedDelay=0,priorCursor=$ddfo.data(DDFO_PRIOR_CURSOR),subcatRect=$ddfo.data(DDFO_ACTIVE_CAT_RECT); if(priorCursor&&priorCursor.x==delayedArgs.cursor.x&&priorCursor.y==delayedArgs.cursor.y){ if(notInRect(delayedArgs.cursor,subcatRect))delayedDelay=0; else delayedDelay=-1;} else{delayedDelay=calcChangeDelay(delayedArgs,subcatRect);} $ddfo.data(DDFO_PRIOR_CURSOR,{x:delayedArgs.cursor.x,y:delayedArgs.cursor.y});if(delayedDelay>0){ var activeCatId=$ddfo.data(DDFO_ACTIVE_CAT_ID); if(activeCatId!==catId){$ddfo.data(DDFO_DELAYED_CHANGE_TIMEOUT,setTimeout(doDelayedChange,delayedDelay));}} else if(delayedDelay>-1){$ddfo.data(DDFO_ACTIVE_CAT_RECT,showDDFOCat($catLi,$ddfo));}}; $ddfo.data(DDFO_DELAYED_CHANGE_TIMEOUT,setTimeout(doDelayedChange,changeDelay));} else{$ddfo.data(DDFO_ACTIVE_CAT_RECT,showDDFOCat($catLi,$ddfo));}} return true;}; var mouseLeave=function(immediately,args){return true;}; var catLiOffset=$catLi.offset(),added=mouseTracker.add([[catLiOffset.left,catLiOffset.top,$catLi.outerWidth(),$catLi.outerHeight()]], {inside:false,mouseEnter:mouseEnter,mouseLeave:mouseLeave}), mtRegions=$ddfo.data(DDFO_MOUSETRACKER_REGIONS)||[];mtRegions.push(added); $ddfo.data(DDFO_MOUSETRACKER_REGIONS,mtRegions);});}; var teardownCatShowAndChange=function($ddfo){clearTimeout($ddfo.data(DDFO_DELAYED_CHANGE_TIMEOUT)); var mtRegions=$ddfo.data(DDFO_MOUSETRACKER_REGIONS); if(mtRegions){ for( var i=0;i<mtRegions.length;i++){mouseTracker.remove(mtRegions[i]);} mtRegions=[];$ddfo.data(DDFO_MOUSETRACKER_REGIONS,mtRegions);$ddfo.css({width:"210px"});} $ddfo.removeData(DDFO_ACTIVE_CAT_ID);$ddfo.find("."+DDFO_CAT_LI_ACTIVE_CLASS).removeClass(DDFO_CAT_LI_ACTIVE_CLASS);}; var pxToInt=function(string){ return parseInt(string.replace("px",""))||0;} var showDDFOCat=function($catLi,$ddfo){ var id=$catLi.attr("id"); var $subcatItem=$("#"+id+"-item"); var $indicator=$ddfo.find("."+DDFO_INDICATOR_CLASS);if($ddfo.data(DDFO_ACTIVE_CAT_ID)===id) return;$catLi.parent().parent().children().find("."+DDFO_CAT_LI_ACTIVE_CLASS).removeClass(DDFO_CAT_LI_ACTIVE_CLASS);$catLi.addClass(DDFO_CAT_LI_ACTIVE_CLASS); var catLiTopBorder=pxToInt($catLi.css("border-top-width")); var catLiTopMargin=pxToInt($catLi.css("margin-top")); var catLiTopPadding=pxToInt($catLi.css("padding-top")); var catLiLineHeight=pxToInt($catLi.css("line-height")); var catLiFontSize=pxToInt($catLi.css("font-size")); var catLiExtra=Math.round((catLiLineHeight-catLiFontSize)/2); $indicator.css({top:$catLi.position() .top+catLiTopBorder+catLiTopMargin+catLiTopPadding+catLiExtra,left: $catLi.position().left+$catLi.outerWidth()}).addClass(DDFO_INDICATOR_ACTIVE_CLASS); $subcatItem.siblings().removeClass(DDFO_SHOW_CLASS);$subcatItem.addClass(DDFO_SHOW_CLASS); var newDDFOProps={width:$ddfo.data(DDFO_ORIG_WIDTH)+$subcatItem.parent().outerWidth()}; if($ddfo.data(DDFO_ACTIVE_CAT_ID)){$ddfo.stop(true,true).css(newDDFOProps);} else{$ddfo.stop(true,true).not(':animated').animate(newDDFOProps,{speed:"fast",complete:function(){$(this).css({overflow:"visible"})}});} if(isIE6){ var $iframeShim=$ddfo.data(DDFO_IFRAME_SHIM); if($iframeShim){ var extraBorderWidth=pxToInt($ddfo.css("border-left-width"))+pxToInt($ddfo.css("border-right-width")); var newShimWidth=newDDFOWidth.width+extraBorderWidth;$iframeShim.css({width:newShimWidth});}} $ddfo.data(DDFO_ACTIVE_CAT_ID,id); var subCatOffset=$subcatItem.offset(), x1=subCatOffset.left,y1=subCatOffset.top-DDFO_TARGET_SLOP, x2=x1+$subcatItem.outerWidth(), y2=y1+$subcatItem.outerHeight()+DDFO_TARGET_SLOP; return{x1:x1,y1:y1,x2:x2,y2:y2};}; var computeSrcURL=function(options){ var baseURL=AWSGlobalNav.getContentBaseURL(); if(options.useLangSrc){retval=baseURL+options.src;} else{retval=baseURL+options.src;} return retval;} var createJSONPSuccessCallback=function(options){ return function(data){ var $ddfoBtn=options.ddfoBtn;$ddfoBtn.click(function(e){e.preventDefault();});applyButtonSkin($ddfoBtn); var $ddfo=$("<div class='ddfo'/>").append(data); $ddfoBtn.parent().append($ddfo); $ddfoBtn.data(DDFO_OTHER_REF,$ddfo); $ddfo.data(DDFO_OTHER_REF,$ddfoBtn); $ddfo.data(DDFO_ATTACH,options.attach); options.extraSuccessCallback($ddfo);};}; var jsonpErrorHandler=function(error){log("An error ocurred while retrieving DDFO menu content from "+error.url);}; var makeAsyncDDFO= function(options){ var defaultOptions={attach:DDFO_ATTACH_LEFT,useLangSrc:true,extraSuccessCallback:function(){ return true;}},src; options=$.extend(defaultOptions,options); $.jsonp({url:computeSrcURL(options),callback:"displayIn", cache:true,pageCache:false,success:createJSONPSuccessCallback(options),error:jsonpErrorHandler});}; var run=function(){$("#main-nav").delegate("."+DDFO_BTN_CLASS,"click mouseenter mouseleave", function(e){ var $ddfoBtn=$(this); var $ddfo=$ddfoBtn.data(DDFO_OTHER_REF); if($ddfoBtn.hasClass(DISABLED_CLASS)) return false; switch(e.type){ case"click":showDDFO($ddfo);e.stopPropagation(); break; case"mouseenter":enterClearLeaveTimeout($ddfo); showDDFOAfterTimeout($ddfo); break; case"mouseleave":leaveClearEnterTimeout($ddfo);hideDDFOAfterTimeout($ddfo); break; default:break;}}).delegate(".ddfo","click mouseenter mouseleave", function(e){ var $ddfo=$(this); switch(e.type){ case"click":e.stopPropagation(); break; case"mouseenter":enterClearLeaveTimeout($ddfo); break; case"mouseleave":hideDDFOAfterTimeout($ddfo); break; default:break;}}); makeAsyncDDFO({ddfoBtn:$("#nav-dd-products-solutions"),attach:DDFO_ATTACH_LEFT,src:"/m11/"}); makeAsyncDDFO({ddfoBtn:$("#nav-dd-developers"),attach:DDFO_ATTACH_RIGHT,src:"/m21/"}); makeAsyncDDFO({ddfoBtn:$("#nav-dd-support"),attach:DDFO_ATTACH_RIGHT,src:"/m31/"}); makeAsyncDDFO({ddfoBtn:$("#gtl-dd-account-console"),attach:DDFO_ATTACH_RIGHT,src:"/m41/"}); makeAsyncDDFO({ddfoBtn:$("#gtl-dd-account-consoles"),attach:DDFO_ATTACH_RIGHT,src:"/m41/"});}; return{run:run,makeAsyncDDFO:makeAsyncDDFO};})(jQuery); AWSGlobalNav.Search=( function($){ var EXTRA_RIGHT_PADDING=6, SEARCH_IN_CONFIG={en:{ defaulLabel:'Search In', pathSelect:{all:'Entire Site', amis:'AMIs',articles:'Articles & Tutorials',products_and_info:'AWS Product Information',case_studies:'Case Studies', customerapps:'Customer Apps',developertools:'Developer Tools',documentation:'Documentation',datasets:'Public Data Sets', releasenotes:'Release Notes',solution_providers:'Partners',code:'Sample Code & Libraries',AWSMarketplace:'AWS Marketplace'}}}; var wrapStringInFunc=function(string){ return function(){ return string;};}; var PATH_CONFIG=[[new RegExp('^/$'),wrapStringInFunc("all")],[new RegExp("^/search(?=/|$)"), function(){ var searchPath=AWSGlobalNav.searchCategory,pathSelect=getConfig("pathSelect"); return(searchPath&&pathSelect.hasOwnProperty(searchPath))?searchPath:"all"}], [new RegExp("solution-providers"),wrapStringInFunc("solution_providers")], [new RegExp("/case-studies"),wrapStringInFunc("case_studies")], [new RegExp('^/([^/]+)'),function(matches){var pathSelect=getConfig("pathSelect") rootPath=matches[1]; return(pathSelect.hasOwnProperty(rootPath))?rootPath:null;}], [new RegExp(".*"),wrapStringInFunc("all")]]; var getConfig=function(key){ var config=SEARCH_IN_CONFIG["en"]; return config[key];}; var createSelectMenu=function(){ var $select=$("#nav-search-dropdown"),searchPath=getSearchPathFromURI();$.each(getConfig("pathSelect"), function(k,v){$select.append($("<option/>").val(k).html(v));}); if(searchPath){searchCategoryUpdater($select,searchPath,0,4,1000);}}; var searchCategoryUpdater=function($select,searchPath,retryCount,maxRetries,pauseTimeMS){ try{$select.val(searchPath);updateSearchInContent();} catch(e){ if(retryCount<maxRetries){setTimeout( function(){searchCategoryUpdater($select,searchPath,retryCount+1,maxRetries,pauseTimeMS);},pauseTimeMS);}}}; var getSearchPathFromURI=function(){ var uri=window.location.pathname,searchPath; $.each(PATH_CONFIG,function(index,config){ var matches=config[0].exec(uri); if(matches){searchPath=config[1](matches); return(searchPath==null);}}); return searchPath;}; var updateSearchInContent=function(){$("#nav-search-in-content").text($("#nav-search-dropdown option:selected").text()); var newPaddingRight=$("#nav-search-in").outerWidth()+EXTRA_RIGHT_PADDING;$("#nav-searchfield-width").css({paddingRight:newPaddingRight});}; var bindChangeHandler=function(){$("#nav-search-dropdown").change(function(){updateSearchInContent();});}; var run=function(){createSelectMenu();bindChangeHandler();}; return{run:run};})(jQuery); $(function(){AWSGlobalNav.DDFO.run(); AWSGlobalNav.Search.run(); });})(jQuery); do i have to add anything else?
  7. you didn't understand, how do you suggest to paste the entire code here? if we are talking about 6 files, each one larger then 300 rows? i just uploaded them as an archive and if someone want to help, download the file and see content. anyone this days has an antivirus, and beside that there's no exe file inside.
  8. you're funny, how do is suppose to paste all the code here? there are like 6 files. in order the menu to work
  9. i have a jquery / javascript megamenu and i want to modify it, but i don't know anything about java or jquery so please be king enough and help me. the menu is working perfectly but i want to make a little modification to look like i want i cannot upload the file on the forum, so you can find it below: http://www.sendspace.com/file/g5do44 this menu become active when user has mouseover the link(s). All i want to do is to transform one of the link menu to be active all the time there are 4 of this links (categories, account, register, support) the one i want to modify is the "categories" menu i want to display the parent menu when the page is loaded, so the user can see the categories list. all other menus should remain the same (inactive). please help me! thank you!
  10. thanks for your reply, i managed to solve this problem, here's the solution: $vat= array(array('code' => 'iva', 'title' => 'IVA', 'text' => $total1, 'value' => '123', 'sort_order' => '2')); array_splice($totals, 2, 0, $vat); <table id="total"> <?php foreach ($totals as $total) { ?> <tr> <td class="right"><b><?php echo $total['title']; ?>:</b></td> <td class="right"><?php echo $total['text']; ?></td> </tr> <?php } ?> </table>
  11. i have an website (shopping-cart) and i want to modify the invoice to show the VAT (tax) . right now if i enable vat tax the prices are shown incorrectly. if the price added by admin is 1000$ the total price with vat is 1200$ i want the price to be displayed 1000$ and before total i want to display the vat of the invoice example: if the total is 1000 the vat shown will be 1000 / 20 * 120 which means 166.66. so the invoice looks like this: product a qty1 price 1000 subtotal 1000 vat(tax) 166 total to pay 1000 in the template file i have this function which generates the total and subtotal: <table id="total"> <?php foreach ($totals as $total) { ?> <tr> <td class="right"><b><?php echo $total['title']; ?>:</b></td> <td class="right"><?php echo $total['text']; ?></td> </tr> <?php } ?> </table> using print_r($totals) will print: Array ( [0] => Array ( [code] => sub_total [title] => Sub-Total [text] => 1000.00€ [value] => 1000 [sort_order] => 1 ) [1] => Array ( [code] => total [title] => Total [text] => 1000.00€ [value] => 1000 [sort_order] => 9 ) ) using print_r($total) will print: Array ( [code] => total [title] => Total [text] => 202.00€ [value] => 202 [sort_order] => 9 ) basically it's simple what i want to do $totals array i must insert a new row inside to make it look like this: Array ( [0] => Array ( [code] => sub_total [title] => Sub-Total [text] => 1000.00€ [value] => 1000 [sort_order] => 1 ) [1] => Array ( [code] => VAT [title] => VAT [text] => 166.66€ [value] => 166.66[sort_order] => 2 ) [2] => Array ( [code] => total [title] => Total [text] => 1000.00€ [value] => 1000 [sort_order] => 9 ) ) how can i explode and add a row in the middle of the array? please help, thank you!
  12. well it works now, thank you very much!! it wasn;t working because it was a directory involved, now it works!
  13. i've tried that but it only display the header2.tpl.php page. doesn't matter if is /index.php or /search.php ...any ideea?
  14. great, and how would i integrate that function to my function: $template_output .= $template->process('header.tpl.php'); thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.